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


PHP Timer::writeTimings方法代码示例

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


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

示例1: getCoverFromEContent

 private function getCoverFromEContent()
 {
     if ($this->configArray['EContent']['library'] && isset($this->id) && is_numeric($this->id)) {
         $this->log("Looking for eContent Cover", PEAR_LOG_INFO);
         $this->initMemcache();
         $this->log("Checking eContent database to see if there is a record for {$this->id}", PEAR_LOG_INFO);
         //Check the database to see if there is an existing title
         require_once ROOT_DIR . '/sys/eContent/EContentRecord.php';
         $epubFile = new EContentRecord();
         $epubFile->id = $this->id;
         if ($epubFile->find(true)) {
             $this->log("Found an eContent record for {$this->id}, source is {$epubFile->source}", PEAR_LOG_INFO);
             //Get the cover for the epub if one exists.
             if (strcasecmp($epubFile->source, 'OverDrive') == 0 && ($epubFile->cover == null || strlen($epubFile->cover) == 0)) {
                 $this->log("Record is an OverDrive record that needs cover information fetched.", PEAR_LOG_INFO);
                 //Get the image from OverDrive
                 require_once ROOT_DIR . '/Drivers/OverDriveDriverFactory.php';
                 $overDriveDriver = OverDriveDriverFactory::getDriver();
                 $filename = $overDriveDriver->getCoverUrl($epubFile);
                 $this->log("Got OverDrive cover information for {$epubFile->id} {$epubFile->sourceUrl}", PEAR_LOG_INFO);
                 $this->log("Received filename {$filename}", PEAR_LOG_INFO);
                 if ($filename != null) {
                     $epubFile->cover = $filename;
                     $ret = $epubFile->update();
                     //Don't update solr for performance reasons
                     $this->log("Result of saving cover url is {$ret}", PEAR_LOG_INFO);
                 }
             } elseif (preg_match('/Colorado State Gov\\. Docs/si', $epubFile->source) == 1 || $epubFile->source == 'CO State Gov Docs') {
                 //Cover is colorado state flag
                 $this->log("Record is a gov docs file.", PEAR_LOG_INFO);
                 $themeName = $this->configArray['Site']['theme'];
                 $filename = "interface/themes/{$themeName}/images/state_flag_of_colorado.png";
                 if ($this->processImageURL($filename, true)) {
                     return;
                 }
             }
             if ($epubFile->cover && strlen($epubFile->cover) > 0) {
                 $this->log("Cover for the file is specified as {$epubFile->cover}.", PEAR_LOG_INFO);
                 if (strpos($epubFile->cover, 'http://') === 0) {
                     $filename = $epubFile->cover;
                     if ($this->processImageURL($filename, true)) {
                         $this->timer->writeTimings();
                         exit;
                     }
                 } else {
                     $filename = $this->bookCoverPath . '/original/' . $epubFile->cover;
                     $this->localFile = $this->bookCoverPath . '/' . $this->size . '/' . $this->cacheName . '.png';
                     if (file_exists($filename)) {
                         if ($this->processImageURL($filename, true)) {
                             $this->timer->writeTimings();
                             exit;
                         }
                     } else {
                         $this->log("Did not find econtent cover file {$filename}", PEAR_LOG_ERR);
                     }
                 }
             }
         }
     }
     $this->log("Did not find a cover based on eContent information.", PEAR_LOG_INFO);
 }
开发者ID:bryandease,项目名称:VuFind-Plus,代码行数:61,代码来源:BookCoverProcessor.php

示例2: Timer

if (empty($timer)) {
    $timer = new Timer(microtime(false));
}
// Retrieve values from configuration file
require_once ROOT_DIR . '/sys/ConfigArray.php';
$configArray = readConfig();
$timer->logTime("Read config");
if (isset($configArray['System']['timings'])) {
    $timer->enableTimings($configArray['System']['timings']);
}
//Start a logger
$logger = new Logger();
//Update error handling
if ($configArray['System']['debug']) {
    ini_set('display_errors', true);
    error_reporting(E_ALL & ~E_DEPRECATED);
}
date_default_timezone_set($configArray['Site']['timezone']);
$timer->logTime("bootstrap");
//Create the QR Code if it doesn't exit
$type = $_REQUEST['type'];
$id = $_REQUEST['id'];
$filename = $configArray['Site']['qrcodePath'] . "/{$type}_{$id}.png";
if (!file_exists($filename)) {
    include ROOT_DIR . '/sys/phpqrcode/qrlib.php';
    $codeContents = $configArray['Site']['url'] . "/{$type}/{$id}/Home";
    QRcode::png($codeContents, $filename, QR_ECLEVEL_L, 3);
}
readfile($filename);
$timer->writeTimings();
开发者ID:victorfcm,项目名称:VuFind-Plus,代码行数:30,代码来源:qrcode.php


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