Piwik\Plugin\Dependency::getCurrentVersion PHP Method

getCurrentVersion() private method

private getCurrentVersion ( $name )
    private function getCurrentVersion($name)
    {
        switch (strtolower($name)) {
            case 'piwik':
                return $this->piwikVersion;
            case 'php':
                return $this->phpVersion;
            default:
                try {
                    $pluginNames = PluginManager::getAllPluginsNames();
                    if (!in_array($name, $pluginNames) || !PluginManager::getInstance()->isPluginLoaded($name)) {
                        return '';
                    }
                    $plugin = PluginManager::getInstance()->loadPlugin(ucfirst($name));
                    if (!empty($plugin)) {
                        return $plugin->getVersion();
                    }
                } catch (\Exception $e) {
                }
        }
        return '';
    }