Add page to show the list of plugins
This commit is contained in:
@@ -23,6 +23,7 @@ use Pimple\Container;
|
||||
* @property \Core\ObjectStorage\ObjectStorageInterface $objectStorage
|
||||
* @property \Core\Cache\Cache $memoryCache
|
||||
* @property \Core\Plugin\Hook $hook
|
||||
* @property \Core\Plugin\Loader $pluginLoader
|
||||
* @property \Integration\BitbucketWebhook $bitbucketWebhook
|
||||
* @property \Integration\GithubWebhook $githubWebhook
|
||||
* @property \Integration\GitlabWebhook $gitlabWebhook
|
||||
|
||||
@@ -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 '?';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,6 +21,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
|
||||
*
|
||||
@@ -55,6 +63,7 @@ class Loader extends \Core\Base
|
||||
Tool::buildDic($this->container, $instance->getClasses());
|
||||
|
||||
$instance->initialize();
|
||||
$this->plugins[] = $instance;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user