共享主机上 Zend 框架和 MVC 的目录结构?
我刚刚在我的本地主机上以 MVC 模式完成了一个 ZF 的小站点,现在我想知道构建目录的最合适的方法是什么。我在某处读过,最好在其中包含“application”、“library”文件夹在“www”目录上方的同一文件夹中,并在index.php文件中设置include_path..以便所有核心文件都无法被入侵者或其他什么访问..?我在一个共享主机上运行多个站点,那么最有组织性和可维护性的最佳目录结构是什么?
非常感谢任何建议和意见! 谢谢
Ive just completed a small site with ZF in MVC pattern on my localhost and am now wondering what would be the most suitable way of structuring the directories.. I've read somewhere that it's best to have "application", "library" folders in a same folder one level above the "www" directory and set the include_path in the index.php file..so that all the core files are inaccessible from intruders or whatnot..? I run multiple sites on one shared hosting so what would be the best directory structure that is most organized and maintainable?
Any suggestions and comments are greatly appreciated!
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有一条规则:除了 zf 的 /public(/htdocs 或其他命名的目录,index.php 所在的目录)之外,您不应该将任何内容放入您的 doucument_root 中。
但我认为对于共享托管,您无法决定 document_root 位于何处,因此您可以仅使用 .htacces 文件来拒绝所有非公开文件。
结构例如:
there is one rule: you should not put anything besides /public (/htdocs or other named - dir, where your index.php situated)directory of zf into your doucument_root.
But I think for shared hosting you cannot decide where is your document_root located, so you can just use .htacces file to deny any non-public files from all.
structure for example: