Example #1
0
 /**
  * renvoi de l'instance et initialisation si nécessaire.
  */
 public static function i()
 {
     if (!self::$_instance instanceof self) {
         self::$_instance = new self();
     }
     return self::$_instance;
 }
Example #2
0
 /**
  * @return Log
  */
 private static function &GetInstance()
 {
     if (is_null(self::$_instance)) {
         self::$_instance = new Log();
     }
     return self::$_instance;
 }
Example #3
0
 public static function getInstance()
 {
     if (empty(self::$_instance)) {
         self::$_instance = new Log();
     }
     return self::$_instance;
 }
Example #4
0
 /**
  * Gets the singleton instance.
  * @return Log
  */
 public static function &instance()
 {
     if (self::$_instance === null) {
         self::$_instance = new self();
     }
     return self::$_instance;
 }
Example #5
0
 public static function getInstance()
 {
     if (self::$_instance == null) {
         self::$_instance = new Log();
     }
     return self::$_instance;
 }
Example #6
0
 /**
  * @return Log 
  */
 public static function init()
 {
     if (!isset(self::$_instance)) {
         self::$_instance = new self();
     }
     return self::$_instance;
 }
Example #7
0
 public static function instance()
 {
     if (Log::$_instance === NULL) {
         Log::$_instance = new Log();
         register_shutdown_function(array(Log::$_instance, 'write'));
     }
     return Log::$_instance;
 }
Example #8
0
File: log.php Project: laiello/ko3
 /**
  * Get the singleton instance of this class and enable writing at shutdown.
  *
  *     $log = Log::instance();
  *
  * @return  Log
  */
 public static function instance()
 {
     if (Log::$_instance === NULL) {
         // Create a new instance
         Log::$_instance = new Log();
         // Write the logs at shutdown
         register_shutdown_function(array(Log::$_instance, 'write'));
     }
     return Log::$_instance;
 }
Example #9
0
 public static function singleton($logfile)
 {
     if ($logfile === null) {
         throw new Log_Exception("The log file path cannot be null.");
     }
     self::$_logFile = $logfile;
     if (self::$_instance === null) {
         $class = __CLASS__;
         self::$_instance = new $class();
     }
     return self::$_instance;
 }
Example #10
0
 /** static public function get_instance
  *		Returns the singleton instance
  *		of the Log Object as a reference
  *
  * @param void
  * @action optionally creates the instance
  * @return Log Object reference
  */
 public static function get_instance()
 {
     if (is_null(self::$_instance)) {
         self::$_instance = new Log();
     }
     return self::$_instance;
 }