• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP SysLog类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中SysLog的典型用法代码示例。如果您正苦于以下问题:PHP SysLog类的具体用法?PHP SysLog怎么用?PHP SysLog使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了SysLog类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: createLog

 public function createLog($user_id)
 {
     $model = new SysLog();
     $time = time();
     $model->user_id = $user_id;
     $model->user_name = User::getNameById($user_id);
     $model->log_time = $time;
     $model->message = "登陆成功!";
     $model->log_ip = Yii::app()->request->userHostAddress;
     if (SysLog::model()->count("user_id=:user_id and log_time=:log_time", array(":user_id" => $user_id, ":lig_time" => $time)) == 0) {
         $model->save();
     }
 }
开发者ID:ruzuojun,项目名称:shiqu,代码行数:13,代码来源:SysLog.php


示例2: onRequest

 public function onRequest($request, $response)
 {
     //SysLog::debug(__METHOD__ . print_r($request,true), __CLASS__);
     //统一进行路由和数据的预处理
     $req = HttpHelper::httpReqHandle($request);
     // SysLog::info(__METHOD__.print_r($req,true),__CLASS__);
     if ($req['r'] === HttpHelper::HTTP_ERROR_URI) {
         $response->status(404);
         //todo:log
         $response->end("not found");
         return;
     }
     //SysLog::info(__METHOD__.'  '.__LINE__ . " REQUEST IS ".print_r($req,true),__CLASS__);
     $class = $req['route']['controller'] . 'Controller';
     $fun = 'action' . $req['route']['action'];
     //判断类是否存在
     if (!class_exists($class) || !method_exists($class, $fun)) {
         $response->status(404);
         SysLog::error(__METHOD__ . " class or fun not found class == {$class} fun == {$fun}", __CLASS__);
         $response->end("uri not found");
         return;
     }
     $obj = new $class($this->server, array('request' => $req['request'], 'response' => $response), $request->fd);
     //代入参数
     $request->scheduler->newTask($obj->{$fun}());
     $request->scheduler->run();
 }
开发者ID:delphinBlue,项目名称:tsf,代码行数:27,代码来源:TSFHttpServ.php


示例3: onReceive

 public function onReceive($server, $clientId, $fromId, $data)
 {
     $data = Yaaf::unpackAll($data);
     SysLog::notice(__METHOD__ . " fd = {$clientId}  fromId = {$fromId} data = " . print_r($data, true), __CLASS__);
     $info = $server->connection_info($clientId, $fromId);
     //yaaf 协议 路由
     $req = YaafHelper::yaafReqHandle($data);
     SysLog::info(__METHOD__ . print_r($req, true), __CLASS__);
     //路由失败 直接返回错误
     if ($req['r'] === YaafHelper::YAAF_ERROR_CMD) {
         //todo 协议搞成yaaf
         $yaaf_data = Yaaf::packHeader() . Yaaf::packBody(array('errCode' => -1, 'errMsg' => 'not found class'));
         $server->sendto($info['remote_ip'], $info['remote_port'], $yaaf_data);
         return;
     }
     $class = $req['route']['controller'] . 'Controller';
     $fun = 'action' . $req['route']['action'];
     //判断类是否存在
     if (!class_exists($class) || !method_exists($class, $fun)) {
         SysLog::error(__METHOD__ . print_r($req, true), __CLASS__);
         $yaaf_data = Yaaf::packHeader() . Yaaf::packBody(array('errCode' => -1, 'errMsg' => 'not found class'));
         $server->sendto($info['remote_ip'], $info['remote_port'], $yaaf_data);
         return;
     }
     $obj = new $class($this->server, array('request' => $data, 'info' => $info), $clientId);
     //代入参数
     $server->scheduler->newTask($obj->doFun($fun));
     $server->scheduler->run();
 }
开发者ID:netstao,项目名称:tsf,代码行数:29,代码来源:YaafUdpServ.php


