protected function prepareRequest(array $assets, $localPath = null)
    {
        if (substr($localPath, -1) != '/') {
            $localPath = $localPath.'/';
        }

        $this->localPath = $localPath;
        $this->storagePath = storage_path('cms/combiner/assets');

        list($assets, $extension) = $this->prepareAssets($assets);

        /*
         * Cache and process
         */
        $cacheKey = $this->getCacheKey($assets);
        $cacheInfo = $this->useCache ? $this->getCache($cacheKey) : false;

        if (!$cacheInfo) {
            $this->setHashOnCombinerFilters($cacheKey);

            $combiner = $this->prepareCombiner($assets);

            if ($this->useDeepHashing) {
                $factory = new AssetFactory($this->localPath);
                $lastMod = $factory->getLastModified($combiner);
            }
            else {
                $lastMod = $combiner->getLastModified();
            }

            $cacheInfo = [
                'version'   => $cacheKey.'-'.$lastMod,
                'etag'      => $cacheKey,
                'lastMod'   => $lastMod,
                'files'     => $assets,
                'path'      => $this->localPath,
                'extension' => $extension
            ];

            $this->putCache($cacheKey, $cacheInfo);
        }

        return $this->getCombinedUrl($cacheInfo['version']);
    }
protected function prepareRequest(array $assets, $localPath = null)
    {
        if (substr($localPath, -1) != '/') {
            $localPath = $localPath.'/';
        }

        $this->localPath = $localPath;
        $this->storagePath = storage_path('cms/combiner/assets');

        list($assets, $extension) = $this->prepareAssets($assets);

        /*
         * Cache and process
         */
        $cacheKey = $this->getCacheKey($assets);
        $cacheInfo = $this->useCache ? $this->getCache($cacheKey) : false;

        if (!$cacheInfo) {
            $this->setHashOnCombinerFilters($cacheKey);

            $combiner = $this->prepareCombiner($assets);

            if ($this->useDeepHashing) {
                $factory = new AssetFactory($this->localPath);
                $lastMod = $factory->getLastModified($combiner);
            }
            else {
                $lastMod = $combiner->getLastModified();
            }

            $cacheInfo = [
                'version'   => $cacheKey.'-'.$lastMod,
                'etag'      => $cacheKey,
                'lastMod'   => $lastMod,
                'files'     => $assets,
                'path'      => $this->localPath,
                'extension' => $extension
            ];

            $this->putCache($cacheKey, $cacheInfo);
        }

        return $this->getCombinedUrl($cacheInfo['version']);
    }
protected function prepareRequest ( array $ assets , $ localPath = null ) { if ( substr ( $ localPath , - 1 ) != '/' ) { $ localPath = $ localPath . '/' ; } $ this -> localPath = $ localPath ; $ this -> storagePath = storage_path ( 'cms/combiner/assets' ) ; list ( $ assets , $ extension ) = $ this -> prepareAssets ( $ assets ) ; /*
         * Cache and process
         */ $ cacheKey = $ this -> getCacheKey ( $ assets ) ; $ cacheInfo = $ this -> useCache ? $ this -> getCache ( $ cacheKey ) : false ; if ( ! $ cacheInfo ) { $ this -> setHashOnCombinerFilters ( $ cacheKey ) ; $ combiner = $ this -> prepareCombiner ( $ assets ) ; if ( $ this -> useDeepHashing ) { $ factory = new AssetFactory ( $ this -> localPath ) ; $ lastMod = $ factory -> getLastModified ( $ combiner ) ; } else { $ lastMod = $ combiner -> getLastModified ( ) ; } $ cacheInfo = [ 'version' => $ cacheKey . '-' . $ lastMod , 'etag' => $ cacheKey , 'lastMod' => $ lastMod , 'files' => $ assets , 'path' => $ this -> localPath , 'extension' => $ extension ] ; $ this -> putCache ( $ cacheKey , $ cacheInfo ) ; } return $ this -> getCombinedUrl ( $ cacheInfo [ 'version' ] ) ; }
Combines asset file references of a single type to produce
a URL reference to the combined contents.
@param array $assets List of asset files.
@param string $localPath File extension, used for aesthetic purposes only.
@return string URL to contents.
Combines asset file references of a single type to produce a URL reference to the combined contents .