Skip to content

Commit

Permalink
Reducing DrushTask default verbosity. (#581)
Browse files Browse the repository at this point in the history
  • Loading branch information
grasmash authored Oct 18, 2016
1 parent 443e48f commit f8a422a
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions phing/phingcludes/DrushTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,10 @@ public function main() {
$option = new DrushOption();
$option->setName('verbose');
$this->options[] = $option;
$exec_level = Project::MSG_INFO;
}
else {
$exec_level = Project::MSG_VERBOSE;
}

foreach ($this->options as $option) {
Expand All @@ -304,9 +308,8 @@ public function main() {
$command[] = $param->getValue();
}


if (!empty($this->dir)) {
$this->log("Changing working directory to: $this->dir");
$this->log("Changing working directory to: $this->dir", $exec_level);
$initial_cwd = getcwd();
chdir($this->dir);
}
Expand All @@ -317,15 +320,15 @@ public function main() {

if ($this->passthru) {
$command = implode(' ', $command);
$this->log("Executing: $command");
$this->log("Executing: $command", $exec_level);
passthru($command, $return);
}
else {
// Redirect sterr to stout for Phing log.
$command[] = '2>&1';

$command = implode(' ', $command);
$this->log("Executing: $command");
$this->log("Executing: $command", $exec_level);
exec($command, $output, $return);

if ($this->logoutput) {
Expand All @@ -337,7 +340,7 @@ public function main() {
}

if (isset($initial_cwd)) {
$this->log("Changing working directory back to $initial_cwd.");
$this->log("Changing working directory back to $initial_cwd.", $exec_level);
chdir($initial_cwd);
}

Expand Down

0 comments on commit f8a422a

Please sign in to comment.