public static function cmp_name(FileSystem_File $a, FileSystem_File $b) { #echo '$a->get_name(): ' . $a->get_name() . "\n"; #echo '$b->get_name(): ' . $b->get_name() . "\n"; if ($a->get_name() == $b->get_name()) { return 0; } if ($a->get_name() < $b->get_name()) { return -1; } if ($a->get_name() > $b->get_name()) { return 1; } }
*/ $database = $row['Database']; $cmd = 'mysqldump' . " --databases {$database}" . " --user={$username}" . " --password={$password}" . " --host={$host}" . " --skip-extended-insert" . " --order-by-primary"; /* * Do we need to create a directory for this DB? */ #$db_dump_dir = $dump_directory->get_name() . "/$database"; $db_dump_dir = "{$dump_directory_name}/{$database}"; if (!is_dir($db_dump_dir)) { mkdir($db_dump_dir); } $dump_filename = "{$db_dump_dir}/latest.dump"; $dump_file = new FileSystem_File($dump_filename); #$dump_file = $dump_directory->get_next_dump_file(); #if ($_SERVER['OS'] == 'Windows_NT') { $cmd .= ' > "' . $dump_file->get_name() . '"'; #} else { # $cmd .= " > $dump_filename"; #} if (!$silent) { echo "The command: {$cmd}\n"; } system($cmd); } /* * ----------------------------------------------------------------------------- * Store this information in the database. * ----------------------------------------------------------------------------- */ /* * Create the database objects.
public static function is_lock_file(FileSystem_File $file) { $file_name = $file->get_name(); #echo "\$file_name: '$file_name'\n"; return preg_match('/\\.txt$/', $file_name); }