eureka / kernel-http
Kernel Http for Content PHP application. Use PSR-7, 15 & 17 to build an application.
Requires
- php: 8.1.*||8.2.*||8.3.*
- ext-filter: *
- ext-json: *
- eureka/component-http: ^5.3
- nyholm/psr7: ^1.8
- psr/cache: ^1.0||^2.0||^3.0
- psr/container: ^1.0||^2.0||^3.0
- psr/http-factory: ^1.0
- psr/http-message: ^1.0||^2.0
- psr/http-server-handler: ^1.0
- psr/http-server-middleware: ^1.0
- psr/log: ^1.1||^2.0||^3.0
- symfony/config: ^5.4||^6.4||^7.0
- symfony/dependency-injection: ^5.4||^6.4||^7.0
- symfony/finder: ^5.4||^6.4||^7.0
- symfony/routing: ^5.4||^6.4||^7.0
- symfony/yaml: ^5.4||^6.4||^7.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.49.0
- maglnet/composer-require-checker: ^4.7.1
- phpstan/phpstan: ^1.10.59
- phpstan/phpstan-phpunit: ^1.3.15
- phpstan/phpstan-strict-rules: ^1.5.2
- phpunit/phpcov: ^9.0.2
- phpunit/phpunit: ^10.5.10
- symfony/cache: ^5.4.35||^6.4.3||^7.0
This package is auto-updated.
Last update: 2024-10-22 18:46:05 UTC
README
Kernel Http for any Eureka Framework application.
Define global Application, Controller & Component kernel versions
Installation
If you wish to install it in your project, require it via composer:
composer require eureka/kernel-http
Usage
<?php declare(strict_types=1); /* * Copyright (c) Romain Cottard * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ use Eureka\Kernel\Http\Application\Application; use Eureka\Kernel\Http\Kernel; //~ Define Loader & add main classes for config require_once __DIR__ . '/vendor/autoload.php'; $root = realpath(__DIR__ . '/'); $env = 'dev'; $debug = true; // Run application // Applications exception should be caught. Try catch useful only when you have a bug in kernel component try { $application = new Application(new Kernel($root, $env, $debug)); $response = $application->run(); $application->send($response); } catch (\Exception $exception) { echo 'Exception: ' . $exception->getMessage() . PHP_EOL; echo 'Trace: ' . $exception->getTraceAsString() . PHP_EOL; exit(1); }
Contributing
See the CONTRIBUTING file.
Install / update project
You can install project with the following command:
make install
And update with the following command:
make update
NB: For the components, the composer.lock
file is not committed.
Testing & CI (Continuous Integration)
Tests
You can run unit tests (with coverage) on your side with following command:
make tests
You can run functional tests (without coverage) on your side with following command:
make integration
For prettier output (but without coverage), you can use the following command:
make testdox # run tests without coverage reports but with prettified output
Code Style
You also can run code style check with following commands:
make phpcs
You also can run code style fixes with following commands:
make phpcsf
Static Analysis
To perform a static analyze of your code (with phpstan, lvl 9 at default), you can use the following command:
make analyze
To ensure you code still compatible with current supported version at Deezer and futures versions of php, you need to run the following commands (both are required for full support):
Minimal supported version:
make php74compatibility
Maximal supported version:
make php83compatibility
CI Simulation
And the last "helper" commands, you can run before commit and push, is:
make ci
License
This project is currently under The MIT License (MIT). See LICENCE file for more information.