Ejemplo n.º 1
0
function monitor_dir()
{
    $monitor_service_dir = APP_PATH . 'service/';
    $monitor_model_dir = APP_PATH . 'model/';
    //echo  "monitor_dir function is called\n" ;
    //echo time()."\n";
    if (check_files_change($monitor_service_dir)) {
        stop_process_by_key('workers');
        start_process_by_key('workers', 'restart', 10);
        echo "worker process restarted \n";
    }
}
Ejemplo n.º 2
0
function start_process_by_key($key, $cmd, $num)
{
    stop_process_by_key($key);
    $cmd = "D:\\php7\\php7.exe  " . CUR_PATH . "/workers.php " . time();
    for ($i = 1; $i < 10; $i++) {
        //execInBackground ( $cmd );
        pclose(popen("start /B " . $cmd, "r"));
    }
}