index : archweb32 | |
Archlinux32 website | gitolite user |
summaryrefslogtreecommitdiff |
author | Erich Eckner <git@eckner.net> | 2018-12-07 10:47:43 +0100 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2018-12-07 10:47:43 +0100 |
commit | e86c3b3a66e8f62c3c97ea6b15c29c80c999d1c6 (patch) | |
tree | 9d6a8f8bfbc64c9e076366b247c6a718e768e31a | |
parent | 2fc12361785c7e874c25d6e79f73b76300fc0cbe (diff) |
-rw-r--r-- | packages/pkginfo.php | 15 |
diff --git a/packages/pkginfo.php b/packages/pkginfo.php index 1dea3ab..3a3fc2e 100644 --- a/packages/pkginfo.php +++ b/packages/pkginfo.php @@ -11,6 +11,21 @@ require_once BASE . "/lib/style.php"; $skip_json_checks = false; if (!$skip_json_checks) { + $memcache = new Memcache; + $memcache -> connect('localhost', 11211) or die ('Memcached Connection Error'); + $pkgapi_reachable = $memcache -> get('pkgapi_reachable'); + if ($pkgapi_reachable === false) { + if (site_is_reachable('https://pkgapi.arch32.tyzoid.com/package/')) + $pkgapi_reachable = 'YES'; + else + $pkgapi_reachable = 'NO'; + $memcache -> set('pkgapi_reachable', $pkgapi_reachable, 0, 300); + } + if ($pkgapi_reachable == 'NO') + $skip_json_checks = true; + } + + if (!$skip_json_checks) { $json_content = json_decode( file_get_contents( "https://pkgapi.arch32.tyzoid.com/package/" . |