Piwik\Updater::markComponentSuccessfullyUninstalled PHP Méthode

markComponentSuccessfullyUninstalled() public méthode

Marks a component as successfully uninstalled. Deletes an option that looks like "version_$componentName".
public markComponentSuccessfullyUninstalled ( string $name )
$name string The component name. Eg, a plugin name, `'core'` or dimension column name.
    public function markComponentSuccessfullyUninstalled($name)
    {
        try {
            Option::delete(self::getNameInOptionTable($name));
        } catch (\Exception $e) {
            // case when the option table is not yet created (before 0.2.10)
        }
        /**
         * Event triggered after a component has been uninstalled.
         *
         * @param string $name The component that has been uninstalled.
         */
        Piwik::postEvent('Updater.componentUninstalled', array($name));
    }

Usage Example

Exemple #1
0
 private function removeInstalledVersionFromOptionTable($name)
 {
     $updater = new Updater();
     $updater->markComponentSuccessfullyUninstalled($name);
 }