當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。