ualibraries / Guide-on-the-Side

The University of Arizona Libraries will no longer provide support for Guide on the Side. The code will remain openly available; however, UAL can no longer provide code fixes or upgrades.
https://ualibraries.github.io/Guide-on-the-Side/about.html
Other
66 stars 48 forks source link

Error when timezone isn't set #97

Open jaronkk opened 9 years ago

jaronkk commented 9 years ago

I was setting up GotS locally and was receiving an error when CakePHP was attempting to serve asset files. The error was caused by my local setup not having a default timezone set in PHP.

I made a commit in our fork to fix the issue, and also add a setting the config.yml file: https://github.com/ndlib/Guide-on-the-Side/commit/1130e3073a4ec1a4f8b023df55313741ec6796c7

If that looks like an acceptable approach I can make a pull request with that update.

2015-01-12 18:26:55 Error: [Exception] DateTime::__construct() [<a href='http://php.net/datetime.construct'>datetime.construct</a>]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone.
Stack Trace:
#0 /Users/jkennel/workspace/www/localhost/guide_on_the_side/lib/Cake/Network/CakeResponse.php(1058): DateTime->__construct('2015-01-08 16:2...')
#1 /Users/jkennel/workspace/www/localhost/guide_on_the_side/lib/Cake/Network/CakeResponse.php(962): CakeResponse->_getUTCDate(1420734076)
#2 /Users/jkennel/workspace/www/localhost/guide_on_the_side/lib/Cake/Routing/Filter/AssetDispatcher.php(62): CakeResponse->modified(1420734076)
jaronkk commented 9 years ago

@michaelhagedon or @simpsonw Would you like me to go ahead and make a pull request for this timezone tweak?

michaelhagedon commented 9 years ago

@jaronkk We’ll take any improvements you’ve got. ☺