ODS Streaming and Safety Options
Bound repeated rows and columns, source size, row count, and memory while reading ODS content.xml.
Updated
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#
$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#
- Validate the ODS ZIP package
The reader checks the mimetype and required
content.xmlentry. - Open content.xml through ZIP
XMLReader advances through tables and selected rows without building a complete document tree.
- Expand bounded repeats
ODS repeat attributes are expanded only within configured safety limits.
- Project selected cells
Unselected columns are skipped before the delivered row is built.
Was this guide useful?Use GitHub issues for corrections, missing examples, or unclear behavior.
Open an issue