public function pack($from, $to)
    {
        if (($gzip = gzopen($to, 'wb')) === false) {
            throw new Exception('Unable create compressed file.');
        }

        if (($source = fopen($from, 'rb')) === false) {
            throw new Exception('Unable open the compression source file.');
        }

        while (!feof($source)) {
            $content = fread($source, 4096);
            gzwrite($gzip, $content, strlen($content));
        }

        gzclose($gzip);
        fclose($source);
    }