Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/packages/pkginfo.php
diff options
context:
space:
mode:
Diffstat (limited to 'packages/pkginfo.php')
-rw-r--r--packages/pkginfo.php16
1 files changed, 3 insertions, 13 deletions
diff --git a/packages/pkginfo.php b/packages/pkginfo.php
index 6cb3bab..86f7100 100644
--- a/packages/pkginfo.php
+++ b/packages/pkginfo.php
@@ -25,14 +25,7 @@ require_once BASE . "/lib/helper.php";
require_once BASE . "/lib/mysql.php";
require_once BASE . "/lib/style.php";
- $memcache = new Memcache;
- if ($memcache -> connect('localhost', 11211)) {
- $memcache_available = true;
- $pkgapi_reachable = $memcache -> get('pkgapi_reachable');
- } else {
- $memcache_available = false;
- $pkgapi_reachable = false;
- }
+ $pkgapi_reachable = apcu_fetch('pkgapi_reachable', $apcu_success);
$tld = explode('.', $_SERVER['HTTP_HOST']);
end($tld);
$tld = current($tld);
@@ -43,16 +36,13 @@ require_once BASE . "/lib/style.php";
$protocol = 'https';
else
$protocol = 'http';
- if ($pkgapi_reachable === false) {
+ if ($apcu_success == false) {
if (site_is_reachable($protocol . '://pkgapi.archlinux32.' . $tld . '/'))
$pkgapi_reachable = 'YES';
else
$pkgapi_reachable = 'NO';
- if ($memcache_available)
- $memcache -> set('pkgapi_reachable', $pkgapi_reachable, 0, 300);
+ apcu_store('pkgapi_reachable', $pkgapi_reachable, 300);
}
- if ($memcache_available)
- $memcache -> close();
if ($pkgapi_reachable == 'YES')
$skip_json_checks = false;
else