.. include:: /Includes.rst.txt .. _installation-composer: ======== Composer ======== An adsum installation is a Composer project without PHP code of its own: the Composer configuration, the environment settings and your overrides in ``config/``. Create an installation ====================== 1. Create a directory and a Composer project: .. code-block:: bash mkdir my-adsum && cd my-adsum composer init --no-interaction --name=company/adsum 2. Allow the Composer plugins that write the entry points and the runtime script: .. code-block:: bash composer config allow-plugins.web-vision/adsum-composer-installers true composer config allow-plugins.symfony/runtime true 3. Require the core and the packages you need: .. code-block:: bash composer require symfony/runtime web-vision/adsum-composer-installers \ web-vision/adsum-core web-vision/adsum-attendance - ``web-vision/adsum-core``: identity, organisation, employees, approvals, notifications - ``web-vision/adsum-working-time``: working-time models, rosters, holidays, the working-day calendar - ``web-vision/adsum-attendance``: time tracking; requires ``adsum-working-time`` 4. Put the secrets into ``.env.local`` (see :ref:`installation-configuration`) and create the tables: .. code-block:: bash bin/console doctrine:migrations:migrate --no-interaction What Composer writes ==================== On every ``composer install`` and ``composer update``, ``web-vision/adsum-composer-installers`` writes: - ``public/index.php`` and ``bin/console``. Both are rewritten every time; do not edit them. - ``.env`` with documented defaults, ``APP_ENV=prod`` and ``APP_DEBUG=0``, only when there is none yet. It contains no secrets. - ``public/bundles//``, a link to the built frontend of every installed package. Other locations are set with ``web-dir`` and ``console`` below ``extra.adsum`` in ``composer.json`` (defaults ``public`` and ``bin/console``). The web root ============ Point the web server to ``public/`` and forward every request that does not match a file to ``index.php``. Behind a reverse proxy, set ``TRUSTED_PROXIES`` (see :ref:`installation-configuration`). Package activation ================== Every installed package of an adsum type is active: the core (``adsum-framework``), adsum packages (``adsum-package``), country packages (``adsum-country``) and extensions of other vendors (``adsum-extension``). Its routes, menu entries and migrations are available on the next start; run ``bin/console doctrine:migrations:migrate`` to create its tables. To deactivate a package, remove it with Composer. An extension needs no bundle class. It declares ``"type": "adsum-extension"`` in its ``composer.json`` and uses this layout: - ``config/services.yaml``: services - ``config/packages/``: configuration of other bundles - ``config/bundles.php``: Symfony bundles it needs - ``src//Domain/Model/``: entities - ``migrations/`` and ``translations/`` Customisation ============= Overrides live in ``config/`` of the project: - ``config/packages/*.yaml``: configuration of Symfony and its bundles - ``config/services.yaml``: services and parameters - ``config/routes.yaml`` and ``config/routes/``: routes - ``config/bundles.php``: additional third-party bundles The configuration of the core loads first, then that of every package, then your ``config/``. The defaults of the core are in ``packages/web-vision/adsum-core/config/packages/``. Example: the time zone for instants until a company time zone is known (default ``Europe/Berlin``): .. code-block:: yaml # config/services.yaml parameters: app.default_time_zone: 'Europe/Vienna' Further parameters: - ``app.photo_directory``: employee photos (default ``var/storage/photos``) - ``app.file_storage_directory``: other files such as company logos and login images (default: the photo directory) On servers, use directories that survive deployments. To keep the files elsewhere, for example in an S3-compatible store, replace the service ``WebVision\Adsum\Core\Shared\Application\Port\FileStorage`` with your own implementation.