Only load plugins derived from 'Plugin' class
This commit is contained in:
parent
ff8fe8dc02
commit
d105fdf6d8
|
@ -75,27 +75,13 @@ function buildPlugins()
|
|||
|
||||
foreach($pluginsDeclaredClasess as $pluginClass)
|
||||
{
|
||||
$Plugin = new $pluginClass();
|
||||
|
||||
// Deprecated
|
||||
// // Check if the plugin is translated.
|
||||
// $languageFilename = PATH_PLUGINS.$Plugin->directoryName().DS.'languages'.DS.$Site->locale().'.json';
|
||||
// if( !Sanitize::pathFile($languageFilename) ) {
|
||||
// $languageFilename = PATH_PLUGINS.$Plugin->directoryName().DS.'languages'.DS.'en_US.json';
|
||||
// }
|
||||
|
||||
// $database = file_get_contents($languageFilename);
|
||||
// $database = json_decode($database, true);
|
||||
|
||||
// // Set name and description from the language file.
|
||||
// $Plugin->setMetadata('name',$database['plugin-data']['name']);
|
||||
// $Plugin->setMetadata('description',$database['plugin-data']['description']);
|
||||
|
||||
// // Remove name and description, and add new words if there are.
|
||||
// unset($database['plugin-data']);
|
||||
// if(!empty($database)) {
|
||||
// $Language->add($database);
|
||||
// }
|
||||
// Ignore non-plugin classes
|
||||
if ( !is_subclass_of( $pluginClass, 'Plugin' ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$Plugin = new $pluginClass();
|
||||
|
||||
// Push Plugin to array all plugins installed and not installed.
|
||||
$plugins['all'][$pluginClass] = $Plugin;
|
||||
|
|
Loading…
Reference in New Issue