chomenko / auto-install
此包的最新版本(v2.1.1)没有可用的许可证信息。
Nette 框架的自动安装服务
v2.1.1
2019-03-11 13:55 UTC
Requires
- php: >=7.2
- doctrine/annotations: ^1.6
- nette/caching: ^2.5
- nette/di: ^2.4
- nette/robot-loader: >=2.4
README
安装
composer require chomenko/auto-install
配置
autoInstall: dirs: - %rootDir%/app extensions: autoInstall: Chomenko\AutoInstall\AutoInstallExtension
使用
use Chomenko\AutoInstall\AutoInstall; class MyService implements AutoInstall { }
使用哪个工厂
搜索以 I 为前缀的类
use Chomenko\AutoInstall\AutoInstall; class MyService implements AutoInstall { } interface IMyService { /** * @return MyService */ public function create(); }
添加服务标签
use Chomenko\AutoInstall\Config; use Chomenko\AutoInstall\AutoInstall; /** * @Config\Tag({"My.tag", "My.nextag"}) */ class MyService implements AutoInstall { }
设置服务实现
use Chomenko\AutoInstall\Config; use Chomenko\AutoInstall\AutoInstall; /** * @Config\Implement("App\IMyService") */ class MyService implements AutoInstall { }