[ Index ]
 

Code source de osCommerce 2.2ms2-060817

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/catalog/admin/includes/classes/ -> logger.php (source)

   1  <?php
   2  /*
   3    $Id: logger.php,v 1.3 2003/06/20 16:23:08 hpdl Exp $
   4  
   5    osCommerce, Open Source E-Commerce Solutions
   6    http://www.oscommerce.com
   7  
   8    Copyright (c) 2003 osCommerce
   9  
  10    Released under the GNU General Public License
  11  */
  12  
  13    class logger {
  14      var $timer_start, $timer_stop, $timer_total;
  15  
  16  // class constructor
  17      function logger() {
  18        $this->timer_start();
  19      }
  20  
  21      function timer_start() {
  22        if (defined("PAGE_PARSE_START_TIME")) {
  23          $this->timer_start = PAGE_PARSE_START_TIME;
  24        } else {
  25          $this->timer_start = microtime();
  26        }
  27      }
  28  
  29      function timer_stop($display = 'false') {
  30        $this->timer_stop = microtime();
  31  
  32        $time_start = explode(' ', $this->timer_start);
  33        $time_end = explode(' ', $this->timer_stop);
  34  
  35        $this->timer_total = number_format(($time_end[1] + $time_end[0] - ($time_start[1] + $time_start[0])), 3);
  36  
  37        $this->write(getenv('REQUEST_URI'), $this->timer_total . 's');
  38  
  39        if ($display == 'true') {
  40          return $this->timer_display();
  41        }
  42      }
  43  
  44      function timer_display() {
  45        return '<span class="smallText">Parse Time: ' . $this->timer_total . 's</span>';
  46      }
  47  
  48      function write($message, $type) {
  49        error_log(strftime(STORE_PARSE_DATE_TIME_FORMAT) . ' [' . $type . '] ' . $message . "\n", 3, STORE_PAGE_PARSE_TIME_LOG);
  50      }
  51    }
  52  ?>


Généré le : Mon Nov 26 19:48:25 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics