Download the PHP package wpdev/odata-feed without Composer
On this page you can find all versions of the php package wpdev/odata-feed. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download wpdev/odata-feed
More information about wpdev/odata-feed
Files in wpdev/odata-feed
Package odata-feed
Short Description Embeds a Power Query OData connection into PhpSpreadsheet workbooks for live Excel refresh
License MIT
Informations about the package odata-feed
OData Feed — Live Connection XLSX Writer
PHP package that takes a PhpSpreadsheet workbook (or file path) and produces an .xlsx with an embedded Power Query connection to a remote OData v4 feed. When opened in Excel and refreshed, Excel re-fetches live data from the configured OData URL.
This package is Package 2 in the excel-kit stack. It pairs with the OData endpoint package (wpdev/phpspreadsheet-odata) which serves the live data.
Requirements
- PHP 7.4 or greater
ext-zip- phpoffice/phpspreadsheet
Installation
Quick start
Load an existing workbook:
Examples
Example 1 — minimal writer demo (static OData URL):
Example 2 — full live refresh playground (OData server + Excel workbook):
Edit $feeds in playground.php, save, then refresh the workbook in Excel. The playground enables HTTP Basic auth ($username / $password) so Excel prompts for credentials on refresh — nothing is stored in the .xlsx. Re-run --build only when sheet names, feedId, or the OData base URL change. For subdirectory hosting, pass --base-url or set PLAYGROUND_BASE_URL when building.
Feed configuration
FeedConfig holds three values:
| Property | Description |
|---|---|
baseUrl |
OData service root, e.g. https://api.example.com/odata |
feedId |
Tenant/feed identifier used as a path segment |
entitySet |
Sheet/entity name, e.g. Sales |
The final OData URL is built as:
Example: https://api.example.com/odata/abc123/Sales
The visible worksheet in the output file is named to match entitySet.
Security
No authentication token or password is stored inside the generated .xlsx. Excel prompts the user for credentials on refresh and stores them in the OS credential manager. The file contains only the OData URL and Power Query definition.
Optional feed metadata persistence
Inject FeedRepositoryInterface to persist feed metadata when writing:
Pass null (default) to skip persistence.
How it works
Hand-synthesizing the Power Query (MS-QDEFF) parts proved too fragile for Excel (it kept triggering the "We found a problem with some content" repair prompt, especially on Excel for Mac). Instead the writer reuses a real, Excel-authored Power Query workbook as a template:
resources/live-template.xlsxis a known-good workbook that Excel itself generated from an OData feed (workingconnections.xml,xl/tables,xl/queryTables, and thecustomXml/item1.xmlDataMashup).LiveXlsxWriterclones that template and rewrites only the OData feed URL inside the DataMashup'sFormulas/Section1.m(rebuilding the inner OPC package and recomputing the MS-QDEFF section lengths). Changing the package invalidates the DPAPI permission bindings, so they are replaced with the spec's single null-byte fallback and Excel applies default permissions on open.
Every other part stays byte-for-byte as Excel wrote it, so the output opens cleanly and refreshes live.
entitySet is normalized to match Package 1 entity-set identifiers (e.g. Sales Data → Sales_Data). feedId must match [A-Za-z0-9_-]+. Credentials are never stored in the file.
To regenerate resources/live-template.xlsx, create a new OData Power Query connection in Excel (Data → Get Data → From OData Feed), load it to a table, save the .xlsx, and drop it in as the template.
Compatibility
| Client | Support |
|---|---|
| Excel for Windows | Supported |
| Excel for Mac | Supported (Power Query available) |
| Apple Numbers | NOT supported (no Power Query / OData live refresh) |
Development
License
GNU General Public License v2.0 or later — see LICENSE.
All versions of odata-feed with dependencies
phpoffice/phpspreadsheet Version ^1.29
wpdev/phpspreadsheet-odata Version ^1.0
ext-zip Version *