Piwik\Updater::getUpdateClassName PHP Method

getUpdateClassName() public method

public getUpdateClassName ( $componentName, $fileVersion )
    public function getUpdateClassName($componentName, $fileVersion)
    {
        $suffix = strtolower(str_replace(array('-', '.'), '_', $fileVersion));
        $className = 'Updates_' . $suffix;
        if ($componentName == 'core') {
            return '\\Piwik\\Updates\\' . $className;
        }
        if (ColumnUpdater::isDimensionComponent($componentName)) {
            return '\\Piwik\\Columns\\Updater';
        }
        return '\\Piwik\\Plugins\\' . $componentName . '\\' . $className;
    }

Usage Example

コード例 #1
0
ファイル: GenerateUpdate.php プロジェクト: piwik/piwik
 private function getNamespace($component)
 {
     $updater = new Updater();
     $className = $updater->getUpdateClassName($component, 'xx');
     $className = str_replace('Updates_xx', '', $className);
     $className = trim($className, '\\');
     return $className;
 }