当前位置: 首页>>代码示例>>PHP>>正文


PHP LogUtil::getLogger方法代码示例

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


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

示例1: updateMemcache

 function updateMemcache()
 {
     // ignore_user_abort();
     //set_time_limit(0);
     //$interval=3600; //(seconds)
     require_once 'model/Feed.php';
     require_once 'lib/BitMemCache.php';
     require_once 'lib/RssReader.php';
     $feed = new Feed();
     $feeds = $feed->getFeeds();
     $logger = LogUtil::getLogger();
     //do{
     include "config/site.php";
     foreach ($feeds as $feed) {
         $url = $feed['url'];
         $mem = new BitMemCache();
         $reader = new RssReader();
         $rss = $reader->fetch($url);
         if (!$rss) {
         } else {
             if ($mem->init()) {
                 $mem->set($url, json_encode($rss));
                 $logger->info("update memcache {$url}");
             }
         }
     }
     //  sleep($interval);
     //}while($memcache);
 }
开发者ID:puregamexyz,项目名称:bitdesign.github.io,代码行数:29,代码来源:BitTimer.php

示例2: __construct

 function __construct()
 {
     include "config/config.php";
     //no include_once, because only first new XXX() will include config.php
     $this->db = new MySQL($mysql_host, $mysql_user, $mysql_pass, $mysql_dbname);
     $this->logger = LogUtil::getLogger();
 }
开发者ID:puregamexyz,项目名称:bitdesign.github.io,代码行数:7,代码来源:BaseModel.php

示例3: fetch

 function fetch($url)
 {
     $cacheDir = "cache/";
     $cacheName = base64_encode($url);
     $fullUrl = $cacheDir . $cacheName;
     $hasCache = is_file($fullUrl);
     require_once "lib/LogUtil.php";
     $logger = LogUtil::getLogger();
     if ($hasCache) {
         // 有缓存且缓存的时间不超过6小时则使用缓存
         $t1 = filemtime($fullUrl);
         $t2 = time();
         $inter = $t2 - $t1;
         if ($inter < 3600 * 6) {
             $url = $fullUrl;
             $logger->info("fullUrl = {$fullUrl} inter={$inter}  t1={$t1}");
         } else {
             $hasCache = false;
             $logger->info("inter={$inter}");
         }
     }
     $logger->info("url={$url}");
     $buff = "";
     $timeout = array('http' => array('timeout' => 20));
     $ctx = stream_context_create($timeout);
     $fp = fopen($url, "r", false, $ctx);
     if (!$fp) {
         return false;
     }
     while (!feof($fp)) {
         $buff .= fgets($fp, 4096);
     }
     fclose($fp);
     if (strlen($buff) <= 0) {
         return false;
     }
     //$pattern="/<!\[CDATA\[(.*?)\]\]>/";
     //preg_match_all($pattern, $str,$out);
     //var_dump($out);
     $from_str = "encoding=\"gb2312\"";
     $to_str = "encoding=\"UTF-8\"";
     $char_set = mb_detect_encoding($buff);
     if ($char_set == 'UTF-8') {
     } else {
         // $buff = mb_convert_encoding($buff,'utf-8','gb2312'); --不支持生僻字,需改成GBK
         $buff = mb_convert_encoding($buff, 'utf-8', 'GBK');
         $buff = str_replace($from_str, $to_str, $buff);
     }
     if (!$hasCache) {
         $cacheFp = fopen($fullUrl, 'w+');
         fwrite($cacheFp, $buff);
         fclose($cacheFp);
         $t3 = filemtime($fullUrl);
         $logger->info("fullUrl={$fullUrl} t3={$t3}");
     }
     return simplexml_load_string($buff, 'SimpleXMLElement', LIBXML_NOCDATA);
 }
开发者ID:puregamexyz,项目名称:bitdesign.github.io,代码行数:57,代码来源:RssReader.php

示例4: __construct

 function __construct($path, $usr, $pass_wd, $db_name)
 {
     if ($this->conn == null) {
         $this->conn = mysql_connect($path, $usr, $pass_wd, true) or die("cannot connect datebase " . $path . " :" . mysql_error());
         mysql_select_db($db_name, $this->conn) or die("cannot select datebase " . $db_name . " :" . mysql_error());
         mysql_query("SET NAMES UTF8");
     }
     $this->logger = LogUtil::getLogger();
 }
开发者ID:puregamexyz,项目名称:bitdesign.github.io,代码行数:9,代码来源:MySQL.php

示例5: saveTpl

 public function saveTpl()
 {
     $arr = array('tpl_name', 'tpl_root');
     $_POST['tpl_root'] = "view/template/" . $_POST['tpl_name'];
     require_once "lib/LogUtil.php";
     $logger = LogUtil::getLogger();
     //$logger->info($_POST['tpl_name']);
     //$logger->info($_POST['tpl_root']);
     return $this->db->postInsertPair("siteparas", $arr);
 }
开发者ID:puregamexyz,项目名称:bitdesign.github.io,代码行数:10,代码来源:Siteparas.php

示例6: listPage

 function listPage()
 {
     $postTile = "";
     $postBlockName = "";
     $sts = "1";
     if (isset($_POST['title'])) {
         $postTile = $_POST["title"];
     }
     if (isset($_POST['sts'])) {
         $sts = $_POST["sts"];
     }
     if (isset($_POST['block_name'])) {
         $postBlockName = $_POST["block_name"];
     }
     $table = "(select a.*,b.block_name,c.usr_nm from content a left join block b on a.block_id=b.block_id left join users c on a.usr_id=c.usr_id where a.sts in (" . formatString($sts) . ") and a.title like '%" . $postTile . "%' and b.block_name like '%" . $postBlockName . "%' order by edit_tm desc) mytable";
     $this->logger = LogUtil::getLogger();
     //$this->logger->info($table);
     $pager = parent::getPager($table, $this->content->db);
     $arrayList = $pager->getData();
     $blockList = $this->block->getBlocks();
     require 'view/admin/content_list.php';
 }
开发者ID:puregamexyz,项目名称:bitdesign.github.io,代码行数:22,代码来源:ContentController.php

示例7: flushMem

 function flushMem()
 {
     $mem = new BitMemCache();
     if ($mem->init()) {
         $logger->info("init 2");
         $logger = LogUtil::getLogger();
         $ret = $mem->flush();
         $logger->info("flush memcache ------------[ {$ret} ]");
     }
     echo "flushMem 2";
 }
开发者ID:puregamexyz,项目名称:bitdesign.github.io,代码行数:11,代码来源:FeedController.php

示例8: __construct

 function __construct()
 {
     parent::__construct();
     $this->logger = LogUtil::getLogger();
 }
开发者ID:puregamexyz,项目名称:bitdesign.github.io,代码行数:5,代码来源:FileController.php


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