original_string: public static function zip_get_central_end($fp, $filesize) {
          // Find end of central directory record.
          fseek($fp, $filesize - 22);
          $info = unpack('Vsig', fread($fp, 4));
          if ($info['sig'] === 0x06054b50) {
              // There is no comment.
              fseek($fp, $filesize - 22);
              $data = fread($fp, 22);
          } else {
              // There is some comment with 0xFF max size - that is 65557.
              fseek($fp, $filesize - 65557);
              $data = fread($fp, 65557);
          }
  
          $pos = strpos($data, pack('V', 0x06054b50));
          if ($pos === false) {
              // Borked ZIP structure!
              return false;
          }
          $centralend = unpack('Vsig/vdisk/vdisk_start/vdisk_entries/ventries/Vsize/Voffset/vcomment_length', substr($data, $pos, 22));
          if ($centralend['comment_length']) {
              $centralend['comment'] = substr($data, 22, $centralend['comment_length']);
          } else {
              $centralend['comment'] = '';
          }
  
          return $centralend;
      }
code: public static function zip_get_central_end($fp, $filesize) {
          // Find end of central directory record.
          fseek($fp, $filesize - 22);
          $info = unpack('Vsig', fread($fp, 4));
          if ($info['sig'] === 0x06054b50) {
              // There is no comment.
              fseek($fp, $filesize - 22);
              $data = fread($fp, 22);
          } else {
              // There is some comment with 0xFF max size - that is 65557.
              fseek($fp, $filesize - 65557);
              $data = fread($fp, 65557);
          }
  
          $pos = strpos($data, pack('V', 0x06054b50));
          if ($pos === false) {
              // Borked ZIP structure!
              return false;
          }
          $centralend = unpack('Vsig/vdisk/vdisk_start/vdisk_entries/ventries/Vsize/Voffset/vcomment_length', substr($data, $pos, 22));
          if ($centralend['comment_length']) {
              $centralend['comment'] = substr($data, 22, $centralend['comment_length']);
          } else {
              $centralend['comment'] = '';
          }
  
          return $centralend;
      }
code_tokens: public static function zip_get_central_end ( $ fp , $ filesize ) { // Find end of central directory record. fseek ( $ fp , $ filesize - 22 ) ; $ info = unpack ( 'Vsig' , fread ( $ fp , 4 ) ) ; if ( $ info [ 'sig' ] === 0x06054b50 ) { // There is no comment. fseek ( $ fp , $ filesize - 22 ) ; $ data = fread ( $ fp , 22 ) ; } else { // There is some comment with 0xFF max size - that is 65557. fseek ( $ fp , $ filesize - 65557 ) ; $ data = fread ( $ fp , 65557 ) ; } $ pos = strpos ( $ data , pack ( 'V' , 0x06054b50 ) ) ; if ( $ pos === false ) { // Borked ZIP structure! return false ; } $ centralend = unpack ( 'Vsig/vdisk/vdisk_start/vdisk_entries/ventries/Vsize/Voffset/vcomment_length' , substr ( $ data , $ pos , 22 ) ) ; if ( $ centralend [ 'comment_length' ] ) { $ centralend [ 'comment' ] = substr ( $ data , 22 , $ centralend [ 'comment_length' ] ) ; } else { $ centralend [ 'comment' ] = '' ; } return $ centralend ; }
docstring: Read end of central signature of ZIP file.
  @internal
  @static
  @param resource $fp
  @param int $filesize
  @return array|bool
docstring_tokens: Read end of central signature of ZIP file .