Returns a session storage handler object, only creating it if it doesn't already exist.

@param   string  $name     The session store to instantiate
@param   array   $options  Array of options

@return  Storage

@since   1.0
@deprecated  2.0
511705
public static function getInstance($name = 'none', $options = array())
	{
		$filter = new InputFilter;
		$name   = strtolower($filter->clean($name, 'word'));

		if (empty(self::$instances[$name]))
		{
			$class = '\\Joomla\\Session\\Storage\\' . ucfirst($name);

			if (!class_exists($class))
			{
				$path = __DIR__ . '/storage/' . $name . '.php';

				if (file_exists($path))
				{
					require_once $path;
				}
				else
				{
					// No attempt to die gracefully here, as it tries to close the non-existing session
					exit('Unable to load session storage class: ' . $name);
				}
			}

			self::$instances[$name] = new $class($options);
		}

		return self::$instances[$name];
	}
653324
public static function add($name, array $options) 
		{

			// Already known?
			if (array_key_exists($name, self::$_auths)) {
				throw new \Exception("There is already a Auth defined for '$name'.", 1);				
			}

			// Create it
			$auth = new Auth($name, $options);
			self::$_auths[$name] = $auth;
			return $auth;

		}
949645
public function storeConsoleLog($name)
    {
        if (in_array($this->driver->getCapabilities()->getBrowserName(), static::$supportsRemoteLogs)) {
            $console = $this->driver->manage()->getLog('browser');

            if (! empty($console)) {
                file_put_contents(
                    sprintf('%s/%s.log', rtrim(static::$storeConsoleLogAt, '/'), $name), json_encode($console, JSON_PRETTY_PRINT)
                );
            }
        }

        return $this;
    }
1164384
private function createServiceFromLazyServiceDelegator(string $name, array $options = null)
    {

        $creationCallback = $this->delegatorCallbackCache[$name] ?? null;
        if ($creationCallback) {
            $object = $creationCallback($this->creationContext, $name, $creationCallback, $options);
            return $object;
        }
        $creationCallback = function () use ($name, $options) {
            return $this->createServiceFromFactory($name, $options);
        };

        $delegatorFactory = $this->delegators[$name][0];
        if (is_string($delegatorFactory)) {
            $delegatorFactory = $this->createLazyServiceDelegatorFactory();
            $this->delegators[$name][0] = $delegatorFactory;
        }

        $creationCallback = function () use ($delegatorFactory, $name, $creationCallback, $options) {
            return $delegatorFactory($this->creationContext, $name, $creationCallback, $options);
        };

        //cache the callback for later requests
        $this->delegatorCallbackCache[$name] = $creationCallback;
        return $creationCallback($this->creationContext, $name, $creationCallback, $options);
    }
1062349
public static function getStorage($name=StorageInterface::class){
        if($name=='default')$name=StorageInterface::class;
        if(static::$storageArr[$name]){
            return static::$storageArr[$name];
        }
        $storage=Ioc::get($name);
        if(!$storage){
            throw new SystemException($name."文件存储不存在,你写个类可以继承自".StorageInterface::class);
        }else
        if($storage instanceof StorageInterface){
            static::$storageArr[$name]=new Storage($storage);
            return static::$storageArr[$name];
        }else{
            throw new SystemException($name."文件存储需要继承".StorageInterface::class);
        }
    }
1182839
protected function getFieldOptions($name, array $options = [])
    {
        $fieldOptions = Arr::get($options, 'field', []);

        if ($this->isFieldDisabled($options)) {
            $fieldOptions['disabled'] = 'disabled';
        }

        $fieldOptions['id'] = $this->getFieldId($name, $options);

        return $fieldOptions;
    }
