* @package MCMS\System\Service */ class PluginSvc extends PluginSvcBase { public static function getInfoForClass($class) { if (!class_exists($class)) { echo 'WARNING: class is invalid: '.$class; return NULL; } $elements = explode('\\', $class); unset($elements[count($elements)-1]); unset($elements[0], $elements[1], $elements[2]); $info = new \stdClass(); $path = _PLUGINPATH_; if ($elements[3] == 'Pluginx') $path = _PLUGINPATHX_; unset($elements[3]); array_walk($elements, function(&$item, $key) { $item = strtolower($item); }); $path .= __DS__.implode(__DS__, $elements); $infoData = array_from_file($path.__DS__.'_info_.php', 'info'); $info->version = isset($infoData['version']) ? $infoData['version'] : 'N/A'; $info->setup = isset($infoData['setup']) ? $infoData['setup'] : NULL; $info->setupi = isset($infoData['setupi']) ? $infoData['setupi'] : NULL; $info->path = $path; return $info; } }