function backup_migrate_filters_invoke_all in Backup and Migrate 6.3
Same name and namespace in other branches
- 8.2 includes/filters.inc \backup_migrate_filters_invoke_all()
- 8.3 includes/filters.inc \backup_migrate_filters_invoke_all()
- 6.2 includes/filters.inc \backup_migrate_filters_invoke_all()
- 7.3 includes/filters.inc \backup_migrate_filters_invoke_all()
- 7.2 includes/filters.inc \backup_migrate_filters_invoke_all()
Invoke the given method on all of the available filters.
18 calls to backup_migrate_filters_invoke_all()
- backup_migrate_backup_fail in ./
backup_migrate.module - Clean up when a backup operation fails.
- backup_migrate_backup_migrate_destinations in includes/
destinations.inc - Implementation of hook_backup_migrate_destinations().
- backup_migrate_backup_migrate_locations in includes/
locations.inc - Implementation of hook_backup_migrate_locations().
- backup_migrate_backup_migrate_sources in includes/
sources.inc - Implementation of hook_backup_migrate_sources().
- backup_migrate_backup_succeed in ./
backup_migrate.module - Clean up when a backup operation suceeds.
File
- includes/
filters.inc, line 67 - All of the filter handling code needed for Backup and Migrate.
Code
function backup_migrate_filters_invoke_all() {
$args = func_get_args();
$op = array_shift($args);
$out = array();
$filters = backup_migrate_get_filters($op);
foreach ($filters as $filter) {
if (method_exists($filter, $op)) {
/* call_user_func_array() ignores the function signature, so we cannot
* use it to pass references. (Call-time pass-by-reference is deprecated
* in PHP5.3.) Work around it, since we have unknown function signatures.
*/
switch (count($args)) {
case 1:
$ret = $filter
->{$op}($args[0]);
break;
case 2:
$ret = $filter
->{$op}($args[0], $args[1]);
break;
default:
// This assumes that no functions with more than 2 arguments expect a
// reference as argument. If so, add another 'case block'.
$ret = call_user_func_array(array(
$filter,
$op,
), $args);
}
$out = array_merge_recursive($out, (array) $ret);
}
}
return $out;
}