diff options
Diffstat (limited to 'Neutron-trunk/api/setup/check.php')
-rw-r--r-- | Neutron-trunk/api/setup/check.php | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/Neutron-trunk/api/setup/check.php b/Neutron-trunk/api/setup/check.php new file mode 100644 index 0000000..d3eb831 --- /dev/null +++ b/Neutron-trunk/api/setup/check.php @@ -0,0 +1,30 @@ +<?php require_once "../../resources/private/relative.php"; getRelativeDetails("api"); ?> +<?php + +// require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php";quit("It works!"); + +if (substr($_SERVER['SERVER_PROTOCOL'], 0, 4) != "HTTP") { + require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php";quit("Unsupported protocol"); +} + +if ($_SERVER['REQUEST_METHOD'] != "GET") { + require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php";quit("Unsupported request method"); +} + +if (!file_exists($_SERVER['DOCUMENT_ROOT'] . "/resources/upload")) { + mkdir($_SERVER['DOCUMENT_ROOT'] . "/resources/upload"); +} + +ob_start(); +phpinfo(); +$data = ob_get_contents(); +ob_clean(); +if (strpos($data, '<tr><td class="e">GD Support </td><td class="v">enabled </td></tr>') !== false || strpos($data, 'GD Support => enabled') !== false) {} else { + require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php";quit("The GD2 library is not installed or enabled"); +} + +if (strpos($_SERVER['HTTP_USER_AGENT'], 'Chrome') !== false || strpos($_SERVER['HTTP_USER_AGENT'], 'Firefox') !== false) {} else { + require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php";quit("Unsupported browser, please use Chrome, Chrome-based or Firefox"); +} + +require $_SERVER['DOCUMENT_ROOT'] . "/api/electrode/quit.php";quit("ok"); |