示例4: send

 public function send(callable $callback)
 {
     $client = new \swoole_client(SWOOLE_SOCK_TCP, SWOOLE_SOCK_ASYNC);
     $client->on("connect", function ($cli) {
         $cli->send($this->data);
     });
     $client->on('close', function ($cli) {
     });
     $client->on('error', function ($cli) use($callback) {
         $cli->close();
         call_user_func_array($callback, array('r' => 1, 'key' => $this->key, 'calltime' => $this->calltime, 'error_msg' => 'conncet error'));
     });
     $client->on("receive", function ($cli, $data) use($callback) {
         $this->calltime = microtime(true) - $this->calltime;
         $cli->close();
         call_user_func_array($callback, array('r' => 0, 'key' => $this->key, 'calltime' => $this->calltime, 'data' => $data));
     });
     if ($client->connect($this->ip, $this->port, $this->timeout, 1)) {
         $this->calltime = microtime(true);
         if (floatval($this->timeout) > 0) {
             $this->timer = swoole_timer_after(floatval($this->timeout) * 1000, function () use($client, $callback) {
                 $client->close();
                 \SysLog::error(__METHOD__ . " TIMEOUT ", __CLASS__);
                 $this->calltime = microtime(true) - $this->calltime;
                 call_user_func_array($callback, array('r' => 2, 'key' => '', 'calltime' => $this->calltime, 'error_msg' => 'timeout'));
             });
         }
     }
 }
开发者ID:RamboLau,项目名称:tsf,代码行数:29,代码来源:TCP.php


示例5: DoLogin

 function DoLogin()
 {
     SysLog::Instance()->log('Login(sso)::DoLogin', "login");
     $ssoclient = SsoClient::Instance();
     SysLog::Instance()->log('Login(sso)::DoLogin poke me!!', "login");
     //       echo "Is sso alive? ";
     //       var_dump($ssoclient->isSsoAlive());
     //       die();
     $SsoAuth = $ssoclient->authenticateSsoUser($this->mUsername, $this->mPassword, $this->mSsoSystemId);
     //       echo "<pre>";
     //       var_dump($SsoAuth);
     //       echo "</pre>";
     //       die();
     SysLog::Instance()->log("DoLogin got SsoAuth: " . print_r($SsoAuth, true), "login");
     if ($SsoAuth['status'] === true) {
         // save SSID
         $ssoclient->saveSsIdToLocal($SsoAuth['ssid'], Configuration::Instance()->GetValue('application', 'sso_group'));
         // request details on SSID
         $SsoAttr = $ssoclient->requestSsIdAttributes($SsoAuth['ssid'], $this->mSsoSystemId);
         SysLog::Instance()->log("DoLogin got SsoAttr: " . print_r($SsoAttr, true), "login");
         $local_username = $SsoAttr['mSsoLocalUsername'];
         $this->mUser->mUserName = $local_username;
         $this->mUser->GetUser();
     }
     //       echo "<pre>";
     //       var_dump($SsoAttr);
     //       echo "</pre>";
     //       die($local_username);
     return $SsoAuth['status'];
 }
开发者ID:rifkiferdian,项目名称:gtfw_boostab,代码行数:30,代码来源:Login.class.php


示例6: DoLogin

 function DoLogin()
 {
     $this->mUser->mUserName = $this->mUserName;
     $this->FetchUserInfo();
     SysLog::Instance()->log('User (' . $this->mUserName . ') active: ' . $this->GetCurrentUser()->GetActive(), 'login');
     if ($this->GetCurrentUser()->GetActive() != 'Yes') {
         return FALSE;
     }
     $hashed = $this->IsPasswordHashed();
     $salt = $this->GetSalt();
     if ($hashed) {
         $hash = md5(md5($salt . $this->GetCurrentUser()->GetPassword()));
     } else {
         $hash = $this->mUser->mPassword;
     }
     SysLog::Instance()->log('comparing: ' . $this->mPassword . ' == ' . $hash . ' hashed=' . $hashed . ' salt=' . $salt, 'login');
     if (md5($this->mPassword) == $hash) {
         SysLog::Instance()->log('Logged in!', 'login');
         $this->mIsLoggedIn = true;
         $_SESSION['is_logged_in'] = true;
         $_SESSION['username'] = (string) $this->mUserName;
         Session::Instance()->Restart();
         // regenerate session_id, prevent session fixation
     } else {
         $this->mIsLoggedIn = false;
         $_SESSION['is_logged_in'] = false;
         $_SESSION['username'] = Configuration::Instance()->GetValue('application', 'default_user');
     }
     return $this->mIsLoggedIn;
 }
