function _displayBrowse($path, &$root_group, &$current_group)
 {
     if (is_a($current_group, 'LimbGroupTest')) {
         $group_tests = $current_group->getTestCasesHandles();
     } else {
         $group_tests = array();
     }
     $buffer = "Available test cases in \n'=== " . $current_group->getLabel() . " ===' :\n";
     if (sizeof($group_tests)) {
         foreach ($group_tests as $index => $group_test) {
             resolve_handle($group_test);
             $buffer .= $path . '/' . $index . ' ' . $group_test->getLabel() . "\n";
         }
         $buffer .= "\n";
     } else {
         $buffer .= "No tests available.\n";
     }
     echo $buffer;
     echo debug::parse_cli_console();
 }
 function parse_console()
 {
     if (sys::exec_mode() == 'cli') {
         return debug::parse_cli_console();
     } else {
         return debug::parse_html_console();
     }
 }
Beispiel #3
0
<?php

/**********************************************************************************
* Copyright 2004 BIT, Ltd. http://www.0x00.ru, mailto: bit@0x00.ru
*
* Released under the LGPL license (http://www.gnu.org/copyleft/lesser.html)
***********************************************************************************
*
* $Id$
*
***********************************************************************************/
$site_path = $argv[1];
require_once $site_path . '/setup.php';
require_once LIMB_DIR . '/core/lib/debug/debug.class.php';
require_once LIMB_DIR . '/core/request/nonbuffered_response.class.php';
require_once LIMB_DIR . '/core/lib/cron/cron_manager.class.php';
$force = false;
if (isset($argv[2]) && $argv[2] == 'force') {
    $force = true;
}
$response =& new nonbuffered_response();
$mgr =& new cron_manager();
$mgr->perform($response, $force);
$response->write(debug::parse_cli_console());
$response->commit();
exit(0);
Beispiel #4
0
    $script_settings = explode(';', $script_string);
    if (sizeof($script_settings) > 1) {
        $script_run_interval = (int) $script_settings[1];
    } else {
        $script_run_interval = 3600;
    }
    $script_name = $script_settings[0];
    $script_file = $cron_scripts_dir . $script_name;
    $now = time();
    if (file_exists($script_file)) {
        $time_diff = $now - (int) $scripts_last_run[$id];
        if ($time_diff > $script_run_interval) {
            echo "running {$script_name}\n";
            debug::add_timing_point("script {$script_name} starting\n");
            include $script_file;
            debug::add_timing_point("script done\n");
            $scripts_last_run[$id] = $now;
        } else {
            echo "will run {$script_name} in " . ($script_run_interval - $time_diff) . " seconds\n";
        }
    } else {
        echo "{$script_file} not found\n";
    }
}
$fp = fopen($cron_last_run_file, 'w');
foreach ($scripts_last_run as $time) {
    fwrite($fp, "{$time}\n");
}
fclose($fp);
echo debug::parse_cli_console();
ob_end_flush();