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


PHP Log::timingplus方法代码示例

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


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

示例1: __autoload

 function __autoload($className)
 {
     Log::timingplus('autoload');
     require_once $className . '.php';
     Log::timingplus('autoload');
     Log::logHtml('class loaded [' . $className . ']');
 }
开发者ID:rasstroen,项目名称:baby-album,代码行数:7,代码来源:include.php

示例2: query

 public static function query($query)
 {
     Log::timingplus('query:' . $query);
     if (!($r = self::getInstance()->query($query, PDO::FETCH_ASSOC))) {
         throw new Exception($query . ' ', Error::E_QUERY);
     }
     Log::timingplus('query:' . $query);
     return $r;
 }
开发者ID:rasstroen,项目名称:ljrate,代码行数:9,代码来源:Database.php

示例3: query

	public static function query($query, $throwError = true) {
		Log::timingplus('query:' . $query);
		if (!$r = self::getInstance()->query($query, PDO::FETCH_ASSOC))
			if ($throwError)
				throw new Exception($query . ' ', Error::E_QUERY);
			else
				return false;
		Log::timingplus('query:' . $query);
		return $r;
	}
开发者ID:rasstroen,项目名称:diary,代码行数:10,代码来源:Database.php

示例4: getHTML

	public function getHTML($xml) {
		global $current_user;
		Log::timingplus('XSLTProcessor');
		$xslTemplate = new DOMDocument();
		$xslProcessor = new XSLTProcessor();
		$filename = Config::need('xslt_files_path') . DIRECTORY_SEPARATOR . $current_user->getTheme() . DIRECTORY_SEPARATOR . $this->xsltFileName;
		$xslTemplate->load($filename, LIBXML_NOENT | LIBXML_DTDLOAD);
		$xslProcessor->importStyleSheet($xslTemplate);
		$html = $xslProcessor->transformToXML($xml);
		Log::timingplus('XSLTProcessor');
		return $html;
	}
开发者ID:rasstroen,项目名称:audio,代码行数:12,代码来源:XSLClass.php

示例5: query

 public static function query($query, $throwError = true)
 {
     Log::timingplus('query:' . $query);
     if (!($r = self::getInstance()->query($query, PDO::FETCH_ASSOC))) {
         if ($throwError) {
             throw new Exception($query . "\n" . print_r(self::getInstance()->errorInfo(), 1));
         } else {
             return false;
         }
     }
     Log::timingplus('query:' . $query);
     return $r;
 }
开发者ID:rasstroen,项目名称:baby-album,代码行数:13,代码来源:Database.php

示例6: getResultXML

 public function getResultXML()
 {
     if ($this->xmlPart !== false) {
         return $this->xmlPart;
     }
     $this->xmlPart = XMLClass::createNodeFromObject(array('data' => $this->data, 'settings' => $this->settings), false, 'module');
     if ($this->xHTMLCachingEnabled) {
         Log::timingplus('BaseModule:xHTML generating #' . $this->moduleName);
         // процессим кусок XML с шаблоном, чтобы получить xHTML
         // шаблон, который отпроцессит только наш модуль - null.xsl
         $XSLClass = new XSLClass(LibPages::$pages[Request::$pageName]['xslt'], $xHTML = true);
         $arr = array($this->moduleName => $this->getXSLTFileName(true));
         // и шаблон модуля
         $XSLClass->setTemplates($arr);
         // создаем документ
         $xml = new DOMDocument('1.0', 'UTF-8');
         $xml->loadXML("<xml version=\"1.0\" encoding=\"utf-8\" >" . "<root></root></xml>");
         $rootNode = $xml->getElementsByTagName("root")->item(0);
         // нода page также нужна для корректной обработки шаблонаы
         $pageNode = $xml->importNode(XMLClass::$pageNode);
         $rootNode->appendChild($pageNode);
         // вставляем в него ноду с данными модуля
         $xHTMLnode = $xml->importNode($this->xmlPart, true);
         $rootNode->appendChild($xHTMLnode);
         $xHTMLnode->setAttribute('name', $this->moduleName);
         // теперь полученный xml процессим с шаблоном
         $xHTML = $XSLClass->getHTML($xml);
         // полученный xHTML нужно вбить в XML ноду "module"
         $xHTMLdoc = new DOMDocument('1.0', 'UTF-8');
         $xHTMLdoc->loadHTML($xHTML);
         $xpath = new DOMXPath($xHTMLdoc);
         $part = $xpath->query('body')->item(0);
         $part = $xHTMLdoc->importNode($part, true);
         // в part лежит HTML код
         // копируем его в новую ноду
         $NewElement = XMLClass::$xml->createElement('module');
         // Clone the attributes:
         foreach ($part->attributes as $attribute) {
             $NewElement->setAttribute($attribute->name, $attribute->value);
         }
         foreach ($part->childNodes as $child) {
             $NewElement->appendChild(XMLClass::$xml->importNode($child, true));
         }
         $this->xmlPart = $NewElement;
         Log::timingplus('BaseModule:xHTML generating #' . $this->moduleName);
     }
     $this->putInCache();
     return $this->xmlPart;
 }
