예제 #1
0
 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();
 }
예제 #2
0
 public function process()
 {
     $transport = $this->package->getTransport();
     $this->modx->log(modX::LOG_LEVEL_INFO, $this->modx->lexicon('package_uninstall_info_prep'));
     /* uninstall package */
     $options = array(xPDOTransport::PREEXISTING_MODE => $this->getProperty('preexisting_mode'));
     if ($this->package->uninstall($options) == false) {
         return $this->failure(sprintf($this->modx->lexicon('package_err_uninstall'), $this->package->getPrimaryKey()));
     }
     $this->modx->log(modX::LOG_LEVEL_WARN, $this->modx->lexicon('package_uninstall_info_success', array('signature' => $this->package->get('signature'))));
     sleep(2);
     $this->modx->log(modX::LOG_LEVEL_INFO, 'COMPLETED');
     $this->clearCache();
     $this->logManagerAction();
     return $this->success();
 }
예제 #3
0
 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();
 }