public static function addCompress(\Phar $phar, $configuration)
    {
        if ($configuration === false) {
            return;
        }
        echo "\nAdd compress";
        foreach ($configuration as $compress) {
            if (in_array($compress, [\Phar::NONE, \Phar::GZ, \Phar::BZ2], true) === false) {
                throw new InvalidConfigException("Invalid configuration. Unknown compress type '{$compress}'.");
            }
            if (\Phar::canCompress($compress) === true) {
                $phar->compress($compress);
            }
        }
    }
public static function addCompress(\Phar $phar, $configuration)
    {
        if ($configuration === false) {
            return;
        }
        echo "\nAdd compress";
        foreach ($configuration as $compress) {
            if (in_array($compress, [\Phar::NONE, \Phar::GZ, \Phar::BZ2], true) === false) {
                throw new InvalidConfigException("Invalid configuration. Unknown compress type '{$compress}'.");
            }
            if (\Phar::canCompress($compress) === true) {
                $phar->compress($compress);
            }
        }
    }
public static function addCompress ( \ Phar $ phar , $ configuration ) { if ( $ configuration === false ) { return ; } echo "\nAdd compress" ; foreach ( $ configuration as $ compress ) { if ( in_array ( $ compress , [ \ Phar :: NONE , \ Phar :: GZ , \ Phar :: BZ2 ] , true ) === false ) { throw new InvalidConfigException ( "Invalid configuration. Unknown compress type '{$compress}'." ) ; } if ( \ Phar :: canCompress ( $ compress ) === true ) { $ phar -> compress ( $ compress ) ; } } }
Add compress to phar file.

@param \Phar $phar          PHAR object to update.
@param int[] $configuration List of compress types.

@throws \yii\base\InvalidConfigException On wrong compress type set (index0h\phar\Module::compress).
Add compress to phar file .