Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/isaeken/plugin-system

Plugin system for your PHP projects
https://github.com/isaeken/plugin-system

composer extension extension-system library packagist php php-plugin-system plugin plugin-system

Last synced: 3 months ago
JSON representation

Plugin system for your PHP projects

Awesome Lists containing this project

README

        

# Plugin System

![Plugin System](https://banners.beyondco.de/Plugin%20System.png?theme=light&packageManager=composer+require&packageName=isaeken%2Fplugin-system&pattern=architect&style=style_1&description=Make+plugins+to+your+script+and+make+it+flexible.&md=1&showWatermark=1&fontSize=100px&images=puzzle)

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

[![run-tests](https://github.com/isaeken/plugin-system/actions/workflows/run-tests.yml/badge.svg)](https://github.com/isaeken/plugin-system/actions/workflows/run-tests.yml)
![Libraries.io dependency status for latest release](https://img.shields.io/librariesio/release/github/isaeken/plugin-system)
![GitHub](https://img.shields.io/github/license/isaeken/plugin-system)
![Packagist PHP Version Support](https://img.shields.io/packagist/php-v/isaeken/plugin-system)
![Packagist Version](https://img.shields.io/packagist/v/isaeken/plugin-system)

## 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

```bash
composer require isaeken/plugin-system
```

### Publish service provider and configs (Laravel)

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

Set your configuration

```php
// config/plugins.php
base_path('plugins'),
'namespace' => '',
];
```

Add service provider to ``config/app.php``
```php
\IsaEken\PluginSystem\PluginSystemServiceProvider::class
```

## Usage

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

### Laravel

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

## Running Tests

To run tests, run the following command

```bash
composer run test
```

## Documentation

[Documentation](https://isaeken.github.io/plugin-system)

## Feedback & Support

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

## Authors

- [@isaeken](https://www.github.com/isaeken)

## License

[MIT](LICENSE.md)