diff options
author | Max Kostikov <max@kostikov.co> | 2020-01-30 20:18:25 +0100 |
---|---|---|
committer | Max Kostikov <max@kostikov.co> | 2020-01-30 20:18:25 +0100 |
commit | 8ed3971ef05be4015b65c9a5b721954c7767ba22 (patch) | |
tree | deb00f06c6d436420b677fa3eb1a2dd7885bc5c9 /Zotlabs/Lib/System.php | |
parent | c92ea70453d57315ac6294f3d35f566aeb17b706 (diff) | |
download | volse-hubzilla-8ed3971ef05be4015b65c9a5b721954c7767ba22.tar.gz volse-hubzilla-8ed3971ef05be4015b65c9a5b721954c7767ba22.tar.bz2 volse-hubzilla-8ed3971ef05be4015b65c9a5b721954c7767ba22.zip |
Prevent multiple database requests on name platform check
Diffstat (limited to 'Zotlabs/Lib/System.php')
-rw-r--r-- | Zotlabs/Lib/System.php | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/Zotlabs/Lib/System.php b/Zotlabs/Lib/System.php index 7bf1343bb..3f500486c 100644 --- a/Zotlabs/Lib/System.php +++ b/Zotlabs/Lib/System.php @@ -5,9 +5,14 @@ namespace Zotlabs\Lib; class System { static public function get_platform_name() { - if(is_array(\App::$config) && is_array(\App::$config['system']) && array_key_exists('platform_name',\App::$config['system'])) - return \App::$config['system']['platform_name']; - return PLATFORM_NAME; + + if(! isset($platform_name)) { + if(is_array(\App::$config) && is_array(\App::$config['system']) && array_key_exists('platform_name',\App::$config['system'])) + static $platform_name = \App::$config['system']['platform_name']; + else + static $platform_name = PLATFORM_NAME; + } + return $platform_name; } static public function get_site_name() { |