开发者ID:rifkiferdian,项目名称:gtfw_boostab,代码行数:30,代码来源:Authentication.class.php


示例7: createUdpApplication

 public static function createUdpApplication($config)
 {
     AutoLoad::addRoot(dirname(dirname($config)));
     SysLog::init(UserConfig::getConfig('log'));
     return new YaafUdpServ();
     // return $class;
     //进行路由解析等
 }
开发者ID:delphinBlue,项目名称:tsf,代码行数:8,代码来源:tsf.php


示例8: init

 /**
  * [init 启动定时器]
  * @return [type] [description]
  */
 public static function init()
 {
     if (!isset(self::$tickKey)) {
         self::$tickKey = swoole_timer_tick(1000 * self::LOOPTIME, function () {
             //循环数组,踢出超时情况
             self::loop();
         });
         \SysLog::info(__METHOD__ . " init timer tick key == " . self::$tickKey, __CLASS__);
     }
 }
开发者ID:JeeLiu,项目名称:tsf,代码行数:14,代码来源:Timer.php


示例9: SessionGc

 function SessionGc($maxExpireTime)
 {
     SysLog::Log('Garbage collecting...', 'Session');
     $result = $this->Execute($this->mSqlQueries['gc_data'], array(time(), $maxExpireTime));
     if (!$result) {
         return TRUE;
     } else {
         return FALSE;
     }
 }
开发者ID:rifkiferdian,项目名称:gtfw_boostab,代码行数:10,代码来源:DatabaseSaveHandler.class.php


示例10: test

 function test($test_value)
 {
     if (trim($test_value) == '') {
         SysLog::Log('RuleRequired: Field ' . $this->mElementName . ' harus diisi', 'formhelper');
         $this->setError('Field ' . $this->mElementName . ' harus diisi');
         return false;
     } else {
         SysLog::Log('RuleRequired: Field ' . $this->mElementName . ' is not empty', 'formhelper');
         return true;
     }
 }
开发者ID:rifkiferdian,项目名称:gtfw_boostab,代码行数:11,代码来源:RuleRequired.rule.class.php


示例11: recv

 /**
  * [packRsp 回调函数,收包,合包,回调]
  * @param  [type] $r          [description]
  * @param  [type] $client_key [description]
  * @param  [type] $data       [description]
  * @return [type]             [description]
  */
 public function recv($r, $client_key, $calltime, $data)
 {
     \SysLog::info(__METHOD__ . " r = {$r} client_key = {$client_key} callList = " . count($this->callRsp), __CLASS__);
     $this->callRsp[$client_key] = array('r' => $r, 'calltime' => $calltime, 'data' => $data);
     //收包完成
     if (count($this->callRsp) == count($this->callList)) {
         \SysLog::info(__METHOD__ . " get all the rsp ==== " . print_r($this->callRsp, true), __CLASS__);
         $this->calltime = microtime(true) - $this->calltime;
         call_user_func_array($this->callback, array('r' => $r, 'key' => '', 'calltime' => $calltime, 'data' => $this->callRsp));
     }
 }
开发者ID:netstao,项目名称:tsf,代码行数:18,代码来源:Multi.php


示例12: DoLogout

 function DoLogout()
 {
     SysLog::Instance()->log('DoLogout sso', 'login');
     $ssoclient = SsoClient::Instance();
     $ssid = $ssoclient->getLocalSsId(Configuration::Instance()->GetValue('application', 'sso_group'));
     $result = $ssoclient->invalidateSsId($ssid);
     SysLog::Instance()->log('DoLogout sso invalidate result' . print_r($result, true), 'login');
     $result2 = $ssoclient->removeLocalSsId(Configuration::Instance()->GetValue('application', 'sso_group'));
     SysLog::Instance()->log('DoLogout sso removeLocalSsId result' . print_r($result2, true), 'login');
     return $result;
 }
开发者ID:rifkiferdian,项目名称:gtfw_boostab,代码行数:11,代码来源:Logout.class.php


