Line 53 | Line 53 |
---|
$filelist = filelist("$phpbb_root_path$src", '', '*'); krsort($filelist);
|
$filelist = filelist("$phpbb_root_path$src", '', '*'); krsort($filelist);
|
| /** * Commented out, as adding the folders produces corrupted archives
|
if ($src_path) { $this->data($src_path, '', true, stat("$phpbb_root_path$src")); }
|
if ($src_path) { $this->data($src_path, '', true, stat("$phpbb_root_path$src")); }
|
| */
|
foreach ($filelist as $path => $file_ary) {
|
foreach ($filelist as $path => $file_ary) {
|
| /** * Commented out, as adding the folders produces corrupted archives
|
if ($path) { // Same as for src_path
| if ($path) { // Same as for src_path
|
Line 68 | Line 73 |
---|
$this->data("$src_path$path", '', true, stat("$phpbb_root_path$src$path")); }
|
$this->data("$src_path$path", '', true, stat("$phpbb_root_path$src$path")); }
|
| */
|
foreach ($file_ary as $file) {
| foreach ($file_ary as $file) {
|
Line 79 | Line 85 |
---|
$this->data("$src_path$path$file", file_get_contents("$phpbb_root_path$src$path$file"), false, stat("$phpbb_root_path$src$path$file")); } }
|
$this->data("$src_path$path$file", file_get_contents("$phpbb_root_path$src$path$file"), false, stat("$phpbb_root_path$src$path$file")); } }
|
| } else { // $src does not exist return false;
|
}
return true;
| }
return true;
|
Line 89 | Line 100 |
---|
*/ function add_custom_file($src, $filename) {
|
*/ function add_custom_file($src, $filename) {
|
| if (!file_exists($src)) { return false; }
|
$this->data($filename, file_get_contents($src), false, stat($src)); return true; }
| $this->data($filename, file_get_contents($src), false, stat($src)); return true; }
|
Line 155 | Line 171 |
---|
*/ function compress_zip($mode, $file) {
|
*/ function compress_zip($mode, $file) {
|
return $this->fp = @fopen($file, $mode . 'b');
| $this->fp = @fopen($file, $mode . 'b');
if (!$this->fp) { trigger_error('Unable to open file ' . $file . ' [' . $mode . 'b]'); }
|
}
/**
| }
/**
|
Line 487 | Line 508 |
---|
function compress_tar($mode, $file, $type = '') { $type = (!$type) ? $file : $type;
|
function compress_tar($mode, $file, $type = '') { $type = (!$type) ? $file : $type;
|
$this->isgz = (strpos($type, '.tar.gz') !== false || strpos($type, '.tgz') !== false) ? true : false; $this->isbz = (strpos($type, '.tar.bz2') !== false) ? true : false;
| $this->isgz = preg_match('#(\.tar\.gz|\.tgz)$#', $type); $this->isbz = preg_match('#\.tar\.bz2$#', $type);
|
$this->mode = &$mode; $this->file = &$file;
| $this->mode = &$mode; $this->file = &$file;
|