MNB PHPExcelDeveloper Guide
v2.0.5
ODS module

ODS Streaming and Safety Options

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

Updated

LevelAdvancedReading time7 minPackagemnb/mnb-phpexcel

What you will learn

  • Understand how ODS repeated row and column markers are expanded.
  • Set limits that prevent malicious or accidental expansion.
  • Use source row slicing and projection for bounded processing.

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.