當前位置: 首頁>>代碼示例>>PHP>>正文


PHP slog函數代碼示例

本文整理匯總了PHP中slog函數的典型用法代碼示例。如果您正苦於以下問題:PHP slog函數的具體用法?PHP slog怎麽用?PHP slog使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了slog函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: map

 public function map()
 {
     $dirty_type = @$_REQUEST["se_account_type"];
     switch ($dirty_type) {
         case "vo_transfer_volume":
             $urlbase = config()->gratiaweb . "/status_graphs/status_vo";
             $sub_title = "Transfer volume (Grouped by VO)";
             $ylabel = "Transfer Volume (GB)";
             break;
         case "user_transfer_volume":
             $urlbase = config()->gratiaweb . "/transfer_graphs/user_transfer_volume";
             $sub_title = "Transfer Volumn (Grouped by Username)";
             $ylabel = "Transfer Volume (GB)";
             break;
         case "se_space":
             $urlbase = config()->gratiaweb . "/status_graphs/status_se_bar";
             $sub_title = "Total Space";
             $ylabel = "GB";
             break;
         case "se_space_free":
             $urlbase = config()->gratiaweb . "/status_graphs/status_se_free_bar";
             $sub_title = "Total Free Space";
             $ylabel = "GB";
             break;
         default:
             slog("unknown account_type (rgse) - maybe a bot");
             exit;
     }
     return array($urlbase, $sub_title, $ylabel);
 }
開發者ID:wangfeilong321,項目名稱:myosg,代碼行數:30,代碼來源:RgseController.php

示例2: map

 public function map()
 {
     $dirty_type = @$_REQUEST["ce_account_type"];
     switch ($dirty_type) {
         case "gip_vo":
             $urlbase = config()->gratiaweb . "/status_graphs/status_vo";
             $sub_title = "Running Jobs by VO";
             $ylabel = "Jobs";
             break;
         case "gip_vo_waiting":
             $urlbase = config()->gratiaweb . "/status_graphs/status_vo_waiting";
             $sub_title = "Queued Jobs by VO";
             $ylabel = "Jobs";
             break;
         case "rsv_metric_quality":
             $urlbase = config()->gratiaweb . "/rsv_graphs/rsv_metric_quality";
             $sub_title = "RSV Data";
             $ylabel = "Probe Names";
             break;
         default:
             slog("unknown account_type (rgce) - maybe bot?");
             exit;
     }
     return array($urlbase, $sub_title, $ylabel);
 }
開發者ID:wangfeilong321,項目名稱:myosg,代碼行數:25,代碼來源:RgceController.php

示例3: upload

 protected function upload($params)
 {
     slog($params);
     /* 返回標準數據 */
     $return = array('status' => 1, 'info' => '上傳成功', 'data' => '');
     $model = $params['model'] == 'Picture' ? 'Picture' : 'File';
     /* 調用文件上傳組件上傳文件 */
     $table = D($model);
     $driver = C("{$model}_UPLOAD_DRIVER");
     d_f('upload', $driver);
     $upload_config = C("{$model}_UPLOAD");
     d_f('upload', $upload_config);
     if (isset($params['rootPath'])) {
         $upload_config['rootPath'] = $params['rootPath'];
     }
     $info = $table->upload($_FILES, $upload_config, $driver, C("UPLOAD_{$driver}_CONFIG"));
     d_f('upload', $info);
     /* 記錄圖片信息 */
     if ($info) {
         $return['status'] = 1;
         $return = array_merge($info[$params['field']], $return);
         if (method_exists($this, 'after_upload')) {
             $this->after_upload(CONTROLLER_NAME, $info, $result);
         }
     } else {
         $return['status'] = 0;
         $return['info'] = $table->getError();
     }
     d_f('upload', $return);
     return $return;
 }
開發者ID:cokeboL,項目名稱:freeblog,代碼行數:31,代碼來源:UploadController.class.php

示例4: uget

function uget($url, $opts = null)
{
    $t = -microtime(true);
    $rs = odie_get($url, $opts);
    $t += microtime(true);
    $t = intval($t * 1000);
    slog("{$url} [{$rs['0']}]\t{$t} ms");
    return $rs;
}
開發者ID:linzelong,項目名稱:zhihu-archive,代碼行數:9,代碼來源:lib_mongodb.php

