[ Index ]
 

Code source de Symfony 1.0.0

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/lib/debug/ -> sfTimerManager.class.php (source)

   1  <?php
   2  
   3  /*
   4   * This file is part of the symfony package.
   5   * (c) 2004-2006 Fabien Potencier <fabien.potencier@symfony-project.com>
   6   *
   7   * For the full copyright and license information, please view the LICENSE
   8   * file that was distributed with this source code.
   9   */
  10  
  11  /**
  12   * sfTimerManager is a container for sfTimer objects.
  13   *
  14   * @package    symfony
  15   * @subpackage util
  16   * @author     Fabien Potencier <fabien.potencier@symfony-project.com>
  17   * @version    SVN: $Id: sfTimerManager.class.php 3211 2007-01-10 20:51:39Z fabien $
  18   */
  19  class sfTimerManager
  20  {
  21    static public $timers = array();
  22  
  23    /**
  24     * Gets a sfTimer instance.
  25     *
  26     * It returns the timer named $name or create a new one if it does not exist.
  27     *
  28     * @param string The name of the timer
  29     *
  30     * @return sfTimer The timer instance
  31     */
  32    public static function getTimer($name)
  33    {
  34      if (!isset(self::$timers[$name]))
  35      {
  36        self::$timers[$name] = new sfTimer($name);
  37      }
  38  
  39      self::$timers[$name]->startTimer();
  40  
  41      return self::$timers[$name];
  42    }
  43  
  44    /**
  45     * Gets all sfTimer instances stored in sfTimerManager.
  46     *
  47     * @return array An array of all sfTimer instances
  48     */
  49    public static function getTimers()
  50    {
  51      return self::$timers;
  52    }
  53  
  54    /**
  55     * Clears all sfTimer instances stored in sfTimerManager.
  56     */
  57    public static function clearTimers()
  58    {
  59      self::$timers = array();
  60    }
  61  }


Généré le : Fri Mar 16 22:42:14 2007 par Balluche grâce à PHPXref 0.7