@param string $context

@return FilesystemCache
487848
private function getData($context)
    {
        if (!array_key_exists($context, $this->storage)) {
            $this->storage[$context] = new FilesystemCache($this->directory . '/' . $context, self::EXTENSION);
        }

        return $this->storage[$context];
    }
107217
public function fetch(ConnectionContext $context, $source)
    {
        if ($context->mustCache()) {
            $options = $this->connector instanceof ConnectorOptions ? $this->connector->getOptions()->copy() : [];
            ksort($options);

            $this->validateCacheKey($key = $this->cacheKeyGenerator->generateCacheKey($source, $options));

            if ($this->cache->hasItem($key)) {
                return $this->cache->getItem($key)->get();
            }
        }

        $data = $this->connector->fetch($context, $source);

        isset($key) && $this->cache->save($this->cache->getItem($key)->set($data));

        return $data;
    }
841161
protected function doCreateSubject($context)
    {
        global $logger;
        $securityManager = $context->resolveSecurityManager();
        $session         = $context->resolveSession();
        $principals      = $context->resolvePrincipals();
        $authenticated   = $context->resolveAuthenticated();
        $roles           = $context->resolveRoles();
        $host            = $context->resolveHost();

        return new DelegatingSubject(
            $principals,
            $authenticated,
            $host,
            $session,
            $roles,
            $securityManager
        );

    }
64159
static public function instance( KernelAwareContext $context )
    {
        static $instance = null;
        if ( $instance === null )
        {
            $class = get_called_class();
            $instance = new $class();
            $instance->setContext( $context );
        }

        return $instance;
    }
919529
public function buffer(Context $context): Promise
    {
        return $context->task(function (Context $context) {
            $buffer = '';
            
            try {
                while (null !== ($chunk = yield $this->read($context, 0xFFFF))) {
                    $buffer .= $chunk;
                }
            } finally {
                $this->close();
            }
            
            return $buffer;
        });
    }
869253
public function getDBQueryBuilder(Context $context = null)
    {
        if ($this->dbQueryBuilder == null) {
            $this->dbQueryBuilder            = new Miner();
        }
        $this->dbQueryBuilder->context = $context;

        return $this->dbQueryBuilder;
    }
708201
private function getFileSystem(ContainerInterface $container): FileSystemInterface
    {
        assert($container->has(FileSystemInterface::class));

        /** @var FileSystemInterface $fileSystem */
        $fileSystem = $container->get(FileSystemInterface::class);

        return $fileSystem;
    }
760365
public static function getInstance(ContextInterface $context)
    {
        return new CreateSourceBackbone(
            MetadataSourceQuestionFactory::getInstance($context),
            MetaDataConfigDAOFactory::getInstance($context),
            $context
        );
    }
998761
public function loadContext($context)
    {

        $now = time();
        $context->created = $now;
        $context->updated = $now;

        return true;

    }
1014890
public function createCacheFile(string $hash, string $fileName, ?string $context = null): bool
    {
        foreach ($this->cacheAdapters as $cacheAdapter) {
            if ($cacheAdapter->create($hash, $fileName, $context)) {
                return true;
            }
        }

        return false;
    }
1235748
protected function before(Context $context)
    {
        // set context forwarder
        $context->forwarder = $context->forwarder ?: [$this, 'forward'];

        return parent::before($context);
    }
485078
@TargetApi(8)
    public static File getExternalCacheDir(Context context) {
        // Do we have a built-in external cache dir method.
        if (Android.isAPI(8)) {
            File cacheDir = context.getExternalCacheDir();
            if (cacheDir != null) {
                return cacheDir;
            }
        }

        // Before Froyo we need to construct the external cache dir ourselves
        final String cacheDir = "/Android/data/" + context.getPackageName() + "/cache/";
        return new File(Environment.getExternalStorageDirectory().getPath() + cacheDir);
    }
753311
public function invalidateCache($source, $context)
    {
        $key = $this->getSpecificSourceCacheKey(
            $source,
            $context
        );

        $this
            ->cache
            ->delete($this->getSpecificSourceCacheKey(
                $source,
                $context
            ));

        unset($this->commentTree[$key]);

        return $this;
    }
1362665
static function setContextCache( $contextName, $context )
    {
        if ( $context === null )
        {
            return;
        }
        if ( isset( $GLOBALS['eZTranslationCacheTable'][$contextName] ) )
        {
            eZDebug::writeWarning( "Translation cache for context '$contextName' already exists", __METHOD__ );
        }
        else
        {
            $GLOBALS['eZTranslationCacheTable'][$contextName] = array();
        }
        $GLOBALS['eZTranslationCacheTable'][$contextName]['root'] = $context;
        $GLOBALS['eZTranslationCacheTable'][$contextName]['info'] = array( 'context' => $contextName );
    }
394467
private function parseContext($context)
    {
        $debugBackTrace = debug_backtrace();
        if(!isset($context['trace']))
        {
            $context['trace'] = $this->getTrace($debugBackTrace);
        }
        if(!isset($context['errorFile']))
        {
            list($file, $line) = $this->getErrorFile($debugBackTrace);
            $context['errorFile'] = $file;
            $context['errorLine'] = $line;
        }
        return $context;
    }
265200
protected function restore(MinifyContext $context)
    {
        $withoutPlaceholders = $context->getPlaceholderContainer()->restorePlaceholders($context->getContents());

        return $context->setContents($withoutPlaceholders);
    }
1066471
protected function addFilesystemManager( \Aimeos\MShop\Context\Item\Iface $context )
	{
		$fs = new \Aimeos\MW\Filesystem\Manager\Standard( $context->getConfig() );

		return $context->setFilesystemManager( $fs );
	}