public function process() { if ($this->package->remove() == false) { $this->modx->log(xPDO::LOG_LEVEL_ERROR, $this->modx->lexicon('package_err_remove')); return $this->modx->error->failure($this->modx->lexicon('package_err_remove', array('signature' => $this->package->getPrimaryKey()))); } $this->clearCache(); $this->removeTransportZip(); $this->removeTransportDirectory(); $this->logManagerAction(); $this->modx->log(modX::LOG_LEVEL_WARN, $this->modx->lexicon('package_remove_info_success')); sleep(2); $this->modx->log(modX::LOG_LEVEL_INFO, 'COMPLETED'); return $this->success(); }
public function process() { $this->modx->log(xPDO::LOG_LEVEL_INFO, $this->modx->lexicon('package_remove_info_gpack')); $transportZip = $this->modx->getOption('core_path') . 'packages/' . $this->package->signature . '.transport.zip'; $transportDir = $this->modx->getOption('core_path') . 'packages/' . $this->package->signature . '/'; if (file_exists($transportZip) && file_exists($transportDir)) { /* remove transport package */ if ($this->package->removePackage($this->getProperty('force')) == false) { $this->modx->log(xPDO::LOG_LEVEL_ERROR, $this->modx->lexicon('package_err_remove')); return $this->failure($this->modx->lexicon('package_err_remove', array('signature' => $this->package->getPrimaryKey()))); } } else { /* for some reason the files were removed, so just remove the DB object instead */ $this->package->remove(); } $this->clearCache(); $this->removeTransportZip($transportZip); $this->removeTransportDirectory($transportDir); return $this->cleanup(); }