} echo 'Task: ' . $_GET['task'] . "\n"; echo 'System: ' . $_GET['system'] . "\n"; echo 'Host: ' . $_GET['host'] . "\n"; $task_event_id = $control_centre->start($_GET['task'], $_GET['system'], $_GET['host']); echo "Task Event ID: {$task_event_id}\n"; } elseif (isset($_GET['finish'])) { /* * To finish a task. */ echo "# Finishing ...\n"; if (!isset($_GET['task_event_id'])) { throw new Exception('No task event ID set!'); } echo 'Task Event ID: ' . $_GET['task_event_id'] . "\n"; $finish_datetime = $control_centre->finish($_GET['task_event_id']); echo "Finished: {$finish_datetime}\n"; } else { /* * List the currently running tasks. */ echo "# Current Tasks:\n"; echo "# task_event_id, host, system, task, start\n"; $current_task_events = $control_centre->get_current_task_events(); foreach ($current_task_events as $current_task_event) { #print_r($current_task_event); #echo 'get_class($current_task_event): '; #echo get_class($current_task_event); #echo "\n"; # #$table = $current_task_event->get_table();
* * @copyright Clear Line Web Design, 2007-03-28 */ /* * Define the necessary classes. */ require_once PROJECT_ROOT . '/haddock/database/classes/' . 'Database_MySQLUserFactory.inc.php'; require_once PROJECT_ROOT . '/haddock/haddock-project-organisation/classes/' . 'HaddockProjectOrganisation_ProjectDirectoryFinder.inc.php'; require_once PROJECT_ROOT . '/project-specific/classes/' . 'ServerAdminScripts_LocalControlCentre.inc.php'; /* * Start doing stuff. */ echo "# dumper status\n"; $project_directory_factory = HaddockProjectOrganisation_ProjectDirectoryFinder::get_instance(); $project_directory = $project_directory_factory->get_project_directory_for_this_project(); $control_centre = new ServerAdminScripts_LocalControlCentre(); /* * To start a dump. */ if (isset($_GET['start'])) { echo "# Starting ...\n"; $task_event_id = $control_centre->start('dumping', 'mysql', $project_directory->get_current_host_name()); echo "Task Event ID: {$task_event_id}\n"; } /* * To finish a dump. */ if (isset($_GET['finish'])) { echo "# Finishing\n"; $finish_datetime = $control_centre->finish($task_id); }