https://github.com/jenstornell/php-plugin-loader
A plugin loader for any project
https://github.com/jenstornell/php-plugin-loader
php plugin plugin-loader plugins
Last synced: 6 months ago
JSON representation
A plugin loader for any project
- Host: GitHub
- URL: https://github.com/jenstornell/php-plugin-loader
- Owner: jenstornell
- License: mit
- Created: 2019-04-20T19:00:11.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-06-22T12:59:20.000Z (over 6 years ago)
- Last Synced: 2025-03-13T09:27:25.631Z (10 months ago)
- Topics: php, plugin, plugin-loader, plugins
- Language: PHP
- Homepage:
- Size: 7.81 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- Changelog: changelog.md
- License: license
Awesome Lists containing this project
README
# PHP Plugin Loader
*Version 1.1*
If you are making some kind of tool, you may want a plugin loader.
## In short
- Very small
- Includes and excludes support
- Will skip hidden plugins prefixed with _
- You can control the plugin load order
## Setup
Include the file to the library. Create a class instance.
1. The first argument should be the path to the plugin folder.
1. The second argument should be plugins that will always be excluded.
```php
load('third', 'second');
$load->load('first', 'forth');
```
### Exclude
If you don't set any plugins to be included, it will load all the plugins that are not excluded. If we don't run the include example above, this example will load all the plugins except `second`.
```php
$load->load('!second');
```
### Prefix to exclude
Another alternative to exclude a plugin is to use the `_` as a prefix. If you name a plugin folder `_fourth`, then it will be excluded.
## Donate
Donate to [DevoneraAB](https://www.paypal.me/DevoneraAB) if you want.
## Requirements
- PHP 7
## License
MIT