-
Notifications
You must be signed in to change notification settings - Fork 1
project API's
the Info class handles plugin's info from plugin.json file.
file: https://github.com/bethropolis/plugin-system/blob/main/src/Info.php
use Bethropolis\PluginSystem\Info;Loads the configuration from the config file.
Refreshes the list of plugins and plugin info.
Scans the plugins directory and returns an array of plugin names.
Adds a plugin to the configuration.
Removes a plugin from the configuration.
Modifies the plugin data for a specific plugin.
Retrieves the list of plugins as an array.
Saves the configuration data to a file.
the lifecycle class handles a plugin's life cycle from installation to uninstallation.
file: https://github.com/bethropolis/plugin-system/blob/main/src/lifeCycle.php
use Bethropolis\PluginSystem\Lifecycle;executed when a plugin is installed
executed when a plugin is uninstalled
Process plugin files. eg plugin.json
this allows it to perform plugin configurations e.t.c
return the path to the plugin's config file
Appends a require statement to a target file if it doesn't already exist.
Undos the require statement from $this-append() .
Resolves the absolute path from a given path.
Resolves the relative path from a given base path.
the manager class handles instalation, uninstallation and updating of plugins.
file: https://github.com/bethropolis/plugin-system/blob/main/src/Manager.php
use Bethropolis\PluginSystem\Manager;initializes the manager
downloads a zip file and extracts it into the plugin directory
removes a plugin from the plugins directory.
updates a plugin.
loads/creates the config file
activates a plugin
deactivates a plugin
toggles between plugin activation and deactivation
checks if a plugin exists
checks if a plugin is active
returns the metadata of a plugin
saves the config file
the plugin class is an abstract to all plugins to be made.
file: https://github.com/bethropolis/plugin-system/blob/main/src/Plugin.php
use Bethropolis\PluginSystem\Plugin;plugin name
plugin version
plugin description
plugin author
returns plugin info such as plugin name, version, description and author.
initializes the plugin, should be defined on every plugin.
links a plugin function to a hook.
links a plugin function to an event.
logs an error.
logs an exception.
the system class handles registering and executing hooks and events.
file: https://github.com/bethropolis/plugin-system/blob/main/src/System.php
use Bethropolis\PluginSystem\System;Loads plugins from a specific directory.
Links a plugin function to a hook.
Executes a hook by calling all registered callbacks associated with it.
Executes a series of hooks.
Registers an event
Adds an action to the event specified by $eventName.
Triggers an event and calls all registered callbacks for that event.
happy coding! 💜