本文整理汇总了PHP中Log::_instance方法的典型用法代码示例。如果您正苦于以下问题:PHP Log::_instance方法的具体用法?PHP Log::_instance怎么用?PHP Log::_instance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Log
的用法示例。
在下文中一共展示了Log::_instance方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: i
/**
* 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;
}
示例2: Log
/**
* @return Log
*/
private static function &GetInstance()
{
if (is_null(self::$_instance)) {
self::$_instance = new Log();
}
return self::$_instance;
}
示例3: getInstance
public static function getInstance()
{
if (empty(self::$_instance)) {
self::$_instance = new Log();
}
return self::$_instance;
}
示例4: self
/**
* Gets the singleton instance.
* @return Log
*/
public static function &instance()
{
if (self::$_instance === null) {
self::$_instance = new self();
}
return self::$_instance;
}
示例5: getInstance
public static function getInstance()
{
if (self::$_instance == null) {
self::$_instance = new Log();
}
return self::$_instance;
}
示例6: init
/**
* @return Log
*/
public static function init()
{
if (!isset(self::$_instance)) {
self::$_instance = new self();
}
return self::$_instance;
}
示例7: instance
public static function instance()
{
if (Log::$_instance === NULL) {
Log::$_instance = new Log();
register_shutdown_function(array(Log::$_instance, 'write'));
}
return Log::$_instance;
}
示例8: 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;
}
示例9: singleton
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;
}
示例10: get_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;
}