Get a cache store instance by name, wrapped in a repository.

@param  string|null  $name
@return \Illuminate\Contracts\Cache\Repository
546721
public function store($name = null)
    {
        $name = $name ?: $this->getDefaultDriver();

        return $this->stores[$name] = $this->get($name);
    }
1368945
public function get($name)
    {
        if (!isset($this->storages[$name])) {
            throw new InvalidArgumentException("Storage $name not found.");
        }

        return $this->storages[$name];
    }
1176093
public function getStore( string $name = null ): CacheStoreInterface
	{
		if( is_null($name) )
		{
			$name = "default";
		}

		if( isset($this->store[$name]) || $this->loadStore($name) )
		{
			return $this->store[$name];
		}

		throw new NotFoundException("The '{$name}' cache store config not found");
	}
99625
public function source($name = '') : SourceRepository
    {
        $name = $name ?: $this->getDefaultSourceRepository();

        return $this->sources[$name] = $this->get($name);
    }
66050
public static function cache(Repository $cache = null)
    {
        if (! $cache) {
            $filestore = new FileStore(new Filesystem(), storage_path());
            $cache = new Repository($filestore);
        }

        return new CacheMiddleware(
            new PrivateCacheStrategy(
                new LaravelCacheStorage($cache)
            )
        );
    }
1322790
private function getRepository($classname)
    {
        $om = ManagerUtils::getManager($this->doctrine, $classname);

        return null !== $om ? $om->getRepository($classname) : null;
    }
1146322
public static function get($name) 
    {
        self::load();
        if (!array_key_exists($name, self::$_factories)) {
            return null;
        }
        return self::$_factories[$name];
    }
35068
public static function getOrCreateRepository($name)
    {
        $name = $name == Repository::class
            ? 'default'
            : str_replace(Repository::class . '.', '', $name);

        $repository = null;
        if (array_key_exists($name, static::$repositories)) {
            $repository = static::$repositories[$name];
        } else {
            $fullName = Repository::class . '.' . $name;
            if (!context()->exists($fullName)) {
                /**
                 * Lazy load.
                 */
                $config = config('database.' . $name);
                /**
                 * @T00D00 - this means that we're overloading every non-default repository to default one?
                 *         - this is needed when mixing different and using multiple repositories
                 *         - maybe the best thing would be to change repositories when needed (leave defaults?)
                 */
                if (!$config && $name != 'default') {
                    $config = config('database.default');
                }
                $repository = RepositoryFactory::getRepositoryByConfig($config, $name);
                context()->bind($fullName, $repository);
            }

            $repository = context()->get($fullName);
        }

        if (!$repository) {
            throw new Exception('Cannot prepare repository');
        }

        return $repository;
    }
654801
public function get($name, &$error = false){

		try{

			$name = $this->_cleanName($name);
		}
		catch(CacheException $e){

			$error = true;

			return null;
		}

		return $this->_Cache->get("{$this->_store}:$name", $error);
	}
187633
protected function fetchFromCache($name, SettingsOwnerInterface $owner = null)
    {
        $cacheKey = $this->getCacheKey($name, $owner);

        return $this->storage->getItem($cacheKey)->get();
    }
381369
public function getContainer($name)
    {
        $container = $this->containers->get($name);

        if (empty($container)) {
            return null;
        }

        return $container;
    }
1213223
final public function getCache($name) {
	
		return ((is_array($this->cache) and array_key_exists($name, $this->cache)) ? $this->cache[$name] : NULL);
	
	}
