src/Zip.php
protected function readCentralDir()
    {
        $size = filesize($this->file);
        if ($size < 277) {
            $maximum_size = $size;
        } else {
            $maximum_size = 277;
        }

        @fseek($this->fh, $size - $maximum_size);
        $pos   = ftell($this->fh);
        $bytes = 0x00000000;

        while ($pos < $size) {
            $byte  = @fread($this->fh, 1);
            $bytes = (($bytes << 8) & 0xFFFFFFFF) | ord($byte);
            if ($bytes == 0x504b0506) {
                break;
            }
            $pos++;
        }

        $data = unpack(
            'vdisk/vdisk_start/vdisk_entries/ventries/Vsize/Voffset/vcomment_size',
            fread($this->fh, 18)
        );

        if ($data['comment_size'] != 0) {
            $centd['comment'] = fread($this->fh, $data['comment_size']);
        } else {
            $centd['comment'] = '';
        }
        $centd['entries']      = $data['entries'];
        $centd['disk_entries'] = $data['disk_entries'];
        $centd['offset']       = $data['offset'];
        $centd['disk_start']   = $data['disk_start'];
        $centd['size']         = $data['size'];
        $centd['disk']         = $data['disk'];
        return $centd;
    }
protected function readCentralDir()
    {
        $size = filesize($this->file);
        if ($size < 277) {
            $maximum_size = $size;
        } else {
            $maximum_size = 277;
        }

        @fseek($this->fh, $size - $maximum_size);
        $pos   = ftell($this->fh);
        $bytes = 0x00000000;

        while ($pos < $size) {
            $byte  = @fread($this->fh, 1);
            $bytes = (($bytes << 8) & 0xFFFFFFFF) | ord($byte);
            if ($bytes == 0x504b0506) {
                break;
            }
            $pos++;
        }

        $data = unpack(
            'vdisk/vdisk_start/vdisk_entries/ventries/Vsize/Voffset/vcomment_size',
            fread($this->fh, 18)
        );

        if ($data['comment_size'] != 0) {
            $centd['comment'] = fread($this->fh, $data['comment_size']);
        } else {
            $centd['comment'] = '';
        }
        $centd['entries']      = $data['entries'];
        $centd['disk_entries'] = $data['disk_entries'];
        $centd['offset']       = $data['offset'];
        $centd['disk_start']   = $data['disk_start'];
        $centd['size']         = $data['size'];
        $centd['disk']         = $data['disk'];
        return $centd;
    }
protected function readCentralDir ( ) { $ size = filesize ( $ this -> file ) ; if ( $ size < 277 ) { $ maximum_size = $ size ; } else { $ maximum_size = 277 ; } @ fseek ( $ this -> fh , $ size - $ maximum_size ) ; $ pos = ftell ( $ this -> fh ) ; $ bytes = 0x00000000 ; while ( $ pos < $ size ) { $ byte = @ fread ( $ this -> fh , 1 ) ; $ bytes = ( ( $ bytes << 8 ) & 0xFFFFFFFF ) | ord ( $ byte ) ; if ( $ bytes == 0x504b0506 ) { break ; } $ pos ++ ; } $ data = unpack ( 'vdisk/vdisk_start/vdisk_entries/ventries/Vsize/Voffset/vcomment_size' , fread ( $ this -> fh , 18 ) ) ; if ( $ data [ 'comment_size' ] != 0 ) { $ centd [ 'comment' ] = fread ( $ this -> fh , $ data [ 'comment_size' ] ) ; } else { $ centd [ 'comment' ] = '' ; } $ centd [ 'entries' ] = $ data [ 'entries' ] ; $ centd [ 'disk_entries' ] = $ data [ 'disk_entries' ] ; $ centd [ 'offset' ] = $ data [ 'offset' ] ; $ centd [ 'disk_start' ] = $ data [ 'disk_start' ] ; $ centd [ 'size' ] = $ data [ 'size' ] ; $ centd [ 'disk' ] = $ data [ 'disk' ] ; return $ centd ; }
Read the central directory

This key-value list contains general information about the ZIP file

@return array
Read the central directory