Exemplo n.º 1
0
 /**
  * Deletes a package.
  *
  * @param bool $ignoreState
  *
  * @return bool TRUE on success, FALSE on error
  */
 protected function _delete($ignoreState = false)
 {
     // if package is installed, uninstall it first
     if ($this->package->isInstalled() && !$this->uninstall() && !$ignoreState) {
         // message is set by uninstall()
         return false;
     }
     if (!rex_dir::delete($this->package->getPath()) && !$ignoreState) {
         $this->message = $this->i18n('not_deleted', $this->package->getName());
         return false;
     }
     if (!$ignoreState) {
         $this->saveConfig();
         $this->message = $this->i18n('deleted', $this->package->getName());
     }
     return true;
 }