[ Index ]

PHP Cross Reference of osCMax 2.0.4

title

Body

[close]

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

   1  <?php
   2  /*

   3  $Id: logger.php 3 2006-05-27 04:59:07Z user $

   4  

   5    osCMax Power E-Commerce

   6    http://oscdox.com

   7  

   8    Copyright 2006 osCMax

   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  ?>


Generated: Fri Jan 1 13:43:16 2010 Cross-referenced by PHPXref 0.7