Development Environment
Requirements
- PHP with the
zip,domandfileinfo(and optionallyapcu,memcached,redis) extensions- Composer for PHP dependency management
- NPM for front end asset serving and bundling
- Docker and Docker Compose for running the local development container
- Git for version control
Instructions
WARNING
These instructions are for setting up a local DEVELOPMENT environment. If you are looking for basic installation instruction see the Installation page instead.
Fork the Directory Lister repository to your own account (optional)
Clone Directory Lister to a local repository
bashgit clone https://github.com/DirectoryLister/DirectoryLister.gitSwitch to the Directory Lister directory
bashcd /path/to/DirectoryListerInstall and build PHP and JavaScript dependencies
bashcomposer install npm installRun the local Docker container
bashdocker-compose up -d
You should now be able to access your local Directory Lister installation at http://localhost.
Common Development Commands
Many common development actions have been defined in the Makefile and can be run with make command.
Clear the application cache
make clear-cacherm --recursive --force app/cache/*Clear built assets
make clear-assetsrm --recursive --force app/assets/*Run test suite
make testcomposer exec phpunitapp/vendor/bin/phpunitCheck or fix coding standards
Make
make coding-standardsINFO
This checks coding standards and reports problems without modifying files.
See the Composer or Manual tab to automatically apply coding standard fixes.
Composer
composer exec php-cs-fixer fix [--diff] [--dry-run]TIP
If no flags are present, coding standard fixes will be automatically applied.
To report coding standard problems without modifying files use the --dry-run flag.
Additionally, to display a diff of the fixes that would be applied, use the --diff flag as well.
Manual
app/vendor/bin/php-cs-fixer fix [--diff] [--dry-run]TIP
If no flags are present, coding standard fixes will be automatically applied.
To report coding standard problems without modifying files use the --dry-run flag.
Additionally, to display a diff of the fixes that would be applied, use the --diff flag as well.
Perform static analysis
make static-analysiscomposer exec phpstan analyzeapp/vendor/bin/phpstan analyzeGenerate code coverage report
make coverageXDEBUG_MODE=coverage composer exec phpunit --coverage-html .coverageXDEBUG_MODE=coverage app/vendor/bin/phpunit --coverage-html .coverageIMPORTANT
Code coverage requires a code coverage engine (e.g. xdebug or pcov) to run.