1 | <?php |
||
19 | class Command extends \Symfony\Component\Console\Command\Command |
||
20 | { |
||
21 | /** |
||
22 | * Available caches. |
||
23 | * |
||
24 | * @var array |
||
25 | */ |
||
26 | private $caches = [ |
||
27 | 'memcached' => 'Memcached', |
||
28 | 'mongodb' => 'MongoDB', |
||
29 | 'redis' => 'Redis', |
||
30 | ]; |
||
31 | |||
32 | /** |
||
33 | * Available adapters. |
||
34 | * |
||
35 | * @var array |
||
36 | */ |
||
37 | private $adapters = [ |
||
38 | 'buzz' => 'BuzzHttpAdapter', |
||
39 | 'curl' => 'CurlHttpAdapter', |
||
40 | 'guzzle' => 'GuzzleHttpAdapter', |
||
41 | 'socket' => 'SocketHttpAdapter', |
||
42 | 'zend' => 'ZendHttpAdapter', |
||
43 | ]; |
||
44 | |||
45 | /** |
||
46 | * Available providers. |
||
47 | * |
||
48 | * @var array |
||
49 | */ |
||
50 | private $providers = [ |
||
51 | 'free_geo_ip' => 'FreeGeoIp', |
||
52 | 'host_ip' => 'HostIp', |
||
53 | 'ip_info_db' => 'IpInfoDb', |
||
54 | 'google_maps' => 'GoogleMaps', |
||
55 | 'google_maps_business' => 'GoogleMapsBusiness', |
||
56 | 'bing_maps' => 'BingMaps', |
||
57 | 'openstreetmaps' => 'OpenStreetMap', |
||
58 | 'cloudmade' => 'CloudMade', |
||
59 | 'geoip' => 'Geoip', |
||
60 | 'map_quest' => 'MapQuest', |
||
61 | 'oio_rest' => 'OIORest', |
||
62 | 'geocoder_ca' => 'GeocoderCa', |
||
63 | 'geocoder_us' => 'GeocoderUs', |
||
64 | 'ign_openls' => 'IGNOpenLS', |
||
65 | 'data_science_toolkit' => 'DataScienceToolkit', |
||
66 | 'yandex' => 'Yandex', |
||
67 | 'geo_plugin' => 'GeoPlugin', |
||
68 | 'geo_ips' => 'GeoIPs', |
||
69 | 'maxmind' => 'MaxMind', |
||
70 | 'geonames' => 'Geonames', |
||
71 | 'ip_geo_base' => 'IpGeoBase', |
||
72 | 'baidu' => 'Baidu', |
||
73 | 'tomtom' => 'TomTom', |
||
74 | 'arcgis_online' => 'ArcGISOnline', |
||
75 | ]; |
||
76 | |||
77 | /** |
||
78 | * Available dumpers. |
||
79 | * |
||
80 | * @var array |
||
81 | */ |
||
82 | private $dumpers = [ |
||
83 | 'gpx' => 'Gpx', |
||
84 | 'geojson' => 'GeoJson', |
||
85 | 'kml' => 'Kml', |
||
86 | 'wkb' => 'Wkb', |
||
87 | 'wkt' => 'Wkt', |
||
88 | ]; |
||
89 | |||
90 | |||
91 | /** |
||
92 | * Returns the cache class name. |
||
93 | * The default cache is Redis. |
||
94 | * |
||
95 | * @param string $cache The name of the cache to use. |
||
96 | * |
||
97 | * @return string The name of the cache to use. |
||
98 | */ |
||
99 | protected function getCache($cache) |
||
108 | |||
109 | /** |
||
110 | * Returns the list of available caches sorted by alphabetical order. |
||
111 | * |
||
112 | * @return string The list of available caches comma separated. |
||
113 | */ |
||
114 | 3 | protected function getCaches() |
|
120 | |||
121 | /** |
||
122 | * Returns the adapter class name. |
||
123 | * The default adapter is cURL. |
||
124 | * |
||
125 | * @param string $adapter The name of the adapter to use. |
||
126 | * |
||
127 | * @return string The name of the adapter class to use. |
||
128 | */ |
||
129 | protected function getAdapter($adapter) |
||
138 | |||
139 | /** |
||
140 | * Returns the list of available adapters sorted by alphabetical order. |
||
141 | * |
||
142 | * @return string The list of available adapters comma separated. |
||
143 | */ |
||
144 | 3 | protected function getAdapters() |
|
150 | |||
151 | /** |
||
152 | * Returns the provider class name. |
||
153 | * The default provider is Google Maps. |
||
154 | * |
||
155 | * @param string $provider The name of the provider to use. |
||
156 | * |
||
157 | * @return string The name of the provider class to use. |
||
158 | */ |
||
159 | protected function getProvider($provider) |
||
168 | |||
169 | /** |
||
170 | * Returns the list of available providers sorted by alphabetical order. |
||
171 | * |
||
172 | * @return string The list of available providers comma separated. |
||
173 | */ |
||
174 | 3 | protected function getProviders() |
|
180 | |||
181 | /** |
||
182 | * Returns the dumper class name. |
||
183 | * The default dumper is WktDumper. |
||
184 | * |
||
185 | * @param string $dumper The name of the dumper to use. |
||
186 | * |
||
187 | * @return string The name of the dumper class to use. |
||
188 | */ |
||
189 | protected function getDumper($dumper) |
||
198 | |||
199 | /** |
||
200 | * Returns the list of available dumpers sorted by alphabetical order. |
||
201 | * |
||
202 | * @return string The list of available dumpers comma separated. |
||
203 | */ |
||
204 | 3 | protected function getDumpers() |
|
210 | |||
211 | /** |
||
212 | * Make a string lowercase. |
||
213 | * |
||
214 | * @param string $string A string to lowercase. |
||
215 | * |
||
216 | * @return string The lowercased string. |
||
217 | */ |
||
218 | private function lowerize($string) |
||
222 | } |
||
223 |