/** * 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; }
/** * @return Log */ private static function &GetInstance() { if (is_null(self::$_instance)) { self::$_instance = new Log(); } return self::$_instance; }
public static function getInstance() { if (empty(self::$_instance)) { self::$_instance = new Log(); } return self::$_instance; }
/** * Gets the singleton instance. * @return Log */ public static function &instance() { if (self::$_instance === null) { self::$_instance = new self(); } return self::$_instance; }
public static function getInstance() { if (self::$_instance == null) { self::$_instance = new Log(); } return self::$_instance; }
/** * @return Log */ public static function init() { if (!isset(self::$_instance)) { self::$_instance = new self(); } return self::$_instance; }
public static function instance() { if (Log::$_instance === NULL) { Log::$_instance = new Log(); register_shutdown_function(array(Log::$_instance, 'write')); } return Log::$_instance; }
/** * 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; }
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; }
/** 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; }