共享主机上 Zend 框架和 MVC 的目录结构?

发布于 2024-10-06 07:16:38 字数 237 浏览 0 评论 0原文

我刚刚在我的本地主机上以 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

单挑你×的.吻 2024-10-13 07:16:38

有一条规则:除了 zf 的 /public(/htdocs 或其他命名的目录,index.php 所在的目录)之外,您不应该将任何内容放入您的 doucument_root 中。

但我认为对于共享托管,您无法决定 document_root 位于何处,因此您可以仅使用 .htacces 文件来拒绝所有非公开文件。

结构例如:

/htdocs
    /application
        /config
        /library
            /Zend
            /(other libraries)
        /user
            /controller
            /model
            /view
        /variable
            /sessions
            /cache
            /view_compiles
        .htaccess (deny from all)
    /images
    /scripts
    /styles
    index.php

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:

/htdocs
    /application
        /config
        /library
            /Zend
            /(other libraries)
        /user
            /controller
            /model
            /view
        /variable
            /sessions
            /cache
            /view_compiles
        .htaccess (deny from all)
    /images
    /scripts
    /styles
    index.php
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文