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("DatasetRead.php"); 00036 include_once("../../auth/validator/AuthValidator.php"); 00037 00038 include_once("../../framework/Logger.php"); 00039 00040 00041 // URI of the dataset to get the description of 00042 // "all" means all datasets visible to that user 00043 $uri = ""; 00044 00045 if(isset($_GET['uri'])) 00046 { 00047 $uri = $_GET['uri']; 00048 } 00049 00050 // Optional IP 00051 $registered_ip = ""; 00052 00053 if(isset($_GET['registered_ip'])) 00054 { 00055 $registered_ip = $_GET['registered_ip']; 00056 } 00057 00058 // Optional Meta information 00059 $meta = "false"; 00060 00061 if(isset($_GET['meta'])) 00062 { 00063 $meta = $_GET['meta']; 00064 } 00065 00066 $mtime = microtime(); 00067 $mtime = explode(' ', $mtime); 00068 $mtime = $mtime[1] + $mtime[0]; 00069 $starttime = $mtime; 00070 00071 $start_datetime = date("Y-m-d h:i:s"); 00072 00073 $requester_ip = "0.0.0.0"; 00074 00075 if(isset($_SERVER['REMOTE_ADDR'])) 00076 { 00077 $requester_ip = $_SERVER['REMOTE_ADDR']; 00078 } 00079 00080 $parameters = ""; 00081 00082 if(isset($_SERVER['REQUEST_URI'])) 00083 { 00084 $parameters = $_SERVER['REQUEST_URI']; 00085 00086 $pos = strpos($parameters, "?"); 00087 00088 if($pos !== FALSE) 00089 { 00090 $parameters = substr($parameters, $pos, strlen($parameters) - $pos); 00091 } 00092 } 00093 elseif(isset($_SERVER['PHP_SELF'])) 00094 { 00095 $parameters = $_SERVER['PHP_SELF']; 00096 } 00097 00098 $ws_dr = new DatasetRead($uri, $meta, $registered_ip, $requester_ip); 00099 00100 $ws_dr->ws_conneg($_SERVER['HTTP_ACCEPT'], $_SERVER['HTTP_ACCEPT_CHARSET'], $_SERVER['HTTP_ACCEPT_ENCODING'], 00101 $_SERVER['HTTP_ACCEPT_LANGUAGE']); 00102 00103 $ws_dr->process(); 00104 00105 $ws_dr->ws_respond($ws_dr->ws_serialize()); 00106 00107 $mtime = microtime(); 00108 $mtime = explode(" ", $mtime); 00109 $mtime = $mtime[1] + $mtime[0]; 00110 $endtime = $mtime; 00111 $totaltime = ($endtime - $starttime); 00112 00113 $logger = new Logger("dataset_read", $requester_ip, 00114 "?uri=" . $uri . "®istered_ip=" . $registered_ip . "&requester_ip=$requester_ip", $_SERVER['HTTP_ACCEPT'], 00115 $start_datetime, $totaltime, $ws_dr->pipeline_getResponseHeaderStatus(), $_SERVER['HTTP_USER_AGENT']); 00116 00117 00119 00120 ?>
