archict/core
最新稳定版本:v1.1.0
Composer 安装命令:
composer require archict/core
包简介
Heart of Archict, this library load and manage Bricks
README 文档
README
In the Land of PHP where the Shadows lie.
One Brick to rule them all, One Brick to find them,
One Brick to bring them all, and in the darkness bind them
In the Land of PHP where the Shadows lie.
Heart of Archict, this library load and manage Bricks.
Usage
<?php use Archict\Core\Core; use Archict\Core\Event\EventDispatcher; $core = Core::build(); // Load Services and Events $core->load(); // Access to all Services $manager = $core->service_manager; $dispatcher = $manager->get(EventDispatcher::class); $dispatcher->dispatch(new MyEvent());
That's all!
Please note that if your package is also a Brick, it will scan only src and include directory for Services.
Supplied Services
ServiceManager
With ServiceManager::get(class-string) you can retrieve any Service. But it's better if you use automatic Service
injection in your own Service constructor.
EventDispatcher
With EventDispatcher::dispatch(mixed) you can dispatch an Event to all its listeners.
CacheInterface
Implementation of PSR-16 cache system.
统计信息
- 总下载量: 1.56k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 3
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-04-18