Exemple #1
0
 /**
  * @param string $cmd
  * @param array $bind
  * @return mixed
  */
 public function execute($cmd, array $bind = [])
 {
     $this->unixStartTime = microtime(true);
     $result = parent::execute($cmd, $bind);
     $this->measure($cmd, $bind, microtime(true) - $this->unixStartTime);
     return $result;
 }
 /**
  * @param string $cmd
  * @param array $bind
  * @return mixed
  */
 public function execute($cmd, array $bind = [])
 {
     try {
         return parent::execute($cmd, $bind);
     } catch (\Exception $e) {
         return $this->retry($e, $cmd, $bind);
     }
 }
Exemple #3
0
 /**
  * @param string $cmd
  * @param array $bind
  * @return mixed
  */
 public function execute($cmd, array $bind = [])
 {
     if ($this->preCallback) {
         $preCallback = $this->preCallback;
         $preCallback($cmd, $bind);
     }
     $result = parent::execute($cmd, $bind);
     if ($this->postCallback) {
         $postCallback = $this->postCallback;
         $postCallback($result);
     }
     return $result;
 }
 /**
  * @param string $cmd
  * @param array $bind
  * @return mixed
  */
 public function execute($cmd, array $bind = [])
 {
     try {
         $result = parent::execute($cmd, $bind);
     } catch (\Exception $e) {
         if ($this->callback) {
             $callback = $this->callback;
             $callback($cmd, $bind, $e);
         }
         return $this->result;
     }
     return $result;
 }