public function buildAsProduction(Collection $collection, $group)
    {
        // Get the assets of the given group from the collection. The collection is also responsible
        // for handling any ordering of the assets so that we just need to build them.
        $assets = $collection->getAssetsWithoutRaw($group);

        $entry = $this->manifest->make($identifier = $collection->getIdentifier());

        // Build the assets and transform the array into a newline separated string. We'll use this
        // as a basis for the collections fingerprint and it will decide as to whether the
        // collection needs to be rebuilt.
        $build = array_to_newlines($assets->map(function($asset) { return $asset->build(true); })->all());

        // If the build is empty then we'll reset the fingerprint on the manifest entry and throw the
        // exception as there's no point going any further.
        if (empty($build))
        {
            $entry->resetProductionFingerprint($group);

            throw new BuildNotRequiredException;
        }

        $fingerprint = $identifier.'-'.md5($build).'.'.$collection->getExtension($group);

        $path = $this->buildPath.'/'.$fingerprint;

        // If the collection has already been built and we're not forcing the build then we'll throw
        // the exception here as we don't need to rebuild the collection.
        if ($fingerprint == $entry->getProductionFingerprint($group) and ! $this->force and $this->files->exists($path))
        {
            throw new BuildNotRequiredException;
        }
        else
        {
            $this->files->put($path, $this->gzip($build));

            $entry->setProductionFingerprint($group, $fingerprint);
        }
    }
public function buildAsProduction(Collection $collection, $group)
    {
        // Get the assets of the given group from the collection. The collection is also responsible
        // for handling any ordering of the assets so that we just need to build them.
        $assets = $collection->getAssetsWithoutRaw($group);

        $entry = $this->manifest->make($identifier = $collection->getIdentifier());

        // Build the assets and transform the array into a newline separated string. We'll use this
        // as a basis for the collections fingerprint and it will decide as to whether the
        // collection needs to be rebuilt.
        $build = array_to_newlines($assets->map(function($asset) { return $asset->build(true); })->all());

        // If the build is empty then we'll reset the fingerprint on the manifest entry and throw the
        // exception as there's no point going any further.
        if (empty($build))
        {
            $entry->resetProductionFingerprint($group);

            throw new BuildNotRequiredException;
        }

        $fingerprint = $identifier.'-'.md5($build).'.'.$collection->getExtension($group);

        $path = $this->buildPath.'/'.$fingerprint;

        // If the collection has already been built and we're not forcing the build then we'll throw
        // the exception here as we don't need to rebuild the collection.
        if ($fingerprint == $entry->getProductionFingerprint($group) and ! $this->force and $this->files->exists($path))
        {
            throw new BuildNotRequiredException;
        }
        else
        {
            $this->files->put($path, $this->gzip($build));

            $entry->setProductionFingerprint($group, $fingerprint);
        }
    }
public function buildAsProduction ( Collection $ collection , $ group ) { // Get the assets of the given group from the collection. The collection is also responsible // for handling any ordering of the assets so that we just need to build them. $ assets = $ collection -> getAssetsWithoutRaw ( $ group ) ; $ entry = $ this -> manifest -> make ( $ identifier = $ collection -> getIdentifier ( ) ) ; // Build the assets and transform the array into a newline separated string. We'll use this // as a basis for the collections fingerprint and it will decide as to whether the // collection needs to be rebuilt. $ build = array_to_newlines ( $ assets -> map ( function ( $ asset ) { return $ asset -> build ( true ) ; } ) -> all ( ) ) ; // If the build is empty then we'll reset the fingerprint on the manifest entry and throw the // exception as there's no point going any further. if ( empty ( $ build ) ) { $ entry -> resetProductionFingerprint ( $ group ) ; throw new BuildNotRequiredException ; } $ fingerprint = $ identifier . '-' . md5 ( $ build ) . '.' . $ collection -> getExtension ( $ group ) ; $ path = $ this -> buildPath . '/' . $ fingerprint ; // If the collection has already been built and we're not forcing the build then we'll throw // the exception here as we don't need to rebuild the collection. if ( $ fingerprint == $ entry -> getProductionFingerprint ( $ group ) and ! $ this -> force and $ this -> files -> exists ( $ path ) ) { throw new BuildNotRequiredException ; } else { $ this -> files -> put ( $ path , $ this -> gzip ( $ build ) ) ; $ entry -> setProductionFingerprint ( $ group , $ fingerprint ) ; } }
Build a production collection.

@param  \Basset\Collection  $collection
@param  string  $group
@return void
@throws \Basset\Exceptions\BuildNotRequiredException
Build a production collection .