Skip to content

Doxswap v2.0.0

Latest

Choose a tag to compare

@deemonic deemonic released this 03 Nov 12:02
9f95511

Doxswap 2.0 refactors the package around constructor injection and slimmer format classes, and fixes several conversion bugs.

This is a major release with breaking changes. Apps that only call Doxswap::convert() through the facade usually need no code changes. Apps that catch specific exceptions, build Doxswap classes with new, or add custom formats should read the upgrade guide.

Breaking changes

  • LibreOffice failures and timeouts throw ConversionFailedException, not Symfony's ProcessFailedException. The original exception is available from getPrevious().
  • Classes take their settings through constructors. Resolve them from the container (app('doxswap') or the facade) instead of using new.
  • ConvertibleFormat::getDriver() now takes the target format. Custom formats should extend AbstractFormat or AbstractImageFormat.
  • Filename::rename() is now an instance method.

New

  • Doxswap::supports($from, $to) and Doxswap::supportedFormats().
  • drivers.process_timeout config option (DOXSWAP_PROCESS_TIMEOUT, default 120 seconds, null for no limit).
  • LIBREOFFICE_PATH env var, with LIBRE_OFFICE_PATH still read as a fallback.
  • FormatNotFoundException and ImagickExtensionNotFoundException.
  • Config changes made at runtime now apply to later conversions.

Fixes

  • Output names keep the original filename: docx-guide.docx now converts to docx-guide.pdf instead of failing.
  • File extensions and target formats are matched regardless of case, so Report.DOCX and 'PDF' work.
  • With perform_cleanup on, the input file is deleted at the path passed to convert(), so nested inputs like reports/input.docx are cleaned up correctly.
  • Tested on Laravel 12 and 13.

Full Changelog: v1.0.3...v2.0.0