You are here

function backup_migrate_exec in Backup and Migrate 7.3

Same name and namespace in other branches
  1. 8.2 backup_migrate.module \backup_migrate_exec()
  2. 8.3 backup_migrate.module \backup_migrate_exec()
  3. 6.3 backup_migrate.module \backup_migrate_exec()
  4. 7.2 backup_migrate.module \backup_migrate_exec()

Execute a command line command.

Return value

bool Returns FALSE if the function failed.

7 calls to backup_migrate_exec()
backup_migrate_destination_db_mysql::_backup_db_to_file_mysqldump in includes/destinations.db.mysql.inc
Backup the databases to a file using the mysqldump command.
backup_migrate_destination_filesource::_backup_to_file_cli in includes/sources.filesource.inc
Backup from this source.
backup_migrate_destination_filesource::_restore_from_file_cli in includes/sources.filesource.inc
Restore to this source.
backup_migrate_files_destination_archivesource::_backup_to_file_cli in includes/sources.archivesource.inc
Backup from this source.
backup_migrate_filter_compression::_backup_migrate_gzip_decode in includes/filters.compression.inc
Gzip decode a file.

... See full list

3 string references to 'backup_migrate_exec'
backup_migrate_destination_filesource::_backup_to_file_cli in includes/sources.filesource.inc
Backup from this source.
backup_migrate_destination_filesource::_restore_from_file_cli in includes/sources.filesource.inc
Restore to this source.
backup_migrate_files_destination_archivesource::_backup_to_file_cli in includes/sources.archivesource.inc
Backup from this source.

File

./backup_migrate.module, line 2050
Backup and restore databases for Drupal.

Code

function backup_migrate_exec($command, $args = array()) {
  if (!function_exists('exec') || ini_get('safe_mode')) {
    return FALSE;
  }

  // Escape the arguments.
  foreach ($args as $key => $arg) {
    $args[$key] = escapeshellarg($arg);
  }
  $command = strtr($command, $args);
  $output = $result = NULL;

  // Run the command.
  exec($command, $output, $result);
  return $result == 0;
}