public function setupCommand(string $cacheIdentifier)
    {
        try {
            $cache = $this->cacheManager->getCache($cacheIdentifier);
        } catch (NoSuchCacheException $exception) {
            $this->outputLine('<error>A Cache with id "%s" is not configured.</error>', [$cacheIdentifier]);
            $this->outputLine('Use the <i>neos.flow:cache:list</i> command to get a list of all configured Caches.');
            $this->quit(1);
            return;
        }
        $cacheBackend = $cache->getBackend();
        if (!$cacheBackend instanceof WithSetupInterface) {
            $this->outputLine('<error>The Cache "%s" is configured to use the backend "%s" but this does not implement the WithSetupInterface.</error>', [$cacheIdentifier, TypeHandling::getTypeForValue($cacheBackend)]);
            $this->quit(1);
            return;
        }
        $this->outputLine('Setting up backend <b>%s</b> for cache "%s"', [TypeHandling::getTypeForValue($cacheBackend), $cache->getIdentifier()]);
        $setupResult = $cacheBackend->setup();
        $this->renderResult($setupResult);
        if ($setupResult->hasErrors() || $setupResult->hasWarnings()) {
            $this->quit(1);
            return;
        }
    }
public function setupCommand(string $cacheIdentifier)
    {
        try {
            $cache = $this->cacheManager->getCache($cacheIdentifier);
        } catch (NoSuchCacheException $exception) {
            $this->outputLine('<error>A Cache with id "%s" is not configured.</error>', [$cacheIdentifier]);
            $this->outputLine('Use the <i>neos.flow:cache:list</i> command to get a list of all configured Caches.');
            $this->quit(1);
            return;
        }
        $cacheBackend = $cache->getBackend();
        if (!$cacheBackend instanceof WithSetupInterface) {
            $this->outputLine('<error>The Cache "%s" is configured to use the backend "%s" but this does not implement the WithSetupInterface.</error>', [$cacheIdentifier, TypeHandling::getTypeForValue($cacheBackend)]);
            $this->quit(1);
            return;
        }
        $this->outputLine('Setting up backend <b>%s</b> for cache "%s"', [TypeHandling::getTypeForValue($cacheBackend), $cache->getIdentifier()]);
        $setupResult = $cacheBackend->setup();
        $this->renderResult($setupResult);
        if ($setupResult->hasErrors() || $setupResult->hasWarnings()) {
            $this->quit(1);
            return;
        }
    }
public function setupCommand ( string $ cacheIdentifier ) { try { $ cache = $ this -> cacheManager -> getCache ( $ cacheIdentifier ) ; } catch ( NoSuchCacheException $ exception ) { $ this -> outputLine ( '<error>A Cache with id "%s" is not configured.</error>' , [ $ cacheIdentifier ] ) ; $ this -> outputLine ( 'Use the <i>neos.flow:cache:list</i> command to get a list of all configured Caches.' ) ; $ this -> quit ( 1 ) ; return ; } $ cacheBackend = $ cache -> getBackend ( ) ; if ( ! $ cacheBackend instanceof WithSetupInterface ) { $ this -> outputLine ( '<error>The Cache "%s" is configured to use the backend "%s" but this does not implement the WithSetupInterface.</error>' , [ $ cacheIdentifier , TypeHandling :: getTypeForValue ( $ cacheBackend ) ] ) ; $ this -> quit ( 1 ) ; return ; } $ this -> outputLine ( 'Setting up backend <b>%s</b> for cache "%s"' , [ TypeHandling :: getTypeForValue ( $ cacheBackend ) , $ cache -> getIdentifier ( ) ] ) ; $ setupResult = $ cacheBackend -> setup ( ) ; $ this -> renderResult ( $ setupResult ) ; if ( $ setupResult -> hasErrors ( ) || $ setupResult -> hasWarnings ( ) ) { $ this -> quit ( 1 ) ; return ; } }
Setup the given Cache if possible

Invokes the setup() method on the configured CacheBackend (if it implements the WithSetupInterface)
which should setup and validate the backend (i.e. create required database tables, directories, ...)

@param string $cacheIdentifier
@return void
@see neos.flow:cache:list
@see neos.flow:cache:setupall
@throws StopActionException
Setup the given Cache if possible