function get_phpinfo() { ob_start(); phpinfo(); $phpinfo = ob_get_contents(); ob_end_clean(); $phpinfo = preg_replace('{^.*?<body>}s', '', $phpinfo); $phpinfo = preg_replace('{</body>.*?$}s', '', $phpinfo); return $phpinfo; } $phpinfo = get_phpinfo(); try { include "./always.php"; set_error_handler('log_setup_error', E_ALL); include "DAViCalSession.php"; if (check_pgsql()->GetOK()) { $session->LoginRequired(isset($c->restrict_setup_to_admin) && $c->restrict_setup_to_admin ? 'Admin' : null); } } catch (Exception $e) { class FakeSession { function AllowedTo() { return true; } } $session = new FakeSession(1); } include "interactive-page.php"; include "page-header.php"; require_once "AwlQuery.php";
// Check memcached server connection case 'memcached': list($result, $message) = check_memcached(); break; // Check solr server connection // Check solr server connection case 'solr': list($result, $message) = check_solr(); break; // None of them // None of them default: list($result, $message) = array(FALSE, "Script: wrong target parameter"); } } else { list($result, $message) = check_pgsql(); } // Build the response if ($result) { echo "<p>[GLOBAL OK]</p>"; } else { echo "<p>[GLOBAL KO]</p>"; } echo "<p>" . $message . "</p>"; // Return error code 500 in case of failure if (!$result) { header('HTTP/1.1 500 Internal Server Error'); } // End of the script exit; /**