定制 orbiter/satellite 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

orbiter/satellite

Composer 安装命令:

composer require orbiter/satellite

包简介

PHP Event Dispatcher with listener and PSR-14 dispatcher, compatible with PSR-11 container and custom invokers.

README 文档

README

Latest Stable Version Latest Unstable Version codecov Total Downloads Github actions Build PHP Version Require

  • PSR-14 Event Dispatcher and Listener
  • using InvokerInterface to execute anything, PSR-11 compatible

Check satellite-app for a ready to use template, or install just this event library:

composer require orbiter/satellite

Dependencies, using PHP-DI here, but possible with any PSR-11 container and any implementation of InvokerInterface:

use function DI\autowire;
use function DI\get;

$dependencies = [
    Satellite\Event\EventListenerInterface::class => autowire(Satellite\Event\EventListener::class),
    Psr\EventDispatcher\ListenerProviderInterface::class => get(Satellite\Event\EventListenerInterface::class),
    Satellite\Event\EventDispatcher::class => autowire()
        ->constructorParameter('listener', get(Psr\EventDispatcher\ListenerProviderInterface::class))
        ->constructorParameter('invoker', get(Invoker\InvokerInterface::class)),
    Psr\EventDispatcher\EventDispatcherInterface::class => get(Satellite\Event\EventDispatcher::class),
];

For full invocation PSR-11 injection based on Reflection, set up the Invoker with the included InvokerTypeHintContainerResolver:

/**
 * @var $invoker \Invoker\Invoker
 */
$invoker = $container->get(\Invoker\Invoker::class);
$invoker->getParameterResolver()->prependResolver(
    new Satellite\InvokerTypeHintContainerResolver($container)
);

Dev Notices

Commands to set up and run e.g. tests:

# on windows:
docker run -it --rm -v %cd%:/app composer install

docker run -it --rm -v %cd%:/var/www/html php:8.1-cli-alpine sh

docker run --rm -v %cd%:/var/www/html php:8.1-cli-alpine sh -c "cd /var/www/html && ./vendor/bin/phpunit --testdox -c phpunit-ci.xml --bootstrap vendor/autoload.php"

# on unix:
docker run -it --rm -v `pwd`:/app composer install

docker run -it --rm -v `pwd`:/var/www/html php:8.1-cli-alpine sh

docker run --rm -v `pwd`:/var/www/html php:8.1-cli-alpine sh -c "cd /var/www/html && ./vendor/bin/phpunit --testdox -c phpunit-ci.xml --bootstrap vendor/autoload.php"

Versions

This project adheres to semver, until 1.0.0 and beginning with 0.1.0: all 0.x.0 releases are like MAJOR releases and all 0.0.x like MINOR or PATCH, modules below 0.1.0 should be considered experimental.

License

This project is free software distributed under the MIT LICENSE.

Contributors

By committing your code to the code repository you agree to release the code under the MIT License attached to the repository.

Maintained by Michael Becker

统计信息

  • 总下载量: 1.22k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 2
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-11-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固