Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Commit 644bd0d

Browse files
committed
Hiding drush status check output in doctor command.
1 parent ef57f4c commit 644bd0d

File tree

3 files changed

+22
-5
lines changed

3 files changed

+22
-5
lines changed

phing/build.yml

+1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ drush:
5656
uri: ${multisite.name}
5757
assume: yes
5858
passthru: yes
59+
logoutput: yes
5960
verbose: ${blt.verbose}
6061

6162
multisite:

phing/phingcludes/DrushTask.php

+20-4
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ class DrushTask extends Task {
7474
private $verbose = FALSE;
7575
private $haltonerror = TRUE;
7676
private $passthru = FALSE;
77+
private $logoutput = TRUE;
7778

7879
/**
7980
* The Drush command to run.
@@ -220,6 +221,17 @@ public function setPassthru($var) {
220221
}
221222
}
222223

224+
/**
225+
* Log output.
226+
*/
227+
public function setLogOutput($var) {
228+
if (is_string($var)) {
229+
$this->passthru = ($var === 'yes' || $var === 'true');
230+
} else {
231+
$this->passthru = !!$var;
232+
}
233+
}
234+
223235
/**
224236
* Initialize the task.
225237
*/
@@ -233,6 +245,7 @@ public function init() {
233245
$this->setVerbose($this->getProject()->getProperty('drush.verbose'));
234246
$this->setAssume($this->getProject()->getProperty('drush.assume'));
235247
$this->setPassthru($this->getProject()->getProperty('drush.passthru'));
248+
$this->setPassthru($this->getProject()->getProperty('drush.logoutput'));
236249
}
237250

238251
/**
@@ -322,9 +335,12 @@ public function main() {
322335
$command = implode(' ', $command);
323336
$this->log("Executing: $command");
324337
exec($command, $output, $return);
325-
// Collect Drush output for display through Phing's log.
326-
foreach ($output as $line) {
327-
$this->log($line);
338+
339+
if ($this->logoutput) {
340+
// Collect Drush output for display through Phing's log.
341+
foreach ($output as $line) {
342+
$this->log($line);
343+
}
328344
}
329345
}
330346

@@ -333,7 +349,7 @@ public function main() {
333349
chdir($initial_cwd);
334350
}
335351

336-
// Set value of the 'pipe' property.
352+
// Set value of the return property.
337353
if (!empty($this->return_property)) {
338354
$this->getProject()->setProperty($this->return_property, implode($this->return_glue, $output));
339355
}

phing/tasks/blt.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
</target>
1010

1111
<target name="doctor" description="Inspects your local blt configuration for possible issues.">
12-
<drush command="status" returnProperty="drush.status" haltonerror="false" passthru="false" verbose="false"/>
12+
<drush command="status" returnProperty="drush.status" haltonerror="false" passthru="false" verbose="false" logoutput="false"/>
1313
<if>
1414
<equals arg1="${drush.status}" arg2="0"/>
1515
<then>

0 commit comments

Comments
 (0)