index.php
Go to the documentation of this file.
00001 <?php 00002 00005 00018 ini_set("display_errors", 00019 "Off"); // Don't display errors to the users. Set it to "On" to see errors for debugging purposes. 00020 00021 ini_set("memory_limit", "64M"); 00022 00023 00024 // Database connectivity procedures 00025 include_once("../../../framework/db.php"); 00026 00027 // Content negotion class 00028 include_once("../../../framework/Conneg.php"); 00029 00030 // The Web Service parent class 00031 include_once("../../../framework/WebService.php"); 00032 00033 include_once("../../../framework/ProcessorXML.php"); 00034 00035 include_once("AuthRegistrarWs.php"); 00036 include_once("../../validator/AuthValidator.php"); 00037 00038 include_once("../../../framework/Logger.php"); 00039 00040 00041 // Title of the service 00042 $title = ""; 00043 00044 if(isset($_GET['title'])) 00045 { 00046 $title = $_GET['title']; 00047 } 00048 00049 // Endpoint URL of the service 00050 $endpoint = ""; 00051 00052 if(isset($_GET['endpoint'])) 00053 { 00054 $endpoint = $_GET['endpoint']; 00055 } 00056 00057 00058 // Crud usage of the service 00059 $crud_usage = ""; 00060 00061 if(isset($_GET['crud_usage'])) 00062 { 00063 $crud_usage = $_GET['crud_usage']; 00064 } 00065 00066 // URI of the service 00067 $ws_uri = ""; 00068 00069 if(isset($_GET['ws_uri'])) 00070 { 00071 $ws_uri = $_GET['ws_uri']; 00072 } 00073 00074 $mtime = microtime(); 00075 $mtime = explode(' ', $mtime); 00076 $mtime = $mtime[1] + $mtime[0]; 00077 $starttime = $mtime; 00078 00079 $start_datetime = date("Y-m-d h:i:s"); 00080 00081 $requester_ip = "0.0.0.0"; 00082 00083 if(isset($_SERVER['REMOTE_ADDR'])) 00084 { 00085 $requester_ip = $_SERVER['REMOTE_ADDR']; 00086 } 00087 00088 // Optional IP 00089 $registered_ip = ""; 00090 00091 if(isset($_GET['registered_ip'])) 00092 { 00093 $registered_ip = $_GET['registered_ip']; 00094 } 00095 00096 $parameters = ""; 00097 00098 if(isset($_SERVER['REQUEST_URI'])) 00099 { 00100 $parameters = $_SERVER['REQUEST_URI']; 00101 00102 $pos = strpos($parameters, "?"); 00103 00104 if($pos !== FALSE) 00105 { 00106 $parameters = substr($parameters, $pos, strlen($parameters) - $pos); 00107 } 00108 } 00109 elseif(isset($_SERVER['PHP_SELF'])) 00110 { 00111 $parameters = $_SERVER['PHP_SELF']; 00112 } 00113 00114 $ws_arws = new AuthRegistrarWs($title, $endpoint, $crud_usage, $ws_uri, $registered_ip, $requester_ip); 00115 00116 $ws_arws->ws_conneg($_SERVER['HTTP_ACCEPT'], $_SERVER['HTTP_ACCEPT_CHARSET'], $_SERVER['HTTP_ACCEPT_ENCODING'], 00117 $_SERVER['HTTP_ACCEPT_LANGUAGE']); 00118 00119 $ws_arws->process(); 00120 00121 $ws_arws->ws_respond($ws_arws->ws_serialize()); 00122 00123 $mtime = microtime(); 00124 $mtime = explode(" ", $mtime); 00125 $mtime = $mtime[1] + $mtime[0]; 00126 $endtime = $mtime; 00127 $totaltime = ($endtime - $starttime); 00128 00129 $logger = new Logger("auth_registrar_ws", $requester_ip, 00130 "?title=" . substr($mode, 0, 64) . "&endpoint=" . $endpoint . "&crud_usage=" . $crud_usage . "&ws_uri=" . $ws_uri 00131 . "&requester_ip=$requester_ip", 00132 $_SERVER['HTTP_ACCEPT'], $start_datetime, $totaltime, $ws_arws->pipeline_getResponseHeaderStatus(), 00133 $_SERVER['HTTP_USER_AGENT']); 00134 00135 00137 00138 ?>
