index : website | |
Archlinux32 website - obsolete | gitolite user |
summaryrefslogtreecommitdiff |
author | Erich Eckner <git@eckner.net> | 2018-12-10 11:31:21 +0100 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2018-12-10 11:31:21 +0100 |
commit | 551012739b75432a484ff5b245cb39acb8ae21a8 (patch) | |
tree | 7f14cd9bb877a775a3e320d3ac7cf6d3b2ccd34c | |
parent | dce8523c52ce1f8e5b4f9799827ed1f5c60a8a55 (diff) |
-rw-r--r-- | packages/pkginfo.php | 34 |
diff --git a/packages/pkginfo.php b/packages/pkginfo.php index d6d04fb..fb1b94f 100644 --- a/packages/pkginfo.php +++ b/packages/pkginfo.php @@ -5,25 +5,25 @@ require_once BASE . "/lib/helper.php"; require_once BASE . "/lib/mysql.php"; require_once BASE . "/lib/style.php"; - if (!$skip_json_checks) { - $memcache = new Memcache; - $memcache -> connect('localhost', 11211) or die ('Memcached Connection Error'); - $pkgapi_reachable = $memcache -> get('pkgapi_reachable'); - $tld = array_pop((explode('.', $_SERVER['HTTP_HOST']))); - if (array_key_exists('HTTPS', $_SERVER) && ($_SERVER['HTTPS'] == 'on')) - $protocol = 'https'; + $memcache = new Memcache; + $memcache -> connect('localhost', 11211) or die ('Memcached Connection Error'); + $pkgapi_reachable = $memcache -> get('pkgapi_reachable'); + $tld = array_pop((explode('.', $_SERVER['HTTP_HOST']))); + if (array_key_exists('HTTPS', $_SERVER) && ($_SERVER['HTTPS'] == 'on')) + $protocol = 'https'; + else + $protocol = 'http'; + if ($pkgapi_reachable === false) { + if (site_is_reachable($protocol . '://pkgapi.archlinux32.' . $tld . '/')) + $pkgapi_reachable = 'YES'; else - $protocol = 'http'; - if ($pkgapi_reachable === false) { - if (site_is_reachable($protocol . '://pkgapi.archlinux32.' . $tld . '/')) - $pkgapi_reachable = 'YES'; - else - $pkgapi_reachable = 'NO'; - $memcache -> set('pkgapi_reachable', $pkgapi_reachable, 0, 300); - } - if ($pkgapi_reachable == 'NO') - $skip_json_checks = true; + $pkgapi_reachable = 'NO'; + $memcache -> set('pkgapi_reachable', $pkgapi_reachable, 0, 300); } + if ($pkgapi_reachable == 'YES') + $skip_json_checks = false; + else + $skip_json_checks = true; if (!$skip_json_checks) { $json_content = json_decode( |