Dotkernel Light follows the PSR-4 standards.
It is a good practice to standardize the file structure of projects.
When using Dotkernel Light, the following structure is installed by default:
bin
- various helper scriptsconfig
- various configuration filesdata
- should contain project-related datalog
- storage of log files generated by dot-error-log librarypublic
- publicly visible files. The webserver need to have this folder as www-document root folder.src
- should contain the source code filestest
- should contain the test filesbin
directoryThis directory contains one file, clear-config-cache.php
which removes the config cache file (data/cache/config-cache.php
- available only when development mode is enabled).
config
directoryThis directory contains all application-related config files:
config.php
: here you will register ConfigProviders after installing packagescontainer.php
: main service container, providing access to all registered servicesdevelopment.config.php.dist
: gets symlinked as development.config.php
when enabling development mode - activates debug modepipeline.php
: contains a list of middlewares, in their order of executiontwig-cs-fixer.php
: configuration file for Twig code style checker/fixerautoload
directoryThis directory contains all service-related local and global config files:
app.global.php
: sets the application namedependencies.global.php
: config file to set global dependencies that should be accessible by all modulesdevelopment.local.php.dist
: gets symlinked as development.local.php
when enabling development mode - activates error handlerserror-handling.global.php
: configures and activates error logslocal.php.dist
: local config file where you can overwrite application name and URLmezzio.global.php
: Mezzio core config filetemplates.global.php
: dotkernel/dot-twigrenderer config filedata
directoryThis directory is a storage for project data files and service caches. Inside you will find:
cache
: Twig's cache directoryAVOID storing sensitive data on VCS.
log
directoryThis directory stores daily log files.
When you access the application from the browser, (if not already created) a new log file gets created in the format specified in the config/autoload/error-handling.global.php
config file under the stream
array key.
public
directoryThis directory contains all publicly available assets and serves as the entry point of the application:
css
: contains app.css
, a single file containing the entire CSS code collected from all modules, in a minified formfonts
: contains app
, a directory containing custom font files collected from all modulesimages
: contains app
, a directory containing all image files collected from all modulesjs
: contains app.js
, a single file containing the entire JavaScript code collected from all modules, in a minified form.htacess
: server configuration file used by Apache web server - this file enables the URL rewrite functionalityindex.php
: the application's main entry pointrobots.txt.dist
: a sample robots.txt file, providing settings allow/deny bot access to certain areas of your application - activate it by duplicating the file as robots.txt
and comment out the lines that don't match your environmentsrc
directoryThis directory contains two directories, called modules:
App
Page
App
directoryThis is the App
module.
It contains all generic functionalities your application depends on.
The assets
directory contains all generic assets, reusable across the application.
The src
contains ConfigProvider.php
, a file that sets template path aliases (getTemplates
) but can also provide dependencies (getDependencies
).
The templates
: contains misc components like the home page, custom error pages, template partials and the default layout template.
Page
directoryThis is the Page
module.
It contains page-related components for your application.
The src
directory contains the following items:
Controller
: contains module controllersFactory
: contains module factories, which are used to provide ready-to-use instances of certain classesService
: contains module service files, which contain classes that provide custom functionalitiesConfigProvider.php
- provides module configuration dataRoutesDelegator.php
- stored main routes found in the moduleThe templates
directory contains the page
directory, with template files for various web pages.
.github
- contains workflow files.laminas-ci
- contains Laminas Continuous Integration (CI) workflow files