Permalink
Browse files

Adding the timezone in the config file

  • Loading branch information...
1 parent f4dde30 commit fdaeb92032e41a3bd0a49edaa03aac7bc3a47bda @D4nte D4nte committed Dec 28, 2011
Showing with 8 additions and 3 deletions.
  1. +3 −0 config.php
  2. +5 −3 src/classes/Settings.php
View
@@ -37,4 +37,7 @@
// Must be writable by web server process
$config->ps_generated = "path_where_photoshow_generates_files_goes_here";
+// Local timezone. Default one is "Europe/Paris".
+#$config->timezone = "Europe/Paris";
+
?>
View
@@ -143,12 +143,12 @@ static public function init($forced = false){
/// Settings already created
if(Settings::$photos_dir !== NULL && !$forced) return;
- /// Set TimeZone
- date_default_timezone_set("Europe/Paris");
+
+ /// Set default values for $config
+ $config->timezone = "Europe/Paris";
/// Load config.php file
$config_file = realpath(dirname(__FILE__)."/../../config.php");
-
if(!include($config_file)){
throw new Exception("You need to create a configuration file.");
}
@@ -159,6 +159,8 @@ static public function init($forced = false){
Settings::$conf_dir = $config->ps_generated."/Conf/";
Settings::$admin_settings_file = $config->ps_generated."/Conf/admin_settings.ini";
+ /// Set TimeZone
+ date_default_timezone_set($config->timezone);
// Now, check that this stuff exists.
if(!file_exists(Settings::$photos_dir)){

0 comments on commit fdaeb92

Please sign in to comment.