public includePlugin ( string $name, string $type, string $suffix, string $classname ) : boolean | ||
$name | string | the name of the plugin |
$type | string | the type of the plugin |
$suffix | string | the suffix of the filename |
$classname | string | the name of the class to instancy |
return | boolean | true if the plugin exists |
public function includePlugin($name, $type, $suffix, $classname)
{
if (!class_exists($classname, false)) {
$optname = '_pluginsPathList_' . $type;
if (!isset($this->config->{$optname})) {
return false;
}
$opt =& $this->config->{$optname};
if (!isset($opt[$name]) || !file_exists($opt[$name] . $name . $suffix)) {
return false;
}
require_once $opt[$name] . $name . $suffix;
}
return true;
}