Skip to content
MNB PHPExcelDeveloper Guide
AI

ODS library

ODS Streaming and Safety Options

Bound repeated rows and columns, source size, row count, and memory while reading ODS content.xml.

Level
Advanced
Reading time
7 min
Package
mnb/mnb-phpexcel-ods
Updated

Protect against repeated-element expansion#

PHP
$rows = Ods::read('upload.ods', [
    'max_file_bytes' => 50 * 1024 * 1024,
    'max_source_rows' => 500000,
    'max_repeated_rows' => 100000,
    'max_repeated_columns' => 5000,
    'source_limit_rows' => 100000,
])->sheet(1)->rows();

How the forward-only reader works#

  1. Validate the ODS ZIP package

    The reader checks the mimetype and required content.xml entry.

  2. Open content.xml through ZIP

    XMLReader advances through tables and selected rows without building a complete document tree.

  3. Expand bounded repeats

    ODS repeat attributes are expanded only within configured safety limits.

  4. Project selected cells

    Unselected columns are skipped before the delivered row is built.