@@ -74,6 +74,7 @@ class DrushTask extends Task {
74
74
private $ verbose = FALSE ;
75
75
private $ haltonerror = TRUE ;
76
76
private $ passthru = FALSE ;
77
+ private $ logoutput = TRUE ;
77
78
78
79
/**
79
80
* The Drush command to run.
@@ -220,6 +221,17 @@ public function setPassthru($var) {
220
221
}
221
222
}
222
223
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
+
223
235
/**
224
236
* Initialize the task.
225
237
*/
@@ -233,6 +245,7 @@ public function init() {
233
245
$ this ->setVerbose ($ this ->getProject ()->getProperty ('drush.verbose ' ));
234
246
$ this ->setAssume ($ this ->getProject ()->getProperty ('drush.assume ' ));
235
247
$ this ->setPassthru ($ this ->getProject ()->getProperty ('drush.passthru ' ));
248
+ $ this ->setPassthru ($ this ->getProject ()->getProperty ('drush.logoutput ' ));
236
249
}
237
250
238
251
/**
@@ -322,9 +335,12 @@ public function main() {
322
335
$ command = implode (' ' , $ command );
323
336
$ this ->log ("Executing: $ command " );
324
337
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
+ }
328
344
}
329
345
}
330
346
@@ -333,7 +349,7 @@ public function main() {
333
349
chdir ($ initial_cwd );
334
350
}
335
351
336
- // Set value of the 'pipe' property.
352
+ // Set value of the return property.
337
353
if (!empty ($ this ->return_property )) {
338
354
$ this ->getProject ()->setProperty ($ this ->return_property , implode ($ this ->return_glue , $ output ));
339
355
}
0 commit comments