當前位置: 首頁>>代碼示例>>PHP>>正文


PHP static::instances方法代碼示例

本文整理匯總了PHP中static::instances方法的典型用法代碼示例。如果您正苦於以下問題:PHP static::instances方法的具體用法?PHP static::instances怎麽用?PHP static::instances使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在static的用法示例。


在下文中一共展示了static::instances方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: instance

 /**
  * @return Model_Search_Stemmer_Decorator
  */
 public static function instance()
 {
     if (!isset(static::$instances)) {
         static::$instances = new static();
     }
     return static::$instances;
 }
開發者ID:ZerGabriel,項目名稱:cms-1,代碼行數:10,代碼來源:decorator.php

示例2: create

 /**
  * Create new instance of Xinix\Theme\Components\Pagination via static method
  *
  * @param Norm\Cursor $entries Entries that we want to page
  *
  * @return Xinix\Theme\Components\Pagination New instance of Pagination class
  */
 public static function create(Cursor $entries)
 {
     $Class = get_called_class();
     if (is_null(static::$instances[$Class])) {
         static::$instances = new $Class($entries);
     }
     return static::$instances;
 }
開發者ID:xinix-technology,項目名稱:blade-theme,代碼行數:15,代碼來源:Pagination.php

示例3: resetInstance

 /**
  * As this is a singleton instance, we wanna be able to re-instatiate (e.g. during
  * tests as the same instance will be used for unit and integrated tests)
  * @return void
  */
 public function resetInstance($name = null)
 {
     if (is_null($name)) {
         static::$instances = array();
     } else {
         unset(static::$instances[$name]);
     }
 }
開發者ID:martynbiz,項目名稱:php-mongo,代碼行數:13,代碼來源:Singleton.php

示例4: delete

 /**
  * Delete an instance from the facade.
  *
  * @param  mixed  $name  instance name or true for all
  */
 public static function delete($name)
 {
     if ($name === true) {
         static::$instances = array();
     } elseif (isset(static::$instances[$name])) {
         unset(static::$instances[$name]);
     }
 }
開發者ID:velosipedist,項目名稱:event,代碼行數:13,代碼來源:Base.php

示例5: __callStatic

 public static function __callStatic($name, $arguments)
 {
     static $bindings = ['A' => 'Auth', 'C' => 'Config', 'D' => 'Db', 'L' => 'Log', 'R' => 'Redirect', 'S' => 'Session', 'T' => 'Template', 'U' => 'Url'];
     if (!is_array(static::$instances)) {
         static::$instances = [];
     }
     if (!isset(static::$instances[$name])) {
         static::$instances[$name] = new $bindings[$name]();
     }
     return static::$instances[$name];
 }
開發者ID:jthemphill,項目名稱:tournament,代碼行數:11,代碼來源:singletons.php

示例6: __callStatic

 /**
  * @param $name
  * @param $arguments
  * @return static
  * @throws Exception
  */
 public static function __callStatic($name, $arguments)
 {
     if (!defined("static::" . $name)) {
         throw new Exception("Unknown enum '" . $name . "'");
     }
     if (!is_array(static::$instances)) {
         static::$instances = [];
     }
     if (!isset(static::$instances[$name])) {
         static::$instances[$name] = new static($name, constant("static::" . $name));
     }
     return static::$instances[$name];
 }
開發者ID:jaspervdm,項目名稱:pogoapi-php,代碼行數:19,代碼來源:Enum.php

示例7: reset

 /**
  * Method to reset class static members for testing and other various issues.
  *
  * @return  void
  *
  * @since   11.1
  */
 public static function reset()
 {
     static::$instances = array();
     static::$base = array();
     static::$root = array();
     static::$current = '';
 }
開發者ID:adjaika,項目名稱:J3Base,代碼行數:14,代碼來源:uri.php

示例8: reset

 /**
  * Resets all metadata instances.
  */
 public static function reset()
 {
     static::$instances = [];
 }
開發者ID:drwrf,項目名稱:mismatch-model,代碼行數:7,代碼來源:Metadata.php

示例9: reset

 public static function reset()
 {
     static::$prophecy = [];
     static::$instances = [];
 }
開發者ID:cheppers,項目名稱:robo-phpcs,代碼行數:5,代碼來源:Process.php

示例10: setProxyContainer

 public static function setProxyContainer(ContainerInterface $container = null)
 {
     static::$instances = [];
     static::$container = $container;
 }
開發者ID:autarky,項目名稱:container,代碼行數:5,代碼來源:AbstractProxy.php

示例11: clearInternalCache

 /**
  * Clears the internal memory cache of model instances.
  * @return void
  */
 public static function clearInternalCache()
 {
     static::$instances = [];
 }
開發者ID:keiosweb,項目名稱:october,代碼行數:8,代碼來源:SettingsModel.php

示例12: clear

 /**
  * Clears the registry of configuration and instances.
  *
  * @return void
  */
 public static function clear()
 {
     static::$instances = [];
 }
開發者ID:jeffersongoncalves,項目名稱:elastic-search,代碼行數:9,代碼來源:TypeRegistry.php

示例13: clears

 /**
  * Clear all of the resolved instances.
  */
 public static function clears()
 {
     static::$instances = array();
 }
開發者ID:krisanalfa,項目名稱:docolight,代碼行數:7,代碼來源:Facade.php

示例14: flushInstances

 /**
  * Remove saved instances
  *
  * @param array $ids Array of instance ids to unset. If omitted all saved instances are removed
  * @return void
  */
 static function flushInstances(array $ids = [])
 {
     if (!empty($ids)) {
         foreach ($ids as $id) {
             if (is_string($id) && isset(static::$instances[$id])) {
                 unset(static::$instances[$id]);
             }
         }
     } else {
         static::$instances = [];
     }
 }
開發者ID:giuseppe-mazzapica,項目名稱:faber,代碼行數:18,代碼來源:Faber.php

示例15: reset

 public static function reset($name = null)
 {
     if (is_null($name)) {
         $name = static::DEFAULT_INSTANCE_NAME;
     }
     static::$instances = null;
 }
開發者ID:teodorpopa,項目名稱:IoC,代碼行數:7,代碼來源:Container.php


注:本文中的static::instances方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。