Skip to content

Extracting a document for minification is missing \ZipArchive::CREATE flag #75

@ideb

Description

@ideb

Problem/Motivation

Deepl support document minification: https://github.com/DeepLcom/deepl-php?tab=readme-ov-file#document-minification

However, extracting the document for minification may fail because the ZipArchive->open call is missing the \ZipArchive::CREATE flag

Steps to reproduce

  1. Create a docx with a single word 'test'
  2. Call \DeepL\Translator::translateDocument with $options[TranslateDocumentOptions::ENABLE_DOCUMENT_MINIFICATION]
  3. Notice the call results in an exception:
    Failed to open ... as ZIP file.

Proposed resolution

Add \ZipArchive::CREATE flag to \DeepL\DocumentMinifier::extractZipTo

User interface changes

None

API changes

None

Data model changes

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions