uninstallPlugin() public method

Uninstalls a Plugin (deletes plugin files from the disk) Only deactivated plugins can be uninstalled
public uninstallPlugin ( $pluginName ) : boolean
$pluginName
return boolean
コード例 #1
0
ファイル: Controller.php プロジェクト: piwik/piwik
 public function uninstall($redirectAfter = true)
 {
     $pluginName = $this->initPluginModification(static::UNINSTALL_NONCE);
     $this->dieIfPluginsAdminIsDisabled();
     $uninstalled = $this->pluginManager->uninstallPlugin($pluginName);
     if (!$uninstalled) {
         $path = Filesystem::getPathToPiwikRoot() . '/plugins/' . $pluginName . '/';
         $messagePermissions = Filechecks::getErrorMessageMissingPermissions($path);
         $messageIntro = $this->translator->translate("Warning: \"%s\" could not be uninstalled. Piwik did not have enough permission to delete the files in {$path}. ", $pluginName);
         $exitMessage = $messageIntro . "<br/><br/>" . $messagePermissions;
         $exitMessage .= "<br> Or manually delete this directory (using FTP or SSH access)";
         $ex = new MissingFilePermissionException($exitMessage);
         $ex->setIsHtmlMessage();
         throw $ex;
     }
     $this->redirectAfterModification($redirectAfter);
 }