isaeken / plugin-system
为您的项目提供插件支持和管理的库
2.0
2022-06-26 17:31 UTC
Requires
- php: ^8.1
- composer/semver: ^3.3.2
- illuminate/support: ^v9.11.0
- psr/log: ^3.0
Requires (Dev)
- laravel/pint: ^0.2.0
- orchestra/testbench: ^7.5
- pestphp/pest: ^1.21
- phpunit/phpunit: ^9.4
- symfony/var-dumper: ^6.1
README
在脚本中添加和制作自己的插件,使其更灵活
特性
- 同步执行插件(的)特定函数
- 使用参数执行方法
- 在运行时启用、禁用或加载插件
- 跟踪方法执行时间
安装
使用composer安装plugin-system
composer require isaeken/plugin-system
发布服务提供者和配置(Laravel)
php artisan vendor:publish --provider="IsaEken\PluginSystem\PluginSystemServiceProvider"
设置您的配置
// config/plugins.php <?php return [ 'directory' => base_path('plugins'), 'namespace' => '', ];
将服务提供者添加到config/app.php
\IsaEken\PluginSystem\PluginSystemServiceProvider::class
用法
$pluginSystem = new \IsaEken\PluginSystem\PluginSystem(); $pluginSystem->load(__DIR__ . '/plugins'); $pluginSystem->handle();
Laravel
app('plugins')->handle();
运行测试
要运行测试,请运行以下命令
composer run test
文档
反馈 & 支持
如果您有任何反馈,请通过hello@isaeken.com.tr联系我们