true]; $ctx = stream_context_create(['http' => $opts]); $token = getenv('USER_TOKEN'); $retval = @file_get_contents('https://main.php.net/fetch/allusers.php?&token=' . rawurlencode($token), false, $ctx); if (!$retval) { return; } $json = json_decode($retval, true); if (!is_array($json)) { return; } if (isset($json['error'])) { return; } return $json; } if (!file_exists("/tmp/svnusers.json") || filemtime("/tmp/svnusers.json") < $_SERVER["REQUEST_TIME"] - 3600) { $json = getAllUsers(); $json_data = var_export($json, true); file_put_contents("/tmp/svnusers.php", ' md5($row['username'] . '@php.net'), 'name' => $row['name'], 'username' => $row['username'], ]; $user[$row["username"]] = $data; $user[$row["name"]] = $data; } } echo 'var users = ', json_encode($user), ";\n", 'var lookup = ', json_encode($lookup), ";\n";