buzzingpixel / mission-control-backend-core
dev-main
2023-11-09 15:33 UTC
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-09-09 17:39:21 UTC
README
此包包含Mission Control后端的基本设置功能。
使用composer将其要求添加到您的项目中。
composer require buzzingpixel/mission-control-backend-core
HTTP
在您的Web入口点前端控制器(通常为公共目录中的index.php
),启动并运行HTTP应用程序,如下所示
<?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();
从示例中可以看出,启动过程的一定部分接受或需要参数,如何实现取决于您。请参阅Dev环境中的示例:[https://github.com/buzzingpixel-mission-control/dev](https://github.com/buzzingpixel-mission-control/dev)
CLI
在您的CLI入口点,启动并运行CLI应用程序,如下所示
#!/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();
依赖关系和事件
需要许多依赖关系和事件。当您第一次启动应用程序时,异常信息应该非常清晰,说明您需要设置什么。有关更多信息,请参阅[https://github.com/buzzingpixel-mission-control/dev](https://github.com/buzzingpixel-mission-control/dev)。
此项目主要是为我而设,因此,在此阶段很难振作起来编写完整的文档。