JsonPath icon indicating copy to clipboard operation
JsonPath copied to clipboard

Filters error on CLI

Open Peekmo opened this issue 10 years ago • 5 comments

Hello

There's problems on the use of filters with PHP CLI (@see unit test testGetAllByKeyFiltered), the eval function seems to fail. If someone got an idea..

Regards, Peekmo

Peekmo avatar Sep 16 '14 20:09 Peekmo

I'll see if I can clear this. I need CLI to work ;)

polerin avatar Dec 05 '14 16:12 polerin

Il could be nice, that's really annoying, also for unit tests.. I spend many many hours on it.. never found the problem.

Peekmo avatar Dec 05 '14 20:12 Peekmo

Looks like it's in how tempFilters() parses the dot notation. I don't have it fixed yet, but I have made a little progess on it.

polerin avatar Dec 05 '14 20:12 polerin

What I've done so far, I'll dig into it a bit more this weekend probably, but if you have any ideas or direction please let me know https://github.com/polerin/JsonPath/compare/FilterFix?diff=split&name=FilterFix

polerin avatar Dec 05 '14 21:12 polerin

The problem is the syntax on line 233. the right one should be: $res = eval('$name = $expr;'); But then your test has a endless loop.

fadoe avatar Mar 18 '15 14:03 fadoe