115904
public function &__get($name)
    {
        // This method must return a reference and not use ternary operators for __set()ing multi-dimensional arrays
        // http://stackoverflow.com/questions/4310473/using-set-with-arrays-solved-but-why
        // http://stackoverflow.com/questions/5966918/return-null-by-reference-via-get
        switch ($name) {
            case 'global':
                if (is_null(static::$global)) {
                    static::$global = new Container;
                }

                return static::$global;
                break;
            case 'session':
                if (is_null(static::$session)) {
                    static::$session = new Session;
                }

                return static::$session;
                break;
            case 'request':
            case 'dir':
            case 'url':
            case 'html':
                return $this->$name;
                break;
            default:
                return $this->html[strtolower($name)];
                break;
        }
    }
839427
private function handleOptionName($name)
    {
        if (is_string($name)) {
            $name = explode('.', $name);
        }

        foreach ($this->optionNameHandlers as $handler) {
            $name = $handler($name);
        }

        return $name;
    }
469271
public function get($name, array $options = [])
    {
        $group = $options['group'];

        $menuItem = $this->menuFactory->createItem($options['name']);

        if (empty($group['on_top']) || false === $group['on_top']) {
            foreach ($group['items'] as $item) {
                if ($this->canGenerateMenuItem($item, $group)) {
                    $menuItem->addChild($this->generateMenuItem($item, $group));
                }
            }

            if (false === $menuItem->hasChildren()) {
                $menuItem->setDisplay(false);
            } elseif (!empty($group['keep_open'])) {
                $menuItem->setAttribute('class', 'keep-open');
                $menuItem->setExtra('keep_open', $group['keep_open']);
            }
        } elseif (1 === \count($group['items'])) {
            if ($this->canGenerateMenuItem($group['items'][0], $group)) {
                $menuItem = $this->generateMenuItem($group['items'][0], $group);
                $menuItem->setExtra('on_top', $group['on_top']);
            } else {
                $menuItem->setDisplay(false);
            }
        }
        $menuItem->setLabel($group['label']);

        return $menuItem;
    }
503291
public function queue($name, array $options = [])
    {
        return $this->queues[$name] = (new QueueBuilder($this, $name))->options($options);
    }
1197266
public function get($name, $options = [], $usePeeringServiceManagers = false)
    {
        if (is_string($options)) {
            $options = ['class_name' => $options];
        }

        return parent::get($name, $options, $usePeeringServiceManagers);
    }
672534
public function pathBuilder($name = null, array $options = []) {
		if ($name instanceof PathBuilderInterface) {
			$this->_pathBuilder = $name;

			return $this->_pathBuilder;
		}

		if ($name !== null) {
			$this->_pathBuilder = $this->createPathBuilder($name, $options);
		}

		return $this->_pathBuilder;
	}
78340
public function getStorage($name)
    {
        $class = sprintf('\\MwbExporter\\Storage\\%sStorage', ucfirst($name));
        if (class_exists($class)) {
            $storage = new $class();

            return $storage;
        }

        throw new \InvalidArgumentException(sprintf('Storage %s not found.', $class));
    }
386006
protected function doCreateCollection($name, array $options)
    {
        $this->mongoDB->createCollection($name, $options);

        return $this->doSelectCollection($name);
    }
812533
public function getMenu($name = null, $options = array())
    {
        if (!isset($name))
        {
            $app = JFactory::getApplication();
            $name = $app->getName();
        }

        try
        {
            if (!class_exists('JMenu' . ucfirst($name))) {
                jimport('cms.menu.'.strtolower($name));
            }

            $menu = JMenu::getInstance($name, $options);
        }
        catch (Exception $e) {
            return null;
        }

        return $menu;
    }
1096607
protected function getStorage($name)
    {
        $nameStorage = 'storage' . ucfirst($name);
        $data        = $this->{$nameStorage}();
        $defaults    = &$this->defaults();

        if (empty($data))
        {
            if (isset($defaults[$name]))
            {
                return $defaults[$name];
            }

            return null;
        }

        return $data;
    }
642341
public static function getRouter($name = null, array $options = array())
    {
        if (!isset($name))
        {
            $app  = \JFactory::getApplication();
            $name = $app->getName();
        }

        try
        {
            $router = \JRouter::getInstance($name, $options);
        }
        catch (\Exception $e)
        {
            return null;
        }

        return $router;
    }