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 228 | Line 249 |
---|
{ trigger_error("Could not create directory $folder"); }
|
{ trigger_error("Could not create directory $folder"); }
|
@chmod($str, 0777);
| phpbb_chmod($str, CHMOD_READ | CHMOD_WRITE);
|
} } }
| } } }
|
Line 257 | Line 278 |
---|
{ trigger_error("Could not create directory $folder"); }
|
{ trigger_error("Could not create directory $folder"); }
|
@chmod($str, 0777);
| phpbb_chmod($str, CHMOD_READ | CHMOD_WRITE);
|
} } }
| } } }
|
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;
|
Line 544 | Line 565 |
---|
{ trigger_error("Could not create directory $folder"); }
|
{ trigger_error("Could not create directory $folder"); }
|
@chmod($str, 0777);
| phpbb_chmod($str, CHMOD_READ | CHMOD_WRITE);
|
} } }
| } } }
|
Line 571 | Line 592 |
---|
{ trigger_error("Could not create directory $folder"); }
|
{ trigger_error("Could not create directory $folder"); }
|
@chmod($str, 0777);
| phpbb_chmod($str, CHMOD_READ | CHMOD_WRITE);
|
} }
| } }
|
Line 580 | Line 601 |
---|
{ trigger_error("Couldn't create file $filename"); }
|
{ trigger_error("Couldn't create file $filename"); }
|
@chmod($target_filename, 0777);
| phpbb_chmod($target_filename, CHMOD_READ);
|
// Grab the file contents fwrite($fp, ($filesize) ? $fzread($this->fp, ($filesize + 511) &~ 511) : '', $filesize);
| // Grab the file contents fwrite($fp, ($filesize) ? $fzread($this->fp, ($filesize + 511) &~ 511) : '', $filesize);
|