kuma-giyomu / jsonparser Goto Github PK
View Code? Open in Web Editor NEWAn event based JSON parser for PHP, suitable for large files
An event based JSON parser for PHP, suitable for large files
Hi, I get the following error while parsing a json feed:
Fatal error: Uncaught exception 'Exception' with message 'Lexical Error: Unmatched Input.' in package\JSONLex.php on line 3475
I've uploaded the json feed file. Had to rename it to "png". You should remove ".png" file extension to get the json file.
Best regards,
Daniel
This raises an exception:
{
"array": [ "bug" ]
}
Hi, sorry before, I ask in here.
I successfully run your test code. But now how I can arrange every property and value into one object?
For example:
$activities = json_decode(file_get_contents($basePath . 'Activity.json'));
$activities will become object so I just call $activities->results or $activity->id.
Your file dumps all the json file, how can i use json_decode to decode data to php array.
i know its not possible to decode whole big json file at once, this is why i am trying your library.
may be using loop to do use json_decode one by one json object and apply my programmings logics in loop to update or insert data in database.
but how to use loop and do json_decode if i can not save the parsed json object to php variable.??
Hello,
I would try your parser but i don't understand one thing.
After parserDocument(), how to give the final php array ?
Thanks
Hm, I tried test/test.php and I'm wondering if this line:
https://github.com/kuma-giyomu/JSONParser/blob/master/package/JSONParser.php#L287
Should be new JSONLex($fileResource)?
whats the $value and $property variable represent in the test file. and can i use this code directly in my controller for working?
For instance
[
1,2,3
]
will cause an exception to be thrown.
Hi.
We're using this parser - it's great - but we ran into an issue on environments with PHP 5.6 installed - we got this error:
Undefined offset: 65536
exception 'ErrorException' with message 'Undefined offset: 65536' in /Users/nino/Documents/gitdev/spire/dcon56/digital-consulting/app/helpers/JSONParser/JSONLex.php:3486
Stack trace:
#0 /Users/nino/Documents/gitdev/spire/dcon56/digital-consulting/app/helpers/JSONParser/JSONLex.php(3486): Illuminate\Exception\Handler->handleError(8, 'Undefined offse...', '/Users/nino/Doc...', 3486, Array)
(with more stack trace steps below, but I don't think they're as useful).
I noticed that 65536 is eight times the 8192 character chunk that you're reading in - I'm not sure what's going on with that.
However, it works fine in PHP 5.4, so that's fine for us.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.