Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a PHP 5.4 Requirement #103

Open
bassrock opened this issue Jul 7, 2014 · 9 comments
Open

Add a PHP 5.4 Requirement #103

bassrock opened this issue Jul 7, 2014 · 9 comments

Comments

@bassrock
Copy link

bassrock commented Jul 7, 2014

Hi,

I am on PHP 5.3 and this was working until I actually loaded a worker and job. It seems that it depends on JSON_PRETTY_PRINT which was not introduced until PHP 5.4.0. I recommend either making it use a helper function for older php versions or making php 5.4 a requirement in the composer.json

@danhunsaker
Copy link

Introduced in #91 - can the constant be removed without breaking the functionality?

@bassrock
Copy link
Author

bassrock commented Jul 7, 2014

There are php functions that have been developed to workaround this particular issue

@danhunsaker
Copy link

It's possible that they would be overkill in this case. If the JSON doesn't need to be pretty printed in the first place, those functions are superfluous overhead.

@ruudk
Copy link
Collaborator

ruudk commented Jul 8, 2014

Well, pretty printed json makes it readable. If you have a big nested json it can be very hard to read sometimes.

@danhunsaker
Copy link

So this is output for a human, not for other parts of the application?

@mrbase
Copy link
Contributor

mrbase commented Jul 8, 2014

it's only used in the admin view of running and failed jobs - not in the actual application, no

however, we should probably fix this issue, but right now i just don't have the time ... PR on the matter will be taken care of tho.

@bassrock
Copy link
Author

bassrock commented Jul 8, 2014

I will remove the constant that makes it pretty printed for now and open a PR so it can work on PHP 5.3, then maybe we can discuss other implementations.

@epicwhale
Copy link
Contributor

Instead of removing it, It is actually possible to achieve JSON pretty print with backwards graceful degradation.

json_encode($data, 128);

More reading here http://stackoverflow.com/a/22208945/515268

@danhunsaker
Copy link

It seems safer to if ( ! defined('JSON_PRETTY_PRINT')) define('JSON_PRETTY_PRINT', 128); at that point...
On Oct 26, 2014 11:13 PM, "Dayson Pais" notifications@github.com wrote:

Instead of removing it, It is actually possible to achieve JSON pretty
print with backwards graceful degradation.

json_encode($data, 128);

More reading here http://stackoverflow.com/a/22208945/515268


Reply to this email directly or view it on GitHub
#103 (comment)
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants