public function compressFile (string $filePath) : bool
    {
        $compressor = $this->getCompressor();

        if (null === $compressor)
        {
            return false;
        }

        $process = new Process(\array_merge($compressor, [$filePath]));
        $process->run();
        return $process->isSuccessful();
    }
public function compressFile (string $filePath) : bool
    {
        $compressor = $this->getCompressor();

        if (null === $compressor)
        {
            return false;
        }

        $process = new Process(\array_merge($compressor, [$filePath]));
        $process->run();
        return $process->isSuccessful();
    }
public function compressFile ( string $ filePath ) : bool { $ compressor = $ this -> getCompressor ( ) ; if ( null === $ compressor ) { return false ; } $ process = new Process ( \ array_merge ( $ compressor , [ $ filePath ] ) ) ; $ process -> run ( ) ; return $ process -> isSuccessful ( ) ; }
Tries to compress the given file and writes the output to the same path with added ".gz".

@param string $filePath
@return bool whether the file was compressed
Tries to compress the given file and writes the output to the same path with added . gz .