index : website | |
Archlinux32 website - obsolete | gitolite user |
summaryrefslogtreecommitdiff |
author | Erich Eckner <git@eckner.net> | 2019-02-13 08:34:10 +0100 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2019-02-13 08:34:10 +0100 |
commit | f5175dca32467dbfecfc1d058b99e7b0a19b9764 (patch) | |
tree | c2929084babb8ff3854318adf2131a75fef16ae7 /packages/pkginfo.php | |
parent | c8e86055394702bd8e257f78ff9a4a787116253d (diff) |
-rw-r--r-- | packages/pkginfo.php | 15 |
diff --git a/packages/pkginfo.php b/packages/pkginfo.php index 7609d11..6cb3bab 100644 --- a/packages/pkginfo.php +++ b/packages/pkginfo.php @@ -26,8 +26,13 @@ require_once BASE . "/lib/mysql.php"; require_once BASE . "/lib/style.php"; $memcache = new Memcache; - $memcache -> connect('localhost', 11211) or die ('Memcached Connection Error'); - $pkgapi_reachable = $memcache -> get('pkgapi_reachable'); + if ($memcache -> connect('localhost', 11211)) { + $memcache_available = true; + $pkgapi_reachable = $memcache -> get('pkgapi_reachable'); + } else { + $memcache_available = false; + $pkgapi_reachable = false; + } $tld = explode('.', $_SERVER['HTTP_HOST']); end($tld); $tld = current($tld); @@ -43,9 +48,11 @@ require_once BASE . "/lib/style.php"; $pkgapi_reachable = 'YES'; else $pkgapi_reachable = 'NO'; - $memcache -> set('pkgapi_reachable', $pkgapi_reachable, 0, 300); + if ($memcache_available) + $memcache -> set('pkgapi_reachable', $pkgapi_reachable, 0, 300); } - $memcache -> close(); + if ($memcache_available) + $memcache -> close(); if ($pkgapi_reachable == 'YES') $skip_json_checks = false; else |