示例13: GetFormHelperManagerJs

    function GetFormHelperManagerJs($standalone = true)
    {
        $js1 = "";
        if (!empty($this->mFormHelpers)) {
            $js_formhelper .= <<<_FORM_HELPER_
   <script type="text/javascript">
      /* must preceed behaviour Library to get the desired effect: add validation selector and then let the rest handled by the simple_validator */
      function GtfwFormHelper() {
_FORM_HELPER_;
            //
            foreach ($this->mFormHelpers as $item) {
                $js_formhelper .= "\n" . $item->getJsCode() . "\n";
            }
            $js_formhelper .= <<<_FORM_HELPER_
      }
_FORM_HELPER_;
            if ($standalone) {
                $js_formhelper .= "\nFormHelperManager.addLoadEvent(GtfwFormHelper); /* apply */";
                // use loadevent
                SysLog::Log('Preparing formHelper for fullpage request', 'formhelpermanager');
            } else {
                $js_formhelper .= "\nGtfwFormHelper(); /* run immediately */";
                // run immediately
                SysLog::Log('Preparing formHelper for component requiremnt', 'formhelpermanager');
            }
            $js_formhelper .= '</script>';
        } else {
            SysLog::Log('No FormHelper set', 'formhelpermanager');
            $js_formhelper = '';
        }
        if ($standalone) {
            $js = <<<_RAW_HEAD_
   <script type="text/javascript" src="js/FormHelper.js"></script>
_RAW_HEAD_;
            $js1 .= <<<_RAW_HEAD_
   <script type="text/javascript" src="js/behaviour.js"></script>
   <script type="text/javascript" src="js/balloon.js"></script>
   <script type="text/javascript" src="js/simple_validator.js"></script>
_RAW_HEAD_;
            // load available js rules
            foreach (FormHelper::$JsRuleFiles as $item) {
                SysLog::Log('Loading JsRulesFiles: ' . $item . '.js', 'formhelpermanager');
                $js1 .= <<<_RAW_HEAD_
   <script type="text/javascript" src="js/formhelper_rules/{$item}.js"></script>
_RAW_HEAD_;
            }
        }
        if ($standalone) {
            return $js . $js_formhelper . $js1;
        } else {
            return $js_formhelper;
        }
    }
开发者ID:rifkiferdian,项目名称:gtfw_boostab,代码行数:53,代码来源:FormHelperManager.class.php


示例14: yaafReqHandle

 /**
  * 处理request对象
  * @param req swoole yaaf server 获得的request对象
  */
 public static function yaafReqHandle($req)
 {
     $cmd = $req['reqHead']['cmd'];
     //路由
     $appRoute = YaafRoute::getRoute($cmd);
     SysLog::info(__METHOD__ . print_r($appRoute, true), __CLASS__);
     if (!$appRoute) {
         return array('r' => self::YAAF_ERROR_CMD);
     }
     //这里考虑以后根据appName路由到后端svr yaafUdpServ作为代理 分发流量
     return array('r' => self::YAAF_OK, 'route' => $appRoute, 'request' => array('reqHead' => $req['reqHead'], 'reqBody' => $req['reqBody']));
 }
开发者ID:netstao,项目名称:tsf,代码行数:16,代码来源:YaafHelper.php


示例15: test

 function test($test_value)
 {
     SysLog::Log('TypeEmail: testing TestValue: "' . $test_value . '"', 'formhelper');
     if (filter_var($test_value, FILTER_VALIDATE_EMAIL) === FALSE) {
         SysLog::Log('TypeEmail: Field ' . $this->mElementName . ' harus berupa alamat email', 'formhelper');
         $this->setError('Field ' . $this->mElementName . ' harus berupa alamat email');
         return false;
     } else {
         SysLog::Log('TypeEmail: Field ' . $this->mElementName . ' adalah alamat email', 'formhelper');
         return true;
     }
 }
开发者ID:rifkiferdian,项目名称:gtfw_boostab,代码行数:12,代码来源:TypeEmail.rule.class.php


