我正在开发一个 Web 应用程序,使用 Codeigniter ( http://codeigniter.com/ ) 框架加上 Flourish 库 ( unframework ) ( http://flourishlib.com/ )。
我只是将繁茂文件夹放入我的应用程序,然后按照说明创建了一个繁茂初始化和配置文件(这些文件创建了 Flourish 自动加载)。
这是我的文件夹结构:
---auxcode\
--------init.php
--------config.php
--------flourish\
---system\
---application\
---公共_html\
init 文件只包含配置文件,配置文件内容如下所示:
function __autoload($class_name){
{
// Customize this to your root Flourish directory
$flourish_root = $_SERVER['DOCUMENT_ROOT'] . '/../auxcode/flourish/';
$file = $flourish_root . $class_name . '.php';
if (file_exists($file)) {
include $file;
return;
}
throw new Exception('The class ' . $class_name . ' could not be loaded');
}
在 public_html 中,索引文件已添加以下内容:
<?php
include_once($_SERVER['DOCUMENT_ROOT'] . '/../inc/init.php');
现在,各自的自动加载功能(因为每个都有自己的)是冲突的。该应用程序仅在我注释掉任一框架的自动加载功能(及其依赖项)时才有效。
请问如何合并自动加载功能,以便我可以访问 CI 并以相同的方式蓬勃发展?
或者是否有更好的方法在一个应用程序中使用这两个系统?请说。
谢谢。