当前位置: 首页>>代码示例>>PHP>>正文


PHP static::_instance方法代码示例

本文整理汇总了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;
 }
开发者ID:jenky,项目名称:serapia,代码行数:7,代码来源:Bootstrap.php

示例2: _i

 public static function _i()
 {
     if (static::$_instance === NULL) {
         static::$_instance = new static();
     }
     return static::$_instance;
 }
开发者ID:sm115,项目名称:SYFramework,代码行数:7,代码来源:YPdo.php

示例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;
 }
开发者ID:prggmr,项目名称:xpspl,代码行数:12,代码来源:singleton.php

示例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;
 }
开发者ID:rocketyang,项目名称:mincms,代码行数:12,代码来源:image.php

示例5: instance

 public static function instance()
 {
     if (static::$_instance == null) {
         static::$_instance = static::factory();
     }
     return static::$_instance;
 }
开发者ID:hymns,项目名称:fuel,代码行数:7,代码来源:transaction.php

示例6: getInstance

 public static function getInstance()
 {
     if (static::$_instance === null || !static::$_instance instanceof static) {
         static::$_instance = new static();
     }
     return static::$_instance;
 }
开发者ID:YidaChen,项目名称:tutorial-php-advenced,代码行数:7,代码来源:Singleton.php

示例7: getInstance

 /**
  * Get instance of \Hoa\Registry.
  *
  * @return  object
  */
 protected static function getInstance()
 {
     if (null === static::$_instance) {
         static::$_instance = new parent();
     }
     return static::$_instance;
 }
开发者ID:Grummfy,项目名称:Central,代码行数:12,代码来源:Registry.php

示例8: getInstance

 public static function getInstance($config)
 {
     if (!static::$_instance instanceof static) {
         static::$_instance = new static($config);
     }
     return static::$_instance;
 }
开发者ID:hopelyj,项目名称:crm_website_php,代码行数:7,代码来源:PDODB.class.php

示例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;
 }
开发者ID:rhymix,项目名称:rhymix,代码行数:13,代码来源:file.php

示例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;
 }
开发者ID:songdent,项目名称:pandaphp,代码行数:13,代码来源:Pandaphp.php

示例11: instance

 public static function instance()
 {
     if (static::$_instance === NULL) {
         static::$_instance = new Event();
     }
     return static::$_instance;
 }
开发者ID:ArmSALArmy,项目名称:Banants,代码行数:7,代码来源:Event.php

示例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;
 }
开发者ID:quickapps-plugins,项目名称:field,代码行数:14,代码来源:TextToolbox.php

示例13: instance

 public static function instance()
 {
     if (empty(static::$_instance)) {
         static::$_instance = new self();
     }
     return static::$_instance;
 }
开发者ID:perftools,项目名称:xhgui,代码行数:7,代码来源:ServiceContainer.php

示例14: getInstance

 public static function getInstance()
 {
     if (empty(static::$_instance)) {
         static::$_instance = new FUFRoute();
     }
     return static::$_instance;
 }
开发者ID:sankam-nikolya,项目名称:FileUploadForm,代码行数:7,代码来源:route.php

示例15: getInstance

 public static final function getInstance()
 {
     if (static::$_instance === null) {
         static::$_instance = new static();
     }
     return static::$_instance;
 }
开发者ID:laubosslink,项目名称:lab,代码行数:7,代码来源:test.php


注:本文中的static::_instance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。