src/Robo/BltTasks.php
protected function invokeHook($hook) {
    if ($this->getConfig()->has("command-hooks.$hook.command")
      && $this->getConfigValue("command-hooks.$hook.command")) {
      $this->say("Executing $hook target hook...");
      $result = $this->taskExecStack()
        ->exec($this->getConfigValue("command-hooks.$hook.command"))
        ->dir($this->getConfigValue("command-hooks.$hook.dir"))
        ->interactive($this->input()->isInteractive())
        ->printOutput(TRUE)
        ->printMetadata(TRUE)
        ->stopOnFail()
        ->run();

      if (!$result->wasSuccessful()) {
        throw new BltException("Executing target-hook $hook failed.");
      }
    }
    else {
      $this->logger->info("Skipped $hook target hook. No hook is defined.");

      return 0;
    }
  }
protected function invokeHook($hook) {
    if ($this->getConfig()->has("command-hooks.$hook.command")
      && $this->getConfigValue("command-hooks.$hook.command")) {
      $this->say("Executing $hook target hook...");
      $result = $this->taskExecStack()
        ->exec($this->getConfigValue("command-hooks.$hook.command"))
        ->dir($this->getConfigValue("command-hooks.$hook.dir"))
        ->interactive($this->input()->isInteractive())
        ->printOutput(TRUE)
        ->printMetadata(TRUE)
        ->stopOnFail()
        ->run();

      if (!$result->wasSuccessful()) {
        throw new BltException("Executing target-hook $hook failed.");
      }
    }
    else {
      $this->logger->info("Skipped $hook target hook. No hook is defined.");

      return 0;
    }
  }
protected function invokeHook ( $ hook ) { if ( $ this -> getConfig ( ) -> has ( "command-hooks.$hook.command" ) && $ this -> getConfigValue ( "command-hooks.$hook.command" ) ) { $ this -> say ( "Executing $hook target hook..." ) ; $ result = $ this -> taskExecStack ( ) -> exec ( $ this -> getConfigValue ( "command-hooks.$hook.command" ) ) -> dir ( $ this -> getConfigValue ( "command-hooks.$hook.dir" ) ) -> interactive ( $ this -> input ( ) -> isInteractive ( ) ) -> printOutput ( TRUE ) -> printMetadata ( TRUE ) -> stopOnFail ( ) -> run ( ) ; if ( ! $ result -> wasSuccessful ( ) ) { throw new BltException ( "Executing target-hook $hook failed." ) ; } } else { $ this -> logger -> info ( "Skipped $hook target hook. No hook is defined." ) ; return 0 ; } }
Invokes a given 'command-hooks' hook, typically defined in blt.yml.

@param string $hook
The hook name.

@return int

@throws \Acquia\Blt\Robo\Exceptions\BltException
Invokes a given command - hooks hook typically defined in blt . yml .