deancameron Posted November 18, 2012 Share Posted November 18, 2012 Hello. 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: XAMPP ->xampfiles ->htdocs -myApp (the Yii Book) -anotherApp -someWordpressThing -EdwardPlaysTennis 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 More sharing options...
Edward Posted November 18, 2012 Share Posted November 18, 2012 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. http://www.yiiframework.com/wiki/116/moving-project-code-outside-of-webroot-plus-multiple-project-support/ 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 More sharing options...
deancameron Posted November 18, 2012 Author Share Posted November 18, 2012 true, but isn't the idea to eventually replicate the local environment to 'los cloud'? Thanks for the quick reply, btw. Link to comment Share on other sites More sharing options...
Larry Posted November 20, 2012 Share Posted November 20, 2012 This is a reasonable problem. I would keep the protected folder within the site directory during development and move it outside of the Web directory on the destination/live server. Link to comment Share on other sites More sharing options...
Ziggi Posted December 11, 2012 Share Posted December 11, 2012 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): /-| | |-YiiFramework |-YourProjectName-| |..............................|-protected |-web-| |.........|-protected 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 More sharing options...
Larry Posted December 11, 2012 Share Posted December 11, 2012 Thanks for sharing that, Ziggi. Link to comment Share on other sites More sharing options...
Ziggi Posted December 11, 2012 Share Posted December 11, 2012 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 More sharing options...
Recommended Posts