Jump to content
Larry Ullman's Book Forums

Directory Structure Confusion


Recommended Posts



I'm working through the most excellent The Yii Book. The app I'm working on is named myApp.


For development I use XAMPP on my mac and the htdocs directory contains various projects (in various states of disarray and madness), so the structure is something like:





-myApp (the Yii Book)






I followed the setup instructions in The Yii Book and moved the "protected" & "framework" folders outside of my htdocs folder.


Something seems not so right about that as now the model, view & controller and other folders associated with myApp are in the "protected" folder - external to myApp.


At some point, I figure I will develop another Yii application on my machine. I can't have two "protected" folders in the same folder.


Did I do something boneheaded (wouldn't be the first time) or does one rename the "protected" folder while developing another Yii app? Why doesn't one keep all of the associated folders inside of that App's space?


Thanks for the info.


Rock on.

Link to comment
Share on other sites

You can rename the protected folder and move it outside the webroot that would be one way of doing it for separate projects. You may also want to check this link out on the YiiFramework.com website.




But if you were working on a localhost as myself i don't think you really need to move the protected folder from the webroot as its safe already for working on.

Link to comment
Share on other sites

  • 3 weeks later...

Actually, I found symlinking directories very helpful while working with IDEs like PhpStorm what is my favorite due to its speed, versatility and reliability.


Then you can create a following structure (dots are only for formatting):










So now you can symlink both 'protected' folders keeping your IDE happy as well as following Larry's safety guidance.

Link to comment
Share on other sites

Thank you, Larry!


Ffor clarification - this setup is for development only. While moved onto production server - symlinks are gone, the inner 'protected' folder is not needed any more and can be removed from production server. This way the only thing left is safe configuration with critical folders outside web root.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...