Feature 5388: Print Invoices (documents) list gets too long. Fixed by default 180...
[fa-stable.git] / includes / archive.inc
index 413e33081d30913f97136d45c4eb22835baa7b1d..1b9e11efe4735753b7c1d8979e77a4b446f921ae 100644 (file)
@@ -16,7 +16,7 @@
 
 class archive
 {
-       function archive($name)
+       function __construct($name)
        {
                $this->options = array (
                        'basedir' => ".",
@@ -238,9 +238,9 @@ class archive
 
 class tar_file extends archive
 {
-       function tar_file($name)
+       function __construct($name)
        {
-               $this->archive($name);
+               parent::__construct($name);
                $this->options['type'] = "tar";
        }
 
@@ -322,7 +322,10 @@ class tar_file extends archive
 
                        while ($block = fread($fp, 512))
                        {
-                               $temp = unpack("a100name/a8mode/a8uid/a8gid/a12size/a12mtime/a8checksum/a1type/a100symlink/a6magic/a2temp/a32temp/a32temp/a8temp/a8temp/a155prefix/a12temp", $block);
+                               if (version_compare(PHP_VERSION, '5.5.0') >= 0)
+                                       $temp = unpack("Z100name/Z8mode/Z8uid/Z8gid/Z12size/Z12mtime/Z8checksum/Z1type/Z100symlink/Z6magic/Z2temp/Z32temp/Z32temp/Z8temp/Z8temp/Z155prefix/Z12temp", $block);
+                               else
+                    $temp = unpack("a100name/a8mode/a8uid/a8gid/a12size/a12mtime/a8checksum/a1type/a100symlink/a6magic/a2temp/a32temp/a32temp/a8temp/a8temp/a155prefix/a12temp", $block);                                      
                                $file = array (
                                        'name' => rtrim($temp['prefix']) . rtrim($temp['name']),
                                        'stat' => array (
@@ -428,9 +431,9 @@ class tar_file extends archive
 
 class gzip_file extends tar_file
 {
-       function gzip_file($name)
+       function __construct($name)
        {
-               $this->tar_file($name);
+               parent::__construct($name);
                $this->options['type'] = "gzip";
        }