@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | } elseif ($parts[1] == 'data') { |
38 | 38 | $controller->data($request); |
39 | 39 | } elseif (sizeof($parts) == 2) { |
40 | - header("Location: " . $parts[1] . "/"); |
|
40 | + header("Location: ".$parts[1]."/"); |
|
41 | 41 | } else { |
42 | 42 | $vocab = $parts[1]; |
43 | 43 | try { |
@@ -93,5 +93,5 @@ discard block |
||
93 | 93 | } |
94 | 94 | } catch (Exception $e) { |
95 | 95 | header("HTTP/1.0 500 Internal Server Error"); |
96 | - echo('ERROR: ' . $e->getMessage()); |
|
96 | + echo('ERROR: '.$e->getMessage()); |
|
97 | 97 | } |
@@ -23,5 +23,5 @@ |
||
23 | 23 | |
24 | 24 | } catch (Exception $e) { |
25 | 25 | header("HTTP/1.0 500 Internal Server Error"); |
26 | - echo('ERROR: ' . $e->getMessage()); |
|
26 | + echo('ERROR: '.$e->getMessage()); |
|
27 | 27 | } |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | } |
15 | 15 | require_once 'vendor/autoload.php'; |
16 | 16 | } catch (Exception $e) { |
17 | - echo "Error: " . $e->getMessage(); |
|
17 | + echo "Error: ".$e->getMessage(); |
|
18 | 18 | return; |
19 | 19 | } |
20 | 20 | |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | // if language code missing, redirect to guessed language |
33 | 33 | // in any case, redirect to <lang>/ |
34 | 34 | $lang = sizeof($parts) == 2 && $parts[1] !== '' ? $parts[1] : $controller->guessLanguage(); |
35 | - header("Location: " . $lang . "/"); |
|
35 | + header("Location: ".$lang."/"); |
|
36 | 36 | } else { |
37 | 37 | if (array_key_exists($parts[1], $config->getLanguages())) { // global pages |
38 | 38 | $request->setLang($parts[1]); |
@@ -61,8 +61,8 @@ discard block |
||
61 | 61 | } |
62 | 62 | if (sizeof($parts) == 3) { // language code missing |
63 | 63 | $lang = $controller->guessLanguage(); |
64 | - $newurl = $controller->getBaseHref() . $vocab . "/" . $lang . "/"; |
|
65 | - header("Location: " . $newurl); |
|
64 | + $newurl = $controller->getBaseHref().$vocab."/".$lang."/"; |
|
65 | + header("Location: ".$newurl); |
|
66 | 66 | } else { |
67 | 67 | if (array_key_exists($parts[2], $config->getLanguages())) { |
68 | 68 | $lang = $parts[2]; |
@@ -103,10 +103,10 @@ discard block |
||
103 | 103 | } |
104 | 104 | } else { // language code missing, redirect to some language version |
105 | 105 | $lang = $controller->guessLanguage($vocab); |
106 | - $newurl = $controller->getBaseHref() . $vocab . "/" . $lang . "/" . implode('/', array_slice($parts, 2)); |
|
106 | + $newurl = $controller->getBaseHref().$vocab."/".$lang."/".implode('/', array_slice($parts, 2)); |
|
107 | 107 | $qs = $request->getServerConstant('QUERY_STRING'); |
108 | 108 | if ($qs) { |
109 | - $newurl .= "?" . $qs; |
|
109 | + $newurl .= "?".$qs; |
|
110 | 110 | } |
111 | 111 | header("Location: $newurl"); |
112 | 112 | } |
@@ -19,7 +19,7 @@ |
||
19 | 19 | /** |
20 | 20 | * Wraps apc_store() and apcu_store() |
21 | 21 | */ |
22 | - public function store($key, $value, $ttl=3600) { |
|
22 | + public function store($key, $value, $ttl = 3600) { |
|
23 | 23 | if (function_exists('apcu_store')) { |
24 | 24 | return apcu_store($key, $value, $ttl); |
25 | 25 | } |
@@ -84,7 +84,7 @@ |
||
84 | 84 | foreach (explode(' ', GLOBAL_PLUGINS) as $pluginName) { |
85 | 85 | $globalPluginsArray[] = "\"$pluginName\""; |
86 | 86 | } |
87 | - $globalPlugins = " " . implode(', ', $globalPluginsArray) . " "; |
|
87 | + $globalPlugins = " ".implode(', ', $globalPluginsArray)." "; |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | # print the prefixes |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | $baseurl = $this->getBaseHref(); |
17 | 17 | $vocid = $vocab->getId(); |
18 | 18 | $query = http_build_query(array('uri'=>$uri, 'format'=>$targetFormat)); |
19 | - $url = $baseurl . "rest/v1/$vocid/data?$query"; |
|
19 | + $url = $baseurl."rest/v1/$vocid/data?$query"; |
|
20 | 20 | $this->redirect303($url); |
21 | 21 | } |
22 | 22 | |
@@ -27,16 +27,16 @@ discard block |
||
27 | 27 | $localname = $vocab->getLocalName($uri); |
28 | 28 | |
29 | 29 | if (!$localname) { |
30 | - $url = $baseurl . "$vocid/"; |
|
30 | + $url = $baseurl."$vocid/"; |
|
31 | 31 | } else { |
32 | 32 | |
33 | 33 | if ($localname !== $uri && $localname === urlencode($localname)) { |
34 | 34 | // the URI can be shortened |
35 | - $url = $baseurl . "$vocid/page/$localname"; |
|
35 | + $url = $baseurl."$vocid/page/$localname"; |
|
36 | 36 | } else { |
37 | 37 | // must use full URI |
38 | 38 | $query = http_build_query(array('uri'=>$uri)); |
39 | - $url = $baseurl . "$vocid/page/?" . $query; |
|
39 | + $url = $baseurl."$vocid/page/?".$query; |
|
40 | 40 | } |
41 | 41 | } |
42 | 42 | $this->redirect303($url); |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | // guess vocabulary based on URI |
58 | 58 | $vocab = $this->model->guessVocabularyFromURI($request->getUri()); |
59 | 59 | if ($vocab === null) { |
60 | - return $this->returnError('404', 'Not Found', 'Unrecognized URI ' . $request->getUri()); |
|
60 | + return $this->returnError('404', 'Not Found', 'Unrecognized URI '.$request->getUri()); |
|
61 | 61 | } |
62 | 62 | $request->setVocab($vocab->getId()); |
63 | 63 | } |
@@ -13,7 +13,7 @@ |
||
13 | 13 | $opts = array('http' => array('method'=>'HEAD', |
14 | 14 | 'user_agent' => 'Skosmos', |
15 | 15 | 'timeout' => $timeout)); |
16 | - $context = stream_context_create($opts); |
|
16 | + $context = stream_context_create($opts); |
|
17 | 17 | $fd = fopen($this->uri, 'rb', false, $context); |
18 | 18 | $headers = stream_get_meta_data($fd)['wrapper_data']; |
19 | 19 | foreach ($headers as $header) { |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | // 1. Ensure characters with special meaning in Lucene are escaped |
42 | 42 | $lucenemap = array(); |
43 | 43 | foreach (str_split(self::LUCENE_ESCAPE_CHARS) as $char) { |
44 | - $lucenemap[$char] = '\\' . $char; // escape with a backslash |
|
44 | + $lucenemap[$char] = '\\'.$char; // escape with a backslash |
|
45 | 45 | } |
46 | 46 | $term = strtr($term, $lucenemap); |
47 | 47 | |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | * @return string sparql order by clause |
93 | 93 | */ |
94 | 94 | private function formatOrderBy($expression, $lang) { |
95 | - if(!$this->model->getConfig()->getCollationEnabled()) { |
|
95 | + if (!$this->model->getConfig()->getCollationEnabled()) { |
|
96 | 96 | return $expression; |
97 | 97 | } |
98 | 98 | $orderby = sprintf('arq:collation(\'%2$s\', %1$s)', $expression, $lang); |
@@ -126,15 +126,15 @@ discard block |
||
126 | 126 | # make text query clause |
127 | 127 | $lcletter = mb_strtolower($letter, 'UTF-8'); // convert to lower case, UTF-8 safe |
128 | 128 | $langClause = $this->generateLangClause($lang); |
129 | - $textcondPref = $this->createTextQueryCondition($letter . '*', 'skos:prefLabel', $langClause); |
|
130 | - $textcondAlt = $this->createTextQueryCondition($letter . '*', 'skos:altLabel', $langClause); |
|
131 | - $orderbyclause = $this->formatOrderBy("LCASE(?match)", $lang) . " STR(?s) LCASE(STR(?qualifier))"; |
|
129 | + $textcondPref = $this->createTextQueryCondition($letter.'*', 'skos:prefLabel', $langClause); |
|
130 | + $textcondAlt = $this->createTextQueryCondition($letter.'*', 'skos:altLabel', $langClause); |
|
131 | + $orderbyclause = $this->formatOrderBy("LCASE(?match)", $lang)." STR(?s) LCASE(STR(?qualifier))"; |
|
132 | 132 | |
133 | - $qualifierClause = $qualifier ? "OPTIONAL { ?s <" . $qualifier->getURI() . "> ?qualifier }" : ""; |
|
133 | + $qualifierClause = $qualifier ? "OPTIONAL { ?s <".$qualifier->getURI()."> ?qualifier }" : ""; |
|
134 | 134 | |
135 | - $filterDeprecated=""; |
|
136 | - if(!$showDeprecated){ |
|
137 | - $filterDeprecated="FILTER NOT EXISTS { ?s owl:deprecated true }"; |
|
135 | + $filterDeprecated = ""; |
|
136 | + if (!$showDeprecated) { |
|
137 | + $filterDeprecated = "FILTER NOT EXISTS { ?s owl:deprecated true }"; |
|
138 | 138 | } |
139 | 139 | |
140 | 140 | $query = <<<EOQ |
@@ -156,18 +156,18 @@ discard block |
||
156 | 156 | $localname = $vocab->getLocalName($uri); |
157 | 157 | if ($localname !== $uri && $localname === urlencode($localname)) { |
158 | 158 | // check that the prefix stripping worked, and there are no problematic chars in localname |
159 | - $paramstr = count($params) > 0 ? '?' . http_build_query($params) : ''; |
|
159 | + $paramstr = count($params) > 0 ? '?'.http_build_query($params) : ''; |
|
160 | 160 | if ($type && $type !== '' && $type !== 'vocab' && !($localname === '' && $type === 'page')) { |
161 | - return "$vocid/$lang/$type/$localname" . $paramstr; |
|
161 | + return "$vocid/$lang/$type/$localname".$paramstr; |
|
162 | 162 | } |
163 | 163 | |
164 | - return "$vocid/$lang/$localname" . $paramstr; |
|
164 | + return "$vocid/$lang/$localname".$paramstr; |
|
165 | 165 | } |
166 | 166 | |
167 | 167 | // case 2: URI outside vocabulary namespace, or has problematic chars |
168 | 168 | // pass the full URI as parameter instead |
169 | 169 | $params['uri'] = $uri; |
170 | - return "$vocid/$lang/$type/?" . http_build_query($params); |
|
170 | + return "$vocid/$lang/$type/?".http_build_query($params); |
|
171 | 171 | } |
172 | 172 | |
173 | 173 | /** |
@@ -293,7 +293,7 @@ discard block |
||
293 | 293 | { |
294 | 294 | if ($modifiedDate) { |
295 | 295 | $ifModifiedSince = $this->getIfModifiedSince(); |
296 | - $this->sendHeader("Last-Modified: " . $modifiedDate->format('D, d M Y H:i:s \G\M\T')); |
|
296 | + $this->sendHeader("Last-Modified: ".$modifiedDate->format('D, d M Y H:i:s \G\M\T')); |
|
297 | 297 | if ($ifModifiedSince !== null && $ifModifiedSince >= $modifiedDate) { |
298 | 298 | $this->sendHeader("HTTP/1.0 304 Not Modified"); |
299 | 299 | return true; |