예제 #1
0
 /**
  * Uninstall a plugin
  *
  * @access public
  * @param  string $pluginId
  * @throws PluginInstallerException
  */
 public function uninstall($pluginId)
 {
     $pluginFolder = PLUGINS_DIR . DIRECTORY_SEPARATOR . basename($pluginId);
     if (!file_exists($pluginFolder)) {
         throw new PluginInstallerException(t('Plugin not found.'));
     }
     if (!is_writable($pluginFolder)) {
         throw new PluginInstallerException(e('You don\'t have the permission to remove this plugin.'));
     }
     Tool::removeAllFiles($pluginFolder);
 }
예제 #2
0
 /**
  * Remove all items from the cache
  *
  * @access public
  */
 public function flush()
 {
     $this->createCacheFolder();
     Tool::removeAllFiles(CACHE_DIR, false);
 }