示例5: parseMusic

 public function parseMusic()
 {
     $query_res = curl('http://tingapi.ting.baidu.com/v1/restserver/ting?method=baidu.ting.search.common&page_size=999', array('query' => I('query')));
     $query = json_decode($query_res, 1);
     if (false !== $query) {
         $this->ajaxReturn($query);
     } else {
         slog('curl失敗');
         $this->error('查詢失敗');
     }
 }
開發者ID:cokeboL,項目名稱:freeblog,代碼行數:11,代碼來源:PostController.class.php

示例6: index

 public function index()
 {
     $wechatauth = new WechatAuth(C('WEIXIN.APPID'), C('WEIXIN.SECRET'), C(''));
     $access_token = $wechatauth->getAccessToken();
     $result = $wechatauth->getServerIp($access_token);
     if (isset($result['errcode'])) {
         $this->error($result['errmsg']);
     }
     slog($result);
     $this->assign('ip', $result['ip_list']);
     $this->display();
 }
開發者ID:cokeboL,項目名稱:freeblog,代碼行數:12,代碼來源:WeixinController.class.php

示例7: __construct

 public function __construct()
 {
     if (APP_DEBUG) {
         slog(array('error_handler' => true, 'optimize' => false, 'show_included_files' => true, 'force_client_id' => C('MY_DEBUG'), 'allow_client_ids' => C('DENUG_ARRAY')), 'set_config');
     }
     $this->weixinTool = D('WeixinTool', 'Service');
     $this->weixin = new WechatAuth(C('appid'), C('appsecret'), $this->weixinTool->getToken());
     //是否更新創建菜單
     if (C('wx_ismenu') == 100) {
         $this->weixinTool->createMenu();
     }
 }
開發者ID:php-wechat,項目名稱:wechat,代碼行數:12,代碼來源:IndexController.class.php

示例8: _initLogger

 /**
  * 日誌
  * @param \Yaf\Dispatcher $dispatcher
  */
 public function _initLogger(\Yaf\Dispatcher $dispatcher)
 {
     //SocketLog
     if (Yaf\ENVIRON === 'develop') {
         if ($this->config->socketlog->enable) {
             //載入
             \Yaf\Loader::import('Common/Logger/slog.function.php');
             //配置SocketLog
             slog($this->config->socketlog->toArray(), 'config');
         }
     }
 }
開發者ID:jsyzchen,項目名稱:chen-yaf,代碼行數:16,代碼來源:Bootstrap.php

示例9: StopAttack

function StopAttack($StrFiltKey, $StrFiltValue, $ArrFiltReq)
{
    $StrFiltValue = arr_foreach($StrFiltValue);
    if (preg_match("/" . $ArrFiltReq . "/is", $StrFiltValue) == 1) {
        slog("<br><br>操作IP: " . $_SERVER["REMOTE_ADDR"] . "<br>操作時間: " . strftime("%Y-%m-%d %H:%M:%S") . "<br>操作頁麵:" . $_SERVER["PHP_SELF"] . "<br>提交方式: " . $_SERVER["REQUEST_METHOD"] . "<br>提交參數: " . $StrFiltKey . "<br>提交數據: " . $StrFiltValue);
        print "<div style=\"position:fixed;top:0px;text-align:center;width:100%;height:100%;background-color:white;color:green;font-weight:bold;border-bottom:5px solid #999;\"><br>您的提交帶有不合法參數,不要醬紫嘛!</div>";
        exit;
    }
    if (preg_match("/" . $ArrFiltReq . "/is", $StrFiltKey) == 1) {
        slog("<br><br>操作IP: " . $_SERVER["REMOTE_ADDR"] . "<br>操作時間: " . strftime("%Y-%m-%d %H:%M:%S") . "<br>操作頁麵:" . $_SERVER["PHP_SELF"] . "<br>提交方式: " . $_SERVER["REQUEST_METHOD"] . "<br>提交參數: " . $StrFiltKey . "<br>提交數據: " . $StrFiltValue);
        print "<div style=\"position:fixed;top:0px;text-align:center;width:100%;height:100%;background-color:white;color:green;font-weight:bold;border-bottom:5px solid #999;\"></div>";
        exit;
    }
}
開發者ID:Jesuslagliva12,項目名稱:OpenAPI,代碼行數:14,代碼來源:sqlguolv.php

