You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 16, 2026. It is now read-only.
Jakub Jakubiec edited this page Feb 24, 2014
·
1 revision
Library
Extends
Path
JSONImport
/application/libraries/JSONImport.php
This library handles nilai data import from JSON file.
Design goal is ability to process huge data sets regardless of their size. So instead of loading data into memory and parsing using json_decode, we're processing input file line by line wherever possible. For that the file needs to be properly formatted. For more details about format see JSON Export.
Methods
__construct - Public
Called automatically validates parameters passed to constructor (requires 'user_id' to be set for the user that imports the data).
Arguments
Variable
Type
Default
Required
Description
$params
array
N/A
Yes
Parameters to initialize library. Currently 'user_id' is required
importFile - Public
Import selected file to current Nilai install, by adding all missing marks, skipping existing ones. All marks get saved for the user specified by passing 'user_id' setting while initializing the library.
Arguments
Variable
Type
Default
Required
Description
$filePath
string
N/A
Yes
Path to the localy copy of the file to be imported
validateUpload - Public
Checks if uploaded file meets all required criteria - is not empty (size > 0 bytes), didn't finish in error and filetype is JSON.