diff options
Diffstat (limited to 'app/Core/Plugin')
-rw-r--r-- | app/Core/Plugin/Base.php | 52 | ||||
-rw-r--r-- | app/Core/Plugin/Loader.php | 9 |
2 files changed, 61 insertions, 0 deletions
diff --git a/app/Core/Plugin/Base.php b/app/Core/Plugin/Base.php index 580d41ad..1f61ab33 100644 --- a/app/Core/Plugin/Base.php +++ b/app/Core/Plugin/Base.php @@ -44,4 +44,56 @@ abstract class Base extends \Core\Base call_user_func($callback, $container); }); } + + /** + * Get plugin name + * + * This method should be overrided by your Plugin class + * + * @access public + * @return string + */ + public function getPluginName() + { + return ucfirst(substr(get_called_class(), 7, -7)); + } + + /** + * Get plugin description + * + * This method should be overrided by your Plugin class + * + * @access public + * @return string + */ + public function getPluginDescription() + { + return ''; + } + + /** + * Get plugin author + * + * This method should be overrided by your Plugin class + * + * @access public + * @return string + */ + public function getPluginAuthor() + { + return '?'; + } + + /** + * Get plugin version + * + * This method should be overrided by your Plugin class + * + * @access public + * @return string + */ + public function getPluginVersion() + { + return '?'; + } } diff --git a/app/Core/Plugin/Loader.php b/app/Core/Plugin/Loader.php index 04b2bfff..9a884dae 100644 --- a/app/Core/Plugin/Loader.php +++ b/app/Core/Plugin/Loader.php @@ -22,6 +22,14 @@ class Loader extends \Core\Base const TABLE_SCHEMA = 'plugin_schema_versions'; /** + * Plugin instances + * + * @access public + * @var array + */ + public $plugins = array(); + + /** * Scan plugin folder and load plugins * * @access public @@ -55,6 +63,7 @@ class Loader extends \Core\Base Tool::buildDic($this->container, $instance->getClasses()); $instance->initialize(); + $this->plugins[] = $instance; } /** |