summaryrefslogtreecommitdiff
path: root/packages/pkginfo.php
diff options
context:
space:
mode:
Diffstat (limited to 'packages/pkginfo.php')
-rw-r--r--packages/pkginfo.php15
1 files changed, 15 insertions, 0 deletions
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/" .