camspiers / json-pretty Goto Github PK
View Code? Open in Web Editor NEWProvides support for json pretty printing in php 5.3
License: MIT License
Provides support for json pretty printing in php 5.3
License: MIT License
It's quite clear, from README, that you don't need Pimple to use json-pretty.
I see that you could use Pimple, but I think that it's not fair to keep it as dependency.
You should remove your Container class (maybe adding its code in README) and move "pimple/pimple" from "require" to "suggest".
If there is a datetime value in the json, it will break the value and cause 2015-09-08 08:56:10
to become 2015-09-08 08: 56: 10
There are other issues with commas
Using JSON_PRETTY_PRINT
[
{
"id": "34",
"system_id": "2000",
"src": "***",
"dst": "790",
"dcontext": "RingGroups-2000",
"clid": "***",
"channel": "SIP\/***-0000005c",
"dstchannel": "SIP\/2000200-0000005d",
"lastapp": "Dial",
"lastdata": "SIP\/2000200&SIP\/2000201),20,ktwx",
"calldate": "2015-09-08 08:56:10",
"answer": "2015-09-08 08:56:10",
"end": "2015-09-08 08:56:20",
"duration": "10",
"billsec": "0",
"disposition": "NO ANSWER",
"uniqueid": "pbx1-1441698970.92",
"linkedid": "pbx1-1441698970.92",
"internal": "0",
"outbound": "0",
"inbound": "1",
"uploaded": "0",
"ddi": null
}
]
Using your lib:
[
{
"id": "34",
"system_id": "2000",
"src": "***",
"dst": "790",
"dcontext": "RingGroups-2000",
"clid": "***",
"channel": "SIP\/***-0000005c",
"dstchannel": "SIP\/2000200-0000005d",
"lastapp": "Dial",
"lastdata": "SIP\/2000200&SIP\/2000201),
20,
ktwx",
"calldate": "2015-09-08 08: 56: 10",
"answer": "2015-09-08 08: 56: 10",
"end": "2015-09-08 08: 56: 20",
"duration": "10",
"billsec": "0",
"disposition": "NO ANSWER",
"uniqueid": "pbx1-1441698970.92",
"linkedid": "pbx1-1441698970.92",
"internal": "0",
"outbound": "0",
"inbound": "1",
"uploaded": "0",
"ddi": null
}
]
Hi man, thank you for your algorithm. I found some issue with this condition:
When I have string in my app like:
<a href=\"{{.domain_cabinet}}/login?next_url=/contest/fbsstar&utm_nooverride=1"
its formatting into:
<a href=\"{
{
.domain_cabinet
}
}/login?next_url=/contest/fbsstar&utm_nooverride=1"
in source file and breaking it
I fixed this with replacing the second condition to:
($c > 1 && $json[$c - 2] === '\\' && $json[$c - 3] !== '\\'))
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.