本文整理匯總了PHP中static::_instance方法的典型用法代碼示例。如果您正苦於以下問題:PHP static::_instance方法的具體用法?PHP static::_instance怎麽用?PHP static::_instance使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類static
的用法示例。
在下文中一共展示了static::_instance方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getInstance
public static final function getInstance()
{
if (!static::$_instance) {
static::$_instance = new self();
}
return static::$_instance;
}
示例2: _i
public static function _i()
{
if (static::$_instance === NULL) {
static::$_instance = new static();
}
return static::$_instance;
}
示例3: instance
/**
* Returns an instance of the singleton.
*
* Passes args to constructor
*/
public static final function instance()
{
if (null === static::$_instance) {
static::$_instance = new self(func_get_args());
}
return self::$_instance;
}
示例4: instance
/**
* Creates a new instance for static use of the class.
*
* @return Image_Driver
*/
protected static function instance()
{
if (static::$_instance == null) {
static::$_instance = static::forge(static::$_config);
}
return static::$_instance;
}
示例5: instance
public static function instance()
{
if (static::$_instance == null) {
static::$_instance = static::factory();
}
return static::$_instance;
}
示例6: getInstance
public static function getInstance()
{
if (static::$_instance === null || !static::$_instance instanceof static) {
static::$_instance = new static();
}
return static::$_instance;
}
示例7: getInstance
/**
* Get instance of \Hoa\Registry.
*
* @return object
*/
protected static function getInstance()
{
if (null === static::$_instance) {
static::$_instance = new parent();
}
return static::$_instance;
}
示例8: getInstance
public static function getInstance($config)
{
if (!static::$_instance instanceof static) {
static::$_instance = new static($config);
}
return static::$_instance;
}
示例9: getInstance
/**
* Create a new instance of the current cache driver, using the given settings.
*
* @param array $config
* @return void
*/
public static function getInstance(array $config)
{
if (static::$_instance === null) {
static::$_instance = new static($config);
}
return static::$_instance;
}
示例10: getInstance
/**
* 獲取Pandaphp單例
* @access public
* @author songdengtao <http://www.songdengtao.cn>
* @return object
*/
public static function getInstance()
{
if (is_null(static::$_instance)) {
static::$_instance = new Pandaphp();
}
return static::$_instance;
}
示例11: instance
public static function instance()
{
if (static::$_instance === NULL) {
static::$_instance = new Event();
}
return static::$_instance;
}
示例12: getInstance
/**
* Returns an instance of this class.
*
* Useful when we need to use some of the trait methods.
*
* @return \Field\Utility\TextToolbox
*/
public static function getInstance()
{
if (!static::$_instance) {
static::$_instance = new TextToolBox();
}
return static::$_instance;
}
示例13: instance
public static function instance()
{
if (empty(static::$_instance)) {
static::$_instance = new self();
}
return static::$_instance;
}
示例14: getInstance
public static function getInstance()
{
if (empty(static::$_instance)) {
static::$_instance = new FUFRoute();
}
return static::$_instance;
}
示例15: getInstance
public static final function getInstance()
{
if (static::$_instance === null) {
static::$_instance = new static();
}
return static::$_instance;
}