Skip to content

isaeken/plugin-system

Repository files navigation

Plugin System

Plugin System

Make and add own plugins to your script and make it flexible

run-tests Libraries.io dependency status for latest release GitHub Packagist PHP Version Support Packagist Version

Features

  • Execute specific function for plugin(s) at the synchronously
  • Execute methods using arguments
  • Enable, disable or load plugins in runtime
  • Track method execution times

Installation

Install plugin-system with composer

  composer require isaeken/plugin-system

Publish service provider and configs (Laravel)

php artisan vendor:publish --provider="IsaEken\PluginSystem\PluginSystemServiceProvider"

Set your configuration

// config/plugins.php
<?php

return [
    'directory' => base_path('plugins'),
    'namespace' => '',
];

Add service provider to config/app.php

\IsaEken\PluginSystem\PluginSystemServiceProvider::class

Usage

$pluginSystem = new \IsaEken\PluginSystem\PluginSystem();
$pluginSystem->load(__DIR__ . '/plugins');
$pluginSystem->handle();

Laravel

app('plugins')->handle();

Running Tests

To run tests, run the following command

  composer run test

Documentation

Documentation

Feedback & Support

If you have any feedback, please reach out to us at [email protected]

Authors

License

MIT