Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reader writer flags #2136

Merged
merged 13 commits into from
Jun 4, 2021
Merged

Reader writer flags #2136

merged 13 commits into from
Jun 4, 2021

Conversation

MarkBaker
Copy link
Member

@MarkBaker MarkBaker commented Jun 1, 2021

This is:

- [ ] a bugfix
- [X] a new feature

Checklist:

Why this change is needed?

Improved use of Readers/Writers by allowing passing flags in the load()/save() methods to support functionality like includeCharts, preparatory to adding support for pivot tables with the same optional mechanism.

Examples:

$reader = IOFactory::createReaderForFile("spreadsheetWithCharts.xlsx");
$reader->load("spreadsheetWithCharts.xlsx", $reader::LOAD_WITH_CHARTS);

or

$spreadsheet = IOFactory::load("spreadsheetWithCharts.xlsx", IReader::LOAD_WITH_CHARTS);

The same functionality can also be applied to other "boolean" features like readDataOnly. Once those features are enabled in this manner, it will be possible to combine multiple flags in a load request:

$reader = IOFactory::createReaderForFile("spreadsheetWithCharts.xlsx");
$reader->load("spreadsheetWithCharts.xlsx", $reader::LOAD_WITH_CHARTS | $reader::LOAD_DATA_ONLY | $reader::LOAD_WITH_PIVOT_TABLES);

or

$spreadsheet = IOFactory::load("spreadsheetWithCharts.xlsx", IReader::LOAD_WITH_CHARTS | IRreader::LOAD_DATA_ONLY | IReader::LOAD_WITH_PIVOT_TABLES);

@MarkBaker MarkBaker merged commit 19724e3 into master Jun 4, 2021
@MarkBaker MarkBaker deleted the Reader-Writer-Flags branch June 4, 2021 11:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant