Calling all Drupal developers!
Help us get this on the first page of Digg. DIGG NOW!
Help us get this on the first page of Digg. DIGG NOW!
drush_op($function)
contributions/drush/drush.inc, line 74
Calls a given function, passing through all arguments unchanged.
This should be used when calling possibly mutative or destructive functions (e.g. unlink() and other file system functions) so that can be suppressed if the simulation mode is enabled.
$function The name of the function.
The return value of the function, or TRUE if simulation mode is enabled.
<?php
function drush_op($function) {
$args = func_get_args();
array_shift($args); // Skip function name
if (DRUSH_VERBOSE || DRUSH_SIMULATE) {
drush_print("Calling $function(". implode(", ", $args) .')');
}
if (DRUSH_SIMULATE) {
return true;
}
return call_user_func_array($function, $args);
}
?>