Can we add date.timezone to php.ini?
-
So you have it up and running then? Looking forward to your writeup on getting it working again.
Then what do we have to do to get the package updated, etc. ;)
edit: I just went to go put in the timezone stuff - and my vnstat is back to before.
Function split() is deprecated in /usr/local/www/vnstat2/vnstat.php on line 130I updated to new snap this morning to see if that fixed the upnp errors I was seeing in the log. I really want to get 1.5.1 vs the 1.4.1 but keep the formatting that was there in the package. But the code from 1.5.1 points to themes folder and locale, etc.
Hope I can find some time at work today to play with it. Maybe your writeup will be available this afternoon?
-
not sure when i'm going to get it done.. haven't started yet… :-(
on line 130, change split to explode
-
I know how to fix that portion ;) Version 1.5.1 of phpfrontend already has that change in place.
I think we are about in the same place - I had gotten to the Warning: strftime() yesterday but ran out of play time ;) to move forward with it.
From the commit history for the package
https://github.com/bsdperimeter/pfsense-packages/commits/master/config/vnstat2Looks like perry mason is the dev for the package, but has not made a commit for like 8 months. Maybe we can just submit the right changes for the package?
-
If you can make it work, and others confirm your fixes work, submit a pull request and I'll approve it.
-
I got 1.5.1 to work after some hacking… I'll have to see what needs to be changed from the package itself to make sure it creates the db and the config.php page... Biggest issue I see, this package downloads the frontend.. Its not in the package itself... Which isn't a big deal I guess, we would just have to overwrite/add some files to it. The theme was built into the config.php page in the past, now it has its own folder. And for the life of me, can't figure how to add date_default_timezone_set("$timezone").. hate to have it as a manual hack..
-
The code for the front end is all bundled up in http://www.pfsense.com/packages/config/vnstat2/bin/vnstat_php_frontend-1.4.1.tar.gz
On the vnstat GUI, when you "Enable vnstat php frontend" then it unpacks this tar and suddenly you have files in /usr/local/www/vnstat2 - like vnstat.php
I suppose that each time you press save it unpacks the tar again, overwriting whatever edits you made to vnstat.php
The problem is that this code is not in the repository. It is a kind of standard distribution of vnstat scripts and stuff. So the scripts would need to be fixed to work with the latest PHP version then make another tar, or find where this came from and get an updated tar that has scripts that work with the current PHP.
And I am guessing that it runs somewhat standalone, not integrated into the pfSense menu tree. So it probably won't understand $timezone.
Someone will need to do a bit of research to sort out the best way to proceed with this. -
Well that frontend is not the actual tar.gz from original site, its been modified to contain the pfsense.css, etc.
You can grab the 1.5.1 tar.gz for the original website here.
http://www.sqweek.com/sqweek/files/vnstat_php_frontend-1.5.1.tar.gzYou can grab the original 1.4.1 here
http://www.sqweek.com/sqweek/files/vnstat_php_frontend-1.4.1.tar.gzCino, can you post your hacks to get 1.5.1 working - thanks!
-
Cino, can you post your hacks to get 1.5.1 working - thanks!
let me know how you make out
http://forum.pfsense.org/index.php/topic,47241.msg274510.html#msg274510we kinda went off topic a lot so i posted the how-to on your old post
-
Looks like the reason we went this way is that the php.ini setup script is a shell script (by necessity) and it doesn't have any knowledge of the timezone in the config.xml file.
It could probably be done, we have other shell scripts that use some shell-fu to grep/awk out values from the config, it's not just a quick/easy fix.
-
thanks jimp… I had a feeling that could be the case :-( I figured out how to get vnstat2 to work for now.... I really need to learn how to program php...lol