buzzingpixel / mission-control-backend-core
Requires
- php: ^8.2
- ext-oauth: *
- ext-pdo: *
- ext-redis: *
- beberlei/assert: ^3.3
- buzzingpixel/container: ^1.1
- buzzingpixel/minify-middleware: ^1.1
- buzzingpixel/php-queue: ^1.0
- buzzingpixel/php-scheduler: ^1.0
- buzzingpixel/php-template-engine: ^1.0
- buzzingpixel/valueobject-ext: ^1.0
- crell/tukio: ^1.4
- funeralzone/valueobjects: ^0.5.0
- guzzlehttp/guzzle: ^7.5
- httpsoft/http-cookie: ^1.0
- lcobucci/clock: ^3.1
- mnapoli/silly: ^1.8
- monolog/monolog: ^3.3
- psr/clock: ^1.0
- psr/container: ^2.0
- psr/event-dispatcher: ^1.0
- psr/log: ^2.0
- ramsey/uuid: ^4.7
- robmorgan/phinx: ^0.13.4
- slim/csrf: ^1.3
- slim/psr7: ^1.6
- slim/slim: ^4.11
- symfony/mailer: ^6.2
Requires (Dev)
- doctrine/coding-standard: ^11.0.0
- filp/whoops: ^2.14
- phpstan/phpstan: ^1.10
- phpstan/phpstan-deprecation-rules: ^1.1
- phpstan/phpstan-strict-rules: ^1.5
- squizlabs/php_codesniffer: ^3.6
- symfony/var-dumper: ^6.2
This package is auto-updated.
Last update: 2024-11-09 18:01:13 UTC
README
This package contains Mission Control's base set up functionality for the backend.
Use composer to require it into your project.
composer require buzzingpixel/mission-control-backend-core
HTTP
In your web entry point front controller (usually index.php
in the public directory), boot up and run the HTTP application like so:
<?php declare(strict_types=1); use MissionControlBackend\Boot; use MissionControlBackendApp\Config\BootHttpMiddlewareConfigFactory; use MissionControlBackendApp\Config\CoreConfigFactory; use MissionControlBackendApp\Config\Dependencies\DependencyBindings; use MissionControlBackendApp\Config\Events\EventRegistration; require dirname(__DIR__) . '/vendor/autoload.php'; (new Boot()) // The first argument of `start` must be an instance of // `\MissionControlBackend\CoreConfig` and is required ->start((new CoreConfigFactory())->create()) // The first argument of `buildContainer` accepts a callable that receives // an instance of `\MissionControlBackend\ContainerBindings` which you can // use to register container bindings. As you require other mission-control // packages, you will need to add that package's dependency bindings here ->buildContainer([DependencyBindings::class, 'register']) // The first argument of `registerEvents` accepts a callable that receives // an instance of `\Crell\Tukio\OrderedProviderInterface` which you can use // to register events. As you require other mission-control packages, you // will need to add that package's event bindings here ->registerEvents([EventRegistration::class, 'register']) ->buildHttpApplication() ->applyRoutes() // The first argument of `applyMiddleware` must be an instance of // `\MissionControlBackend\Http\BootHttpMiddlewareConfig` and is required ->applyMiddleware((new BootHttpMiddlewareConfigFactory())->create()) ->runApplication();
As you can see from the example, certain parts of the boot process accept or require arguments, it's up to you how to implement those. See the Dev environment for a working example: https://github.com/buzzingpixel-mission-control/dev
CLI
In your CLI entry point, boot up and run the cli application like so:
#!/usr/bin/env php <?php use MissionControlBackend\Boot; use MissionControlBackendApp\Config\CoreConfigFactory; use MissionControlBackendApp\Config\Dependencies\DependencyBindings; use MissionControlBackendApp\Config\Events\EventRegistration; require __DIR__ . '/vendor/autoload.php'; (new Boot()) // The first argument of `start` must be an instance of // `\MissionControlBackend\CoreConfig` and is required. This is exactly the // same as above in the web entry point ->start((new CoreConfigFactory)->create()) // The first argument of `buildContainer` accepts a callable that receives // an instance of `\MissionControlBackend\ContainerBindings` which you can // use to register container bindings. As you require other mission-control // packages, you will need to add that packages dependency bindings here. // This is exactly the same as above in the web entry point ->buildContainer([DependencyBindings::class, 'register']) // The first argument of `registerEvents` accepts a callable that receives // an instance of `\Crell\Tukio\OrderedProviderInterface` which you can use // to register events. As you require other mission-control packages, you // will need to add that package's event bindings here. This is exactly the // same as above in the web entry point ->registerEvents([EventRegistration::class, 'register']) ->buildCliApplication() ->applyCommands() ->runApplication();
Dependencies and events
There are a number of dependencies and events needed. As you start up the application for the first time, the exception messages should be pretty clear what you need to set up as they are encountered. See https://github.com/buzzingpixel-mission-control/dev for a better idea.
This project is primarily for me so, it's hard to muster up the gumption to write full documentation at this time.