-
Notifications
You must be signed in to change notification settings - Fork 194
Libraries JSONExport
Jakub Jakubiec edited this page Feb 24, 2014
·
1 revision
Library | Extends | Path |
---|---|---|
JSONExport | /application/libraries/JSONExport.php |
This library handles nilai data export to JSON file.
Export should be able to handle data regardless of number of marks to export. So data are processed in packs, saved to temporary file and served as attachment in the end. JSON file format has to be well defined in order to import it later line-by-line, without need to load it as a whole into memory.
Constant | Type | Default | Description |
---|---|---|---|
FLUSH_ON_WRITE | boolean | false | Decides if every write to the file should result in flushing it |
JSON_START | string | {\n | JSON start character |
JSON_END | string | } | JSON end character |
JSON_MAIN_OBJECT_START | string | "export": {\n | Json export object header |
JSON_ARRAY_START | string | [\n | JSON Array Start character |
JSON_ARRAY_END | string | ] | JSON Array End character |
Called automatically, creates temporary file to put data in.
Called automatically, removes temporary file with data.
Add selected mark to export file
Variable | Type | Default | Required | Description |
---|---|---|---|---|
$markData | stdObj | N/A | Yes | Single mark data with all dependent information about labels, tags etc. |
Adds metadata about export file, like number of records, file format revision etc. Data comes in key/value pair format.
Variable | Type | Default | Required | Description |
---|---|---|---|---|
$metaName | string | N/A | Yes | Metadata key |
$metaValue | string | N/A | Yes | Metadata value |
Marks file as completed and returns file handle to the file containing data.