组织文件和文件夹结构[关闭]

问题描述 投票:0回答:1

几年来,我一直在使用基于Web的解决方案,主要是PHP和WordPress项目。 我不确定是否以最佳方式组织项目。

那么,如何正确构建项目?

例如,我有一个项目,其中我使用Yarn进行程序包控制,并使用gulp进行SASS和jQuery。 在这里,我的结构如下所示:

  • 资产

    • CSS
      • style.css文件
      • style.min.css
    • 上海社会科学院
      • style.scss
    • JS
      • scripts.js中
      • scripts.min.js
    • IMG
  • node_modules

    • 引导
    • jQuery的
    • 等等
    • header.php文件
    • 的index.php
    • page.php文件
    • footer.php
    • gulpfile.js
    • 的package.json
    • yarn.lock

这不是最佳实践吗? 我找不到任何有关此事的专业页面,而那些确实存在的页面却说了不同的话。尽管每个人都不相同,但必须有某种类型的准则。

php structure project-management directory-structure project-structure
1个回答
4
投票

研究工作的结果是,扫描https://packagist.org上列出的每个软件包,其中详细说明了绝大多数软件包正在使用的目录,即大多数人在无意识的情况下无意识地同意的目录:

https://github.com/php-pds/skeleton

目录的简短摘要:

If a package has a root-level directory for ...     
                            ... then it MUST be named:
command-line executables    bin/
configuration files         config/
documentation files         docs/
web server files            public/
other resource files        resources/
PHP source code             src/
test code                   tests/
© www.soinside.com 2019 - 2024. All rights reserved.