From 830133d1024878b84dd5b897306f9f963968e800 Mon Sep 17 00:00:00 2001 From: netkas Date: Mon, 23 Dec 2024 21:21:30 -0500 Subject: [PATCH] Minor change --- src/Socialbox/Abstracts/CacheLayer.php | 162 ++++++++++++------------- src/Socialbox/Socialbox.php | 6 + 2 files changed, 87 insertions(+), 81 deletions(-) diff --git a/src/Socialbox/Abstracts/CacheLayer.php b/src/Socialbox/Abstracts/CacheLayer.php index 4e07a5c..3e1f7af 100644 --- a/src/Socialbox/Abstracts/CacheLayer.php +++ b/src/Socialbox/Abstracts/CacheLayer.php @@ -1,90 +1,90 @@ getEngine(); + if (self::$instance === null) + { + $engine = Configuration::getCacheConfiguration()->getEngine(); - if ($engine === 'redis') - { - self::$instance = new RedisCacheLayer(); - } - else if ($engine === 'memcached') - { - self::$instance = new MemcachedCacheLayer(); - } - else - { - throw new RuntimeException('Invalid cache engine specified in the configuration, must be either "redis" or "memcached".'); + if ($engine === 'redis') + { + self::$instance = new RedisCacheLayer(); + } + else if ($engine === 'memcached') + { + self::$instance = new MemcachedCacheLayer(); + } + else + { + throw new RuntimeException('Invalid cache engine specified in the configuration, must be either "redis" or "memcached".'); + } } + + return self::$instance; } - - return self::$instance; - } -} \ No newline at end of file + } \ No newline at end of file diff --git a/src/Socialbox/Socialbox.php b/src/Socialbox/Socialbox.php index 4d4b0c6..7feb1d3 100644 --- a/src/Socialbox/Socialbox.php +++ b/src/Socialbox/Socialbox.php @@ -127,6 +127,12 @@ return; } } + else + { + http_response_code(400); + print('External domains are not supported yet'); + return; + } try {