コード例 #1
0
ファイル: processes.php プロジェクト: guohuadeng/stampApp
/**
 * This file is a part of MyWebSQL package
 *
 * @file:      modules/processes.php
 * @author     Samnan ur Rehman
 * @copyright  (c) 2008-2014 Samnan ur Rehman
 * @web        http://mywebsql.net
 * @license    http://mywebsql.net/license
 */
function processRequest(&$db)
{
    // html and form is started by calling function
    print "<link href='cache.php?css=theme,default,alerts,results' rel=\"stylesheet\" />\n";
    $type = 'message ui-state-highlight';
    if (isset($_REQUEST['prcid']) && is_array($_REQUEST['prcid'])) {
        $killed = $missed = array();
        foreach ($_REQUEST['prcid'] as $process_id) {
            if (ctype_digit($process_id) && killProcess($db, $process_id)) {
                $killed[] = $process_id;
            } else {
                $missed[] = $process_id;
            }
        }
        if (count($killed) > 0) {
            $msg = str_replace('{{PID}}', implode(',', $killed), __('The process with id [{{PID}}] was killed'));
            $type = 'message ui-state-default';
        } else {
            $msg = str_replace('{{PID}}', implode(',', $missed), __('No such process [id = {{PID}}]'));
            $type = 'message ui-state-error';
        }
    } else {
        $msg = __('Select a process and click the button to kill the process');
    }
    displayProcessList($db, $msg, $type);
}
コード例 #2
0
 public function stop()
 {
     killProcess($this->PID);
     $this->PID = null;
     $this->saveState();
 }