本文整理汇总了PHP中Monitor::run方法的典型用法代码示例。如果您正苦于以下问题:PHP Monitor::run方法的具体用法?PHP Monitor::run怎么用?PHP Monitor::run使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Monitor
的用法示例。
在下文中一共展示了Monitor::run方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createApplication
public function createApplication()
{
$ems = new Monitor();
$ems->run();
$app = $ems->getApp();
$app['debug'] = true;
unset($app['exception_handler']);
return $app;
}
示例2: __construct
<?php
$router = array('apple' => array('url' => 'http://zg-router.youxi021.com', 'ver' => '1.7.1'), 'kingnet' => array('url' => 'http://router.zg.kingnet.com', 'ver' => '1.8.0'), 'jp' => array('url' => 'zg-jp-router.ucube.mobi', 'ver' => '1.4.0'), 'kr' => array('url' => 'http://zg-kr-router.kingnet.com', 'ver' => '1.6.0'));
$Monitor = new Monitor($router);
$Monitor->run();
$error_list = $Monitor->get_error();
if (!empty($error_list)) {
echo implode("\r\n", $error_list);
exit;
}
class Monitor
{
private $router_server = array();
private $login_server = array();
private $game_server = array();
private $error_list = array();
private $user_info = array();
public function __construct($router_server)
{
$this->set_router($router_server);
$this->user_info['email'] = 'wangdy@jidongnet.com';
$this->user_info['password'] = 'robot123';
$this->user_info['mac'] = "111111111111";
}
public function set_router($router_server)
{
$this->router_server = $router_server;
}
public function get_error()
{
return $this->error_list;
示例3: detect
/**
* This function includes the IDS vendor parts and runs the
* detection routines on the request array.
*
* @param object cake controller object
* @return boolean
*/
public function detect(&$controller)
{
$this->controller =& $controller;
$this->name = Inflector::singularize($this->controller->name);
#set include path for IDS and store old one
$path = get_include_path();
set_include_path(VENDORS . 'phpids/');
#require the needed files
vendor('phpids/IDS/Init');
#add request url and user agent
$_REQUEST['IDS_request_uri'] = $_SERVER['REQUEST_URI'];
if (isset($_SERVER['HTTP_USER_AGENT'])) {
$_REQUEST['IDS_user_agent'] = $_SERVER['HTTP_USER_AGENT'];
}
#init the PHPIDS and pass the REQUEST array
$this->init = Init::init();
$ids = new Monitor($_REQUEST, $this->init);
$result = $ids->run();
// Re-set include path
set_include_path($path);
if (!$result->isEmpty()) {
$this->react($result);
}
return true;
}
示例4: catch
} catch (PDOException $e) {
echo $e->getMessage() . "\n";
}
$i = 1;
foreach ($monitors as $monitor) {
//print_r($monitor);
$pid = pcntl_fork();
/*
if ($pid == -1) {
die('could not fork');
}
*/
if (!$pid) {
echo 'Executing Child #' . $i . "..\n";
$mon = new Monitor($dsn, $monitor);
$mon->run();
exit($i);
} elseif ($pid) {
//echo "execute in parent \n";
//nothing to do
}
$i++;
}
foreach ($servers as $server) {
//print_r($server);
$pid = pcntl_fork();
/*
if ($pid == -1) {
die('could not fork');
}
*/
示例5: Monitor
<?php
require_once 'Monitor.php';
$monitor = new Monitor();
$monitor->run();