Skip to content

Commit 50807f2

Browse files
committed
Implemented json, yaml, PHP and MySQL dumpers.
1 parent 80974bf commit 50807f2

File tree

18 files changed

+616
-0
lines changed

18 files changed

+616
-0
lines changed

.gitmodules

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[submodule "vendor/Symfony/Component/Locale"]
2+
path = vendor/Symfony/Component/Locale
3+
url = https://github.com/symfony/Locale.git
4+
[submodule "vendor/Symfony/Component/Yaml"]
5+
path = vendor/Symfony/Component/Yaml
6+
url = https://github.com/symfony/Yaml.git
7+
[submodule "vendor/Symfony/Component/ClassLoader"]
8+
path = vendor/Symfony/Component/ClassLoader
9+
url = https://github.com/symfony/ClassLoader.git
10+
[submodule "vendor/Symfony/Component/Filesystem"]
11+
path = vendor/Symfony/Component/Filesystem
12+
url = https://github.com/symfony/Filesystem.git
13+
[submodule "vendor/Symfony/Component/Finder"]
14+
path = vendor/Symfony/Component/Finder
15+
url = https://github.com/symfony/Finder.git

LICENSE

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Copyright (c) Саша Стаменковић <umpirsky@gmail.com>
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy
4+
of this software and associated documentation files (the "Software"), to deal
5+
in the Software without restriction, including without limitation the rights
6+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the Software is furnished
8+
to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in all
11+
copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19+
THE SOFTWARE.

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Country List
2+
============
3+
4+
List of all countries with names and ISO 3166-1 codes in all languages and data formats.

autoload.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
3+
/**
4+
* This file is part of the Country List project.
5+
*
6+
* (c) Саша Стаменковић <umpirsky@gmail.com>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
require_once __DIR__ . '/vendor/Symfony/Component/ClassLoader/UniversalClassLoader.php';
13+
14+
use Symfony\Component\ClassLoader\UniversalClassLoader;
15+
16+
$loader = new UniversalClassLoader();
17+
$loader->registerNamespaces(array(
18+
'Symfony' => __DIR__ . '/vendor',
19+
'Umpirsky' => __DIR__ . '/vendor'
20+
));
21+
$loader->register();

build

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/usr/bin/env php
2+
<?php
3+
4+
/**
5+
* This file is part of the Country List project.
6+
*
7+
* (c) Саша Стаменковић <umpirsky@gmail.com>
8+
*
9+
* For the full copyright and license information, please view the LICENSE
10+
* file that was distributed with this source code.
11+
*/
12+
13+
require_once __DIR__ . '/autoload.php';
14+
15+
use Symfony\Component\Locale\Locale;
16+
use Symfony\Component\Filesystem\Filesystem;
17+
use Umpirsky\Country\Dumper\Iterator;
18+
19+
$locale = new Locale();
20+
$filesystem = new Filesystem();
21+
$dumperIterator = new Iterator();
22+
foreach ($locale->getLocales() as $language) {
23+
$countries = $locale->getDisplayCountries($language);
24+
foreach($dumperIterator as $dumper) {
25+
$file = sprintf('%s/country/country.%s.%s', __DIR__, $language, $dumper->getFormat());
26+
$filesystem->touch($file);
27+
file_put_contents($file, $dumper->dump($countries));
28+
}
29+
}

country/country.af.yaml~

