index : website | |
Archlinux32 website - obsolete | gitolite user |
summaryrefslogtreecommitdiff |
-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 |