Skip to content

v4.0.0

Latest

Choose a tag to compare

@aVadim483 aVadim483 released this 22 Jul 20:38

Added

  • Reading of legacy XLS workbooks (Excel 97-2003, BIFF8). Excel::open() now chooses the reader
    from the file signature, so XLSX and XLS are opened the same way; the file extension is never
    consulted. Excel::openXls() opens a workbook explicitly and Excel::isXls() exposes the test.
    See docs/21-xls.md.
    • Values and types, with dates detected through number formats
    • Cell styles: fonts, fills, borders, alignment, number formats and palette colours
    • Formula text, including shared formulas
    • Embedded images
    • Multiple worksheets, hidden and very hidden sheets, merged cells, sheet dimensions
    • Encrypted workbooks and BIFF5/BIFF7 files are rejected with a message saying which
  • AbstractBook and AbstractSheet, holding the format-independent half of the readers: read areas,
    key modes, result-mode flags, the row generator and every read* helper. XLSX and XLS share one
    implementation of the whole public reading API.
  • withHeader() now accepts an optional list of column names: withHeader(['name', 'birthday']). The
    header row is still skipped, but the names come from the list instead of from its values. Names are
    positional - the first name goes to the first column of the read area - so no column letters are
    involved and the same call works on a sheet whose data does not start at A1. A shorter list renames
    only the columns it covers. Supported for XLSX, XLS and CSV. Calling it with no argument is
    unchanged. This mirrors the naming of writeHeader() in the sibling fast-excel-writer.

Fixed

  • Sheet::readCellsWithStylesFrom() returned bare cell values instead of values with styles: it called
    readCells() rather than readCellsWithStyles(), and passed the style key into a bool parameter.
  • Sheet::readCellsWithStyles($styleKey) never narrowed the result to the requested property. The key
    was looked up on the nested style, where properties sit inside their group, so 'fill-color' - the
    example in the method's own docblock - always returned the complete style instead.
  • Complete cell styles - getCompleteStyleByIdx(), readCellsWithStyles() and everything built on
    them - died with Call to undefined method DOMText::getAttribute() on workbooks whose styles.xml
    is written with indentation, which several writers do.

Changed

  • Reading XLSX is about 1.5 times faster. Values, types and peak memory are unchanged.
  • The accessors that returned a concrete Sheet now return AbstractSheet, and the fluent setters on
    the workbook return AbstractBook. The objects handed back are unchanged, and a subclass may still
    narrow the return type back, so this only affects explicit type declarations in calling code.

Full changelog: CHANGELOG.md · по-русски