aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs
diff options
context:
space:
mode:
authorMax Kostikov <max@kostikov.co>2020-01-30 20:18:25 +0100
committerMax Kostikov <max@kostikov.co>2020-01-30 20:18:25 +0100
commit8ed3971ef05be4015b65c9a5b721954c7767ba22 (patch)
treedeb00f06c6d436420b677fa3eb1a2dd7885bc5c9 /Zotlabs
parentc92ea70453d57315ac6294f3d35f566aeb17b706 (diff)
downloadvolse-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')
-rw-r--r--Zotlabs/Lib/System.php11
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() {