示例16: httpReqHandle

 /**
  * 处理request对象
  * @param req swoole http server 获得的request对象
  */
 public static function httpReqHandle($req)
 {
     $method = $req->server['request_method'];
     $uri = $req->server['request_uri'];
     //路由
     $appRoute = HttpRoute::urlrouter_rewrite($uri, $method);
     SysLog::info(__METHOD__ . print_r($appRoute, true), __CLASS__);
     if (!$appRoute) {
         return array('r' => self::HTTP_ERROR_URI);
     }
     return array('r' => self::HTTP_OK, 'route' => $appRoute, 'request' => array('uri' => $uri, 'header' => $req->header, 'get' => array_merge((array) (isset($req->get) ? $req->get : array()), (array) $appRoute['get']), 'post' => isset($req->post) ? $req->post : '', 'files' => isset($req->files) ? $req->files : '', 'cookie' => isset($req->cookie) ? $req->cookie : '', 'rawcontent' => $req->rawContent(), 'method' => $method));
 }
开发者ID:RamboLau,项目名称:tsf,代码行数:16,代码来源:HttpHelper.php


示例17: __construct

 function __construct($dbConfig = NULL)
 {
     parent::__construct($dbConfig);
     SysLog::Instance()->log("creating AdodbLiteDatabaseEngine", "database");
     require_once Configuration::Instance()->GetValue('application', 'gtfw_base') . 'main/lib/adodb_lite/adodb.inc.php';
     $GLOBALS['ADODB_FETCH_MODE'] = ADODB_FETCH_ASSOC;
     // this should be in config, but how?
     SysLog::Instance()->log("AdodbLiteDatabaseEngine::Preparing dbtype:" . $this->mDbConfig['db_type']);
     $this->mrDbConnection = ADONewConnection($this->mDbConfig['db_type']);
     // set debug mode via configuration
     $this->mrDbConnection->debug = (bool) $this->mDbConfig['db_debug_enabled'];
     SysLog::Instance()->log("AdodbLiteDatabaseEngine::Done preparing dbtype:" . $this->mDbConfig['db_type']);
 }
开发者ID:rifkiferdian,项目名称:gtfw_boostab,代码行数:13,代码来源:AdodbLiteDatabaseEngine.class.php


示例18: Send

 final function Send()
 {
     $result = $this->ProcessRequest();
     $dbMsg = SysLog::Instance()->getAllError();
     if (isset($result["exec"]) && !empty($dbMsg)) {
         $result["exec"] = "message=" . json_encode($dbMsg) . ";for(var msg in message){console.log(message[msg]);};" . $result["exec"];
     } elseif (isset($result["exec"]) && empty($dbMsg)) {
         $result["exec"] = "if(console.clear != undefined)console.clear(); if(window.clear != undefined) window.clear();" . $result["exec"];
     } elseif (!isset($result["exec"]) && !empty($dbMsg)) {
         $result["exec"] = "message=" . json_encode($dbMsg) . ";for(var msg in message){console.log(message[msg]);};" . $result;
     }
     $result = $this->returnJSON($result);
     echo "{$result}";
 }
开发者ID:rifkiferdian,项目名称:gtfw_boostab,代码行数:14,代码来源:JsonResponse.class.php


示例19: validate

 final function validate()
 {
     $test_value = $this->mTestValue;
     SysLog::Log($this->getRuleName() . ': testing TestValue: "' . print_r($test_value, true) . '"', 'formhelper');
     if (is_array($test_value)) {
         foreach ($test_value as $key => $value) {
             if (!$this->test($value)) {
                 return false;
             }
         }
         return true;
     } else {
         return $this->test($test_value);
     }
 }
开发者ID:rifkiferdian,项目名称:gtfw_boostab,代码行数:15,代码来源:ValidationRuleBase.class.php


示例20: test

 private function test()
 {
     $test = new TestModel();
     $res = (yield $test->MysqlMuticallTest());
     SysLog::info(__METHOD__ . " res == " . print_r($res, true), __CLASS__);
     if ($res['r'] == 0) {
         //yield success
         SysLog::info(__METHOD__ . " yield success data == " . print_r($res['data'], true), __CLASS__);
         (yield $res);
     } else {
         //yield failed
         SysLog::error(__METHOD__ . " yield failed res == " . print_r($res, true), __CLASS__);
         (yield array('r' => 1, 'error_msg' => 'yield failed'));
     }
 }
开发者ID:sukui,项目名称:tsf,代码行数:15,代码来源:TestController.php



注:本文中的SysLog类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP System类代码示例发布时间:2022-05-23
下一篇:
PHP Sys类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap