Пример #1
0
 protected function _filterExt($action, $objName, $cmd = null)
 {
     if (is_null($cmd)) {
         $cmd = $this->_filterExtDef;
     }
     if (!$cmd) {
         return 1;
     }
     $cmd .= $this->_dbName . " {$action} {$objName}";
     $output = $ret = null;
     exec($cmd, $output, $ret);
     if ($output) {
         $this->_out->logError("Error output from external filter:" . PHP_EOL . implode(PHP_EOL, $output));
     }
     return $ret;
 }
Пример #2
0
 protected function _filterExt($action, $objName, $cmd = null)
 {
     if (is_null($cmd)) {
         $cmd = $this->_filterExtDef;
     }
     if (!$cmd) {
         return 1;
     }
     $cmd .= escapeshellarg($this->_dbName) . ' ' . escapeshellarg($action) . ' ' . escapeshellarg($objName);
     $output = array();
     $ret = null;
     exec($cmd, $output, $ret);
     if ($output) {
         $this->_out->logError("Error output from external filter:" . PHP_EOL . implode(PHP_EOL, $output));
     }
     return $ret;
 }
Пример #3
0
 public function run()
 {
     if ($this->_stopAt !== false) {
         return false;
     }
     $orders = $this->_roles;
     try {
         $this->_runPhase("init", $orders) && $this->_runPhase("refreshLocal", $orders) && $this->_runPhase("refreshRemote", $orders) && $this->_runPhase("compare", $orders) && $this->_runPhase("updateRemote", $orders) && $this->_runPhase("shutdown", $orders);
     } catch (Core_StopException $e) {
         // error message
         $this->_stopAt = $e;
         self::$out->logError($e->getMessage());
         return false;
     } catch (Exception $e) {
         $myE = new Core_StopException("", "engine init", null, Core_StopException::RETCODE_FOREIGN_EXCEPTION);
         $myE->setException($e);
         $this->_stopAt = $myE;
         throw $e;
     }
     $this->_lock->unlock();
     return true;
 }