@@ -48,7 +48,7 @@ class ZipStreamer {
48
48
private $ extFileAttrFile ;
49
49
private $ extFileAttrDir ;
50
50
51
- /** @var stream output stream zip file is written to */
51
+ /** @var resource $outStream output stream zip file is written to */
52
52
private $ outStream ;
53
53
/** @var boolean zip64 enabled */
54
54
private $ zip64 = True ;
@@ -438,7 +438,7 @@ private function addDataDescriptor($dataLength, $gzLength, $dataCRC32) {
438
438
439
439
private function buildZip64EndOfCentralDirectoryRecord ($ cdRecLength ) {
440
440
$ versionToExtract = $ this ->getVersionToExtract (False );
441
- $ cdRecCount = sizeof ($ this ->cdRec );
441
+ $ cdRecCount = count ($ this ->cdRec );
442
442
443
443
return ''
444
444
. pack32le (self ::ZIP64_END_OF_CENTRAL_DIRECTORY ) // zip64 end of central dir signature 4 bytes (0x06064b50)
@@ -517,12 +517,12 @@ private function buildCentralDirectoryHeader($filePath, $timestamp, $gpFlags,
517
517
private function buildEndOfCentralDirectoryRecord ($ cdRecLength ) {
518
518
if ($ this ->zip64 ) {
519
519
$ diskNumber = -1 ;
520
- $ cdRecCount = min (sizeof ($ this ->cdRec ), 0xffff );
520
+ $ cdRecCount = min (count ($ this ->cdRec ), 0xffff );
521
521
$ cdRecLength = -1 ;
522
522
$ offset = -1 ;
523
523
} else {
524
524
$ diskNumber = 0 ;
525
- $ cdRecCount = sizeof ($ this ->cdRec );
525
+ $ cdRecCount = count ($ this ->cdRec );
526
526
$ offset = $ this ->offset ->getLoBytes ();
527
527
}
528
528
//throw new \Exception(sprintf("zip64 %d diskno %d", $this->zip64, $diskNumber));
@@ -646,7 +646,7 @@ protected function __construct($level) {
646
646
$ class = self ::PECL2_DEFLATE_STREAM_CLASS ;
647
647
}
648
648
if (!class_exists ($ class )) {
649
- new \Exception ('unable to instantiate PECL deflate stream (requires pecl_http >= 0.10) ' );
649
+ throw new \Exception ('unable to instantiate PECL deflate stream (requires pecl_http >= 0.10) ' );
650
650
}
651
651
652
652
$ deflateFlags = constant ($ class . '::TYPE_RAW ' );
@@ -723,8 +723,8 @@ class GPFLAGS {
723
723
724
724
// compression settings for deflate/deflate64
725
725
const DEFL_NORM = 0x0000 ; // normal compression (COMP1 and COMP2 not set)
726
- const DEFL_MAX = COMP1 ; // maximum compression
727
- const DEFL_FAST = COMP2 ; // fast compression
726
+ const DEFL_MAX = self :: COMP1 ; // maximum compression
727
+ const DEFL_FAST = self :: COMP2 ; // fast compression
728
728
const DEFL_SFAST = 0x0006 ; // superfast compression (COMP1 and COMP2 set)
729
729
}
730
730
0 commit comments