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("CrudRead.php"); 00036 include_once("../../auth/validator/AuthValidator.php"); 00037 00038 include_once("../../framework/Logger.php"); 00039 00040 00041 // URI of the resource to get its description 00042 $uri = ""; 00043 00044 if(isset($_GET['uri'])) 00045 { 00046 $uri = $_GET['uri']; 00047 } 00048 00049 // URI of the crud to get the description of 00050 $dataset = ""; 00051 00052 if(isset($_GET['dataset'])) 00053 { 00054 $dataset = $_GET['dataset']; 00055 } 00056 00057 // Include the reference of the resources that links to this resource 00058 $include_linksback = ""; 00059 00060 if(isset($_GET['include_linksback'])) 00061 { 00062 $include_linksback = $_GET['include_linksback']; 00063 } 00064 00065 // Include the reference of the resources that links to this resource 00066 $include_reification = ""; 00067 00068 if(isset($_GET['include_reification'])) 00069 { 00070 $include_reification = $_GET['include_reification']; 00071 } 00072 00073 00074 // Optional IP 00075 $registered_ip = ""; 00076 00077 if(isset($_GET['registered_ip'])) 00078 { 00079 $registered_ip = $_GET['registered_ip']; 00080 } 00081 00082 $mtime = microtime(); 00083 $mtime = explode(' ', $mtime); 00084 $mtime = $mtime[1] + $mtime[0]; 00085 $starttime = $mtime; 00086 00087 $start_datetime = date("Y-m-d h:i:s"); 00088 00089 $requester_ip = "0.0.0.0"; 00090 00091 if(isset($_SERVER['REMOTE_ADDR'])) 00092 { 00093 $requester_ip = $_SERVER['REMOTE_ADDR']; 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_cr = new CrudRead($uri, $dataset, $include_linksback, $include_reification, $registered_ip, $requester_ip); 00115 00116 $ws_cr->ws_conneg($_SERVER['HTTP_ACCEPT'], $_SERVER['HTTP_ACCEPT_CHARSET'], $_SERVER['HTTP_ACCEPT_ENCODING'], 00117 $_SERVER['HTTP_ACCEPT_LANGUAGE']); 00118 00119 $ws_cr->process(); 00120 00121 $ws_cr->ws_respond($ws_cr->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("crud_read", $requester_ip, 00130 "?uri=" . $uri . "&dataset=" . $dataset . "&include_linksback=" . $include_linksback . "®istered_ip=" 00131 . $registered_ip . "&requester_ip=$requester_ip", $_SERVER['HTTP_ACCEPT'], $start_datetime, $totaltime, 00132 $ws_cr->pipeline_getResponseHeaderStatus(), $_SERVER['HTTP_USER_AGENT']); 00133 00134 00136 00137 ?>
