protected function purge(
        array $scopes  = [self::SCOPE_EVERYTHING],
        array $argumentBag = []
    ) {
        $result = 0;

        // Iterate the scopes passed ...
        foreach ($scopes as $scope) {

            // Build scope for cache
            if (false === in_array($scope, $this->validScopes)) {
                throw new Doozr_Exception(
                    sprintf('Scope %s not allowed!', $scope)
                );
            }

            // Check for multi scope
            if (self::SCOPE_EVERYTHING === $scope) {
                $scope = $this->validScopes;
                array_shift($scope);

            } else {
                $scope = [$scope];
            }

            $app = Doozr_Kernel_App::boot(
                DOOZR_APP_ENVIRONMENT,
                DOOZR_RUNTIME_ENVIRONMENT,
                DOOZR_UNIX,
                DOOZR_DEBUGGING,
                DOOZR_CACHING,
                DOOZR_CACHING_CONTAINER,
                DOOZR_LOGGING,
                DOOZR_PROFILING,
                DOOZR_APP_ROOT,
                DOOZR_APP_NAMESPACE,
                DOOZR_DIRECTORY_TEMP,
                DOOZR_DOCUMENT_ROOT,
                DOOZR_NAMESPACE,
                DOOZR_NAMESPACE_FLAT
            );

            // Scope
            foreach ($scope as $singleScope) {

                /* @var Doozr_Cache_Service $cache */
                $cache = Doozr_Loader_Serviceloader::load(
                    'cache',
                    DOOZR_CACHING_CONTAINER,
                    $singleScope,
                    [],
                    DOOZR_UNIX,
                    DOOZR_CACHING
                );

                // We can purge simply everything from passed scope!
                try {
                    $result += $cache->garbageCollection($singleScope, -1, true);

                } catch (Exception $exception) {
                    break;
                }
            }
        }

        return $result;
    }
protected function purge(
        array $scopes  = [self::SCOPE_EVERYTHING],
        array $argumentBag = []
    ) {
        $result = 0;

        // Iterate the scopes passed ...
        foreach ($scopes as $scope) {

            // Build scope for cache
            if (false === in_array($scope, $this->validScopes)) {
                throw new Doozr_Exception(
                    sprintf('Scope %s not allowed!', $scope)
                );
            }

            // Check for multi scope
            if (self::SCOPE_EVERYTHING === $scope) {
                $scope = $this->validScopes;
                array_shift($scope);

            } else {
                $scope = [$scope];
            }

            $app = Doozr_Kernel_App::boot(
                DOOZR_APP_ENVIRONMENT,
                DOOZR_RUNTIME_ENVIRONMENT,
                DOOZR_UNIX,
                DOOZR_DEBUGGING,
                DOOZR_CACHING,
                DOOZR_CACHING_CONTAINER,
                DOOZR_LOGGING,
                DOOZR_PROFILING,
                DOOZR_APP_ROOT,
                DOOZR_APP_NAMESPACE,
                DOOZR_DIRECTORY_TEMP,
                DOOZR_DOCUMENT_ROOT,
                DOOZR_NAMESPACE,
                DOOZR_NAMESPACE_FLAT
            );

            // Scope
            foreach ($scope as $singleScope) {

                /* @var Doozr_Cache_Service $cache */
                $cache = Doozr_Loader_Serviceloader::load(
                    'cache',
                    DOOZR_CACHING_CONTAINER,
                    $singleScope,
                    [],
                    DOOZR_UNIX,
                    DOOZR_CACHING
                );

                // We can purge simply everything from passed scope!
                try {
                    $result += $cache->garbageCollection($singleScope, -1, true);

                } catch (Exception $exception) {
                    break;
                }
            }
        }

        return $result;
    }
protected function purge ( array $ scopes = [ self :: SCOPE_EVERYTHING ] , array $ argumentBag = [ ] ) { $ result = 0 ; // Iterate the scopes passed ... foreach ( $ scopes as $ scope ) { // Build scope for cache if ( false === in_array ( $ scope , $ this -> validScopes ) ) { throw new Doozr_Exception ( sprintf ( 'Scope %s not allowed!' , $ scope ) ) ; } // Check for multi scope if ( self :: SCOPE_EVERYTHING === $ scope ) { $ scope = $ this -> validScopes ; array_shift ( $ scope ) ; } else { $ scope = [ $ scope ] ; } $ app = Doozr_Kernel_App :: boot ( DOOZR_APP_ENVIRONMENT , DOOZR_RUNTIME_ENVIRONMENT , DOOZR_UNIX , DOOZR_DEBUGGING , DOOZR_CACHING , DOOZR_CACHING_CONTAINER , DOOZR_LOGGING , DOOZR_PROFILING , DOOZR_APP_ROOT , DOOZR_APP_NAMESPACE , DOOZR_DIRECTORY_TEMP , DOOZR_DOCUMENT_ROOT , DOOZR_NAMESPACE , DOOZR_NAMESPACE_FLAT ) ; // Scope foreach ( $ scope as $ singleScope ) { /* @var Doozr_Cache_Service $cache */ $ cache = Doozr_Loader_Serviceloader :: load ( 'cache' , DOOZR_CACHING_CONTAINER , $ singleScope , [ ] , DOOZR_UNIX , DOOZR_CACHING ) ; // We can purge simply everything from passed scope! try { $ result += $ cache -> garbageCollection ( $ singleScope , - 1 , true ) ; } catch ( Exception $ exception ) { break ; } } } return $ result ; }
Purges content from cache.

@param array $scopes  The scope to purge content for.
@param array $argumentBag The arguments bag

@author Benjamin Carl <opensource@clickalicious.de>
@return int The number of elements purged
@access protected
@throws Doozr_Exception
Purges content from cache .