LogoLogo
  • Introduction
  • Installation
  • Upgrade Guide
  • Docker
  • Configuration
    • Configuration Overview
    • Configuration Reference
    • Hiding Files
  • Help & Support
    • Troubleshooting
    • Common Issues
  • Developers
    • Development Environment
Powered by GitBook
On this page
  • Requirements
  • Instructions
  • Common Development Commands
  • Clear the application cache
  • Build dependencies and assets (for production)
  • Clear built assets
  • Run test suite
  • Check or fix coding standards
  • Perform static analysis
  • Generate code coverage report

Was this helpful?

Edit on GitHub
  1. Developers

Development Environment

PreviousCommon Issues

Last updated 1 month ago

Was this helpful?

Requirements

  • >= 8.2 with the zip, dom and fileinfo (and optionally apcu, memcached, redis) extensions

    • for PHP dependency management

  • for front end asset serving and bundling

  • and for running the local development container

  • for version control

Instructions

These instructions are for setting up a local DEVELOPMENT environment. If you are looking for basic installation instruction see the page instead.

  1. (optional)

  2. git clone {{ REPOSITORY_URL }}
  3. Switch to the Directory Lister directory

    cd /path/to/DirectoryLister
  4. Install and build PHP and JavaScript dependencies

    composer install
    npm install
    npm run dev
  5. Run the local Docker container

    docker-compose up -d
  6. Add a host name entry to /etc/hosts (optional)

    127.0.0.1  directory-lister.local

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-cache
rm --recursive --force app/cache/*

Build dependencies and assets (for production)

make production
composer install --no-dev --no-interaction --prefer-dist --optimize-autoloader
npm install --no-save
npm run build
npm prune --production

Clear built assets

make clear-assets
rm --recursive --force app/assets/*

Run test suite

make tests
composer exec phpunit
app/vendor/bin/phpunit

Check or fix coding standards

make coding-standards

This will apply coding standard fixes will be automatically. See the Compor or Manual tab to report coding standard problems without modifying files.

composer exec php-cs-fixer fix [--diff] [--dry-run]

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.

app/vendor/bin/php-cs-fixer fix [--diff] [--dry-run]

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-analysis
composer exec phpstan analyze
app/vendor/bin/phpstan analyze

Generate code coverage report

make coverage
XDEBUG_MODE=coverage composer exec phpunit --coverage-html .coverage
XDEBUG_MODE=coverage app/vendor/bin/phpunit --coverage-html .coverage

Code coverage requires a code coverage engine (e.g. xdebug pr pcov) to run.

You should now be able to access your local Directory Lister installation at http://localhost (or if you added a host name entry)

PHP
Composer
NPM
Docker
Docker Compose
Git
Installation
Fork the Directory Lister repository to your own account
Clone Directory Lister to a local repository
http://directory-lister.local