Lines changed: 255 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,255 @@
1+
AF: Afganistan
2+
AX: 'Åland Islands'
3+
AL: Albanië
4+
DZ: Algerië
5+
AS: 'Amerikaans Samoa'
6+
AD: Andorra
7+
AO: Angola
8+
AI: Anguilla
9+
AQ: Antarktika
10+
AG: 'Antigua en Barbuda'
11+
AR: Argentinië
12+
AM: Armenië
13+
AW: Aruba
14+
AC: 'Ascension Island'
15+
AZ: Aserbeidjan
16+
AU: Australië
17+
BS: Bahamas
18+
BH: Bahrein
19+
BD: Bangladesj
20+
BB: Barbados
21+
BE: België
22+
BZ: Belize
23+
BJ: Benin
24+
BM: Bermuda
25+
BT: Bhoetan
26+
BF: 'Boerkina Fasso'
27+
BO: Bolivië
28+
BA: 'Bosnië en Herzegowina'
29+
BW: Botswana
30+
BV: 'Bouvet Island'
31+
BR: Brasilië
32+
IO: 'Britse Indiese Oseaan Gebied'
33+
VG: 'Britse Maagde-eilande'
34+
BN: Broenei
35+
BG: Bulgarye
36+
BI: Burundi
37+
IC: 'Canary Islands'
38+
EA: 'Ceuta and Melilla'
39+
CL: Chili
40+
CX: 'Christmas Island'
41+
CY: Ciprus
42+
CP: 'Clipperton Island'
43+
CC: 'Cocos [Keeling] Islands'
44+
KM: Comore
45+
CK: Cookeilande
46+
CR: 'Costa Rica'
47+
CD: 'Demokratiese Republiek van die Kongo'
48+
DK: Denemarke
49+
DG: 'Diego Garcia'
50+
DJ: Djiboeti
51+
DM: Dominika
52+
DO: 'Dominikaanse Republiek'
53+
DE: Duitsland
54+
EC: Ecuador
55+
EG: Egipte
56+
GQ: Ekwatoriaal-Guinee
57+
ER: Eritrea
58+
EE: Estland
59+
ET: Ethiopië
60+
EU: 'European Union'
61+
FK: Falklandeilande
62+
FO: Faroëreilande
63+
FJ: Fidji
64+
PH: Filippyne
65+
FI: Finland
66+
FR: Frankryk
67+
GF: Frans-Guyana
68+
PF: Frans-Polinesië
69+
TF: 'French Southern Territories'
70+
GA: Gaboen
71+
GM: Gambië
72+
GE: Georgië
73+
GH: Ghana
74+
GI: Gibraltar
75+
GD: Grenada
76+
GR: Griekeland
77+
GL: Groenland
78+
GB: Groot-Brittanje
79+
GP: Guadeloupe
80+
GU: Guam
81+
GT: Guatemala
82+
GG: Guernsey
83+
GN: Guinee
84+
GW: Guinee-Bissau
85+
GY: Guyana
86+
HT: Haïti
87+
HM: 'Heard Island and McDonald Islands'
88+
HN: Honduras
89+
HU: Hongarye
90+
HK: Hongkong
91+
IE: Ierland
92+
IN: Indië
93+
ID: Indonesië
94+
IQ: Irak
95+
IR: Iran
96+
IM: 'Isle of Man'
97+
IL: Israel
98+
IT: Italië
99+
CI: Ivoorkus
100+
JM: Jamaika
101+
JP: Japan
102+
YE: Jemen
103+
JE: Jersey
104+
JO: Jordanië
105+
KY: Kaaimanseilande
106+
CV: 'Kaap Verde'
107+
KH: Kambodja
108+
CM: Kameroen
109+
CA: Kanada
110+
KZ: Kasakstan
111+
QA: Katar
112+
KE: Kenia
113+
KG: Kirgisië
114+
KI: Kiribati
115+
KW: Koeweit
116+
CO: Kolombië
117+
CG: Kongo
118+
HR: Kroasië
119+
CU: Kuba
120+
LA: Laos
121+
LS: Lesotho
122+
LV: Letland
123+
LB: Libanon
124+
LR: Liberië
125+
LY: Libië
126+
LI: Liechtenstein
127+
LT: Litaue
128+
LU: Luxemburg
129+
MO: 'Macau SAR China'
130+
MK: Macedonië
131+
MG: Madagaskar
132+
MW: Malawi
133+
MV: Maledive
134+
MY: Maleisië
135+
ML: Mali
136+
MT: Malta
137+
MA: Marokko
138+
MH: Marshall-eilande
139+
MQ: Martinique
140+
MU: Mauritius
141+
YT: Mayotte
142+
MX: Meksiko
143+
MM: Mianmar
144+
FM: Mikronesië
145+
MD: Moldova
146+
MC: Monaco
147+
MN: Mongolië
148+
ME: Montenegro
149+
MS: Montserrat
150+
MZ: Mosambiek
151+
MR: Mouritanië
152+
NA: Namibië
153+
NR: Naoeroe
154+
NL: Nederland
155+
AN: Nederlands-Antille
156+
NP: Nepal
157+
NI: Nicaragua
158+
NC: Nieu-Kaledonië
159+
NZ: Nieu-Seeland
160+
NE: Niger
161+
NG: Nigerië
162+
NU: Niue
163+
KP: Noord-Korea
164+
MP: 'Noordelike Marianaeilande'
165+
NO: Noorweë
166+
NF: Norfolk-eiland
167+
UA: Oekraine
168+
UZ: Oesbekistan
169+
OM: Oman
170+
TL: Oos-Timor
171+
AT: Oostenryk
172+
QO: 'Outlying Oceania'
173+
PK: Pakistan
174+
PW: Palau
175+
PS: Palestina
176+
PA: Panama
177+
PG: 'Papoea Nieu-Guinee'
178+
PY: Paraguay
179+
PE: Peru
180+
PN: Pitcairn
181+
PL: Pole
182+
PT: Portugal
183+
PR: 'Puerto Rico'
184+
RE: Réunion
185+
RO: Roemenië
186+
RU: Rusland
187+
RW: Rwanda
188+
BL: 'Saint Barthélemy'
189+
KN: 'Saint Kitts en Nevis'
190+
MF: 'Saint Martin'
191+
VC: 'Saint Vincent en die Grenadine'
192+
SV: Salvador
193+
WS: Samoa
194+
SM: 'San Marino'
195+
ST: 'Sao Tome en Principe'
196+
SA: Saoedi-Arabië
197+
SN: Senegal
198+
CF: 'Sentraal-Afrikaanse Republiek'
199+
RS: Serbia
200+
CS: 'Serwië en Montenegro'
201+
SC: Seychelle
202+
SL: 'Sierra Leone'
203+
SG: Singapoer
204+
SH: 'Sint Helena'
205+
LC: 'Sint Lucia'
206+
PM: 'Sint-Pierre en Miquelon'
207+
SY: Sirië
208+
CN: Sjina
209+
SK: Slowakye
210+
SI: Slowenië
211+
SD: Soedan
212+
SB: 'Solomon Eilande'
213+
SO: Somalië
214+
GS: 'South Georgia and the South Sandwich Islands'
215+
ES: Spanje
216+
LK: 'Sri Lanka'
217+
ZA: Suid-Afrika
218+
KR: Suid-Korea
219+
SR: Suriname
220+
SJ: 'Svalbard and Jan Mayen'
221+
SZ: Swaziland
222+
SE: Swede
223+
CH: Switserland
224+
TJ: Tadjikistan
225+
TW: Taiwan
226+
TZ: Tanzanië
227+
TH: Thailand
228+
CZ: 'Tjeggiese Republiek'
229+
TG: Togo
230+
TK: Tokelau
231+
TO: Tonga
232+
TT: 'Trinidad en Tobago'
233+
TA: 'Tristan da Cunha'
234+
TD: Tsjaad
235+
TN: Tunisië
236+
TM: Turkmenië
237+
TC: 'Turks en Caicos Eilande'
238+
TR: Turkye
239+
TV: Tuvalu
240+
UM: 'U.S. Minor Outlying Islands'
241+
UG: Uganda
242+
UY: Uruguay
243+
VI: 'V.S. Maagde-eilande'
244+
VU: Vanuatu
245+
VA: Vatikaan
246+
VE: Venezuela
247+
AE: 'Verenigde Arabiese Emirate'
248+
US: 'Verenigde State van Amerika'
249+
VN: Viëtnam
250+
WF: 'Wallis en Futuna'
251+
EH: Wes-Sahara
252+
BY: Wit-Rusland
253+
IS: Ysland
254+
ZM: Zambië
255+
ZW: Zimbabwe
Submodule ClassLoader added at 8bceaa2
Submodule Filesystem added at f475e82

vendor/Symfony/Component/Finder

Submodule Finder added at b3adc8d

vendor/Symfony/Component/Locale

Submodule Locale added at b7ea9a1

0 commit comments

Comments
 (0)