Saturday 12 January 2019

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

I have a application which is running on the Yii 1 Framework.



This is how the project structure looks like:




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



To improve the security, I want to make sure, that application (php) files or other stuff is in the root directory.



I want to have following structure:



\app
\config
\models
\views

... and a lot more
\htdocs [ROOT]
\css
\js
\img
index.php


After changing the structure, I get errors as expected. I already changed the path in /htdocs/index.php, but there are more:




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


Is there an easy way to fix all the paths, without changing 1 million paths in the framework?



Thank you very much!

No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...