本文整理汇总了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;
}