本文整理汇总了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);
}
示例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);
}
示例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;
}
示例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;
}
示例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('查询失败');
}
}
示例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();
}
示例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();
}
}
示例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');
}
}
}
示例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;
}
}
示例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;
}
示例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;
}
示例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;
}
}
示例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;
}
示例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";
}
}
示例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();
}