Phergie_Plugin_Handler::getPluginInfo PHP Method

getPluginInfo() public method

Returns metadata corresponding to a specified plugin.
public getPluginInfo ( string $plugin ) : array | boolean
$plugin string Short name of the plugin class
return array | boolean Associative array containing the path to the class file and its containing directory as well as the full class name
    public function getPluginInfo($plugin)
    {
        foreach (array_reverse($this->paths) as $path) {
            $file = $path['path'] . $plugin . '.php';
            if (file_exists($file)) {
                $path = array('dir' => $path['path'], 'file' => $file, 'class' => $path['prefix'] . $plugin);
                return $path;
            }
        }
        // If the class can't be found, display an error
        throw new Phergie_Plugin_Exception('Class file for plugin "' . $plugin . '" cannot be found', Phergie_Plugin_Exception::ERR_CLASS_NOT_FOUND);
    }