Skip to content

Commit

Permalink
Add some old code from 4.x to automatically derive timezone from the …
Browse files Browse the repository at this point in the history
…OS. Commented out, in testing, for now.
  • Loading branch information
mark-unwin committed Feb 13, 2024
1 parent 854e6c9 commit a026de0
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions app/Config/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -473,5 +473,29 @@ public function __construct()
if (!empty($_SERVER['CI_ENVIRONMENT']) and $_SERVER['CI_ENVIRONMENT'] === 'development') {
$this->CSPEnabled = false;
}

// $timezone = '';
// $default = 'UTC';
// if ((string) php_uname('s') === 'Linux') {
// // On many systems (Mac, for instance) "/etc/localtime" is a symlink
// // to the file with the timezone info
// if (@is_link('/etc/localtime')) {
// // If it is, that file's name is actually the "Olsen" format timezone
// $temp_file = @readlink('/etc/localtime');
// $temp_pos = strpos($temp_file, 'zoneinfo');
// if ($temp_pos) {
// // When it is, it's in the "/usr/share/zoneinfo/" folder
// $timezone = substr($temp_file, $temp_pos + strlen('zoneinfo/'));
// }
// } else {
// // On other systems, like Ubuntu, there's file with the Olsen time right inside it.
// $timezone = @file_get_contents('/etc/timezone');
// }
// if ((string)$timezone === '') {
// $this->appTimezone = $default;
// } else {
// $this->appTimezone = $timezone;
// }
// }
}
}

0 comments on commit a026de0

Please sign in to comment.