@@ -27,6 +27,9 @@ |
||
27 | 27 | |
28 | 28 | /* */ |
29 | 29 | |
30 | + /** |
|
31 | + * @return string |
|
32 | + */ |
|
30 | 33 | function getLabel($res, $ps = '') { |
31 | 34 | if (!$ps) $ps = array(); |
32 | 35 | foreach ($ps as $p => $os) { |
@@ -32,6 +32,11 @@ |
||
32 | 32 | |
33 | 33 | /* */ |
34 | 34 | |
35 | + /** |
|
36 | + * @param string $type |
|
37 | + * |
|
38 | + * @return string |
|
39 | + */ |
|
35 | 40 | function getTerm($v, $type) { |
36 | 41 | if (!is_array($v)) {/* uri or bnode */ |
37 | 42 | if (preg_match('/^\_\:(.*)$/', $v, $m)) { |
@@ -113,6 +113,9 @@ |
||
113 | 113 | return array(0, $v); |
114 | 114 | } |
115 | 115 | |
116 | + /** |
|
117 | + * @param string $v |
|
118 | + */ |
|
116 | 119 | function xBlockSet($v) { |
117 | 120 | if (!$r = $this->x("\{", $v)) return array(0, $v); |
118 | 121 | $blocks = array(); |
@@ -73,6 +73,9 @@ discard block |
||
73 | 73 | |
74 | 74 | /* */ |
75 | 75 | |
76 | + /** |
|
77 | + * @param string $val |
|
78 | + */ |
|
76 | 79 | function setVar($name, $val, $type = 'literal', $meta = '') { |
77 | 80 | /* types: literal, var, rows, bool, doc, http_response, undefined, ? */ |
78 | 81 | $this->env['vars'][$name] = array( |
@@ -160,6 +163,9 @@ discard block |
||
160 | 163 | return ''; |
161 | 164 | } |
162 | 165 | |
166 | + /** |
|
167 | + * @param string $path |
|
168 | + */ |
|
163 | 169 | function getPropertyValue($obj, $path) { |
164 | 170 | $val = isset($obj['value']) ? $obj['value'] : $obj; |
165 | 171 | $path = $this->replacePlaceholders($path, 'property_value', 0); |
@@ -241,6 +247,9 @@ discard block |
||
241 | 247 | |
242 | 248 | /* */ |
243 | 249 | |
250 | + /** |
|
251 | + * @param string $context |
|
252 | + */ |
|
244 | 253 | function getArraySerialization($v, $context) { |
245 | 254 | $v_type = ARC2::getStructType($v);/* string|array|triples|index */ |
246 | 255 | $pf = ARC2::getPreferredFormat(); |
@@ -308,6 +317,9 @@ discard block |
||
308 | 317 | } |
309 | 318 | } |
310 | 319 | |
320 | + /** |
|
321 | + * @return boolean |
|
322 | + */ |
|
311 | 323 | function getStore($ep_uri) { |
312 | 324 | /* local store */ |
313 | 325 | if ((!$ep_uri || $ep_uri == ARC2::getScriptURI()) && ($this->v('sparqlscript_default_endpoint', '', $this->a) == 'local')) { |
@@ -58,6 +58,9 @@ |
||
58 | 58 | |
59 | 59 | /* */ |
60 | 60 | |
61 | + /** |
|
62 | + * @param string $q |
|
63 | + */ |
|
61 | 64 | function query($q, $result_format = '', $src = '', $keep_bnode_ids = 0, $log_query = 0) { |
62 | 65 | if ($log_query) $this->logQuery($q); |
63 | 66 | ARC2::inc('SPARQLPlusParser'); |
@@ -92,6 +92,9 @@ discard block |
||
92 | 92 | |
93 | 93 | /* */ |
94 | 94 | |
95 | + /** |
|
96 | + * @return string |
|
97 | + */ |
|
95 | 98 | function getCollation() { |
96 | 99 | $rs = $this->queryDB('SHOW TABLE STATUS LIKE "' . $this->getTablePrefix(). 'setting"', $this->getDBCon()); |
97 | 100 | return ($rs && ($row = mysql_fetch_array($rs)) && isset($row['Collation'])) ? $row['Collation'] : ''; |
@@ -109,6 +112,9 @@ discard block |
||
109 | 112 | |
110 | 113 | /* */ |
111 | 114 | |
115 | + /** |
|
116 | + * @param string $tbl |
|
117 | + */ |
|
112 | 118 | function hasHashColumn($tbl) { |
113 | 119 | $var_name = 'has_hash_column_' . $tbl; |
114 | 120 | if (!isset($this->$var_name)) { |
@@ -203,6 +209,9 @@ discard block |
||
203 | 209 | return ($rs && ($row = mysql_fetch_array($rs))) ? 1 : 0; |
204 | 210 | } |
205 | 211 | |
212 | + /** |
|
213 | + * @param string $k |
|
214 | + */ |
|
206 | 215 | function getSetting($k, $default = 0) { |
207 | 216 | $tbl = $this->getTablePrefix() . 'setting'; |
208 | 217 | $sql = "SELECT val FROM " . $tbl . " WHERE k = '" .md5($k). "'"; |
@@ -213,6 +222,9 @@ discard block |
||
213 | 222 | return $default; |
214 | 223 | } |
215 | 224 | |
225 | + /** |
|
226 | + * @param string $k |
|
227 | + */ |
|
216 | 228 | function setSetting($k, $v) { |
217 | 229 | $con = $this->getDBCon(); |
218 | 230 | $tbl = $this->getTablePrefix() . 'setting'; |
@@ -225,6 +237,9 @@ discard block |
||
225 | 237 | return $this->queryDB($sql, $con); |
226 | 238 | } |
227 | 239 | |
240 | + /** |
|
241 | + * @param string $k |
|
242 | + */ |
|
228 | 243 | function removeSetting($k) { |
229 | 244 | $tbl = $this->getTablePrefix() . 'setting'; |
230 | 245 | return $this->queryDB("DELETE FROM " . $tbl . " WHERE k = '" . md5($k) . "'", $this->getDBCon()); |
@@ -376,6 +391,9 @@ discard block |
||
376 | 391 | |
377 | 392 | /* */ |
378 | 393 | |
394 | + /** |
|
395 | + * @param string $q |
|
396 | + */ |
|
379 | 397 | function query($q, $result_format = '', $src = '', $keep_bnode_ids = 0, $log_query = 0) { |
380 | 398 | if ($log_query) $this->logQuery($q); |
381 | 399 | $con = $this->getDBCon(); |
@@ -464,6 +482,9 @@ discard block |
||
464 | 482 | return abs(crc32($val)); |
465 | 483 | } |
466 | 484 | |
485 | + /** |
|
486 | + * @return resource|null |
|
487 | + */ |
|
467 | 488 | function getTermID($val, $term = '') { |
468 | 489 | $tbl = preg_match('/^(s|o)$/', $term) ? $term . '2val' : 'id2val'; |
469 | 490 | $con = $this->getDBCon(); |
@@ -605,6 +626,9 @@ discard block |
||
605 | 626 | ); |
606 | 627 | } |
607 | 628 | |
629 | + /** |
|
630 | + * @param string[] $ps |
|
631 | + */ |
|
608 | 632 | function inferLabelProps($ps) { |
609 | 633 | $this->query('DELETE FROM <label-properties>'); |
610 | 634 | $sub_q = ''; |
@@ -82,6 +82,9 @@ discard block |
||
82 | 82 | |
83 | 83 | /* */ |
84 | 84 | |
85 | + /** |
|
86 | + * @param string $q |
|
87 | + */ |
|
85 | 88 | function saveCustomSPOG($path, $q) { |
86 | 89 | if (!$fp = @fopen($path, 'w')) return $this->addError('Could not create backup file at ' . realpath($path)); |
87 | 90 | fwrite($fp, $this->getHeader()); |
@@ -95,6 +98,9 @@ discard block |
||
95 | 98 | |
96 | 99 | /* */ |
97 | 100 | |
101 | + /** |
|
102 | + * @param integer $offset |
|
103 | + */ |
|
98 | 104 | function getRecordset($offset) { |
99 | 105 | $prefix = $this->store->getTablePrefix(); |
100 | 106 | $con = $this->store->getDBCon(); |
@@ -33,6 +33,9 @@ discard block |
||
33 | 33 | |
34 | 34 | /* */ |
35 | 35 | |
36 | + /** |
|
37 | + * @return string |
|
38 | + */ |
|
36 | 39 | function getQueryString($mthd = '') { |
37 | 40 | $r = ''; |
38 | 41 | if (!$mthd || ($mthd == 'post')) { |
@@ -65,6 +68,10 @@ discard block |
||
65 | 68 | return $this->v1('endpoint_features', array(), $this->a); |
66 | 69 | } |
67 | 70 | |
71 | + /** |
|
72 | + * @param string $k |
|
73 | + * @param string $v |
|
74 | + */ |
|
68 | 75 | function setHeader($k, $v) { |
69 | 76 | $this->headers[$k] = $v; |
70 | 77 | } |
@@ -78,6 +85,9 @@ discard block |
||
78 | 85 | } |
79 | 86 | } |
80 | 87 | |
88 | + /** |
|
89 | + * @return string |
|
90 | + */ |
|
81 | 91 | function getResult() { |
82 | 92 | return $this->result; |
83 | 93 | } |
@@ -289,6 +299,9 @@ discard block |
||
289 | 299 | |
290 | 300 | /* */ |
291 | 301 | |
302 | + /** |
|
303 | + * @param string $default |
|
304 | + */ |
|
292 | 305 | function getResultFormat($formats, $default) { |
293 | 306 | $prefs = array(); |
294 | 307 | /* arg */ |
@@ -179,6 +179,10 @@ discard block |
||
179 | 179 | return 1; |
180 | 180 | } |
181 | 181 | |
182 | + /** |
|
183 | + * @param string $type_id |
|
184 | + * @param string $tbl |
|
185 | + */ |
|
182 | 186 | function getTermID($val, $type_id, $tbl) { |
183 | 187 | $con = $this->store->getDBCon(); |
184 | 188 | /* buffered */ |
@@ -415,6 +419,9 @@ discard block |
||
415 | 419 | return 1; |
416 | 420 | } |
417 | 421 | |
422 | + /** |
|
423 | + * @param string $er |
|
424 | + */ |
|
418 | 425 | function autoRepairTable($er, $con, $sql = '') { |
419 | 426 | $this->addError('MySQL error: ' . $er . ' (' . $sql . ')'); |
420 | 427 | if (preg_match('/Table \'[^\']+\/([a-z0-9\_\-]+)\' .*(crashed|repair)/i', $er, $m)) { |