898115
public function getRepository($name = null, $source = null, $forceNew = false)
    {
        $name = $name ?: $this->getName();

        $key = ModelResolver::getDIKey($name);

        // Let's prepare controller getter.
        if (!$this->container->exists($key)) {
            // Use resolver to find model class and create it.
            $this->container->share($key, function (Container $container) use ($name, $source) {
                $config    = clone $this->config;
                $modelName = ucfirst($name) . 'Model';
                $repoName  = ucfirst($name) . 'Repository';
                $source    = $source ?: $this->getDataSource();

                /*
                 * If the name of this model not same as this controller, we don't pass name into it,
                 * so that the model will keep it's own name.
                 * Otherwise we override the name in model config with ours.
                 */
                if ($name && strcasecmp($name, $this->getName()) !== 0) {
                    $config['name'] = null;
                }

                try {
                    $repoResolver = $this->getPackage()->getMvcResolver()->getRepositoryResolver();

                    // Use RepositoryResolver to fin Repository class
                    try {
                        $class = $repoResolver->resolve($repoName);
                    } catch (\DomainException $e) {
                        // Use ModelResolver to get legacy Model classes
                        // @deprecated
                        $class = $repoResolver->getModelResolver()->resolve($modelName);
                    }

                    // Create object by container, container will auto inject all necessary dependencies
                    return $container->createSharedObject($class, ['config' => $config]);
                } catch (\Exception $e) {
                    if (!$e instanceof \DomainException && !$e instanceof \UnexpectedValueException) {
                        throw $e;
                    }

                    // Guess the repository position
                    $class = MvcHelper::getPackageNamespace($this) . '\Repository\\' . ucfirst($repoName);

                    if (class_exists($class)) {
                        return $container->createSharedObject($class, ['source' => $source, 'config' => $config]);
                    }

                    // Guess the model position
                    // @deprecated
                    $class = MvcHelper::getPackageNamespace($this) . '\Model\\' . ucfirst($modelName);

                    if (class_exists($class)) {
                        return $container->createSharedObject($class, ['source' => $source, 'config' => $config]);
                    }

                    $config['name'] = $name;

                    return new Repository($config);
                }
            });
        }

        // Get model from controller.
        return $this->container->get($key, $forceNew);
    }
1127230
public function getRecord($name = null)
    {
        $recordName = $name ?: $this->record;

        if ($recordName === false) {
            return new NullRecord();
        }

        $recordName = $recordName ?: $this->getName();

        $mapper = $this->getDataMapper($name);

        if ($mapper instanceof AbstractDatabaseMapperProxy) {
            $mapper = $mapper::getInstance();
        }

        // (1) If name is class, just new it.
        if (class_exists($recordName)) {
            return new $recordName($this->table, $this->keys, $mapper);
        }

        // (2): Find object from registered namespaces
        if ($record = RecordResolver::create($recordName, $this->table, $this->keys, $mapper)) {
            return $record;
        }

        $errors[] = sprintf(
            'Record: "%s" not found from namespaces: (%s)',
            $recordName,
            implode(" |\n ", RecordResolver::dumpNamespaces())
        );

        // (3): Find from package directory.
        $class = sprintf(
            '%s\Record\%sRecord',
            MvcHelper::getPackageNamespace(static::class, 2),
            ucfirst($recordName)
        );

        if (class_exists($class)) {
            return new $class($this->table, $this->keys, $mapper);
        }

        $errors[] = sprintf('Class: %s not exists.', $class);

        // If name is NULL and this model prepared a default record name.
        // We must throw exception to tell developers record not found.
        if (!$name && $this->record) {
            throw new \LogicException(implode("\n- ", $errors));
        }

        // If name not NULL, set it as table name, otherwise use pre-set table property.
        $table = $name ?: $this->table;

        if (!$table) {
            throw new \LogicException(
                'Please add table property to ' . get_called_class() . " to support Record object. \n" .
                implode("\n- ", $errors)
            );
        }

        // (4): If name is null, we get default object with table name provided.
        return new Record($table, $this->keys, $mapper);
    }
1311408
public function getRepository(string $name): Repository
    {
        if (!isset($this->repositories[$name])) {
            throw new \InvalidArgumentException(\sprintf(
                'The name %s is not a valid repository, try one of %s',
                $name,
                \implode(', ', \array_keys($this->repositories))
            ));
        }

        return $this->repositories[$name];
    }
9799
public static function getInstance($name, array $config, Container $repository, Repository $cache)
    {
        if (self::$oInstance == false) {
            self::$oInstance = new Registry($name, $config, $repository, $cache);
        }
        return self::$oInstance;
    }
260634
protected function resolve($name)
	{
		$config = $this->getConfig($name);

		if (is_null($config))
		{
			throw new InvalidArgumentException('Cache config is not defined.');
		}

		if (!isset($config['hash']))
		{
			$config['hash']      = $this->app->hash('');
		}
		if (!isset($config['cachebase']))
		{
			$config['cachebase'] = PATH_APP . DS . 'cache' . DS . (isset($this->app['client']->alias) ? $this->app['client']->alias : $this->app['client']->name);
		}

		if (isset($this->customCreators[$name]))
		{
			$config['cache_handler'] = $name;

			return $this->callCustomCreator($config);
		}
		else
		{
			$class = __NAMESPACE__ . '\\Storage\\' . ucfirst($name);

			if (!class_exists($class))
			{
				throw new InvalidArgumentException("Cache store [{$name}] is not defined.");
			}

			return new $class((array) $config);
		}
	}