mediamonks/skeleton-symfony

MediaMonks Symfony Skeleton Project

10.1.0 2023-04-12 07:18 UTC

README

Features:

  • Symfony 5.4(LTS) and 6.*
  • Docker setup, supports php 8.1 and 8.2
  • PHPStan

Installation:

composer create-project mediamonks/skeleton-symfony:^10.1 .

Via Docker:

docker run --rm --interactive --tty --user "$(id -u):$(id -g)" --volume $PWD:/app --volume ~/.ssh:/root/.ssh composer create-project mediamonks/skeleton-symfony:^10.1 .

Available commands:

  • composer analyse, runs PHPStan
  • composer security-check, runs symfony's security checker (via symfony-cli)

Customizing PHP:

You can customize php by adding ini files to tools/docker/php/custom.

Increasing php memory limit

  • Add memory_limit.ini to tools/docker/php/custom.
  • Add the following content:
    memory_limit=256M
  • Run docker compose up --build --force-recreate

Increase file upload size

  • Add file_uploads.ini to tools/docker/php/custom.
  • Add the following content:
    file_uploads=On
    upload_max_filesize=10M
  • Run docker compose up --build --force-recreate

Recommended packages

Xdebug

The php container is already prepared to run Xdebug.
However, to actually use it, a few manual configurations are required.

PhpStorm setup

  • While in PhpStorm open the setting (Windows shortcut: Ctrl + Alt + S)
  • Navigate to PHP -> Servers
  • Click the + icon to add a new entry
  • Fill the Name and the Host with hostname provided for the project (E.g. example-project.lcl)
  • Choose Xdebug Debugger
  • Check Use path mappings
    • Map the project symfony folder to /var/www/source/symfony

Browser setup

  • For Chrome install the Xdebug helper extension
    • For other browsers, search for alternatives.
  • Once the extension is installed, just simply enable it by setting it to Debug.