dotkernel/light

Dotkernel Light Application

Maintainers

Package info

github.com/dotkernel/light

Type:project

pkg:composer/dotkernel/light

Transparency log

Statistics

Installs: 1

Dependents: 0

Suggesters: 0

Stars: 11

Open Issues: 10

1.5.0 2026-08-03 14:06 UTC

This package is auto-updated.

Last update: 2026-08-03 14:12:48 UTC


README

Dotkernel Light is the smallest complete Mezzio application — a PSR-15 pipeline, routing and templating, with nothing to strip out. A real starting point for a simple site. Underneath it uses Laminas Service Manager as the PSR-11 container and Laminas Diactoros for PSR-7 messages, with FastRoute for routing and Twig for templating.

Check out our demo.

Documentation

Documentation is available at: https://docs.dotkernel.org/light-documentation/

Badges

OSS Lifecycle Packagist Dependency Version

GitHub issues GitHub forks GitHub stars GitHub license

Continuous Integration codecov Qodana Build Assets

PHPStan PHPstan Level

Contents

Requirements

  • PHP 8.3, 8.4 or 8.5 (~8.3.0 || ~8.4.0 || ~8.5.0). All three versions are covered by CI.
  • Node.js ^20.19.0 || >=22.12.0 — required by the Vite and Sass versions used to build the interface.

npm ships bundled with Node.js, so any supported Node.js release provides a compatible npm.

The exact Node.js versions the interface is built against are defined by the matrix in .github/workflows/build-assets.yml, which is the authoritative list.

The following paths must be writable by the user the web server runs as:

  • data/cache/ — compiled Twig templates and the aggregated configuration cache
  • log/ — application error logs

Composer

Installation instructions:

If you have never used composer before make sure you read the Composer Basic Usage section in Composer's documentation.

Choosing an Installation Path

Example:

  • absolute path /var/www/dk
  • or relative path dk (equivalent with ./dk)

Installing Dotkernel Light

After you choose the path for Dotkernel light (dk will be used for the remainder of this example), let's move onto installation.

Clone the repository into that path — git creates the directory for you:

git clone https://github.com/dotkernel/light.git dk
cd dk

This method ensures that the default branch is installed, even if it is not released.

The dependencies have to be installed separately by running this command:

composer install

During installation, the laminas/laminas-component-installer Composer plugin prompts for some configuration settings, for example the lines below:

Please select which config file you wish to inject 'Laminas\HttpHandlerRunner\ConfigProvider' into:
  [0] Do not inject
  [1] config/config.php
  Make your selection (default is 1):

Select [0] Do not inject. Dotkernel registers the config providers it needs explicitly in config/config.php, so automatic injection is not required.

If you choose [1] config/config.php, the ConfigProvider will be appended to that file instead.

The next question is:

Remember this option for other packages of the same type? (Y/n)

You should enter y and press Enter, so you are not asked again for every remaining component.

This choice is remembered for all subsequent components, not just this one. If you later install a package whose ConfigProvider does need to be registered, add it to config/config.php yourself.

Finally, make sure your local configuration file exists:

cp config/autoload/local.php.dist config/autoload/local.php

A Composer hook normally creates this file for you, but it is registered on post-update-cmd only, so it does not run for installs performed from an existing composer.lock. The file is git-ignored and holds your local settings — application.url and the page routes are defined here and nowhere else.

Development Mode

Run this command to enable dev mode by turning debug flag to true and turning configuration caching to off. It will also make sure that any existing config cache is cleared.

composer development-enable

Bundling Static Modules

Prerequisite software: Node.js ^20.19.0 || >=22.12.0

To install dependencies into the node_modules directory run this command.

npm install

If npm install fails, this could be caused by user permissions of npm. We recommend installing npm through Node Version Manager.

You can skip the next step until you make changes in the src/App/assets folder

The build command compiles the components from the src/App/assets folder into the public folder.

This command overwrites existing files in the public folder.

npm run build

While actively working on the assets, this command rebuilds them on every change instead of requiring a manual rebuild:

npm run watch

Running the Application

For a quick look, PHP's built-in server is enough:

composer serve

The application is then available at http://localhost:8080.

For anything beyond that, we recommend running your applications in WSL:

  • Make sure you have WSL installed on your system.
  • Currently we provide a distro implementation for AlmaLinux10.
  • Install the application in a virtualhost as recommended by the chosen distro. The virtualhost document root must point to the public directory — the entry point is public/index.php — and never to the project root.
  • Set $baseUrl in config/autoload/local.php to the address of your virtualhost.
  • Run the application by opening the virtualhost address in your browser.

You should see the Dotkernel Light welcome page.

NOTE:

  • If you are getting exceptions or errors regarding some missing services, clear the configuration cache:
composer clear-config-cache

If config-cache.php is present that config will be loaded regardless of the ConfigAggregator::ENABLE_CACHE in config/autoload/mezzio.global.php

Testing and Code Quality

Run every check at once — coding standard, Twig coding standard, static analysis and unit tests:

composer check

The individual commands are also available:

Command Purpose
composer cs-check / composer cs-fix PHP coding standard (Laminas Coding Standard)
composer twig-cs-check / composer twig-cs-fix Twig template coding standard
composer static-analysis PHPStan, level 8
composer test PHPUnit test suite

Going Live

Before deploying to production, rename the robots file and adjust it for your site:

mv public/robots.txt.dist public/robots.txt