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 // Database connectivity procedures 00024 include_once("../framework/db.php"); 00025 00026 // Content negotion class 00027 include_once("../framework/Conneg.php"); 00028 00029 // The Web Service parent class 00030 include_once("../framework/WebService.php"); 00031 00032 include_once("../framework/ProcessorXML.php"); 00033 00034 include_once("../framework/Solr.php"); 00035 00036 include_once("Browse.php"); 00037 include_once("../auth/validator/AuthValidator.php"); 00038 include_once("../auth/lister/AuthLister.php"); 00039 00040 include_once("../framework/Logger.php"); 00041 00042 include_once("../framework/Namespaces.php"); 00043 00044 // Full text query supporting the Lucene operators 00045 $attributes = "all"; 00046 00047 if(isset($_POST['attributes'])) 00048 { 00049 $attributes = $_POST['attributes']; 00050 } 00051 00052 // Types to filter 00053 $types = "all"; 00054 00055 if(isset($_POST['types'])) 00056 { 00057 $types = $_POST['types']; 00058 } 00059 00060 // Filtering types 00061 $datasets = "all"; 00062 00063 if(isset($_POST['datasets'])) 00064 { 00065 $datasets = $_POST['datasets']; 00066 } 00067 00068 // Number of items to return 00069 $items = "10"; 00070 00071 if(isset($_POST['items'])) 00072 { 00073 $items = $_POST['items']; 00074 } 00075 00076 // Where to start the paging in the dataset 00077 $page = "0"; 00078 00079 if(isset($_POST['page'])) 00080 { 00081 $page = $_POST['page']; 00082 } 00083 00084 // Enable the inference engine 00085 $inference = "on"; 00086 00087 if(isset($_POST['inference'])) 00088 { 00089 $inference = $_POST['inference']; 00090 } 00091 00092 // Include aggregates 00093 $include_aggregates = "false"; 00094 00095 if(isset($_POST['include_aggregates'])) 00096 { 00097 $include_aggregates = $_POST['include_aggregates']; 00098 } 00099 00100 00101 // Optional IP 00102 $registered_ip = ""; 00103 00104 if(isset($_POST['registered_ip'])) 00105 { 00106 $registered_ip = $_POST['registered_ip']; 00107 } 00108 00109 $mtime = microtime(); 00110 $mtime = explode(' ', $mtime); 00111 $mtime = $mtime[1] + $mtime[0]; 00112 $starttime = $mtime; 00113 00114 $start_datetime = date("Y-m-d h:i:s"); 00115 00116 $requester_ip = "0.0.0.0"; 00117 00118 if(isset($_SERVER['REMOTE_ADDR'])) 00119 { 00120 $requester_ip = $_SERVER['REMOTE_ADDR']; 00121 } 00122 00123 $parameters = ""; 00124 00125 if(isset($_SERVER['REQUEST_URI'])) 00126 { 00127 $parameters = $_SERVER['REQUEST_URI']; 00128 00129 $pos = strpos($parameters, "?"); 00130 00131 if($pos !== FALSE) 00132 { 00133 $parameters = substr($parameters, $pos, strlen($parameters) - $pos); 00134 } 00135 } 00136 elseif(isset($_SERVER['PHP_SELF'])) 00137 { 00138 $parameters = $_SERVER['PHP_SELF']; 00139 } 00140 00141 $ws_b = new Browse($attributes, $types, $datasets, $items, $page, $inference, $include_aggregates, $registered_ip, 00142 $requester_ip); 00143 00144 $ws_b->ws_conneg($_SERVER['HTTP_ACCEPT'], $_SERVER['HTTP_ACCEPT_CHARSET'], $_SERVER['HTTP_ACCEPT_ENCODING'], 00145 $_SERVER['HTTP_ACCEPT_LANGUAGE']); 00146 00147 $ws_b->process(); 00148 00149 $ws_b->ws_respond($ws_b->ws_serialize()); 00150 00151 $mtime = microtime(); 00152 $mtime = explode(" ", $mtime); 00153 $mtime = $mtime[1] + $mtime[0]; 00154 $endtime = $mtime; 00155 $totaltime = ($endtime - $starttime); 00156 00157 $logger = new Logger("browse", $requester_ip, 00158 "?attributes=" . $attributes . "&datasets=" . $datasets . "&types=" . $types . "&items=" . $items . "&page=" . $page 00159 . "&inference=" . $inference . "&include_aggregates=" . $include_aggregates . "®istered_ip=" . $registered_ip 00160 . "&requester_ip=$requester_ip", 00161 $_SERVER['HTTP_ACCEPT'], $start_datetime, $totaltime, $ws_b->pipeline_getResponseHeaderStatus(), 00162 $_SERVER['HTTP_USER_AGENT']); 00163 00164 00166 00167 ?>
