框架/ PHP:如何更改包含路径


Yii 1 Framework / PHP: How to change the include path?

我有一个在Yii 1框架上运行的应用程序。

项目结构如下:

'app
   'config
   'models
   'views
   ... and a lot more
'css
'js
'img
'.. and some more stuff
index.php

为了提高安全性,我要确保应用程序(php)文件或其他东西位于根目录中。

我想有以下结构:

'app
    'config
    'models
    'views
    ... and a lot more
'htdocs [ROOT]
    'css
    'js
    'img
    index.php

改变结构后,我得到了预期的错误。我已经更改了/htdocs/index.php中的路径,但还有更多:

No such file or directory in [...]'yii'framework'base'CApplication.php on line 133

是否有一种简单的方法来修复所有的路径,而不改变框架中的100万条路径?

非常感谢!

我怎么理解,你移动你的前控制器(index.php)到你的根文件?如果你查看index.php文件,你会看到这样一行代码:

$yii = dirname(__FILE__) . '...some/directories/yiisoft/yii/framework/yii.php';

然后它的文件需要和创建应用程序,你需要改变它的路径到适当的