index.php
Go to the documentation of this file.
00001 <?php 00002 00005 00018 // Don't display errors to the users. Set it to "On" to see errors for debugging purposes. 00019 ini_set("display_errors", "Off"); 00020 00021 ini_set("memory_limit", "128M"); 00022 set_time_limit(2700); 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 include_once("../../framework/Namespaces.php"); 00033 00034 include_once("../../framework/ProcessorXML.php"); 00035 00036 include_once("TrackerCreate.php"); 00037 include_once("../../auth/validator/AuthValidator.php"); 00038 00039 include_once("../../framework/Logger.php"); 00040 00041 00042 // IP being registered 00043 $registered_ip = ""; 00044 00045 if(isset($_POST['registered_ip'])) 00046 { 00047 $registered_ip = $_POST['registered_ip']; 00048 } 00049 00050 // Dataset where the record is indexed 00051 $fromDataset = ""; 00052 00053 if(isset($_POST['from_dataset'])) 00054 { 00055 $fromDataset = $_POST['from_dataset']; 00056 } 00057 00058 // Record that got changed 00059 $record = ""; 00060 00061 if(isset($_POST['record'])) 00062 { 00063 $record = $_POST['record']; 00064 } 00065 00066 // Action that has been performed on the record 00067 $action = ""; 00068 00069 if(isset($_POST['action'])) 00070 { 00071 $action = $_POST['action']; 00072 } 00073 00074 // Serialization of the state (usually RDF description) of the record prior the performance of the action on the record. 00075 $previousState = ""; 00076 00077 if(isset($_POST['previous_state'])) 00078 { 00079 $previousState = $_POST['previous_state']; 00080 } 00081 00082 // MIME type of the serialization of the previous state of a record. Usually, application/rdf+xml or application/rdf+n3. 00083 $previousStateMime = ""; 00084 00085 if(isset($_POST['previous_state_mime'])) 00086 { 00087 $previousStateMime = $_POST['previous_state_mime']; 00088 } 00089 00090 // Performer of the action on the target record. 00091 $performer = ""; 00092 00093 if(isset($_POST['performer'])) 00094 { 00095 $performer = $_POST['performer']; 00096 } 00097 00098 $mtime = microtime(); 00099 $mtime = explode(' ', $mtime); 00100 $mtime = $mtime[1] + $mtime[0]; 00101 $starttime = $mtime; 00102 00103 $start_datetime = date("Y-m-d h:i:s"); 00104 00105 $requester_ip = "0.0.0.0"; 00106 00107 if(isset($_SERVER['REMOTE_ADDR'])) 00108 { 00109 $requester_ip = $_SERVER['REMOTE_ADDR']; 00110 } 00111 00112 $parameters = ""; 00113 00114 if(isset($_SERVER['REQUEST_URI'])) 00115 { 00116 $parameters = $_SERVER['REQUEST_URI']; 00117 00118 $pos = strpos($parameters, "?"); 00119 00120 if($pos !== FALSE) 00121 { 00122 $parameters = substr($parameters, $pos, strlen($parameters) - $pos); 00123 } 00124 } 00125 elseif(isset($_SERVER['PHP_SELF'])) 00126 { 00127 $parameters = $_SERVER['PHP_SELF']; 00128 } 00129 00130 $ws_trackercreate = new TrackerCreate($fromDataset, $record, $action, $previousState, $previousStateMime, $performer, $registered_ip, $requester_ip); 00131 00132 $ws_trackercreate->ws_conneg($_SERVER['HTTP_ACCEPT'], $_SERVER['HTTP_ACCEPT_CHARSET'], $_SERVER['HTTP_ACCEPT_ENCODING'], 00133 $_SERVER['HTTP_ACCEPT_LANGUAGE']); 00134 00135 $ws_trackercreate->process(); 00136 00137 $ws_trackercreate->ws_respond($ws_trackercreate->ws_serialize()); 00138 00139 $mtime = microtime(); 00140 $mtime = explode(" ", $mtime); 00141 $mtime = $mtime[1] + $mtime[0]; 00142 $endtime = $mtime; 00143 $totaltime = ($endtime - $starttime); 00144 00145 $logger = new Logger("tracker_create", $requester_ip, 00146 "?from_dataset=" . urlencode($fromDataset) . "&record=" . urlencode($record) . "&action=" . $action . 00147 "&previous_state=&previous_state_mime=" . $previousStateMime . "&performer=" . urlencode($performer) . "®istered_ip=" 00148 . $registered_ip . "&requester_ip=$requester_ip", $_SERVER['HTTP_ACCEPT'], $start_datetime, $totaltime, 00149 $ws_trackercreate->pipeline_getResponseHeaderStatus(), $_SERVER['HTTP_USER_AGENT']); 00150 00151 00153 00154 ?>
