LogoLogo
  • Introduction
  • Installation
  • Upgrade Guide
  • Docker
  • Configuration
    • Configuration Overview
      • File Matching Patterns
    • Configuration Reference
  • 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

Requirements

  • PHP >= 8.2 with the zip, dom and fileinfo (and optionally apcu, 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

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

  1. Fork the Directory Lister repository to your own account (optional)

  2. Clone Directory Lister to a local repository

    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

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

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.

PreviousCommon Issues

Last updated 2 months ago

Was this helpful?