@@ -3,6 +3,10 @@ |
||
3 | 3 | require_once(dirname(__FILE__).'/../require/class.Connection.php'); |
4 | 4 | |
5 | 5 | class create_db { |
6 | + |
|
7 | + /** |
|
8 | + * @param string $filename |
|
9 | + */ |
|
6 | 10 | public static function import_file($filename) { |
7 | 11 | $filename = filter_var($filename,FILTER_SANITIZE_STRING); |
8 | 12 | $Connection = new Connection(); |
@@ -13,6 +13,9 @@ discard block |
||
13 | 13 | function sparql_connect( $endpoint ) { return new sparql_connection( $endpoint ); } |
14 | 14 | |
15 | 15 | function sparql_ns( $short, $long, $db = null ) { return _sparql_a_connection( $db )->ns( $short, $long ); } |
16 | +/** |
|
17 | + * @param string $sparql |
|
18 | + */ |
|
16 | 19 | function sparql_query( $sparql, $db = null ) { return _sparql_a_connection( $db )->query( $sparql ); } |
17 | 20 | function sparql_errno( $db = null ) { return _sparql_a_connection( $db )->errno(); } |
18 | 21 | function sparql_error( $db = null ) { return _sparql_a_connection( $db )->error(); } |
@@ -84,6 +87,9 @@ discard block |
||
84 | 87 | $this->params = $params; |
85 | 88 | } |
86 | 89 | |
90 | + /** |
|
91 | + * @param integer $timeout |
|
92 | + */ |
|
87 | 93 | function query( $query, $timeout=null ) |
88 | 94 | { |
89 | 95 | $prefixes = ""; |
@@ -324,6 +330,10 @@ discard block |
||
324 | 330 | var $fields; |
325 | 331 | var $db; |
326 | 332 | var $i = 0; |
333 | + |
|
334 | + /** |
|
335 | + * @param sparql_connection $db |
|
336 | + */ |
|
327 | 337 | function __construct( $db, $rows, $fields ) |
328 | 338 | { |
329 | 339 | $this->rows = $rows; |
@@ -77,7 +77,7 @@ |
||
77 | 77 | /** |
78 | 78 | * Returns list of available locales |
79 | 79 | * |
80 | - * @return array |
|
80 | + * @return string[] |
|
81 | 81 | */ |
82 | 82 | public function listLocaleDir() |
83 | 83 | { |
@@ -58,6 +58,10 @@ discard block |
||
58 | 58 | } else return $ident; |
59 | 59 | } |
60 | 60 | |
61 | + /** |
|
62 | + * @param string $correct_ident |
|
63 | + * @param string $source |
|
64 | + */ |
|
61 | 65 | public function addOperator($ident,$correct_ident,$source) { |
62 | 66 | $query = "INSERT INTO translation (Operator,Operator_correct,Source) VALUES (:ident,:correct_ident,:source)"; |
63 | 67 | $query_values = array(':ident' => $ident,':correct_ident' => $correct_ident, ':source' => $source); |
@@ -69,6 +73,10 @@ discard block |
||
69 | 73 | } |
70 | 74 | } |
71 | 75 | |
76 | + /** |
|
77 | + * @param string $correct_ident |
|
78 | + * @param string $source |
|
79 | + */ |
|
72 | 80 | public function updateOperator($ident,$correct_ident,$source) { |
73 | 81 | $query = "UPDATE translation SET Operator_correct = :correct_ident,Source = :source WHERE Operator = :ident"; |
74 | 82 | $query_values = array(':ident' => $ident,':correct_ident' => $correct_ident, ':source' => $source); |
@@ -118,6 +118,9 @@ discard block |
||
118 | 118 | ); |
119 | 119 | } |
120 | 120 | |
121 | + /** |
|
122 | + * @param boolean $force |
|
123 | + */ |
|
121 | 124 | static function geosInstalled($force = NULL) { |
122 | 125 | static $geos_installed = NULL; |
123 | 126 | if ($force !== NULL) $geos_installed = $force; |
@@ -222,6 +225,10 @@ discard block |
||
222 | 225 | |
223 | 226 | // Detect a format given a value. This function is meant to be SPEEDY. |
224 | 227 | // It could make a mistake in XML detection if you are mixing or using namespaces in weird ways (ie, KML inside an RSS feed) |
228 | + |
|
229 | + /** |
|
230 | + * @return string |
|
231 | + */ |
|
225 | 232 | static function detectFormat(&$input) { |
226 | 233 | $mem = fopen('php://memory', 'r+'); |
227 | 234 | fwrite($mem, $input, 11); // Write 11 bytes - we can detect the vast majority of formats in the first 11 bytes |
@@ -113,7 +113,6 @@ discard block |
||
113 | 113 | * Serializes an object into a geojson string |
114 | 114 | * |
115 | 115 | * |
116 | - * @param Geometry $obj The object to serialize |
|
117 | 116 | * |
118 | 117 | * @return string The GeoJSON string |
119 | 118 | */ |
@@ -126,6 +125,9 @@ discard block |
||
126 | 125 | } |
127 | 126 | } |
128 | 127 | |
128 | + /** |
|
129 | + * @param Geometry $geometry |
|
130 | + */ |
|
129 | 131 | public function getArray($geometry) { |
130 | 132 | if ($geometry->getGeomType() == 'GeometryCollection') { |
131 | 133 | $component_array = array(); |
@@ -18,8 +18,6 @@ discard block |
||
18 | 18 | /** |
19 | 19 | * Read GeoRSS string into geometry objects |
20 | 20 | * |
21 | - * @param string $georss - an XML feed containing geoRSS |
|
22 | - * |
|
23 | 21 | * @return Geometry|GeometryCollection |
24 | 22 | */ |
25 | 23 | public function read($gpx) { |
@@ -80,6 +78,9 @@ discard block |
||
80 | 78 | return geoPHP::geometryReduce($geometries); |
81 | 79 | } |
82 | 80 | |
81 | + /** |
|
82 | + * @param string $string |
|
83 | + */ |
|
83 | 84 | protected function getPointsFromCoords($string) { |
84 | 85 | $coords = array(); |
85 | 86 | $latlon = explode(' ',$string); |
@@ -42,6 +42,9 @@ |
||
42 | 42 | return '<'.$this->nss.'gpx creator="geoPHP" version="1.0">'.$this->geometryToGPX($geometry).'</'.$this->nss.'gpx>'; |
43 | 43 | } |
44 | 44 | |
45 | + /** |
|
46 | + * @param string $text |
|
47 | + */ |
|
45 | 48 | public function geomFromText($text) { |
46 | 49 | // Change to lower-case and strip all CDATA |
47 | 50 | $text = strtolower($text); |
@@ -49,6 +49,9 @@ discard block |
||
49 | 49 | return $this->geometryToKML($geometry); |
50 | 50 | } |
51 | 51 | |
52 | + /** |
|
53 | + * @param string $text |
|
54 | + */ |
|
52 | 55 | public function geomFromText($text) { |
53 | 56 | |
54 | 57 | // Change to lower-case and strip all CDATA |
@@ -184,6 +187,9 @@ discard block |
||
184 | 187 | return $coordinates; |
185 | 188 | } |
186 | 189 | |
190 | + /** |
|
191 | + * @param Geometry $geom |
|
192 | + */ |
|
187 | 193 | private function geometryToKML($geom) { |
188 | 194 | $type = strtolower($geom->getGeomType()); |
189 | 195 | switch ($type) { |