[ Index ]
 

Code source de Zen Cart E-Commerce Shopping Cart 1.3.7.1

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

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

   1  <?php
   2  //

   3  // +----------------------------------------------------------------------+

   4  // |zen-cart Open Source E-commerce                                       |

   5  // +----------------------------------------------------------------------+

   6  // | Copyright (c) 2003 The zen-cart developers                           |

   7  // |                                                                      |   

   8  // | http://www.zen-cart.com/index.php                                    |   

   9  // |                                                                      |   

  10  // | Portions Copyright (c) 2003 osCommerce                               |

  11  // +----------------------------------------------------------------------+

  12  // | This source file is subject to version 2.0 of the GPL license,       |

  13  // | that is bundled with this package in the file LICENSE, and is        |

  14  // | available through the world-wide-web at the following url:           |

  15  // | http://www.zen-cart.com/license/2_0.txt.                             |

  16  // | If you did not receive a copy of the zen-cart license and are unable |

  17  // | to obtain it through the world-wide-web, please send a note to       |

  18  // | license@zen-cart.com so we can mail you a copy immediately.          |

  19  // +----------------------------------------------------------------------+

  20  
  21  //  $Id: logger.php 1969 2005-09-13 06:57:21Z drbyte $

  22  //

  23  
  24    class logger {
  25      var $timer_start, $timer_stop, $timer_total;
  26  
  27  // class constructor

  28      function logger() {
  29        $this->timer_start();
  30      }
  31  
  32      function timer_start() {
  33        if (defined("PAGE_PARSE_START_TIME")) {
  34          $this->timer_start = PAGE_PARSE_START_TIME;
  35        } else {
  36          $this->timer_start = microtime();
  37        }
  38      }
  39  
  40      function timer_stop($display = 'false') {
  41        $this->timer_stop = microtime();
  42  
  43        $time_start = explode(' ', $this->timer_start);
  44        $time_end = explode(' ', $this->timer_stop);
  45  
  46        $this->timer_total = number_format(($time_end[1] + $time_end[0] - ($time_start[1] + $time_start[0])), 3);
  47  
  48        $this->write($_SERVER['REQUEST_URI'], $this->timer_total . 's');
  49  
  50        if ($display == 'true') {
  51          return $this->timer_display();
  52        }
  53      }
  54  
  55      function timer_display() {
  56        return '<span class="smallText">Parse Time: ' . $this->timer_total . 's</span>';
  57      }
  58  
  59      function write($message, $type) {
  60        error_log(strftime(STORE_PARSE_DATE_TIME_FORMAT) . ' [' . $type . '] ' . $message . "\n", 3, STORE_PAGE_PARSE_TIME_LOG);
  61      }
  62    }
  63  ?>


Généré le : Mon Nov 26 16:45:43 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics