/usr/share/php/kohana2/modules/archive/libraries/drivers/Archive/Gzip.php is in libkohana2-modules-php 2.3.4-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | <?php defined('SYSPATH') OR die('No direct access allowed.');
/**
* Archive library gzip driver.
*
* $Id: Gzip.php 3769 2008-12-15 00:48:56Z zombor $
*
* @package Archive
* @author Kohana Team
* @copyright (c) 2007-2008 Kohana Team
* @license http://kohanaphp.com/license.html
*/
class Archive_Gzip_Driver implements Archive_Driver {
public function create($paths, $filename = FALSE)
{
$archive = new Archive('tar');
foreach ($paths as $set)
{
$archive->add($set[0], $set[1]);
}
$gzfile = gzencode($archive->create());
if ($filename == FALSE)
{
return $gzfile;
}
if (substr($filename, -7) !== '.tar.gz')
{
// Append tar extension
$filename .= '.tar.gz';
}
// Create the file in binary write mode
$file = fopen($filename, 'wb');
// Lock the file
flock($file, LOCK_EX);
// Write the tar file
$return = fwrite($file, $gzfile);
// Unlock the file
flock($file, LOCK_UN);
// Close the file
fclose($file);
return (bool) $return;
}
public function add_data($file, $name, $contents = NULL)
{
return FALSE;
}
} // End Archive_Gzip_Driver Class
|