File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed
Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -9,18 +9,22 @@ class Api
99{
1010 private $ token ;
1111 private $ key ;
12+ private $ domain ;
1213
1314 private $ error ;
1415
1516 /**
1617 * @param string $token
1718 * @param string $key
1819 */
19- public function __construct ($ token , $ key )
20+ public function __construct ($ token , $ key, $ domain = false )
2021 {
2122 $ this ->token = $ token ;
2223 $ this ->key = $ key ;
2324 $ this ->error = NULL ;
25+ $ this ->domain = 'http://kladr-api.ru/ ' ;
26+ if ($ domain )
27+ $ this ->domain = domain;
2428 }
2529
2630 private function GetURL (Query $ query )
@@ -30,17 +34,12 @@ private function GetURL(Query $query)
3034 return FALSE ;
3135 }
3236
33- if (empty ($ this ->key )) {
34- $ this ->error = 'Ключ не может быть пустым ' ;
35- return FALSE ;
36- }
37-
3837 if (empty ($ query )) {
3938 $ this ->error = 'Объект запроса не может быть пустым ' ;
4039 return FALSE ;
4140 }
4241
43- return ' http://kladr-api.ru/ api.php? ' . $ query . '&token= ' . $ this ->token . ' &key= ' . $ this -> key ;
42+ return $ this -> domain . ' api.php? ' . $ query . '&token= ' . $ this ->token ;
4443 }
4544
4645 /**
You can’t perform that action at this time.
0 commit comments