Skip to content

Commit 0eefdc9

Browse files
committed
upgrade file-structure file
1 parent 34d7b72 commit 0eefdc9

1 file changed

Lines changed: 21 additions & 14 deletions

File tree

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,30 @@
11
# File structure
22

3-
It is a good practice to standardize the file structure of projects. This way it’s easier to keep a clean overview of multiple projects, and less time is wasted trying to find the correct class.
3+
Dotkernel API follows the [PSR-4](https://www.php-fig.org/psr/psr-4/) standards.
44

5-
When using DotKernel API the following structure is recommended:
5+
It is a good practice to standardize the file structure of projects.
6+
7+
When using DotKernel API the following structure is installed by default:
8+
9+
![Dotkernel API File Structure!](https://docs.dotkernel.org/img/api/file-structure-dk-api.png)
610

711
## Main directories
812

9-
* `src` - should contain the source code files
10-
* `templates` - should contain the page templates and layouts
13+
* `bin` - executable files from CLI
14+
* `config` - various configuration files
1115
* `data` - should contain project-related data (AVOID storing sensitive data on VCS)
12-
* `docs` - should contain project-related documentation
16+
* `documentation` - should contain project-related documentation
17+
* `log` - storage of log files generated by dot-error-log library
18+
* `public` - publicly visible files. The webserver need to have this folder as www-document root folder.
19+
* `src` - should contain the source code files
20+
* `test` - should contain the test files
1321

14-
These directories reside in one of the following directories:
22+
## Special purpose folders
1523

16-
* if the Module is a composer package where the directories above are stored in the package’s root path, eg.: `/vendor/my-name/my-project-name/`
17-
* if the Module is an extension/component for the project, eg.: `/src/MyProjectName`
24+
* `.github` - containes workflow files
25+
* `.laminas-ci` - contains laminas-ci workflow files
1826

19-
## The `src` directory
27+
## `src` directory
2028

2129
This directory contains all source code related to the Module. It should contain following directories, if they’re not empty:
2230

@@ -35,20 +43,19 @@ The `src` directory should also contain 2 files:
3543
* `ConfigProvider.php` - Provides configuration data
3644
* `RoutesDelegator.php` - Module main routes entry file
3745

38-
## The `templates` directory
46+
## `templates` directory
3947

4048
This directory contains the template files, used for example to help render e-mail templates.
4149

4250
> DotKernel API uses twig as Templating Engine. All template files have the extension .html.twig
4351
44-
## The `data` directory
52+
## `data` directory
4553

4654
This directory contains project-related data (such as cache, file uploads)
4755

4856
We recommend using the following directory structure:
4957

5058
* `data/cache` - location where caches are stored
5159
* `data/oauth` - encryption, private and public keys needed for authentication.
52-
* `data/lock` - folder where lock files generated by commands are stored, if enabled
53-
* `data/doctrine/fixtures` - folder for doctrine data fixtures
54-
* `data/doctrine/migrations` - folder for doctrine migrations
60+
* `data/doctrine` - fixtures and migrations
61+
* `data/lock` - lock files generated by `dotkernel/dot-cli` [See more](https://docs.dotkernel.org/dot-cli/v3/lock-files/)

0 commit comments

Comments
 (0)