开发者ID:rasstroen,项目名称:ljrate,代码行数:49,代码来源:BaseModule.php

示例7: getFromCache

 protected function getFromCache()
 {
     if (!$this->cache_enabled) {
         return false;
     }
     $cache_sec = isset($this->params['cache']) ? max(0, (int) $this->params['cache']) : 0;
     if (!$cache_sec) {
         return false;
     }
     if ($data = Cache::get($this->xml_cache_name, Cache::DATA_TYPE_XML, $cache_sec)) {
         Log::timingplus($this->moduleName . ' : XML from cache');
         $doc = new DOMDocument();
         $doc->loadXML($data);
         // говорим нашему дереву что этот кусок из кеша будет вставлен
         $part = $doc->getElementsByTagName("module")->item(0);
         $this->xmlPart = XMLClass::$xml->importNode($part, true);
         Log::timingplus($this->moduleName . ' : XML from cache');
         return $this->xmlPart;
     }
     return false;
 }
开发者ID:rasstroen,项目名称:hardtechno,代码行数:21,代码来源:BaseModule.php

示例8: set

 public static function set($name, $value, $cache_seconds = false, $datatype = self::DATA_TYPE_VAR)
 {
     self::init();
     Log::timingplus('cache:set');
     if (!$cache_seconds) {
         $cache_seconds = self::$max_cache_sec;
     }
     switch (self::$cacheType) {
         case self::CACHE_TYPE_XCACHE:
             self::set_xcache($name, $value, $datatype, $cache_seconds);
             break;
         case self::CACHE_TYPE_MEMCACHE:
             break;
         case self::CACHE_TYPE_FILE:
             self::set_file($name, $value, $datatype);
             break;
     }
     Log::timingplus('cache:set');
 }
开发者ID:rasstroen,项目名称:jma,代码行数:19,代码来源:Cache.php

示例9: getHTML

 public function getHTML($xml, $xslt = false)
 {
     Log::timingplus('XSLTProcessor');
     $xslTemplate = new DOMDocument();
     $xslProcessor = new XSLTProcessor();
     $xslTemplate->loadXML($xslt ? $xslt : $this->getSplitedTemplate(), LIBXML_NOENT | LIBXML_DTDLOAD);
     $xslProcessor->importStyleSheet($xslTemplate);
     // кладем в кеш xslt
     $html = $xslProcessor->transformToXML($xml);
     Log::timingplus('XSLTProcessor');
     return $html;
 }
开发者ID:rasstroen,项目名称:jma,代码行数:12,代码来源:XSLClass.php

示例10: searchSeriesByString

 public function searchSeriesByString($string, $offset = 0, $limit = 100)
 {
     if (Config::need('disable_solr')) {
         $foundids = array_keys(Database::sql2array('SELECT `id` FROM `series` WHERE `title` LIKE \'%' . $string . '%\' LIMIT ' . $offset . ',' . $limit, 'id'));
         $foundcnt = count($foundids);
         return array($foundids, $foundcnt, array());
     }
     Log::timingplus('solr searchSeriesByString');
     $series = self::$series;
     $ids = array();
     $count = 0;
     /* @var $books Apache_Solr_Service */
     // @text field - for bio including, @name- for 1,2,3name
     $string = $string ? $string : '*';
     $query = $string == '*' ? '*:*' : 'text:' . $series->escape($string);
     // дубликаты убираем
     $query .= ' AND books_count:true';
     // удаленные убираем
     $query .= ' AND is_s_duplicate:false';
     $query .= ' AND is_deleted:false';
     $res = $series->search($query, $offset, $limit, array('fl' => 'id', 'hl' => 'true', 'hl.fl' => '*', 'usePhraseHighlighter' => 'true'));
     /* @var $res Apache_Solr_Response */
     foreach ($res->response->docs as $document) {
         $ids[$document->id] = $document->id;
     }
     $count = $res->response->numFound;
     Log::timingplus('solr searchSeriesByString');
     return array($ids, $count, $this->getHighlighted($res));
 }
开发者ID:rasstroen,项目名称:metro,代码行数:29,代码来源:Search.php

示例11: getHTML

 public function getHTML($xml, $xslt = false)
 {
     $doc = new DOMDocument();
     $xsl = new XSLTProcessor();
     $doc->loadXML($xslt ? $xslt : $this->getSplitedTemplate());
     $xsl->importStyleSheet($doc);
     // кладем в кеш xslt
     Log::timingplus('XSLTProcessor');
     $res = $xsl->transformToXML($xml);
     Log::timingplus('XSLTProcessor');
     return $res;
 }
开发者ID:rasstroen,项目名称:ljrate,代码行数:12,代码来源:XSLClass.php


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