Commit 66832c41 authored by Klaus Weidenbach's avatar Klaus Weidenbach
Browse files

Update intl library.

Update intl library from v0.4? (2014) to v0.7.4 (2016).
Use global composer autoloader now.
parent 8e4c5db7
......@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"content-hash": "50f781f18deef8573188a713376a711d",
"content-hash": "cc603d3dc499e43f840f9551039fa93c",
"packages": [
{
"name": "bshaffer/oauth2-server-php",
......@@ -62,6 +62,50 @@
],
"time": "2017-01-06T23:20:00+00:00"
},
{
"name": "commerceguys/intl",
"version": "v0.7.4",
"source": {
"type": "git",
"url": "https://github.com/commerceguys/intl.git",
"reference": "edfcfc26ed8505c4f6fcf862eb36dfda1af74b00"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/commerceguys/intl/zipball/edfcfc26ed8505c4f6fcf862eb36dfda1af74b00",
"reference": "edfcfc26ed8505c4f6fcf862eb36dfda1af74b00",
"shasum": ""
},
"require": {
"php": ">=5.4.0"
},
"require-dev": {
"mikey179/vfsstream": "1.*",
"phpunit/phpunit": "~4.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "0.x-dev"
}
},
"autoload": {
"psr-4": {
"CommerceGuys\\Intl\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Bojan Zivanovic"
}
],
"description": "Internationalization library powered by CLDR data.",
"time": "2016-12-13T12:33:19+00:00"
},
{
"name": "ezyang/htmlpurifier",
"version": "v4.9.3",
......
......@@ -8,6 +8,7 @@
* language related tasks.
*/
use CommerceGuys\Intl\Language\LanguageRepository;
/**
* @brief Get the browser's submitted preferred languages.
......@@ -298,11 +299,7 @@ function detect_language($s) {
* @param string $s Language code to look up
* @param string $l (optional) In which language to return the name
* @return string with the language name, or $s if unrecognized
*
* @todo include CommerceGuys\Intl through composer like SabreDAV.
*/
require_once(__DIR__ . '/../library/intl/vendor/autoload.php');
use CommerceGuys\Intl\Language\LanguageRepository;
function get_language_name($s, $l = null) {
// get() expects the second part to be in upper case
if (strpos($s, '-') !== false) $s = substr($s, 0, 2) . strtoupper(substr($s, 2));
......
language: php
php:
- 5.4
- 5.5
- 5.6
- hhvm
install:
- composer self-update
- composer install
script:
- ./vendor/bin/phpunit -c ./phpunit.xml --coverage-text --strict
{
"AF": {
"name": "Afganistan"
},
"AX": {
"name": "Ålandeilande"
},
"AL": {
"name": "Albanië"
},
"DZ": {
"name": "Algerië"
},
"AS": {
"name": "Amerikaans-Samoa"
},
"VI": {
"name": "Amerikaanse Maagde-eilande"
},
"AD": {
"name": "Andorra"
},
"AO": {
"name": "Angola"
},
"AI": {
"name": "Anguilla"
},
"AQ": {
"name": "Antarktika"
},
"AG": {
"name": "Antigua en Barbuda"
},
"AR": {
"name": "Argentinië"
},
"AM": {
"name": "Armenië"
},
"AW": {
"name": "Aruba"
},
"AC": {
"name": "Ascensioneiland"
},
"AU": {
"name": "Australië"
},
"AZ": {
"name": "Azerbeidjan"
},
"BS": {
"name": "Bahamas"
},
"BH": {
"name": "Bahrein"
},
"BD": {
"name": "Bangladesj"
},
"BB": {
"name": "Barbados"
},
"BY": {
"name": "Belarus"
},
"BE": {
"name": "België"
},
"BZ": {
"name": "Belize"
},
"BJ": {
"name": "Benin"
},
"BM": {
"name": "Bermuda"
},
"BT": {
"name": "Bhoetan"
},
"BO": {
"name": "Bolivië"
},
"BA": {
"name": "Bosnië en Herzegowina"
},
"BW": {
"name": "Botswana"
},
"BR": {
"name": "Brasilië"
},
"IO": {
"name": "Britse Indiese Oseaangebied"
},
"VG": {
"name": "Britse Maagde-eilande"
},
"BN": {
"name": "Broenei"
},
"BG": {
"name": "Bulgarye"
},
"BF": {
"name": "Burkina Faso"
},
"BI": {
"name": "Burundi"
},
"EA": {
"name": "Ceuta en Melilla"
},
"CL": {
"name": "Chili"
},
"CC": {
"name": "Cocos- (Keeling) eilande"
},
"CO": {
"name": "Colombië"
},
"KM": {
"name": "Comore"
},
"CK": {
"name": "Cookeilande"
},
"CR": {
"name": "Costa Rica"
},
"CW": {
"name": "Curaçao"
},
"CD": {
"name": "Demokratiese Republiek van die Kongo"
},
"DK": {
"name": "Denemarke"
},
"DG": {
"name": "Diego Garcia"
},
"DJ": {
"name": "Djiboeti"
},
"DM": {
"name": "Dominica"
},
"DO": {
"name": "Dominikaanse Republiek"
},
"DE": {
"name": "Duitsland"
},
"EC": {
"name": "Ecuador"
},
"EG": {
"name": "Egipte"
},
"IM": {
"name": "Eiland Man"
},
"GQ": {
"name": "Ekwatoriaal-Guinee"
},
"SV": {
"name": "El Salvador"
},
"ER": {
"name": "Eritrea"
},
"EE": {
"name": "Estland"
},
"ET": {
"name": "Ethiopië"
},
"FK": {
"name": "Falklandeilande"
},
"FO": {
"name": "Faroëreilande"
},
"FJ": {
"name": "Fidji"
},
"PH": {
"name": "Filippyne"
},
"FI": {
"name": "Finland"
},
"FR": {
"name": "Frankryk"
},
"GF": {
"name": "Frans-Guyana"
},
"PF": {
"name": "Frans-Polinesië"
},
"TF": {
"name": "Franse Suidelike Gebiede"
},
"GA": {
"name": "Gaboen"
},
"GM": {
"name": "Gambië"
},
"GE": {
"name": "Georgië"
},
"GH": {
"name": "Ghana"
},
"GI": {
"name": "Gibraltar"
},
"GD": {
"name": "Grenada"
},
"GR": {
"name": "Griekeland"
},
"GL": {
"name": "Groenland"
},
"GP": {
"name": "Guadeloupe"
},
"GU": {
"name": "Guam"
},
"GT": {
"name": "Guatemala"
},
"GG": {
"name": "Guernsey"
},
"GN": {
"name": "Guinee"
},
"GW": {
"name": "Guinee-Bissau"
},
"GY": {
"name": "Guyana"
},
"HT": {
"name": "Haïti"
},
"HN": {
"name": "Honduras"
},
"HU": {
"name": "Hongarye"
},
"HK": {
"name": "Hongkong SAS Sjina"
},
"IE": {
"name": "Ierland"
},
"IN": {
"name": "Indië"
},
"ID": {
"name": "Indonesië"
},
"IQ": {
"name": "Irak"
},
"IR": {
"name": "Iran"
},
"IL": {
"name": "Israel"
},
"IT": {
"name": "Italië"
},
"CI": {
"name": "Ivoorkus"
},
"JM": {
"name": "Jamaika"
},
"JP": {
"name": "Japan"
},
"YE": {
"name": "Jemen"
},
"JE": {
"name": "Jersey"
},
"JO": {
"name": "Jordanië"
},
"KY": {
"name": "Kaaimanseilande"
},
"CV": {
"name": "Kaap Verde"
},
"KH": {
"name": "Kambodja"
},
"CM": {
"name": "Kameroen"
},
"CA": {
"name": "Kanada"
},
"IC": {
"name": "Kanariese Eilande"
},
"BQ": {
"name": "Karibiese Nederland"
},
"QA": {
"name": "Katar"
},
"KZ": {
"name": "Kazakstan"
},
"KE": {
"name": "Kenia"
},
"CX": {
"name": "Kerseiland"
},
"KG": {
"name": "Kirgisië"
},
"KI": {
"name": "Kiribati"
},
"KW": {
"name": "Koeweit"
},
"XK": {
"name": "Kosovo"
},
"HR": {
"name": "Kroasië"
},
"CU": {
"name": "Kuba"
},
"LA": {
"name": "Laos"
},
"LS": {
"name": "Lesotho"
},
"LV": {
"name": "Letland"
},
"LB": {
"name": "Libanon"
},
"LR": {
"name": "Liberië"
},
"LY": {
"name": "Libië"
},
"LI": {
"name": "Liechtenstein"
},
"LT": {
"name": "Litaue"
},
"LU": {
"name": "Luxemburg"
},
"MO": {
"name": "Macau SAS Sjina"
},
"MK": {
"name": "Macedonië"
},
"MG": {
"name": "Madagaskar"
},
"MW": {
"name": "Malawi"
},
"MV": {
"name": "Maledive"
},
"MY": {
"name": "Maleisië"
},
"ML": {
"name": "Mali"
},
"MT": {
"name": "Malta"
},
"MA": {
"name": "Marokko"
},
"MH": {
"name": "Marshalleilande"
},
"MQ": {
"name": "Martinique"
},
"MR": {
"name": "Mauritanië"
},
"MU": {
"name": "Mauritius"
},
"YT": {
"name": "Mayotte"
},
"MX": {
"name": "Meksiko"
},
"MM": {
"name": "Mianmar (Birma)"
},
"FM": {
"name": "Mikronesië"
},
"MD": {
"name": "Moldowa"
},
"MC": {
"name": "Monaco"
},
"MN": {
"name": "Mongolië"
},
"ME": {
"name": "Montenegro"
},
"MS": {
"name": "Montserrat"
},
"MZ": {
"name": "Mosambiek"
},
"NA": {
"name": "Namibië"
},
"NR": {
"name": "Nauru"
},
"NL": {
"name": "Nederland"
},
"NP": {
"name": "Nepal"
},
"NI": {
"name": "Nicaragua"
},
"NC": {
"name": "Nieu-Kaledonië"
},
"NZ": {
"name": "Nieu-Seeland"
},
"NE": {
"name": "Niger"
},
"NG": {
"name": "Nigerië"
},
"NU": {
"name": "Niue"
},
"KP": {
"name": "Noord-Korea"
},
"MP": {
"name": "Noordelike Mariana-eilande"
},
"NO": {
"name": "Noorweë"
},
"NF": {
"name": "Norfolkeiland"
},
"UA": {
"name": "Oekraïne"
},
"UZ": {
"name": "Oesbekistan"
},
"OM": {
"name": "Oman"
<