Ejemplo n.º 1
0
 /**
  * Redirect to referer. If referer is no valid this function will use $alternative URL
  *
  * @param string $alternative Alternative URL
  * @return null
  */
 function redirectToReferer($alternative)
 {
     redirect_to_referer($alternative);
 }
 /**
  * Execute SVN command
  *
  * @param string $command
  * @return boolean
  */
 function execute($command)
 {
     $this->output = null;
     $authentication = '--username ' . $this->active_repository->getUsername() . ' --password ' . $this->active_repository->getPassword() . ' --non-interactive';
     $executable_path = empty($this->executable_path) ? '' : with_slash($this->executable_path);
     $escaped = escapeshellcmd($executable_path . "svn " . $authentication . " " . $this->config_dir . " " . $this->trust_server_certificate . " {$command}") . " " . $this->stderr2stdout;
     //pre_var_dump($escaped);
     exec($escaped, $this->output);
     $error = $this->checkResponse($this->output);
     if (is_error($error)) {
         if (!$this->triggerred_by_handler) {
             flash_error($error->getMessage());
             redirect_to_referer(source_module_url($this->active_project));
         } else {
             $this->error = $error->getMessage();
         }
         // if
     }
     // if
     return true;
 }