Download the PHP package quorum/exporter without Composer
On this page you can find all versions of the php package quorum/exporter. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package exporter
Exporter
A Streamed Data Export Tool
Supported formats:
- CSV / TSV
- SpreadsheetML "Excel 2004 XML Spreadsheet"
- More to come.
Requirements
- maennchen/zipstream-php: ~2.1
- ext-SPL: *
- ext-mbstring: *
- ext-dom: *
- ext-json: *
- php: >=7.4
Installing
Install the latest version with:
Example
Simple CSV Export
Documentation
Class: \Quorum\Exporter\DataExport
Method: DataExport->__construct
DataExport is the object used to orchestrate the export process regardless of export format.
Parameters:
- \Quorum\Exporter\EngineInterface
$engine
- The engine by which to export the data sheets.
Method: DataExport->addSheet
Add a Data Sheet to the export.
Parameters:
- \Quorum\Exporter\DataSheet
$sheet
- The DataSheet to add to the export - string | null
$sheetTitle
- Optional Title to give the data export. Most Engines will interpret this as filename (sans file extension). If excluded, the name will be left to the engine.
Method: DataExport->export
Trigger the final export process.
Parameters:
- resource | null
$outputStream
- The stream resource to export to. NULL will open a php://output resource.
Class: \Quorum\Exporter\DataSheet
Method: DataSheet->__construct
DataSheet is the representation of a Worksheet
Parameters:
- string | null
$name
- The name to give the sheet. The use is Engine implementation specific but is likely filename or Sheet name
Method: DataSheet->getName
Get the name of the sheet. Use thereof is Engine Specific
Method: DataSheet->addRow
Append a row worth of data to the end of the Worksheet.
Parameters:
- array
$row
- An array of scalars.
Throws: \Quorum\Exporter\Exceptions\InvalidDataTypeException
Method: DataSheet->addRows
Append multiple rows of data to the end of the Worksheet.
Parameters:
- array | \Iterator
$dataSet
- An iterable of arrays of scalars.
Method: DataSheet->current
Return the current value
Method: DataSheet->next
Move forward to next element
Method: DataSheet->key
Return the key of the current element
Method: DataSheet->valid
Checks if current position is valid
Method: DataSheet->rewind
Rewind the Iterator to the first element
Class: \Quorum\Exporter\EngineInterface
Class: \Quorum\Exporter\Engines\CsvEngine
Method: CsvEngine->__construct
The default and highly recommended export format for CSV tab delimited UTF-16LE with leading Byte Order Mark.
While this may seem like an odd choice, the reason for this is cross platform Microsoft Excel compatibility.
You can read more on the topic here
Parameters:
- string
$outputEncoding
- The encoding to output. Defaults to UTF-16LE as it is by far the best supported by Excel - string | null
$delimiter
- Character to use as Delimiter. Default varies based on encoding. - string
$enclosure
- Character to use as Enclosure. - string
$inputEncoding
- The encoding of the input going into the CSVs.
Method: CsvEngine->setEnclosure
Character to use as CSV value enclosure. Commonly this will be "
Method: CsvEngine->setTmpDir
Set the tmpDir to write interim files to.
Defaults to sys_get_temp_dir
Method: CsvEngine->getMultiSheetStrategy
Get the current strategy for Multi-Sheet export
Method: CsvEngine->setMultiSheetStrategy
Set the strategy for allowing multiple sheets.
Supported strategies are CsvEngine::STRATEGY_ZIP
and CsvEngine::STRATEGY_CONCAT
CsvEngine::STRATEGY_ZIP
will output a single zipfile containing every sheet as a separate CSV file.CsvEngine::STRATEGY_CONCAT
will output a single CSV file with every sheet one after the next.
Parameters:
- string
$multiSheetStrategy
- Use the constantCsvEngine::STRATEGY_ZIP
orCsvEngine::STRATEGY_CONCAT
Method: CsvEngine->getDelimiter
Gets delimiter. If unset, UTF-16 and UTF-32 default to TAB "\t", everything else to COMMA ","
Method: CsvEngine->setDelimiter
Sets delimiter. Setting to NULL triggers automatic delimiter decision based on recommended encoding rules.
Parameters:
- string | null
$delimiter
- Delimiter Character. Must be a single byte.
Method: CsvEngine->getEnclosure
Get the current character used for enclosure.
Method: CsvEngine->disableBom
Whether to disable the leading Byte Order Mark for the given encoding from being output.
Class: \Quorum\Exporter\Engines\SpreadsheetMLEngine
Method: SpreadsheetMLEngine->setCreatedTime
Parameters:
- int | null
$createdTime
- The timestamp to use for the created time. If null, the current time will be used.
Class: \Quorum\Exporter\Exceptions\ExportException
Class: \Quorum\Exporter\Exceptions\InvalidDataTypeException
Class: \Quorum\Exporter\Exceptions\OutputException
Class: \Quorum\Exporter\Exceptions\WritableException
All versions of exporter with dependencies
ext-spl Version *
ext-mbstring Version *
ext-dom Version *
ext-json Version *
php Version >=7.4