This publication describes a standard filesystem skeleton suitable for all PHP packages.
Please see https://github.com/php-pds/skeleton_research for background information.
Command-line tools for validating or generating PDS conform packages which are included with this standard are documented here.
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this publication are to be interpreted as described in RFC 2119.
A package MUST use these names for these root-level directories:
| 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/ |
A package MUST use these names for these root-level files:
| If a package has a root-level file for ... | ... then it MUST be named: |
|---|---|
| a log of changes between releases | CHANGELOG(.*) |
| guidelines for contributors | CONTRIBUTING(.*) |
| licensing information | LICENSE(.*) |
| information about the package itself | README(.*) |
A package SHOULD include a root-level file indicating the licensing and copyright terms of the package contents.
If the package provides a root-level directory for command-line executable
files, it MUST be named bin/.
This publication does not otherwise define the structure and contents of the directory.
If the package provides a root-level directory for configuration files, it MUST
be named config/.
This publication does not otherwise define the structure and contents of the directory.
If the package provides a root-level directory for documentation files, it MUST
be named docs/.
This publication does not otherwise define the structure and contents of the directory.
If the package provides a root-level directory for web server files, it MUST be
named public/.
This publication does not otherwise define the structure and contents of the directory.
N.b.: This directory MAY be intended as a web server document root. Alternatively, it MAY be that the files will be served dynamically via other code, copied or symlinked to the "real" document root, or otherwise managed so that they become publicly available on the web.
If the package provides a root-level directory for other resource files, it MUST
be named resources/.
This publication does not otherwise define the structure and contents of the directory.
If the package provides a root-level directory for PHP source code files, it
MUST be named src/.
This publication does not otherwise define the structure and contents of the directory.
If the package provides a root-level directory for test files, it MUST be named
tests/.
This publication does not otherwise define the structure and contents of the directory.
The package MAY contain other root-level directories for purposes not described by this publication.
This publication does not define the structure and contents of the other root-level directories.