本文整理汇总了PHP中Logger::_instance方法的典型用法代码示例。如果您正苦于以下问题:PHP Logger::_instance方法的具体用法?PHP Logger::_instance怎么用?PHP Logger::_instance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Logger
的用法示例。
在下文中一共展示了Logger::_instance方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: instance
/**
* 单例
* @param array $config
*/
public static function instance()
{
if (self::$_instance === NULL) {
self::$_instance = new self();
}
return self::$_instance;
}
示例2: GetInstance
/**
* @param none
* @return instance of Logger class
*/
public static function GetInstance()
{
if (self::$_instance == NULL) {
self::$_instance = new Logger();
}
return self::$_instance;
}
示例3: getInstance
/**
* Get an instance of the Logger object
*
* @return Object of this class
*/
public static function getInstance()
{
if (!self::$_instance) {
$className = __CLASS__;
self::$_instance = new $className();
}
return self::$_instance;
}
示例4: getInstance
/**
* Get the unique instance that can be exist of this class.
* Singleton software patter premise.
*
* @param \Doctrine\ORM\EntityManager $entityManager
* @return type
*/
public static function getInstance(\Doctrine\ORM\EntityManager $entityManager)
{
if (!isset($_instance)) {
Logger::$_instance = new Logger();
}
Logger::$_instance->_entityManager = $entityManager;
return Logger::$_instance;
}
示例5: log
public static function log($level = self::INFO, $application, $action, $message, $writeMethod)
{
// nao faz login se USE_LOGGER eh falso
if (USE_LOGGER === false) {
return;
}
if (!isset(self::$_instance)) {
self::$_instance = new Logger();
self::$_dbinfo = isset($_SESSION['phpgw_info']['expressomail']['server']['loggerdb']) ? $_SESSION['phpgw_info']['expressomail']['server']['loggerdb'] : $GLOBALS['phpgw_info']['server']['loggerdb'];
}
$application = strtolower($application);
$action = strtolower($action);
if ($writeMethod === Logger::IN_DB) {
self::$_instance->writeDB($level, $application, $action, $message);
} else {
self::$_instance->writeFile($level, $application, $action, $message);
}
}
示例6: getInstance
/**
* Public method to get An instance of the Logger class
* @return object
*/
public static function getInstance()
{
if (is_null(self::$_instance)) {
self::$_instance = new self();
}
return self::$_instance;
}