concrete/src/Cache/Cache.php
protected function loadConfig($level)
    {
        $app = Application::getFacadeApplication();
        $drivers = [];
        $driverConfigs = $app['config']->get("concrete.cache.levels.{$level}.drivers", []);
        $preferredDriverName = $app['config']->get("concrete.cache.levels.{$level}.preferred_driver", null);

        // Load the preferred driver(s) first
        if (!empty($preferredDriverName)) {
            if (is_array($preferredDriverName)) {
                foreach ($preferredDriverName as $driverName) {
                    $preferredDriver = array_get($driverConfigs, $driverName, []);
                    $drivers[] = $this->buildDriver($preferredDriver);
                }
            } else {
                $preferredDriver = array_get($driverConfigs, $preferredDriverName, []);
                $drivers[] = $this->buildDriver($preferredDriver);
            }
        }
        // If we dont have any perferred drivers or preferred drivers available
        // Build Everything
        if (empty($drivers)) {
            foreach ($driverConfigs as $driverConfig) {
                if (!$driverConfig) {
                    continue;
                }

                $drivers[] = $this->buildDriver($driverConfig);
            }
        }

        // Remove any empty arrays for an accurate count
        array_filter($drivers);
        $count = count($drivers);
        if ($count > 1) {
            $driver = new Composite(['drivers' => $drivers]);
        } elseif ($count === 1) {
            reset($drivers);
            $driver = current($drivers);
        } else {
            $driver = new BlackHole();
        }

        return $driver;
    }
protected function loadConfig($level)
    {
        $app = Application::getFacadeApplication();
        $drivers = [];
        $driverConfigs = $app['config']->get("concrete.cache.levels.{$level}.drivers", []);
        $preferredDriverName = $app['config']->get("concrete.cache.levels.{$level}.preferred_driver", null);

        // Load the preferred driver(s) first
        if (!empty($preferredDriverName)) {
            if (is_array($preferredDriverName)) {
                foreach ($preferredDriverName as $driverName) {
                    $preferredDriver = array_get($driverConfigs, $driverName, []);
                    $drivers[] = $this->buildDriver($preferredDriver);
                }
            } else {
                $preferredDriver = array_get($driverConfigs, $preferredDriverName, []);
                $drivers[] = $this->buildDriver($preferredDriver);
            }
        }
        // If we dont have any perferred drivers or preferred drivers available
        // Build Everything
        if (empty($drivers)) {
            foreach ($driverConfigs as $driverConfig) {
                if (!$driverConfig) {
                    continue;
                }

                $drivers[] = $this->buildDriver($driverConfig);
            }
        }

        // Remove any empty arrays for an accurate count
        array_filter($drivers);
        $count = count($drivers);
        if ($count > 1) {
            $driver = new Composite(['drivers' => $drivers]);
        } elseif ($count === 1) {
            reset($drivers);
            $driver = current($drivers);
        } else {
            $driver = new BlackHole();
        }

        return $driver;
    }
protected function loadConfig ( $ level ) { $ app = Application :: getFacadeApplication ( ) ; $ drivers = [ ] ; $ driverConfigs = $ app [ 'config' ] -> get ( "concrete.cache.levels.{$level}.drivers" , [ ] ) ; $ preferredDriverName = $ app [ 'config' ] -> get ( "concrete.cache.levels.{$level}.preferred_driver" , null ) ; // Load the preferred driver(s) first if ( ! empty ( $ preferredDriverName ) ) { if ( is_array ( $ preferredDriverName ) ) { foreach ( $ preferredDriverName as $ driverName ) { $ preferredDriver = array_get ( $ driverConfigs , $ driverName , [ ] ) ; $ drivers [ ] = $ this -> buildDriver ( $ preferredDriver ) ; } } else { $ preferredDriver = array_get ( $ driverConfigs , $ preferredDriverName , [ ] ) ; $ drivers [ ] = $ this -> buildDriver ( $ preferredDriver ) ; } } // If we dont have any perferred drivers or preferred drivers available // Build Everything if ( empty ( $ drivers ) ) { foreach ( $ driverConfigs as $ driverConfig ) { if ( ! $ driverConfig ) { continue ; } $ drivers [ ] = $ this -> buildDriver ( $ driverConfig ) ; } } // Remove any empty arrays for an accurate count array_filter ( $ drivers ) ; $ count = count ( $ drivers ) ; if ( $ count > 1 ) { $ driver = new Composite ( [ 'drivers' => $ drivers ] ) ; } elseif ( $ count === 1 ) { reset ( $ drivers ) ; $ driver = current ( $ drivers ) ; } else { $ driver = new BlackHole ( ) ; } return $ driver ; }
Loads the composite driver from constants.

@param $level

@return \Stash\Interfaces\DriverInterface
Loads the composite driver from constants .