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

get_beer_data.php can return json files in wrong order #40

Open
mikefelix opened this issue Aug 29, 2014 · 0 comments
Open

get_beer_data.php can return json files in wrong order #40

mikefelix opened this issue Aug 29, 2014 · 0 comments

Comments

@mikefelix
Copy link

I run BrewPi on my Ubuntu server instead of a RPi. I ran into an issue with my graph data not displaying correctly once midnight came and went. I discovered that this file is using readdir(), which is specified in the PHP docs to return files in the order they are stored in the filesystem (i.e. what you get if you run ls -U). For whatever reason, ls -U returns the files in reverse order on my system (test-2014-08-29.json comes before test-2014-08-28.json) and this is the order readdir() is getting them, which confuses the graph. Changing the file to use scandir() instead fixed the issue for me because scandir() sorts the filenames alphabetically despite their filesystem order.

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

1 participant