示例10: processXML

 public function processXML($bdii)
 {
     $resources = array();
     $model = new Resource();
     $oim_resources = $model->getgroupby("fqdn");
     foreach ($bdii->Resources->Resource as $resource) {
         $fqdn = (string) $resource->FQDN;
         if (isset($oim_resources[$fqdn])) {
             $oim_resource_info = $oim_resources[$fqdn][0];
             $resources[$oim_resource_info->id] = array("info" => $oim_resource_info, "bdii" => $resource);
         } else {
             slog("BDII FQDN: [{$fqdn}] doesn't exist in OIM");
         }
     }
     return $resources;
 }
開發者ID:wangfeilong321,項目名稱:myosg,代碼行數:16,代碼來源:BDII.php

示例11: get_answer_link_list

function get_answer_link_list($content)
{
    $dom = HTML5::loadHTML($content);
    $dom = $dom->getElementById('zh-profile-answer-list');
    $ret = array();
    if (empty($dom)) {
        echo "empty #zh-profile-answer-list\n";
        slog('empty #zh-profile-answer-list');
        return $ret;
    }
    foreach ($dom->getElementsByTagName('a') as $key => $node) {
        if ($attr = $node->getAttribute('class') == 'question_link') {
            $ret[] = $node->getAttribute('href');
        }
    }
    return $ret;
}
開發者ID:linzelong,項目名稱:zhihu-archive,代碼行數:17,代碼來源:logic.php

示例12: StopAttack

function StopAttack($StrFiltKey, $StrFiltValue, $ArrFiltReq)
{
    $StrFiltValue = arr_foreach($StrFiltValue);
    if (preg_match("/" . $ArrFiltReq . "/is", $StrFiltValue) == 1) {
        slog("<br><br>操作IP: " . $_SERVER["REMOTE_ADDR"] . "<br>操作時間: " . strftime("%Y-%m-%d %H:%M:%S") . "<br>操作頁麵:" . $_SERVER["PHP_SELF"] . "<br>提交方式: " . $_SERVER["REQUEST_METHOD"] . "<br>來源: " . $_SERVER['HTTP_REFERER'] . "<br>提交參數: " . $StrFiltKey . "<br>提交數據: " . $StrFiltValue);
        header('HTTP/1.1 400 Bad Request');
        header('status: 400 Bad Request');
        print "<div style=\"position:fixed;top:0px;width:100%;height:100%;background-color:white;color:green;font-weight:bold;border-bottom:5px solid #999;\"><br>您的提交帶有不合法參數,謝謝合作!<br><br>了解更多請點擊:<a href=\"http://www.16888.com\">http://www.16888.com</a></div>";
        exit;
    }
    if (preg_match("/" . $ArrFiltReq . "/is", $StrFiltKey) == 1) {
        slog("<br><br>操作IP: " . $_SERVER["REMOTE_ADDR"] . "<br>操作時間: " . strftime("%Y-%m-%d %H:%M:%S") . "<br>操作頁麵:" . $_SERVER["PHP_SELF"] . "<br>提交方式: " . $_SERVER["REQUEST_METHOD"] . "<br>來源: " . $_SERVER['HTTP_REFERER'] . "<br>提交參數: " . $StrFiltKey . "<br>提交數據: " . $StrFiltValue);
        header('HTTP/1.1 400 Bad Request');
        header('status: 400 Bad Request');
        print "<div style=\"position:fixed;top:0px;width:100%;height:100%;background-color:white;color:green;font-weight:bold;border-bottom:5px solid #999;\"><br>您的提交帶有不合法參數,謝謝合作!<br><br>了解更多請點擊:<a href=\"http://www.16888.com\">http://www.16888.com</a></div>";
        exit;
    }
}
開發者ID:nymbian,項目名稱:codelib,代碼行數:18,代碼來源:360_safe3.php

示例13: getBdii

 public function getBdii()
 {
     //try only for N seconds to pull this data
     $ctx = stream_context_create(array('http' => array('timeout' => 8)));
     //cache these xml for little bit
     $seconds = 60;
     $c = new Cache("/tmp/myosg.bdii");
     if ($c->isFresh($seconds)) {
         $cemonbdii_content = $c->get();
     } else {
         //cemon raw file listing for production
         slog("loading " . config()->cemonbdii_url);
         $cemonbdii_content = file_get_contents(config()->cemonbdii_url, 0, $ctx);
         if ($cemonbdii_content !== false) {
             $c->set($cemonbdii_content);
         } else {
             error_log("failed to download xml from " . config()->cemonbdii_url . " -- using previous cache");
             error_log(print_r($ctx, true));
             //use previous cache
             $cemonbdii_content = $c->get();
         }
     }
     $cemonbdii = new SimpleXMLElement($cemonbdii_content);
     /*
             $c = new Cache("/tmp/myosg.bdii-itb");
             if($c->isFresh($seconds)) { 
                 $cemonbdii_itb_content = $c->get();
             } else {
                 //cemon raw file listing for itb
                 slog("loading ".config()->cemonbdii_itb_url);
                 $cemonbdii_itb_content = file_get_contents(config()->cemonbdii_itb_url, 0, $ctx);
                 $c->set($cemonbdii_itb_content);
             }
     
             //merge itb content to prod content
             try {
                 $itb = new SimpleXMLElement($cemonbdii_itb_content);
                 $this->merge($cemonbdii, $itb);
             } catch(exception $e) {
                 elog("failed to parse for some reason... maybe itb is not available?");
             }
     */
     return $cemonbdii;
 }
開發者ID:wangfeilong321,項目名稱:myosg,代碼行數:44,代碼來源:LDIF.php

示例14: saveAnswer

 public static function saveAnswer($base_url, $username, $answer_link_list)
 {
     foreach ($answer_link_list as $url) {
         if (preg_match('%^/question/(\\d+)/answer/(\\d+)%', $url, $matches)) {
             $qid = $matches[1];
             $aid = $matches[2];
         } else {
             echo "{$url} not good\n";
             exit(1);
         }
         $url = $base_url . $url;
         echo "\t{$url}";
         $t = microtime(true);
         list($code, $content) = odie_get($url);
         echo "\t[{$code}]";
         if ($code != 200) {
             // fail fast
             echo "\tfail\n";
             slog("{$url} [{$code}] error");
             $success_ratio = get_average(0, 'success_ratio');
             continue;
         } else {
             $success_ratio = get_average(1, 'success_ratio');
         }
         $t = intval((microtime(true) - $t) * 1000);
         $avg = intval(get_average($t));
         echo "\t{$t} ms\n";
         if (empty($content)) {
             echo "content is empty\n";
             slog("{$url} [{$code}] empty");
             return false;
         }
         list($question, $descript, $content, $vote) = parse_answer_pure($content);
         slog("{$url} [{$code}] ^{$vote}\t{$question}");
         Question::saveQuestion($qid, $question, $descript);
         Answer::_saveAnswer($aid, $qid, $username, $content, $vote);
     }
     if (isset($success_ratio) && isset($avg)) {
         $success_ratio = intval($success_ratio * 100) . '%';
         echo "\tAvg: {$avg} ms\tsuccess_ratio: {$success_ratio}\n";
     }
 }
開發者ID:linzelong,項目名稱:zhihu-archive,代碼行數:42,代碼來源:Answer.php

示例15: tickeListAct

 /**
  * 列表
  */
 public function tickeListAct()
 {
     slog("test");
     $areainfo = R('Api/areainfo');
     foreach ($areainfo['data'] as $k => $v) {
         //如果是成都地區,過濾佛山的場館
         if (DISTRICT_SERVER == 'CHENGDU' && $v['id'] == 3) {
             continue;
         }
         $venuesinfo = R('Api/venuesinfo', array($v['id']));
         foreach ($venuesinfo['data'] as $k1 => $v1) {
             $areaName[$v1['id']]['id'] = $v1['id'];
             $areaName[$v1['id']]['name'] = $v['name'] . $v1['name'];
         }
     }
     $this->assign('activity_text', getSysConfig('activity-text'));
     $this->assign('isHasCoupon', \Wechat\Logic\CouponLogic::isHasCoupon(getOpenid()));
     $this->assign('venuesinfo', $areaName);
     $this->display();
 }
開發者ID:skyshow,項目名稱:ticket,代碼行數:23,代碼來源:TicketController.class.php


注:本文中的slog函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。