我在CodeIgniter中成功使用了Zend Framework 1库
我就是这样做的
,使用此内容添加Zend.php
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Zend {
function __construct($class = NULL) {
// include path for Zend Framework
// alter it accordingly if you have put the 'Zend' folder elsewhere
ini_set('include_path', ini_get('include_path') . PATH_SEPARATOR . FCPATH . 'system/libraries');
if ($class) {
require_once (string) $class . EXT;
log_message('debug', "Zend Class $class Loaded");
} else {
log_message('debug', "Zend Class Initialized");
}
}
function load($class) {
require_once (string) $class . EXT;
log_message('debug', "Zend Class $class Loaded");
}
}
这是我在CodeIgniter控制器中使用它的示例
//load it inside function __construct()
$this->load->library('Zend');
$this->zend->load('Zend/Feed');
$this->zend->load('Zend/Search/Lucene');
//use it inside function
$index = new Zend_Search_Lucene( "assets/index" );
query = "yes";
$hits = $index->find($query);
现在,我想在Yii2 basic
中使用Zend Framework 1库我在Zend框架的路径/库中复制了文件夹Zend
将其粘贴到Yii2基本路径/供应商文件夹
如何在Yii2 basic中设置和使用Zend Framework 1库?
简要说明赞赏!先谢谢