Esempio n. 1
0
 /**
  * Get or create the singleton alias loader instance.
  *
  * @param  array  $aliases
  * @return \Illuminate\Foundation\AliasLoader
  */
 public static function getInstance(array $aliases = array())
 {
     if (is_null(static::$instance)) {
         static::$instance = new static($aliases);
     }
     $aliases = array_merge(static::$instance->getAliases(), $aliases);
     static::$instance->setAliases($aliases);
     return static::$instance;
 }
Esempio n. 2
0
 /**
  * Get or create the singleton alias loader instance.
  *
  * @param  array  $aliases
  * @return \Illuminate\Foundation\AliasLoader
  */
 public static function getInstance(array $aliases = array())
 {
     //单例
     if (is_null(static::$instance)) {
         return static::$instance = new static($aliases);
     }
     $aliases = array_merge(static::$instance->getAliases(), $aliases);
     static::$instance->setAliases($aliases);
     //返回当前类对象,可以做链式操作
     return static::$instance;
 }