Updated core extension, timezone
This commit is contained in:
parent
5bc785fac3
commit
80ce9c75b7
2 changed files with 12 additions and 7 deletions
|
@ -2,7 +2,7 @@
|
|||
// Core extension, https://github.com/datenstrom/yellow-extensions/tree/master/source/core
|
||||
|
||||
class YellowCore {
|
||||
const VERSION = "0.8.81";
|
||||
const VERSION = "0.8.82";
|
||||
const RELEASE = "0.8.20";
|
||||
public $page; // current page
|
||||
public $content; // content files
|
||||
|
@ -3249,10 +3249,15 @@ class YellowToolbox {
|
|||
|
||||
// Detect server timezone
|
||||
public function detectServerTimezone() {
|
||||
$timezone = @date_default_timezone_get();
|
||||
if (PHP_OS=="Darwin" && $timezone=="UTC") {
|
||||
if (preg_match("#zoneinfo/(.*)#", @readlink("/etc/localtime"), $matches)) $timezone = $matches[1];
|
||||
$timezone = ini_get("date.timezone");
|
||||
if (empty($timezone)) {
|
||||
if (PHP_OS=="Darwin") {
|
||||
if (preg_match("#zoneinfo/(.*)#", @readlink("/etc/localtime"), $matches)) $timezone = $matches[1];
|
||||
} else {
|
||||
if (preg_match("/^(\S+)\/(\S+)/", $this->readFile("/etc/timezone"), $matches)) $timezone = $matches[1];
|
||||
}
|
||||
}
|
||||
if (empty($timezone)) $timezone = "UTC";
|
||||
return $timezone;
|
||||
}
|
||||
|
||||
|
@ -3264,7 +3269,7 @@ class YellowToolbox {
|
|||
if (preg_match("/^(\S+)\/(\S+)/", $this->getServer("SERVER_SOFTWARE"), $matches)) {
|
||||
$name = $matches[1];
|
||||
$version = $matches[2];
|
||||
} elseif (preg_match("/^(\S+)/u", $this->getServer("SERVER_SOFTWARE"), $matches)) {
|
||||
} elseif (preg_match("/^(\S+)/", $this->getServer("SERVER_SOFTWARE"), $matches)) {
|
||||
$name = $matches[1];
|
||||
}
|
||||
if (PHP_SAPI=="cli" || PHP_SAPI=="cli-server") {
|
||||
|
|
|
@ -21,11 +21,11 @@ Tag: feature
|
|||
system/extensions/command.php: command.php, create, update
|
||||
|
||||
Extension: Core
|
||||
Version: 0.8.81
|
||||
Version: 0.8.82
|
||||
Description: Core functionality of the website.
|
||||
DocumentationUrl: https://github.com/datenstrom/yellow-extensions/tree/master/source/core
|
||||
DownloadUrl: https://github.com/datenstrom/yellow-extensions/raw/master/zip/core.zip
|
||||
Published: 2022-05-14 12:50:14
|
||||
Published: 2022-05-16 17:15:20
|
||||
Developer: Datenstrom
|
||||
Tag: feature
|
||||
system/extensions/core.php: core.php, create, update
|
||||
|
|
Loading…
Add table
Reference in a new issue