public function onSiteDeleted($idSite) { // we do not delete logs here on purpose (you can run these queries on the log_ tables to delete all data) Cache::deleteCacheWebsiteAttributes($idSite); $archiveInvalidator = StaticContainer::get('Piwik\\Archive\\ArchiveInvalidator'); $archiveInvalidator->forgetRememberedArchivedReportsToInvalidateForSite($idSite); MeasurableSettingsTable::removeAllSettingsForSite($idSite); }
/** * Uninstalls a Plugin (deletes plugin files from the disk) * Only deactivated plugins can be uninstalled * * @param $pluginName * @throws \Exception * @return bool */ public function uninstallPlugin($pluginName) { if ($this->isPluginLoaded($pluginName)) { throw new \Exception("To uninstall the plugin {$pluginName}, first disable it in Piwik > Settings > Plugins"); } $this->loadAllPluginsAndGetTheirInfo(); SettingsStorage\Backend\PluginSettingsTable::removeAllSettingsForPlugin($pluginName); SettingsStorage\Backend\MeasurableSettingsTable::removeAllSettingsForPlugin($pluginName); $this->executePluginDeactivate($pluginName); $this->executePluginUninstall($pluginName); $this->removePluginFromPluginsInstalledConfig($pluginName); $this->unloadPluginFromMemory($pluginName); $this->removePluginFromConfig($pluginName); $this->removeInstalledVersionFromOptionTable($pluginName); $this->clearCache($pluginName); self::deletePluginFromFilesystem($pluginName); if ($this->isPluginInFilesystem($pluginName)) { return false; } /** * Event triggered after a plugin has been uninstalled. * * @param string $pluginName The plugin that has been uninstalled. */ Piwik::postEvent('PluginManager.pluginUninstalled', array($pluginName)); return true; }