index.php
Go to the documentation of this file.
00001 <?php 00002 00005 00018 error_reporting(0); 00019 00020 ini_set("memory_limit", "64M"); 00021 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 // Loading the Named Entities Extraction web service 00035 include_once("ConverterBibtex.php"); 00036 include_once("BibtexParser.php"); 00037 include_once("BibtexParserCsv.php"); 00038 include_once("BibtexItem.php"); 00039 00040 include_once("../../framework/Logger.php"); 00041 00042 $document = ""; 00043 $url = ""; 00044 00045 /* 00046 3 mime choices for the text input: 00047 00048 (1) application/x-bibtex 00049 (2) application/rdf+xml 00050 (3) application/rdf+n3 00051 */ 00052 00053 $base_uri = "http://www.baseuri.com/resource/"; 00054 00055 if(isset($_POST['document'])) 00056 { 00057 $document = str_replace('\"', '"', $_POST['document']); 00058 } 00059 00060 $docmime = "application/x-bibtex"; 00061 00062 if(isset($_POST['docmime'])) 00063 { 00064 $docmime = $_POST['docmime']; 00065 } 00066 00067 if(isset($_POST['base_uri'])) 00068 { 00069 $base_uri = $_POST['base_uri']; 00070 } 00071 00072 $registered_ip = ""; 00073 00074 if(isset($_POST['registered_ip'])) 00075 { 00076 $registered_ip = $_POST['registered_ip']; 00077 } 00078 00079 $mtime = microtime(); 00080 $mtime = explode(' ', $mtime); 00081 $mtime = $mtime[1] + $mtime[0]; 00082 $starttime = $mtime; 00083 00084 $start_datetime = date("Y-m-d h:i:s"); 00085 00086 $requester_ip = "0.0.0.0"; 00087 00088 if(isset($_SERVER['REMOTE_ADDR'])) 00089 { 00090 $requester_ip = $_SERVER['REMOTE_ADDR']; 00091 } 00092 00093 $parameters = ""; 00094 00095 if(isset($_SERVER['REQUEST_URI'])) 00096 { 00097 $parameters = $_SERVER['REQUEST_URI']; 00098 00099 $pos = strpos($parameters, "?"); 00100 00101 if($pos !== FALSE) 00102 { 00103 $parameters = substr($parameters, $pos, strlen($parameters) - $pos); 00104 } 00105 } 00106 elseif(isset($_SERVER['PHP_SELF'])) 00107 { 00108 $parameters = $_SERVER['PHP_SELF']; 00109 } 00110 00111 $ws_cbibtex = new ConverterBibtex($document, $docmime, $base_uri, $registered_ip, $requester_ip); 00112 00113 $ws_cbibtex->ws_conneg($_SERVER['HTTP_ACCEPT'], $_SERVER['HTTP_ACCEPT_CHARSET'], $_SERVER['HTTP_ACCEPT_ENCODING'], 00114 $_SERVER['HTTP_ACCEPT_LANGUAGE']); 00115 00116 $ws_cbibtex->process(); 00117 00118 $ws_cbibtex->ws_respond($ws_cbibtex->ws_serialize()); 00119 00120 $mtime = microtime(); 00121 $mtime = explode(" ", $mtime); 00122 $mtime = $mtime[1] + $mtime[0]; 00123 $endtime = $mtime; 00124 $totaltime = ($endtime - $starttime); 00125 00126 $logger = new Logger("converter/bibtex", $requester_ip, 00127 "?text=-&type=" . $type . "&base_uri=" . $base_uri . "&requester_ip=$requester_ip", $_SERVER['HTTP_ACCEPT'], 00128 $start_datetime, $totaltime, $ws_cbibtex->pipeline_getResponseHeaderStatus(), $_SERVER['HTTP_USER_AGENT']); 00129 00130 00132 00133 ?>
