Exemplo n.º 1
0
     * To start a task.
     */
    echo "# Starting\n";
    if (!isset($_GET['task'])) {
        throw new Exception('No task set!');
    }
    if (!isset($_GET['system'])) {
        throw new Exception('No system set!');
    }
    if (!isset($_GET['host'])) {
        throw new Exception('No host set!');
    }
    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.
Exemplo n.º 2
0
 *
 * @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);
}