AsperaGmbH Xlsx Reader Versions Save

xlsx-reader is a PHP library for fast and efficient reading of XLSX spreadsheet files. Its focus is on reading the data contained within XLSX files, disregarding all document styling beyond that which is strictly necessary for data type recognition. It is built to be usable for very big XLSX files in the magnitude of multiple GBs.

v1.1.0

11 months ago
  • Full support for PHP 8.2.
  • New ReaderConfiguration property: $xml_reader_flags (settable via setXmlReaderFlags()) Will be given to any usage of XMLReader, allowing declaration of libxml constants such as LIBXML_PARSEHUGE.
  • Added dependency to ext-libxml in composer.json. (Was already required before, but wasn't explicitly noted as such.)
  • Fixed issues with system date/time format specifications in XLSX file.

v1.0.0

1 year ago

Summary:

  • Minimum supported PHP version increased from 5.6 to 7.1.
  • Full support for PHP 8.1.
  • Iterator adjustments. (Details further below.)
  • General code cleanup and bugfixes.

Breaking changes:

  • Type hints from PHP 7.0 and 7.1 were added. Take note of this if you happen to extend any of the reader's classes in your code.
  • Trying to iterate through a document without first calling open() will now throw an exception.
  • The key of each row is 1-based now. This is to be in alignment with the values of the "r" attribute in the actual XLSX document, which this method represents.
  • The count() method was removed, as it didn't provide the intended functionality. Its actual functionality, which is to count how many rows were read so far, can be easily emulated by incrementing a counter variable within the iteration loop.
  • Exception messages and -types in case of errors were adjusted. If you rely on their exact types/wording in any way, make sure to adjust your exception handling accordingly.
  • The methods setDecimalSeparator() and setThousandsSeparator() were removed. (This change was already communicated in a previous version, but not completely enforced yet.)
  • indexFromColumnLetter() no longer returns false on error. An exception is thrown instead.

Breaking changes for code addressing SharedStrings directly:

  • SharedStrings now manages its own temporary files. Manual management from the outer scope is no longer necessary.
  • Attempting to read SharedStrings data after closing the SharedStrings instance will now throw an exception.
  • setHandleCurrentIndex() and setCount() have been removed from SharedStringsOptimizedFile, as they served no real function.

Non-breaking changes:

  • Calling close() now properly cleans up unnecessary resources from the reader that may have an impact on its memory consumption.
  • Documentation improvements.

Iterator adjustments:

The Iterator interface allows iteration through the document by using a foreach on the Reader instance. The previous implementation of the reader did not follow the Iterator interface rules correctly. The adjustments in this update rectify this. As a result, take note of the following changes:

If you're using foreach on the Reader instance to read the document contents (like the example code in the readme):

  • The key of each element now represents the actual row number, which, in XLSX, starts counting at 1. (Previous versions started at 0.)

If you're calling the methods current() or key() directly:

  • Do not call current() or key() without first checking the return value of valid(). Trying to access invalid positions will now throw an exception.
  • current() and key() both start at the first position now, regardless of the order in which they are called.
  • key() is 1-based now. This is to be in alignment with the values of the "r" attribute in the actual XLSX document, which this method represents.

v0.10.2

1 year ago
  • Suppress PHP 8.1 notices about return type incompatibilities

v0.10.1

2 years ago
  • Fixed an issue that made returnUnformatted overrule all configuration options for date/time values.

v0.10.0

2 years ago

Breaking changes:

  • next() no longer returns the current row. Use current() instead.
  • SkipEmptyCells needs to be supplied as a ReaderSkipConfiguration constant now.

Non-breaking changes:

  • New configuration option "SkipEmptyRows". Use it to exclude either all empty rows or all empty rows at the end of the document from the output. Use ReaderSkipConfiguration values to configure it.
  • Configuration option "SkipEmptyCells" can now be configured to only skip trailing empty cells.
  • Added support for scientific notation format.
  • Fraction formatting support was enhanced.
  • Fixed: "General" format does not output values as decimal, if they are stored using scientific notation internally.
  • Fixed: Assorted edge cases in number formatting.
  • Added notes to documentation of "ReturnUnformatted" and "ReturnPercentageDecimal" about possible gotchas.
  • Internal refactorings.

v0.9.0

2 years ago

Breaking changes:

  • Reader configuration options must now be supplied to the Reader constructor via a ReaderConfiguration instance. Supplying configuration options via an array is no longer supported.
  • When the "ReturnUnformatted" option is set, percentage values are now returned as strings instead of numbers. This aligns their behavior with that of other values.
  • setDecimalSeparator() and setThousandsSeparator() methods have been removed, as they no longer had any function.
  • Forced date/time format '' (empty string) gets interpreted correctly now.

Non-breaking changes:

  • New configuration option "ReturnPercentageDecimal". When set to true, percentage values will be returned using their technical, internal representation ('50%' => '0.5') rather than how they are displayed within a document ('50%' => '50').
  • Remove unnecessary restriction of custom formats to predetermined formats from the official specification documents.
  • SharedStringsConfiguration calls can now be chained.
  • Fix potential resource leaks caused by not closing reader instances.
  • Update README.md to reflect the current code state.

v0.8.2

2 years ago
  • Added support for empty rows with attributes (or: self-closing row tags).
  • Minor improvement of test handling.

v0.8.1

3 years ago
  • Added support for multi-range row span values, fixing issues caused by sheets that use them.

v0.8.0

4 years ago

Breaking changes:

  • Public-facing method "setCurrencyCode" has been removed, as the currency_code value had no effect to begin with.

Non-breaking changes:

  • New configuration option "ReturnUnformatted". If set to true, cell values will be returned without number formatting applied. (Note: Date/Time values are still controlled by the "ReturnDateTimeObjects" option.)
  • Number format parsing has been improved. The reader is now capable of parsing more complex number formats.
  • General format now outputs cell values as-is, instead of attempting to cast them to a float.

v0.7.7

4 years ago
  • Fixed issues regarding negative date/time values, causing very early date definitions to lead to unexpected errors.
  • Fixed number formatting not being applied in all expected cases.