Reputation: 23
I'm relatively new to Yii. I've managed to get a sample application up and running but as I am now moving to a real project, I would like to use the following folder structure for increased security:
[Server root (/) ]
- yii
-- framework
-- requirements
[Server htdocs]
- myapp
-- public
--- assets
--- css
--- images
--- themes
--- index.php
-- private
--- protected
All is fine when I leave the protected folder inside the public folder but I don't want to do this.
The only way I can get it to work using my proposed structure is if I create a symlink inside the public folder pointing to the protected folder inside the private folder. If I reference it directly in the private folder it just gives me a blank page upon app load.
I've double checked my configuration paths and permissions.
Any help is appreciated.
Upvotes: 1
Views: 2174
Reputation: 17576
There is an open source project called Yii Boilerplate which proposes application structure for Yii to use in large projects that require scalability.
Upvotes: 0
Reputation: 4708
You can configure Yii to use the folders you want for your specific needs, eg. protected-folder, assets, themes, etc.
Have a look at "The directory structure of the Yii project site" for an example.
Upvotes: 2
Reputation: 13029
You can put your protected folder where you want, but you have to tell it to index.php
. In your case, the line where it says:
$config=dirname(__FILE__).'/protected/config/main.php';
must say:
$config=dirname(__FILE__).'/../private/protected/config/main.php';
And same in index-test.php
Upvotes: 1