public function getCdrFile(): string
    {
        $name = static::filterFilename($this->name);

        // get attributes
        $comment = $this->opt->getComment();

        // get dos timestamp
        $time = static::dosTime($this->opt->getTime()->getTimestamp());

        $footer = $this->buildZip64ExtraBlock();

        $fields = [
            ['V', ZipStream::CDR_FILE_SIGNATURE],   // Central file header signature
            ['v', ZipStream::ZIP_VERSION_MADE_BY],  // Made by version
            ['v', $this->version->getValue()],      // Extract by version
            ['v', $this->bits],                     // General purpose bit flags - data descriptor flag set
            ['v', $this->method->getValue()],       // Compression method
            ['V', $time],                           // Timestamp (DOS Format)
            ['V', $this->crc],                      // CRC32
            ['V', $this->zlen->getLowFF()],         // Compressed Data Length
            ['V', $this->len->getLowFF()],          // Original Data Length
            ['v', strlen($name)],                   // Length of filename
            ['v', strlen($footer)],                 // Extra data len (see above)
            ['v', strlen($comment)],                // Length of comment
            ['v', 0],                               // Disk number
            ['v', 0],                               // Internal File Attributes
            ['V', 32],                              // External File Attributes
            ['V', $this->ofs->getLowFF()]           // Relative offset of local header
        ];

        // pack fields, then append name and comment
        $header = ZipStream::packFields($fields);

        return $header . $name . $footer . $comment;
    }
public function getCdrFile(): string
    {
        $name = static::filterFilename($this->name);

        // get attributes
        $comment = $this->opt->getComment();

        // get dos timestamp
        $time = static::dosTime($this->opt->getTime()->getTimestamp());

        $footer = $this->buildZip64ExtraBlock();

        $fields = [
            ['V', ZipStream::CDR_FILE_SIGNATURE],   // Central file header signature
            ['v', ZipStream::ZIP_VERSION_MADE_BY],  // Made by version
            ['v', $this->version->getValue()],      // Extract by version
            ['v', $this->bits],                     // General purpose bit flags - data descriptor flag set
            ['v', $this->method->getValue()],       // Compression method
            ['V', $time],                           // Timestamp (DOS Format)
            ['V', $this->crc],                      // CRC32
            ['V', $this->zlen->getLowFF()],         // Compressed Data Length
            ['V', $this->len->getLowFF()],          // Original Data Length
            ['v', strlen($name)],                   // Length of filename
            ['v', strlen($footer)],                 // Extra data len (see above)
            ['v', strlen($comment)],                // Length of comment
            ['v', 0],                               // Disk number
            ['v', 0],                               // Internal File Attributes
            ['V', 32],                              // External File Attributes
            ['V', $this->ofs->getLowFF()]           // Relative offset of local header
        ];

        // pack fields, then append name and comment
        $header = ZipStream::packFields($fields);

        return $header . $name . $footer . $comment;
    }
public function getCdrFile ( ) : string { $ name = static :: filterFilename ( $ this -> name ) ; // get attributes $ comment = $ this -> opt -> getComment ( ) ; // get dos timestamp $ time = static :: dosTime ( $ this -> opt -> getTime ( ) -> getTimestamp ( ) ) ; $ footer = $ this -> buildZip64ExtraBlock ( ) ; $ fields = [ [ 'V' , ZipStream :: CDR_FILE_SIGNATURE ] , // Central file header signature [ 'v' , ZipStream :: ZIP_VERSION_MADE_BY ] , // Made by version [ 'v' , $ this -> version -> getValue ( ) ] , // Extract by version [ 'v' , $ this -> bits ] , // General purpose bit flags - data descriptor flag set [ 'v' , $ this -> method -> getValue ( ) ] , // Compression method [ 'V' , $ time ] , // Timestamp (DOS Format) [ 'V' , $ this -> crc ] , // CRC32 [ 'V' , $ this -> zlen -> getLowFF ( ) ] , // Compressed Data Length [ 'V' , $ this -> len -> getLowFF ( ) ] , // Original Data Length [ 'v' , strlen ( $ name ) ] , // Length of filename [ 'v' , strlen ( $ footer ) ] , // Extra data len (see above) [ 'v' , strlen ( $ comment ) ] , // Length of comment [ 'v' , 0 ] , // Disk number [ 'v' , 0 ] , // Internal File Attributes [ 'V' , 32 ] , // External File Attributes [ 'V' , $ this -> ofs -> getLowFF ( ) ] // Relative offset of local header ] ; // pack fields, then append name and comment $ header = ZipStream :: packFields ( $ fields ) ; return $ header . $ name . $ footer . $ comment ; }
Send CDR record for specified file.

@return string
Send CDR record for specified file .