Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md4
-rw-r--r--bower.json8
-rw-r--r--config/global.ini.php4
-rwxr-xr-xconsole2
-rw-r--r--core/Common.php92
-rw-r--r--core/DataArray.php5
-rw-r--r--core/Exception/AuthenticationFailedException.php13
-rw-r--r--core/Exception/Exception.php (renamed from core/Exceptions/HtmlMessageException.php)24
-rw-r--r--core/Exception/MissingFilePermissionException.php13
-rw-r--r--core/Exception/NoPrivilegesException.php13
-rw-r--r--core/Exception/NoWebsiteFoundException.php13
-rw-r--r--core/Filechecks.php9
-rw-r--r--core/FrontController.php23
-rw-r--r--core/Plugin/Controller.php15
-rw-r--r--core/Plugin/MetadataLoader.php2
-rw-r--r--core/Session.php7
-rw-r--r--core/Tracker.php29
-rw-r--r--core/Translate.php2
-rwxr-xr-xcore/Twig.php3
-rw-r--r--core/Updates/1.8.3-b1.php4
-rw-r--r--core/Version.php2
-rw-r--r--js/piwik.js3
-rw-r--r--lang/cs.json3
-rw-r--r--lang/fr.json29
-rw-r--r--lang/nl.json1
-rwxr-xr-xlibs/MaxMindGeoIP/geoip.inc2342
-rwxr-xr-xlibs/MaxMindGeoIP/geoipcity.inc382
-rwxr-xr-xlibs/MaxMindGeoIP/geoipregionvars.php8633
-rw-r--r--libs/PiwikTracker/PiwikTracker.php11
-rwxr-xr-xmisc/log-analytics/import_logs.py13
-rw-r--r--piwik.js2
-rw-r--r--plugins/API/lang/fr.json4
-rw-r--r--plugins/Actions/lang/el.json1
-rw-r--r--plugins/Actions/lang/fr.json16
-rw-r--r--plugins/Annotations/lang/fr.json18
-rw-r--r--plugins/Contents/lang/fr.json5
-rw-r--r--plugins/CoreAdminHome/lang/fr.json42
-rw-r--r--plugins/CoreConsole/Commands/ManagePlugin.php34
-rw-r--r--plugins/CoreHome/lang/fr.json8
-rw-r--r--plugins/CorePluginsAdmin/Controller.php9
-rw-r--r--plugins/CorePluginsAdmin/lang/fr.json2
-rw-r--r--plugins/CoreUpdater/lang/fr.json6
-rw-r--r--plugins/CustomVariables/Archiver.php2
-rw-r--r--plugins/Dashboard/Controller.php10
-rw-r--r--plugins/Dashboard/Dashboard.php4
-rw-r--r--plugins/DevicesDetection/lang/cs.json2
-rw-r--r--plugins/DevicesDetection/lang/da.json1
-rw-r--r--plugins/DevicesDetection/lang/de.json2
-rw-r--r--plugins/DevicesDetection/lang/el.json2
-rw-r--r--plugins/DevicesDetection/lang/fr.json4
-rw-r--r--plugins/DevicesDetection/lang/it.json2
-rw-r--r--plugins/Events/lang/el.json1
-rw-r--r--plugins/ExamplePlugin/tests/Integration/SimpleTest.php17
-rw-r--r--plugins/ExamplePlugin/tests/Unit/SimpleTest.php3
-rw-r--r--plugins/Goals/Controller.php2
-rw-r--r--plugins/Goals/lang/fr.json21
-rw-r--r--plugins/Installation/Exception/DatabaseConnectionFailedException.php15
-rw-r--r--plugins/Installation/Installation.php7
-rw-r--r--plugins/Installation/lang/cs.json2
-rw-r--r--plugins/Installation/lang/da.json2
-rw-r--r--plugins/Installation/lang/de.json2
-rw-r--r--plugins/Installation/lang/el.json2
-rw-r--r--plugins/Installation/lang/fr.json10
-rw-r--r--plugins/Installation/lang/it.json2
-rw-r--r--plugins/Live/lang/fr.json6
-rw-r--r--plugins/Live/tests/Integration/APITest.php2
-rw-r--r--plugins/Login/lang/cs.json1
-rw-r--r--plugins/Login/lang/fr.json4
-rw-r--r--plugins/Login/tests/Integration/LoginTest.php2
-rw-r--r--plugins/MobileMessaging/API.php4
-rw-r--r--plugins/MobileMessaging/lang/fr.json4
-rw-r--r--plugins/MobileMessaging/tests/Integration/MobileMessagingTest.php2
-rw-r--r--plugins/Overlay/Controller.php2
-rw-r--r--plugins/Overlay/lang/fr.json6
-rw-r--r--plugins/PrivacyManager/lang/da.json1
-rw-r--r--plugins/PrivacyManager/lang/de.json1
-rw-r--r--plugins/PrivacyManager/lang/el.json1
-rw-r--r--plugins/PrivacyManager/lang/fr.json9
-rw-r--r--plugins/PrivacyManager/lang/it.json1
-rw-r--r--plugins/Referrers/lang/fr.json28
-rw-r--r--plugins/SEO/MajesticClient.php2
-rw-r--r--plugins/SEO/tests/Integration/SEOTest.php2
-rw-r--r--plugins/ScheduledReports/API.php10
-rw-r--r--plugins/ScheduledReports/Controller.php2
-rw-r--r--plugins/ScheduledReports/lang/fr.json2
-rw-r--r--plugins/ScheduledReports/tests/Integration/ApiTest.php2
-rw-r--r--plugins/SegmentEditor/lang/fr.json1
-rw-r--r--plugins/SegmentEditor/tests/Integration/SegmentEditorTest.php2
-rw-r--r--plugins/SitesManager/SitesManager.php2
-rw-r--r--plugins/SitesManager/lang/fr.json10
-rw-r--r--plugins/SitesManager/tests/Integration/SitesManagerTest.php2
-rw-r--r--plugins/TestRunner/Aws/Instance.php11
-rw-r--r--plugins/TestRunner/Runner/InstanceLauncher.php1
-rw-r--r--plugins/UserCountry/Controller.php16
-rwxr-xr-xplugins/UserCountry/LocationProvider.php9
-rwxr-xr-xplugins/UserCountry/LocationProvider/GeoIp/Php.php41
-rw-r--r--plugins/UserCountry/lang/fr.json6
-rw-r--r--plugins/UserCountryMap/Controller.php6
-rw-r--r--plugins/UserCountryMap/lang/fr.json2
-rw-r--r--plugins/UserSettings/Archiver.php3
-rw-r--r--plugins/UserSettings/Columns/Language.php19
-rw-r--r--plugins/UserSettings/lang/fr.json6
-rw-r--r--plugins/UserSettings/tests/System/expected/test___UserSettings.getLanguageCode_day.xml6
-rw-r--r--plugins/UserSettings/tests/System/expected/test___UserSettings.getLanguage_day.xml2
-rw-r--r--plugins/UsersManager/tests/Integration/APITest.php2
-rw-r--r--plugins/UsersManager/tests/Integration/UserPreferencesTest.php2
-rw-r--r--plugins/UsersManager/tests/Integration/UsersManagerTest.php2
-rw-r--r--plugins/VisitFrequency/lang/de.json1
-rw-r--r--plugins/VisitFrequency/lang/el.json1
-rw-r--r--plugins/VisitFrequency/lang/fr.json2
-rw-r--r--plugins/VisitFrequency/lang/it.json1
-rw-r--r--plugins/VisitTime/lang/fr.json4
-rw-r--r--plugins/VisitorInterest/lang/fr.json6
-rw-r--r--plugins/Widgetize/Controller.php2
-rw-r--r--plugins/ZenMode/lang/nl.json9
-rwxr-xr-xtests/PHPUnit/BenchmarkTestCase.php2
-rw-r--r--tests/PHPUnit/ConsoleCommandTestCase.php3
-rw-r--r--tests/PHPUnit/FakeAccess.php2
-rw-r--r--tests/PHPUnit/Fixtures/ManyVisitsWithGeoIP.php4
-rw-r--r--tests/PHPUnit/Fixtures/TwoSitesWithAnnotations.php2
-rw-r--r--tests/PHPUnit/Fixtures/UITestFixture.php4
-rw-r--r--tests/PHPUnit/Framework/Constraint/ResponseCode.php56
-rw-r--r--tests/PHPUnit/Framework/Fixture.php42
-rwxr-xr-xtests/PHPUnit/Framework/TestCase/SystemTestCase.php6
-rw-r--r--tests/PHPUnit/Integration/AccessTest.php34
-rw-r--r--tests/PHPUnit/Integration/ArchiveProcessingTest.php29
-rw-r--r--tests/PHPUnit/Integration/AssetManager/UIAssetMinifierTest.php6
-rw-r--r--tests/PHPUnit/Integration/CronArchive/FixedSiteIdsTest.php7
-rw-r--r--tests/PHPUnit/Integration/CronArchive/SharedSiteIdsTest.php5
-rw-r--r--tests/PHPUnit/Integration/DataAccess/ModelTest.php7
-rw-r--r--tests/PHPUnit/Integration/DbTest.php11
-rw-r--r--tests/PHPUnit/Integration/DocumentationGeneratorTest.php (renamed from tests/PHPUnit/Core/API/DocumentationGeneratorTest.php)13
-rw-r--r--tests/PHPUnit/Integration/HttpTest.php17
-rw-r--r--tests/PHPUnit/Integration/JsProxyTest.php22
-rw-r--r--tests/PHPUnit/Integration/LogTest.php40
-rw-r--r--tests/PHPUnit/Integration/OptionTest.php25
-rw-r--r--tests/PHPUnit/Integration/PiwikTest.php7
-rw-r--r--tests/PHPUnit/Integration/Plugin/SettingsTest.php10
-rw-r--r--tests/PHPUnit/Integration/ReleaseCheckListTest.php68
-rw-r--r--tests/PHPUnit/Integration/ReportTest.php6
-rw-r--r--tests/PHPUnit/Integration/SegmentTest.php39
-rw-r--r--tests/PHPUnit/Integration/ServeStaticFileTest.php7
-rwxr-xr-xtests/PHPUnit/Integration/SqlTest.php17
-rw-r--r--tests/PHPUnit/Integration/Tracker/ActionTest.php16
-rw-r--r--tests/PHPUnit/Integration/Tracker/DbTest.php11
-rw-r--r--tests/PHPUnit/Integration/Tracker/Visit2Test.php27
-rw-r--r--tests/PHPUnit/Integration/Tracker/VisitTest.php15
-rw-r--r--tests/PHPUnit/Integration/TrackerTest.php2
-rw-r--r--tests/PHPUnit/Integration/TravisEnvironmentTest.php22
-rw-r--r--tests/PHPUnit/Integration/UpdaterTest.php7
-rw-r--r--tests/PHPUnit/Integration/ViewDataTable/ManagerTest.php8
-rw-r--r--tests/PHPUnit/Integration/WidgetsListTest.php23
-rwxr-xr-xtests/PHPUnit/System/AnnotationsTest.php2
-rw-r--r--tests/PHPUnit/System/FrontControllerTest.php2
-rwxr-xr-xtests/PHPUnit/System/ManyVisitorsOneWebsiteTest.php14
-rwxr-xr-xtests/PHPUnit/System/TrackerTest.php72
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest__Live.getLastVisitsDetails_range.xml32
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_countryCode__API.getSuggestedValuesForSegment.xml6
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_latitude__API.getSuggestedValuesForSegment.xml3
-rw-r--r--tests/PHPUnit/System/expected/test_AutoSuggestAPITest_longitude__API.getSuggestedValuesForSegment.xml3
-rw-r--r--tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest__UserCountry.getContinent_month.xml64
-rw-r--r--tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest__UserCountry.getCountry_month.xml55
-rw-r--r--tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest__UserCountry.getLocationFromIP.json1
-rw-r--r--tests/PHPUnit/System/expected/test_OneVisitor_NoKeywordSpecified__Referrers.getKeywords_day.xml2
-rw-r--r--tests/PHPUnit/TestingEnvironment.php2
-rw-r--r--tests/PHPUnit/Unit/CommonTest.php55
-rw-r--r--tests/javascript/index.php4
-rw-r--r--tests/resources/TestPluginLogClass.php3
168 files changed, 6055 insertions, 7124 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 4d13393ba4..6147d20627 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,10 @@
This is a changelog for Piwik platform developers. All changes for our HTTP API's, Plugins, Themes, etc will be listed here.
+## Piwik 2.10.0
+
+### New APIs
+* New URL parameter `send_image=0` in the [HTTP Tracking API](http://developer.piwik.org/api-reference/tracking-api) to receive a HTTP 204 response code instead of a GIF image. This improves performance and can fix errors if images are not allowed to be obtained directly (eg Chrome Apps).
## Piwik 2.9.0
diff --git a/bower.json b/bower.json
index d764f63f10..b591829f43 100644
--- a/bower.json
+++ b/bower.json
@@ -34,14 +34,6 @@
"ignore": [
"**/.*",
"node_modules",
- "bower_components",
- "core",
- "plugins",
- "libs",
- "misc",
- "tmp",
- "config",
- "lang",
"tests"
]
}
diff --git a/config/global.ini.php b/config/global.ini.php
index 516497ada1..a8025027c0 100644
--- a/config/global.ini.php
+++ b/config/global.ini.php
@@ -571,13 +571,13 @@ ignore_visits_cookie_name = piwik_ignore
; Comma separated list of variable names that will be read to define a Campaign name, for example CPC campaign
; Example: If a visitor first visits 'index.php?piwik_campaign=Adwords-CPC' then it will be counted as a campaign referrer named 'Adwords-CPC'
; Includes by default the GA style campaign parameters
-campaign_var_name = "pk_campaign,piwik_campaign,utm_campaign,utm_source,utm_medium"
+campaign_var_name = "pk_cpn,pk_campaign,piwik_campaign,utm_campaign,utm_source,utm_medium"
; Comma separated list of variable names that will be read to track a Campaign Keyword
; Example: If a visitor first visits 'index.php?piwik_campaign=Adwords-CPC&piwik_kwd=My killer keyword' ;
; then it will be counted as a campaign referrer named 'Adwords-CPC' with the keyword 'My killer keyword'
; Includes by default the GA style campaign keyword parameter utm_term
-campaign_keyword_var_name = "pk_kwd,piwik_kwd,pk_keyword,utm_term"
+campaign_keyword_var_name = "pk_kwd,pk_keyword,piwik_kwd,utm_term"
; maximum length of a Page Title or a Page URL recorded in the log_action.name table
page_maximum_length = 1024;
diff --git a/console b/console
index 07cd41f0e5..f0b25f3d8e 100755
--- a/console
+++ b/console
@@ -27,4 +27,4 @@ if (!Piwik\Common::isPhpCliMode()) {
$console = new Piwik\Console();
$console->init();
-$console->run();
+$console->run(); \ No newline at end of file
diff --git a/core/Common.php b/core/Common.php
index 6dfa2d22fa..a3e7515a24 100644
--- a/core/Common.php
+++ b/core/Common.php
@@ -34,6 +34,7 @@ class Common
/*
* Database
*/
+ const LANGUAGE_CODE_INVALID = 'xx';
/**
* Hashes a string into an integer which should be very low collision risks
@@ -461,7 +462,7 @@ class Common
// we deal w/ json differently
if ($varType == 'json') {
$value = self::undoMagicQuotes($requestArrayToUse[$varName]);
- $value = self::json_decode($value, $assoc = true);
+ $value = json_decode($value, $assoc = true);
return self::sanitizeInputValues($value, $alreadyStripslashed = true);
}
@@ -937,8 +938,8 @@ class Common
*/
public static function getCountry($lang, $enableLanguageToCountryGuess, $ip)
{
- if (empty($lang) || strlen($lang) < 2 || $lang == 'xx') {
- return 'xx';
+ if (empty($lang) || strlen($lang) < 2 || $lang == self::LANGUAGE_CODE_INVALID) {
+ return self::LANGUAGE_CODE_INVALID;
}
$validCountries = self::getCountriesList();
@@ -974,35 +975,73 @@ class Common
}
}
}
- return 'xx';
+ return self::LANGUAGE_CODE_INVALID;
}
/**
- * Returns the visitor language based only on the Browser 'accepted language' information
+ * Returns the language and region string, based only on the Browser 'accepted language' information.
+ * * The language tag is defined by ISO 639-1
*
* @param string $browserLanguage Browser's accepted langauge header
* @param array $validLanguages array of valid language codes
- * @return string 2 letter ISO 639 code
+ * @return string 2 letter ISO 639 code 'es' (Spanish)
*/
- public static function extractLanguageCodeFromBrowserLanguage($browserLanguage, $validLanguages)
+ public static function extractLanguageCodeFromBrowserLanguage($browserLanguage, $validLanguages = array())
{
- // assumes language preference is sorted;
- // does not handle language-script-region tags or language range (*)
- if (!empty($validLanguages) && preg_match_all('/(?:^|,)([a-z]{2,3})([-][a-z]{2})?/', $browserLanguage, $matches, PREG_SET_ORDER)) {
- foreach ($matches as $parts) {
- if (count($parts) == 3) {
- // match locale (language and location)
- if (in_array($parts[1] . $parts[2], $validLanguages)) {
- return $parts[1] . $parts[2];
- }
+ $validLanguages = self::checkValidLanguagesIsSet($validLanguages);
+ $languageRegionCode = self::extractLanguageAndRegionCodeFromBrowserLanguage($browserLanguage, $validLanguages);
+
+ if(strlen($languageRegionCode) == 2) {
+ $languageCode = $languageRegionCode;
+ } else {
+ $languageCode = substr($languageRegionCode, 0, 2);
+ }
+ if(in_array($languageCode, $validLanguages)) {
+ return $languageCode;
+ }
+ return self::LANGUAGE_CODE_INVALID;
+ }
+
+ /**
+ * Returns the language and region string, based only on the Browser 'accepted language' information.
+ * * The language tag is defined by ISO 639-1
+ * * The region tag is defined by ISO 3166-1
+ *
+ * @param string $browserLanguage Browser's accepted langauge header
+ * @param array $validLanguages array of valid language codes. Note that if the array includes "fr" then it will consider all regional variants of this language valid, such as "fr-ca" etc.
+ * @return string 2 letter ISO 639 code 'es' (Spanish) or if found, includes the region as well: 'es-ar'
+ */
+ public static function extractLanguageAndRegionCodeFromBrowserLanguage($browserLanguage, $validLanguages = array() )
+ {
+ $validLanguages = self::checkValidLanguagesIsSet($validLanguages);
+
+ if(!preg_match_all('/(?:^|,)([a-z]{2,3})([-][a-z]{2})?/', $browserLanguage, $matches, PREG_SET_ORDER)) {
+ return self::LANGUAGE_CODE_INVALID;
+ }
+ foreach ($matches as $parts) {
+ $langIso639 = $parts[1];
+ if(empty($langIso639)) {
+ continue;
+ }
+
+ // If a region tag is found eg. "fr-ca"
+ if (count($parts) == 3) {
+ $regionIso3166 = $parts[2]; // eg. "-ca"
+
+ if (in_array($langIso639 . $regionIso3166, $validLanguages)) {
+ return $langIso639 . $regionIso3166;
}
- // match language only (where no region provided)
- if (in_array($parts[1], $validLanguages)) {
- return $parts[1];
+
+ if (in_array($langIso639, $validLanguages)) {
+ return $langIso639 . $regionIso3166;
}
}
+ // eg. "fr" or "es"
+ if (in_array($langIso639, $validLanguages)) {
+ return $langIso639;
+ }
}
- return 'xx';
+ return self::LANGUAGE_CODE_INVALID;
}
/**
@@ -1161,4 +1200,17 @@ class Common
}
}
}
+
+ /**
+ * @param $validLanguages
+ * @return array
+ */
+ protected static function checkValidLanguagesIsSet($validLanguages)
+ {
+ if (empty($validLanguages)) {
+ $validLanguages = array_keys(Common::getLanguagesList());
+ return $validLanguages;
+ }
+ return $validLanguages;
+ }
}
diff --git a/core/DataArray.php b/core/DataArray.php
index 7515ef8699..2eab0bbab5 100644
--- a/core/DataArray.php
+++ b/core/DataArray.php
@@ -99,6 +99,11 @@ class DataArray
return;
}
+ // Edge case fail safe
+ if(!isset($oldRowToUpdate[Metrics::INDEX_NB_VISITS])) {
+ return;
+ }
+
$oldRowToUpdate[Metrics::INDEX_NB_VISITS] += $newRowToAdd[Metrics::INDEX_NB_VISITS];
$oldRowToUpdate[Metrics::INDEX_NB_ACTIONS] += $newRowToAdd[Metrics::INDEX_NB_ACTIONS];
$oldRowToUpdate[Metrics::INDEX_NB_UNIQ_VISITORS] += $newRowToAdd[Metrics::INDEX_NB_UNIQ_VISITORS];
diff --git a/core/Exception/AuthenticationFailedException.php b/core/Exception/AuthenticationFailedException.php
new file mode 100644
index 0000000000..ca3efc25c1
--- /dev/null
+++ b/core/Exception/AuthenticationFailedException.php
@@ -0,0 +1,13 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Exception;
+
+class AuthenticationFailedException extends Exception
+{
+} \ No newline at end of file
diff --git a/core/Exceptions/HtmlMessageException.php b/core/Exception/Exception.php
index 243a0f1726..106034bf5a 100644
--- a/core/Exceptions/HtmlMessageException.php
+++ b/core/Exception/Exception.php
@@ -6,25 +6,25 @@
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*
*/
-namespace Piwik\Exceptions;
+namespace Piwik\Exception;
-use Exception;
+use Exception as PhpException;
/**
* An exception whose message has HTML content. When these exceptions are caught
* the message will not be sanitized before being displayed to the user.
- *
- * @api
*/
-class HtmlMessageException extends Exception
+abstract class Exception extends PhpException
{
- /**
- * Returns the exception message.
- *
- * @return string
- */
- public function getHtmlMessage()
+ private $isHtmlMessage = false;
+
+ public function setIsHtmlMessage()
+ {
+ $this->isHtmlMessage = true;
+ }
+
+ public function isHtmlMessage()
{
- return $this->getMessage();
+ return $this->isHtmlMessage;
}
} \ No newline at end of file
diff --git a/core/Exception/MissingFilePermissionException.php b/core/Exception/MissingFilePermissionException.php
new file mode 100644
index 0000000000..268725c70b
--- /dev/null
+++ b/core/Exception/MissingFilePermissionException.php
@@ -0,0 +1,13 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Exception;
+
+class MissingFilePermissionException extends Exception
+{
+} \ No newline at end of file
diff --git a/core/Exception/NoPrivilegesException.php b/core/Exception/NoPrivilegesException.php
new file mode 100644
index 0000000000..3ee8c9ce2b
--- /dev/null
+++ b/core/Exception/NoPrivilegesException.php
@@ -0,0 +1,13 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Exception;
+
+class NoPrivilegesException extends Exception
+{
+} \ No newline at end of file
diff --git a/core/Exception/NoWebsiteFoundException.php b/core/Exception/NoWebsiteFoundException.php
new file mode 100644
index 0000000000..eb97cad37a
--- /dev/null
+++ b/core/Exception/NoWebsiteFoundException.php
@@ -0,0 +1,13 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Exception;
+
+class NoWebsiteFoundException extends Exception
+{
+} \ No newline at end of file
diff --git a/core/Filechecks.php b/core/Filechecks.php
index eab93fd260..0c37680fc4 100644
--- a/core/Filechecks.php
+++ b/core/Filechecks.php
@@ -8,7 +8,7 @@
*/
namespace Piwik;
-use Piwik\Exceptions\HtmlMessageException;
+use Piwik\Exception\MissingFilePermissionException;
class Filechecks
{
@@ -96,7 +96,7 @@ class Filechecks
}
}
- $directoryMessage = "<p><b>Piwik couldn't write to some directories $optionalUserInfo</b>.</p>";
+ $directoryMessage = "<p><b>Piwik couldn't write to some directories $optionalUserInfo</b>.</p>";
$directoryMessage .= "<p>Try to Execute the following commands on your server, to allow Write access on these directories"
. ":</p>"
. "<blockquote>$directoryList</blockquote>"
@@ -104,7 +104,10 @@ class Filechecks
. "<p>After applying the modifications, you can <a href='index.php'>refresh the page</a>.</p>"
. "<p>If you need more help, try <a href='?module=Proxy&action=redirect&url=http://piwik.org'>Piwik.org</a>.</p>";
- throw new HtmlMessageException($directoryMessage);
+ $ex = new MissingFilePermissionException($directoryMessage);
+ $ex->setIsHtmlMessage();
+
+ throw $ex;
}
/**
diff --git a/core/FrontController.php b/core/FrontController.php
index 16d5930fe2..25e56cc4f9 100644
--- a/core/FrontController.php
+++ b/core/FrontController.php
@@ -12,7 +12,7 @@ namespace Piwik;
use Exception;
use Piwik\API\Request;
use Piwik\API\ResponseBuilder;
-use Piwik\Exceptions\HtmlMessageException;
+use Piwik\Exception\AuthenticationFailedException;
use Piwik\Http\Router;
use Piwik\Plugin\Controller;
use Piwik\Plugin\Report;
@@ -420,10 +420,15 @@ class FrontController extends Singleton
try {
$authAdapter = Registry::get('auth');
} catch (Exception $e) {
- throw new HtmlMessageException("Authentication object cannot be found in the Registry. Maybe the Login plugin is not activated?
- <br />You can activate the plugin by adding:<br />
- <code>Plugins[] = Login</code><br />
- under the <code>[Plugins]</code> section in your config/config.ini.php");
+ $message = "Authentication object cannot be found in the Registry. Maybe the Login plugin is not activated?
+ <br />You can activate the plugin by adding:<br />
+ <code>Plugins[] = Login</code><br />
+ under the <code>[Plugins]</code> section in your config/config.ini.php";
+
+ $ex = new AuthenticationFailedException($message);
+ $ex->setIsHtmlMessage();
+
+ throw $ex;
}
Access::getInstance()->reloadAccess($authAdapter);
@@ -614,10 +619,10 @@ class FrontController extends Singleton
{
$debugTrace = $ex->getTraceAsString();
- if (method_exists($ex, 'getHtmlMessage')) {
- $message = $ex->getHtmlMessage();
- } else {
- $message = Common::sanitizeInputValue($ex->getMessage());
+ $message = $ex->getMessage();
+
+ if (!method_exists($ex, 'isHtmlMessage') || !$ex->isHtmlMessage()) {
+ $message = Common::sanitizeInputValue($message);
}
$logo = new CustomLogo();
diff --git a/core/Plugin/Controller.php b/core/Plugin/Controller.php
index 9985c100d5..4afcbf25ad 100644
--- a/core/Plugin/Controller.php
+++ b/core/Plugin/Controller.php
@@ -17,7 +17,8 @@ use Piwik\Config as PiwikConfig;
use Piwik\Config;
use Piwik\DataTable\Filter\CalculateEvolutionFilter;
use Piwik\Date;
-use Piwik\Exceptions\HtmlMessageException;
+use Piwik\Exception\NoPrivilegesException;
+use Piwik\Exception\NoWebsiteFoundException;
use Piwik\FrontController;
use Piwik\Menu\MenuTop;
use Piwik\Menu\MenuUser;
@@ -841,16 +842,22 @@ abstract class Controller
$message = "Error: no website was found in this Piwik installation.
<br />Check the table '$siteTableName' in your database, it should contain your Piwik websites.";
- throw new HtmlMessageException($message);
+ $ex = new NoWebsiteFoundException($message);
+ $ex->setIsHtmlMessage();
+
+ throw $ex;
}
if (!Piwik::isUserIsAnonymous()) {
$currentLogin = Piwik::getCurrentUserLogin();
$emails = implode(',', Piwik::getAllSuperUserAccessEmailAddresses());
- $errorMessage = sprintf(Piwik::translate('CoreHome_NoPrivilegesAskPiwikAdmin'), $currentLogin, "<br/><a href='mailto:" . $emails . "?subject=Access to Piwik for user $currentLogin'>", "</a>");
+ $errorMessage = sprintf(Piwik::translate('CoreHome_NoPrivilegesAskPiwikAdmin'), $currentLogin, "<br/><a href='mailto:" . $emails . "?subject=Access to Piwik for user $currentLogin'>", "</a>");
$errorMessage .= "<br /><br />&nbsp;&nbsp;&nbsp;<b><a href='index.php?module=" . Registry::get('auth')->getName() . "&amp;action=logout'>&rsaquo; " . Piwik::translate('General_Logout') . "</a></b><br />";
- throw new HtmlMessageException($errorMessage);
+ $ex = new NoPrivilegesException($errorMessage);
+ $ex->setIsHtmlMessage();
+
+ throw $ex;
}
echo FrontController::getInstance()->dispatch(Piwik::getLoginPluginName(), false);
diff --git a/core/Plugin/MetadataLoader.php b/core/Plugin/MetadataLoader.php
index 34bb90dcdc..e75bc58338 100644
--- a/core/Plugin/MetadataLoader.php
+++ b/core/Plugin/MetadataLoader.php
@@ -95,7 +95,7 @@ class MetadataLoader
return array();
}
- $info = Common::json_decode($json, $assoc = true);
+ $info = json_decode($json, $assoc = true);
if (!is_array($info)
|| empty($info)
) {
diff --git a/core/Session.php b/core/Session.php
index d8fa47b4d2..f67b2e4caf 100644
--- a/core/Session.php
+++ b/core/Session.php
@@ -9,7 +9,7 @@
namespace Piwik;
use Exception;
-use Piwik\Exceptions\HtmlMessageException;
+use Piwik\Exception\MissingFilePermissionException;
use Piwik\Session\SaveHandler\DbTable;
use Zend_Session;
@@ -132,7 +132,10 @@ class Session extends Zend_Session
$e->getMessage()
);
- throw new HtmlMessageException($message, $e->getCode(), $e);
+ $ex = new MissingFilePermissionException($message, $e->getCode(), $e);
+ $ex->setIsHtmlMessage();
+
+ throw $ex;
}
}
diff --git a/core/Tracker.php b/core/Tracker.php
index ed911e55f6..a84afd9632 100644
--- a/core/Tracker.php
+++ b/core/Tracker.php
@@ -436,7 +436,7 @@ class Tracker
$result['message'] = $this->getMessageFromException($e);
}
Common::sendHeader('Content-Type: application/json');
- echo Common::json_encode($result);
+ echo json_encode($result);
die(1);
exit;
}
@@ -454,7 +454,7 @@ class Tracker
Common::sendHeader('Content-Type: text/html; charset=utf-8');
echo $this->getMessageFromException($e);
} else {
- $this->outputTransparentGif();
+ $this->sendResponse();
}
die(1);
exit;
@@ -496,12 +496,12 @@ class Tracker
$this->outputAccessControlHeaders();
Common::sendHeader('Content-Type: application/json');
- echo Common::json_encode($result);
+ echo json_encode($result);
exit;
}
switch ($this->getState()) {
case self::STATE_LOGGING_DISABLE:
- $this->outputTransparentGif ();
+ $this->sendResponse();
Common::printDebug("Logging disabled, display transparent logo");
break;
@@ -513,7 +513,7 @@ class Tracker
case self::STATE_NOSCRIPT_REQUEST:
case self::STATE_NOTHING_TO_NOTICE:
default:
- $this->outputTransparentGif ();
+ $this->sendResponse();
Common::printDebug("Nothing to notice => default behaviour");
break;
}
@@ -648,7 +648,7 @@ class Tracker
return $visit;
}
- protected function outputTransparentGif ()
+ private function sendResponse()
{
if (isset($GLOBALS['PIWIK_TRACKER_DEBUG'])
&& $GLOBALS['PIWIK_TRACKER_DEBUG']
@@ -660,11 +660,24 @@ class Tracker
// If there was an error during tracker, return so errors can be flushed
return;
}
- $transGifBase64 = "R0lGODlhAQABAIAAAAAAAAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==";
- Common::sendHeader('Content-Type: image/gif');
$this->outputAccessControlHeaders();
+ $request = $_GET + $_POST;
+
+ if (array_key_exists('send_image', $request) && $request['send_image'] === '0') {
+ Common::sendHeader("HTTP/1.1 204 No Response");
+ return;
+ }
+
+ $this->outputTransparentGif();
+ }
+
+ protected function outputTransparentGif ()
+ {
+ $transGifBase64 = "R0lGODlhAQABAIAAAAAAAAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==";
+ Common::sendHeader('Content-Type: image/gif');
+
print(base64_decode($transGifBase64));
}
diff --git a/core/Translate.php b/core/Translate.php
index 65381c0a2d..c29d0f0339 100644
--- a/core/Translate.php
+++ b/core/Translate.php
@@ -173,7 +173,7 @@ class Translate
$clientSideTranslations[$key] = $translations[$plugin][$stringName];
}
- $js = 'var translations = ' . Common::json_encode($clientSideTranslations) . ';';
+ $js = 'var translations = ' . json_encode($clientSideTranslations) . ';';
$js .= "\n" . 'if (typeof(piwik_translations) == \'undefined\') { var piwik_translations = new Object; }' .
'for(var i in translations) { piwik_translations[i] = translations[i];} ';
return $js;
diff --git a/core/Twig.php b/core/Twig.php
index 2e0ef95844..b15efe088f 100755
--- a/core/Twig.php
+++ b/core/Twig.php
@@ -10,7 +10,6 @@ namespace Piwik;
use Exception;
use Piwik\DataTable\Filter\SafeDecodeLabel;
-use Piwik\Period\Range;
use Piwik\Translate;
use Piwik\View\RenderTokenParser;
use Piwik\Visualization\Sparkline;
@@ -245,7 +244,7 @@ class Twig
protected function addFilter_prettyDate()
{
$prettyDate = new Twig_SimpleFilter('prettyDate', function ($dateString, $period) {
- return Range::factory($period, $dateString)->getLocalizedShortString();
+ return Period\Factory::build($period, $dateString)->getLocalizedShortString();
});
$this->twig->addFilter($prettyDate);
}
diff --git a/core/Updates/1.8.3-b1.php b/core/Updates/1.8.3-b1.php
index 7a00ec20b3..ee8e6c4d00 100644
--- a/core/Updates/1.8.3-b1.php
+++ b/core/Updates/1.8.3-b1.php
@@ -98,8 +98,8 @@ class Updates_1_8_3_b1 extends Updates
is_null($period) ? ScheduledReports::DEFAULT_PERIOD : $period,
ScheduledReports::EMAIL_TYPE,
is_null($format) ? ScheduledReports::DEFAULT_REPORT_FORMAT : $format,
- Common::json_encode(preg_split('/,/', $reports)),
- Common::json_encode($parameters),
+ json_encode(preg_split('/,/', $reports)),
+ json_encode($parameters),
$ts_created,
$ts_last_sent,
$deleted
diff --git a/core/Version.php b/core/Version.php
index b4545cacac..fa7f0f29b7 100644
--- a/core/Version.php
+++ b/core/Version.php
@@ -20,5 +20,5 @@ final class Version
* The current Piwik version.
* @var string
*/
- const VERSION = '2.9.0-b9';
+ const VERSION = '2.9.0';
}
diff --git a/js/piwik.js b/js/piwik.js
index e374649c64..98f22d7f8a 100644
--- a/js/piwik.js
+++ b/js/piwik.js
@@ -2925,7 +2925,8 @@ if (typeof Piwik !== 'object') {
'&_viewts=' + lastVisitTs +
(String(lastEcommerceOrderTs).length ? '&_ects=' + lastEcommerceOrderTs : '') +
(String(referralUrl).length ? '&_ref=' + encodeWrapper(purify(referralUrl.slice(0, referralUrlMaxLength))) : '') +
- (charSet ? '&cs=' + encodeWrapper(charSet) : '');
+ (charSet ? '&cs=' + encodeWrapper(charSet) : '') +
+ '&send_image=0';
// browser features
for (i in browserFeatures) {
diff --git a/lang/cs.json b/lang/cs.json
index 81ad8853d5..722df7a1a3 100644
--- a/lang/cs.json
+++ b/lang/cs.json
@@ -209,6 +209,7 @@
"LastDays": "Posledních %s dní (včetně dneška)",
"LastDaysShort": "Posledních %s dní",
"LayoutDirection": "ltr",
+ "LearnMore": "%1$sdozvědět se více%2$s",
"Live": "Živě",
"Loading": "Načítám...",
"LoadingData": "Načítám data...",
@@ -355,6 +356,7 @@
"Seconds": "%s sekund",
"SeeAll": "Zobrazit vše",
"SeeTheOfficialDocumentationForMoreInformation": "Pro více informací navštivte %soficiální dokumentaci%s.",
+ "SeeThisFaq": "Podívejte se na %1$stento často kladený dotaz%2$s.",
"Segment": "Část",
"SelectYesIfYouWantToSendEmailsViaServer": "Zvolte \"Ano\" pokud chcete e-mail posílat pomocí uvedeného serveru místo lokální funkce PHP mail",
"Settings": "Nastavení",
@@ -433,6 +435,7 @@
"WarningFileIntegrityNoMd5file": "Test integrity nemůže být dokončen z důvodů chybějící funkce md5_file().",
"WarningPasswordStored": "%sUpozornění:%s Toto heslo bude uloženo v konfiguračním souboru viditelné pro všechny s přístupem k němu.",
"WarningPhpVersionXIsTooOld": "PHP verze %s, kterou používáte již není podporována (EOL). Důrazně doporučujeme aktualizovat na novější verzi, protože stávající může obsahovat bezpečnostní a další problémy, které byly opraveny v novějších verzích PHP.",
+ "WarningPiwikWillStopSupportingPHPVersion": "Piwik tuto verzi PHP přestane podporovat za %s. Aktualizujte, dokud je čas!",
"Website": "Web stránky",
"Weekly": "Týdně",
"WeeklyReport": "Týdně",
diff --git a/lang/fr.json b/lang/fr.json
index 9d36b1ad9d..1e5f9cbc77 100644
--- a/lang/fr.json
+++ b/lang/fr.json
@@ -27,7 +27,7 @@
"Cancel": "Annuler",
"CannotUnzipFile": "Impossible de décompresser le ficher %1$s: %2$s",
"ChangePassword": "Modifier le mot de passe",
- "ChangeTagCloudView": "Veuillez noter que vous pouvez visualiser le rapport sous une autre forme qu'un nuage de tags. Utilisez les contrôles à la fin du rapport pour ce faire.",
+ "ChangeTagCloudView": "Veuillez noter que vous pouvez visualiser le rapport sous une autre forme qu'un nuage de tags. Pour cela, utilisez les option en dessous du rapport.",
"ChooseDate": "Sélectionnez une date",
"ChooseLanguage": "Sélectionnez la langue",
"ChoosePeriod": "Sélectionnez la période",
@@ -55,11 +55,11 @@
"ColumnEntrances": "Entrées",
"ColumnEntrancesDocumentation": "Nombre de visites qui ont démarré sur cette page.",
"ColumnExitRate": "Taux de sortie",
- "ColumnExitRateDocumentation": "Pourcentage de visites qui ont quitté le site web après avoir visualisé cette page (affichages uniques divisés par sorties)",
+ "ColumnExitRateDocumentation": "Pourcentage de visites qui ont quitté le site web après avoir visualisé cette page (affichages uniques divisés par sorties).",
"ColumnExits": "Sorties",
"ColumnExitsDocumentation": "Nombre de visites qui se sont terminées sur cette page.",
"ColumnGenerationTime": "Délais de génération",
- "ColumnKeyword": "Mot clef",
+ "ColumnKeyword": "Mot-clé",
"ColumnLabel": "Nom",
"ColumnMaxActions": "Nombre maximum d'actions en une visite",
"ColumnNbActions": "Actions",
@@ -153,11 +153,11 @@
"ExceptionIncompatibleClientServerVersions": "La version de votre client %1$s est %2$s ce qui est incompatible avec le serveur de version %3$s.",
"ExceptionInvalidAggregateReportsFormat": "Le type de rapport suivant '%s' n'est pas valide. Essayer un des types suivants : %s.",
"ExceptionInvalidArchiveTimeToLive": "La durée de l'archivage doit être un nombre de secondes supérieur à zéro.",
- "ExceptionInvalidDateFormat": "Le format de date doit être: %s ou n'importe quel mot clef supporté par la fonction %s (visitez %s pour plus d'informations)",
+ "ExceptionInvalidDateFormat": "Le format de date doit être : %s ou n'importe quel mot-clé supporté par la fonction %s (visitez %s pour plus d'informations)",
"ExceptionInvalidDateRange": "La date '%s' ne correspond pas au format suivant : %s.",
- "ExceptionInvalidPeriod": "La période '%s' n'est pas supportée. Veuillez essayer parmi celles-ci à la place: %s.",
- "ExceptionInvalidRendererFormat": "Le format de rendu '%s' n'est pas valide. Veuillez essayer un de ceux-ci à la place: %s.",
- "ExceptionInvalidReportRendererFormat": "Format de rapport '%s' invalide. Essayez n'importe lequel des formats suivants à la place: %s.",
+ "ExceptionInvalidPeriod": "La période '%s' n'est pas supportée. Veuillez essayer parmi celles-ci à la place : %s.",
+ "ExceptionInvalidRendererFormat": "Le format de rendu '%s' n'est pas valide. Veuillez essayer un de ceux-ci à la place : %s.",
+ "ExceptionInvalidReportRendererFormat": "Format de rapport '%s' invalide. Essayez n'importe lequel des formats suivants à la place : %s.",
"ExceptionInvalidStaticGraphType": "Le type de graph suivant '%s' n'est pas valide. Essayer un des types suivants : %s.",
"ExceptionInvalidToken": "La clef partagée (token) n'est pas valide.",
"ExceptionLanguageFileNotFound": "Le fichier de langage '%s' n'a pas été trouvé.",
@@ -203,7 +203,7 @@
"InvalidDateRange": "Plage de dates invalide, veuillez recommencer.",
"InvalidResponse": "Les données reçues sont invalides",
"IP": "IP",
- "JsTrackingTag": "Code JavaScript de suivi",
+ "JsTrackingTag": "Code de suivi JavaScript",
"Language": "Langue",
"LastDays": "%s derniers jours (aujourd'hui inclus)",
"LastDaysShort": "Derniers %s jours",
@@ -249,7 +249,7 @@
"MonthlyReport": "mensuel",
"MonthlyReports": "Rapports mensuels",
"More": "Plus",
- "MoreDetails": "Plus de Détails",
+ "MoreDetails": "Plus de détails",
"MoreLowerCase": "plus",
"MultiSitesSummary": "Tous les sites web",
"Name": "Nom",
@@ -302,7 +302,7 @@
"Outlink": "Lien sortant",
"Outlinks": "Liens sortant",
"OverlayRowActionTooltip": "Visualisez les données d'analyse directement sur votre site web (ouvre un nouvel onglet)",
- "OverlayRowActionTooltipTitle": "Afficher la page par dessus",
+ "OverlayRowActionTooltipTitle": "Ouvrir l'analyse des pages web",
"Overview": "Récapitulatif",
"Pages": "Pages",
"ParameterMustIntegerBetween": "Le paramètre %s doit être un entier entre les valeurs %s et %s.",
@@ -338,13 +338,13 @@
"ReportGeneratedFrom": "Ce rapport a été généré en utilisant des données de %s.",
"ReportRatioTooltip": "'%1$s' représente %2$s de %3$s %4$s avec %5$s.",
"Reports": "Rapports",
- "ReportsContainingTodayWillBeProcessedAtMostEvery": "Rapports du jour (ou n'importe quelle autre plage de dates incluant aujourd'hui) seront calculés tout au plus chaque",
+ "ReportsContainingTodayWillBeProcessedAtMostEvery": "Les rapports du jour (ou n'importe quelle autre plage de dates incluant aujourd'hui) seront calculés tout au plus chaque",
"ReportsWillBeProcessedAtMostEveryHour": "Les rapports seront donc traités tout au plus chaque heure.",
"RequestTimedOut": "Une requête vers %s a expiré. Veuillez réessayer.",
"Required": "%s requis",
"ReturningVisitor": "Visiteur de retour",
"ReturningVisitorAllVisits": "Voir tous les visiteurs",
- "RowEvolutionRowActionTooltip": "Visualisez l'évolution des métriques pour cette ligne ont changée en fonction du temps",
+ "RowEvolutionRowActionTooltip": "Visualisez l'évolution dans le temps des métriques de cette ligne",
"RowEvolutionRowActionTooltipTitle": "Ouvrir l'évolution de la ligne",
"Rows": "Rangées",
"RowsToDisplay": "Lignes à afficher",
@@ -355,6 +355,7 @@
"Seconds": "%ss",
"SeeAll": "tout montrer",
"SeeTheOfficialDocumentationForMoreInformation": "Consultez la %s documentation officielle %s pour plus d'information.",
+ "SeeThisFaq": "Voir %1$scette faq%2$s.",
"Segment": "Segment",
"SelectYesIfYouWantToSendEmailsViaServer": "Sélectionnez \"Oui\" si vous voulez ou devez envoyer un e-mail via un serveur nommé à la place de la fonction de courrier local.",
"Settings": "Paramètres",
@@ -431,7 +432,7 @@
"WarningFileIntegrityNoManifest": "Le contrôle d'intégrité n'a pu être effectué car le fichier manifest.inc.php est manquant.",
"WarningFileIntegrityNoManifestDeployingFromGit": "Si vous déployez Piwik depuis Git, ce message est normal.",
"WarningFileIntegrityNoMd5file": "Le contrôle d'intégrité n'a pu être effectué car la fonction md5_file() est manquante.",
- "WarningPasswordStored": "%sAttention:%s Ce mot de passe sera stocké dans le fichier de configuration et sera visible pour n'importe qui y ayant accès.",
+ "WarningPasswordStored": "%sAttention :%s Ce mot de passe sera stocké dans le fichier de configuration et sera visible pour n'importe qui y ayant accès.",
"WarningPhpVersionXIsTooOld": "La version de PHP que vous utilisez (%s) est en fin de support. Nous vous incitons vivement à upgrader vers une version plus récente. Votre version actuelle vous expose à des failles de sécurité et des bugs qui ont été corrigés dans les versions les plus récentes de PHP.",
"WarningPiwikWillStopSupportingPHPVersion": "Piwik va arrêter le support de cette version de PHP en %s. Mettez à jour votre version de PHP avant qu'il ne soit trop tard !",
"Website": "Site",
@@ -501,7 +502,7 @@
"NoWebsiteFound": "Aucun site trouvé",
"NoWebsitesShort": "Pas de site internet",
"PossibleSslError": "Erreur potentielle de certificat SSL",
- "PossibleSslErrorExplanation": "Une erreur peut être causée par un certificat invalide ou auto-signé: \"%s\". La connexion peut fonctionner pour vous en ignorant la validation SSL mais cela est moins sécurisé. Vous pouvez modifier la validation SSL à n'importe quel moment depuis les paramètres.",
+ "PossibleSslErrorExplanation": "Une erreur peut être causée par un certificat invalide ou auto-signé : \"%s\". La connexion peut fonctionner pour vous en ignorant la validation SSL mais cela est moins sécurisé. Vous pouvez modifier la validation SSL à n'importe quel moment depuis les paramètres.",
"PullDownToRefresh": "Faites glisser vers le bas pour actualiser",
"RatingDontRemindMe": "Ne pas me rappeler",
"RatingNotNow": "Pas maintenant",
diff --git a/lang/nl.json b/lang/nl.json
index 12d8e8204c..4ac4995266 100644
--- a/lang/nl.json
+++ b/lang/nl.json
@@ -491,6 +491,7 @@
"NoVisitorsShort": "Geen Bezoekers",
"NoWebsiteFound": "Geen website gevonden",
"NoWebsitesShort": "Geen Websites",
+ "PossibleSslError": "Mogelijke SSL certificaat fout",
"PullDownToRefresh": "Trek om te vernieuwen ...",
"RatingDontRemindMe": "Herrinner me er niet aan",
"RatingNotNow": "Niet nu",
diff --git a/libs/MaxMindGeoIP/geoip.inc b/libs/MaxMindGeoIP/geoip.inc
index 96226d6079..516eb2fc59 100755
--- a/libs/MaxMindGeoIP/geoip.inc
+++ b/libs/MaxMindGeoIP/geoip.inc
@@ -28,16 +28,36 @@ define("GEOIP_MEMORY_CACHE", 1);
define("GEOIP_SHARED_MEMORY", 2);
define("STRUCTURE_INFO_MAX_SIZE", 20);
define("DATABASE_INFO_MAX_SIZE", 100);
-define("GEOIP_COUNTRY_EDITION", 1);
-define("GEOIP_PROXY_EDITION", 8);
-define("GEOIP_ASNUM_EDITION", 9);
-define("GEOIP_NETSPEED_EDITION", 10);
-define("GEOIP_REGION_EDITION_REV0", 7);
-define("GEOIP_REGION_EDITION_REV1", 3);
-define("GEOIP_CITY_EDITION_REV0", 6);
-define("GEOIP_CITY_EDITION_REV1", 2);
-define("GEOIP_ORG_EDITION", 5);
-define("GEOIP_ISP_EDITION", 4);
+if (!defined('GEOIP_COUNTRY_EDITION')) {
+ define("GEOIP_COUNTRY_EDITION", 106);
+}
+if (!defined("GEOIP_PROXY_EDITION")) {
+ define("GEOIP_PROXY_EDITION", 8);
+}
+if (!defined("GEOIP_ASNUM_EDITION")) {
+ define("GEOIP_ASNUM_EDITION", 9);
+}
+if (!defined("GEOIP_NETSPEED_EDITION")) {
+ define("GEOIP_NETSPEED_EDITION", 10);
+}
+if (!defined("GEOIP_REGION_EDITION_REV0")) {
+ define("GEOIP_REGION_EDITION_REV0", 112);
+}
+if (!defined("GEOIP_REGION_EDITION_REV1")) {
+ define("GEOIP_REGION_EDITION_REV1", 3);
+}
+if (!defined("GEOIP_CITY_EDITION_REV0")) {
+ define("GEOIP_CITY_EDITION_REV0", 111);
+}
+if (!defined("GEOIP_CITY_EDITION_REV1")) {
+ define("GEOIP_CITY_EDITION_REV1", 2);
+}
+if (!defined("GEOIP_ORG_EDITION")) {
+ define("GEOIP_ORG_EDITION", 110);
+}
+if (!defined("GEOIP_ISP_EDITION")) {
+ define("GEOIP_ISP_EDITION", 4);
+}
define("SEGMENT_RECORD_LENGTH", 3);
define("STANDARD_RECORD_LENGTH", 3);
define("ORG_RECORD_LENGTH", 4);
@@ -48,1844 +68,682 @@ define("US_OFFSET", 1);
define("CANADA_OFFSET", 677);
define("WORLD_OFFSET", 1353);
define("FIPS_RANGE", 360);
-define("GEOIP_UNKNOWN_SPEED", 0);
-define("GEOIP_DIALUP_SPEED", 1);
-define("GEOIP_CABLEDSL_SPEED", 2);
-define("GEOIP_CORPORATE_SPEED", 3);
-define("GEOIP_DOMAIN_EDITION", 11);
-define("GEOIP_COUNTRY_EDITION_V6", 12);
+if (!defined("GEOIP_UNKNOWN_SPEED")) {
+ define("GEOIP_UNKNOWN_SPEED", 0);
+}
+if (!defined("GEOIP_DIALUP_SPEED")) {
+ define("GEOIP_DIALUP_SPEED", 1);
+}
+if (!defined("GEOIP_CABLEDSL_SPEED")) {
+ define("GEOIP_CABLEDSL_SPEED", 2);
+}
+if (!defined("GEOIP_CORPORATE_SPEED")) {
+ define("GEOIP_CORPORATE_SPEED", 3);
+}
+if (!defined("GEOIP_DOMAIN_EDITION")) {
+ define("GEOIP_DOMAIN_EDITION", 11);
+}
+if (!defined("GEOIP_COUNTRY_EDITION_V6")) {
+ define("GEOIP_COUNTRY_EDITION_V6", 12);
+}
define("GEOIP_LOCATIONA_EDITION", 13);
define("GEOIP_ACCURACYRADIUS_EDITION", 14);
define("GEOIP_CITYCOMBINED_EDITION", 15);
define("GEOIP_CITY_EDITION_REV1_V6", 30);
-define("GEOIP_CITY_EDITION_REV0_V6", 31);
-define("GEOIP_NETSPEED_EDITION_REV1", 32);
-define("GEOIP_NETSPEED_EDITION_REV1_V6", 33);
-define("GEOIP_USERTYPE_EDITION", 28);
-define("GEOIP_USERTYPE_EDITION_V6", 29);
-define("GEOIP_ASNUM_EDITION_V6", 21);
-define("GEOIP_ISP_EDITION_V6", 22);
-define("GEOIP_ORG_EDITION_V6", 23);
-define("GEOIP_DOMAIN_EDITION_V6", 24);
-
-define("CITYCOMBINED_FIXED_RECORD", 7);
-
-class GeoIP
-{
- public $flags;
- public $filehandle;
- public $memory_buffer;
- public $databaseType;
- public $databaseSegments;
- public $record_length;
- public $shmid;
- public $GEOIP_COUNTRY_CODE_TO_NUMBER = array(
- "" => 0,
- "AP" => 1,
- "EU" => 2,
- "AD" => 3,
- "AE" => 4,
- "AF" => 5,
- "AG" => 6,
- "AI" => 7,
- "AL" => 8,
- "AM" => 9,
- "CW" => 10,
- "AO" => 11,
- "AQ" => 12,
- "AR" => 13,
- "AS" => 14,
- "AT" => 15,
- "AU" => 16,
- "AW" => 17,
- "AZ" => 18,
- "BA" => 19,
- "BB" => 20,
- "BD" => 21,
- "BE" => 22,
- "BF" => 23,
- "BG" => 24,
- "BH" => 25,
- "BI" => 26,
- "BJ" => 27,
- "BM" => 28,
- "BN" => 29,
- "BO" => 30,
- "BR" => 31,
- "BS" => 32,
- "BT" => 33,
- "BV" => 34,
- "BW" => 35,
- "BY" => 36,
- "BZ" => 37,
- "CA" => 38,
- "CC" => 39,
- "CD" => 40,
- "CF" => 41,
- "CG" => 42,
- "CH" => 43,
- "CI" => 44,
- "CK" => 45,
- "CL" => 46,
- "CM" => 47,
- "CN" => 48,
- "CO" => 49,
- "CR" => 50,
- "CU" => 51,
- "CV" => 52,
- "CX" => 53,
- "CY" => 54,
- "CZ" => 55,
- "DE" => 56,
- "DJ" => 57,
- "DK" => 58,
- "DM" => 59,
- "DO" => 60,
- "DZ" => 61,
- "EC" => 62,
- "EE" => 63,
- "EG" => 64,
- "EH" => 65,
- "ER" => 66,
- "ES" => 67,
- "ET" => 68,
- "FI" => 69,
- "FJ" => 70,
- "FK" => 71,
- "FM" => 72,
- "FO" => 73,
- "FR" => 74,
- "SX" => 75,
- "GA" => 76,
- "GB" => 77,
- "GD" => 78,
- "GE" => 79,
- "GF" => 80,
- "GH" => 81,
- "GI" => 82,
- "GL" => 83,
- "GM" => 84,
- "GN" => 85,
- "GP" => 86,
- "GQ" => 87,
- "GR" => 88,
- "GS" => 89,
- "GT" => 90,
- "GU" => 91,
- "GW" => 92,
- "GY" => 93,
- "HK" => 94,
- "HM" => 95,
- "HN" => 96,
- "HR" => 97,
- "HT" => 98,
- "HU" => 99,
- "ID" => 100,
- "IE" => 101,
- "IL" => 102,
- "IN" => 103,
- "IO" => 104,
- "IQ" => 105,
- "IR" => 106,
- "IS" => 107,
- "IT" => 108,
- "JM" => 109,
- "JO" => 110,
- "JP" => 111,
- "KE" => 112,
- "KG" => 113,
- "KH" => 114,
- "KI" => 115,
- "KM" => 116,
- "KN" => 117,
- "KP" => 118,
- "KR" => 119,
- "KW" => 120,
- "KY" => 121,
- "KZ" => 122,
- "LA" => 123,
- "LB" => 124,
- "LC" => 125,
- "LI" => 126,
- "LK" => 127,
- "LR" => 128,
- "LS" => 129,
- "LT" => 130,
- "LU" => 131,
- "LV" => 132,
- "LY" => 133,
- "MA" => 134,
- "MC" => 135,
- "MD" => 136,
- "MG" => 137,
- "MH" => 138,
- "MK" => 139,
- "ML" => 140,
- "MM" => 141,
- "MN" => 142,
- "MO" => 143,
- "MP" => 144,
- "MQ" => 145,
- "MR" => 146,
- "MS" => 147,
- "MT" => 148,
- "MU" => 149,
- "MV" => 150,
- "MW" => 151,
- "MX" => 152,
- "MY" => 153,
- "MZ" => 154,
- "NA" => 155,
- "NC" => 156,
- "NE" => 157,
- "NF" => 158,
- "NG" => 159,
- "NI" => 160,
- "NL" => 161,
- "NO" => 162,
- "NP" => 163,
- "NR" => 164,
- "NU" => 165,
- "NZ" => 166,
- "OM" => 167,
- "PA" => 168,
- "PE" => 169,
- "PF" => 170,
- "PG" => 171,
- "PH" => 172,
- "PK" => 173,
- "PL" => 174,
- "PM" => 175,
- "PN" => 176,
- "PR" => 177,
- "PS" => 178,
- "PT" => 179,
- "PW" => 180,
- "PY" => 181,
- "QA" => 182,
- "RE" => 183,
- "RO" => 184,
- "RU" => 185,
- "RW" => 186,
- "SA" => 187,
- "SB" => 188,
- "SC" => 189,
- "SD" => 190,
- "SE" => 191,
- "SG" => 192,
- "SH" => 193,
- "SI" => 194,
- "SJ" => 195,
- "SK" => 196,
- "SL" => 197,
- "SM" => 198,
- "SN" => 199,
- "SO" => 200,
- "SR" => 201,
- "ST" => 202,
- "SV" => 203,
- "SY" => 204,
- "SZ" => 205,
- "TC" => 206,
- "TD" => 207,
- "TF" => 208,
- "TG" => 209,
- "TH" => 210,
- "TJ" => 211,
- "TK" => 212,
- "TM" => 213,
- "TN" => 214,
- "TO" => 215,
- "TL" => 216,
- "TR" => 217,
- "TT" => 218,
- "TV" => 219,
- "TW" => 220,
- "TZ" => 221,
- "UA" => 222,
- "UG" => 223,
- "UM" => 224,
- "US" => 225,
- "UY" => 226,
- "UZ" => 227,
- "VA" => 228,
- "VC" => 229,
- "VE" => 230,
- "VG" => 231,
- "VI" => 232,
- "VN" => 233,
- "VU" => 234,
- "WF" => 235,
- "WS" => 236,
- "YE" => 237,
- "YT" => 238,
- "RS" => 239,
- "ZA" => 240,
- "ZM" => 241,
- "ME" => 242,
- "ZW" => 243,
- "A1" => 244,
- "A2" => 245,
- "O1" => 246,
- "AX" => 247,
- "GG" => 248,
- "IM" => 249,
- "JE" => 250,
- "BL" => 251,
- "MF" => 252,
- "BQ" => 253,
- "SS" => 254
- );
-
- public $GEOIP_COUNTRY_CODES = array(
- "",
- "AP",
- "EU",
- "AD",
- "AE",
- "AF",
- "AG",
- "AI",
- "AL",
- "AM",
- "CW",
- "AO",
- "AQ",
- "AR",
- "AS",
- "AT",
- "AU",
- "AW",
- "AZ",
- "BA",
- "BB",
- "BD",
- "BE",
- "BF",
- "BG",
- "BH",
- "BI",
- "BJ",
- "BM",
- "BN",
- "BO",
- "BR",
- "BS",
- "BT",
- "BV",
- "BW",
- "BY",
- "BZ",
- "CA",
- "CC",
- "CD",
- "CF",
- "CG",
- "CH",
- "CI",
- "CK",
- "CL",
- "CM",
- "CN",
- "CO",
- "CR",
- "CU",
- "CV",
- "CX",
- "CY",
- "CZ",
- "DE",
- "DJ",
- "DK",
- "DM",
- "DO",
- "DZ",
- "EC",
- "EE",
- "EG",
- "EH",
- "ER",
- "ES",
- "ET",
- "FI",
- "FJ",
- "FK",
- "FM",
- "FO",
- "FR",
- "SX",
- "GA",
- "GB",
- "GD",
- "GE",
- "GF",
- "GH",
- "GI",
- "GL",
- "GM",
- "GN",
- "GP",
- "GQ",
- "GR",
- "GS",
- "GT",
- "GU",
- "GW",
- "GY",
- "HK",
- "HM",
- "HN",
- "HR",
- "HT",
- "HU",
- "ID",
- "IE",
- "IL",
- "IN",
- "IO",
- "IQ",
- "IR",
- "IS",
- "IT",
- "JM",
- "JO",
- "JP",
- "KE",
- "KG",
- "KH",
- "KI",
- "KM",
- "KN",
- "KP",
- "KR",
- "KW",
- "KY",
- "KZ",
- "LA",
- "LB",
- "LC",
- "LI",
- "LK",
- "LR",
- "LS",
- "LT",
- "LU",
- "LV",
- "LY",
- "MA",
- "MC",
- "MD",
- "MG",
- "MH",
- "MK",
- "ML",
- "MM",
- "MN",
- "MO",
- "MP",
- "MQ",
- "MR",
- "MS",
- "MT",
- "MU",
- "MV",
- "MW",
- "MX",
- "MY",
- "MZ",
- "NA",
- "NC",
- "NE",
- "NF",
- "NG",
- "NI",
- "NL",
- "NO",
- "NP",
- "NR",
- "NU",
- "NZ",
- "OM",
- "PA",
- "PE",
- "PF",
- "PG",
- "PH",
- "PK",
- "PL",
- "PM",
- "PN",
- "PR",
- "PS",
- "PT",
- "PW",
- "PY",
- "QA",
- "RE",
- "RO",
- "RU",
- "RW",
- "SA",
- "SB",
- "SC",
- "SD",
- "SE",
- "SG",
- "SH",
- "SI",
- "SJ",
- "SK",
- "SL",
- "SM",
- "SN",
- "SO",
- "SR",
- "ST",
- "SV",
- "SY",
- "SZ",
- "TC",
- "TD",
- "TF",
- "TG",
- "TH",
- "TJ",
- "TK",
- "TM",
- "TN",
- "TO",
- "TL",
- "TR",
- "TT",
- "TV",
- "TW",
- "TZ",
- "UA",
- "UG",
- "UM",
- "US",
- "UY",
- "UZ",
- "VA",
- "VC",
- "VE",
- "VG",
- "VI",
- "VN",
- "VU",
- "WF",
- "WS",
- "YE",
- "YT",
- "RS",
- "ZA",
- "ZM",
- "ME",
- "ZW",
- "A1",
- "A2",
- "O1",
- "AX",
- "GG",
- "IM",
- "JE",
- "BL",
- "MF",
- "BQ",
- "SS",
- "O1"
- );
-
- public $GEOIP_COUNTRY_CODES3 = array(
- "",
- "AP",
- "EU",
- "AND",
- "ARE",
- "AFG",
- "ATG",
- "AIA",
- "ALB",
- "ARM",
- "CUW",
- "AGO",
- "ATA",
- "ARG",
- "ASM",
- "AUT",
- "AUS",
- "ABW",
- "AZE",
- "BIH",
- "BRB",
- "BGD",
- "BEL",
- "BFA",
- "BGR",
- "BHR",
- "BDI",
- "BEN",
- "BMU",
- "BRN",
- "BOL",
- "BRA",
- "BHS",
- "BTN",
- "BVT",
- "BWA",
- "BLR",
- "BLZ",
- "CAN",
- "CCK",
- "COD",
- "CAF",
- "COG",
- "CHE",
- "CIV",
- "COK",
- "CHL",
- "CMR",
- "CHN",
- "COL",
- "CRI",
- "CUB",
- "CPV",
- "CXR",
- "CYP",
- "CZE",
- "DEU",
- "DJI",
- "DNK",
- "DMA",
- "DOM",
- "DZA",
- "ECU",
- "EST",
- "EGY",
- "ESH",
- "ERI",
- "ESP",
- "ETH",
- "FIN",
- "FJI",
- "FLK",
- "FSM",
- "FRO",
- "FRA",
- "SXM",
- "GAB",
- "GBR",
- "GRD",
- "GEO",
- "GUF",
- "GHA",
- "GIB",
- "GRL",
- "GMB",
- "GIN",
- "GLP",
- "GNQ",
- "GRC",
- "SGS",
- "GTM",
- "GUM",
- "GNB",
- "GUY",
- "HKG",
- "HMD",
- "HND",
- "HRV",
- "HTI",
- "HUN",
- "IDN",
- "IRL",
- "ISR",
- "IND",
- "IOT",
- "IRQ",
- "IRN",
- "ISL",
- "ITA",
- "JAM",
- "JOR",
- "JPN",
- "KEN",
- "KGZ",
- "KHM",
- "KIR",
- "COM",
- "KNA",
- "PRK",
- "KOR",
- "KWT",
- "CYM",
- "KAZ",
- "LAO",
- "LBN",
- "LCA",
- "LIE",
- "LKA",
- "LBR",
- "LSO",
- "LTU",
- "LUX",
- "LVA",
- "LBY",
- "MAR",
- "MCO",
- "MDA",
- "MDG",
- "MHL",
- "MKD",
- "MLI",
- "MMR",
- "MNG",
- "MAC",
- "MNP",
- "MTQ",
- "MRT",
- "MSR",
- "MLT",
- "MUS",
- "MDV",
- "MWI",
- "MEX",
- "MYS",
- "MOZ",
- "NAM",
- "NCL",
- "NER",
- "NFK",
- "NGA",
- "NIC",
- "NLD",
- "NOR",
- "NPL",
- "NRU",
- "NIU",
- "NZL",
- "OMN",
- "PAN",
- "PER",
- "PYF",
- "PNG",
- "PHL",
- "PAK",
- "POL",
- "SPM",
- "PCN",
- "PRI",
- "PSE",
- "PRT",
- "PLW",
- "PRY",
- "QAT",
- "REU",
- "ROU",
- "RUS",
- "RWA",
- "SAU",
- "SLB",
- "SYC",
- "SDN",
- "SWE",
- "SGP",
- "SHN",
- "SVN",
- "SJM",
- "SVK",
- "SLE",
- "SMR",
- "SEN",
- "SOM",
- "SUR",
- "STP",
- "SLV",
- "SYR",
- "SWZ",
- "TCA",
- "TCD",
- "ATF",
- "TGO",
- "THA",
- "TJK",
- "TKL",
- "TKM",
- "TUN",
- "TON",
- "TLS",
- "TUR",
- "TTO",
- "TUV",
- "TWN",
- "TZA",
- "UKR",
- "UGA",
- "UMI",
- "USA",
- "URY",
- "UZB",
- "VAT",
- "VCT",
- "VEN",
- "VGB",
- "VIR",
- "VNM",
- "VUT",
- "WLF",
- "WSM",
- "YEM",
- "MYT",
- "SRB",
- "ZAF",
- "ZMB",
- "MNE",
- "ZWE",
- "A1",
- "A2",
- "O1",
- "ALA",
- "GGY",
- "IMN",
- "JEY",
- "BLM",
- "MAF",
- "BES",
- "SSD",
- "O1"
- );
-
- public $GEOIP_COUNTRY_NAMES = array(
- "",
- "Asia/Pacific Region",
- "Europe",
- "Andorra",
- "United Arab Emirates",
- "Afghanistan",
- "Antigua and Barbuda",
- "Anguilla",
- "Albania",
- "Armenia",
- "Curacao",
- "Angola",
- "Antarctica",
- "Argentina",
- "American Samoa",
- "Austria",
- "Australia",
- "Aruba",
- "Azerbaijan",
- "Bosnia and Herzegovina",
- "Barbados",
- "Bangladesh",
- "Belgium",
- "Burkina Faso",
- "Bulgaria",
- "Bahrain",
- "Burundi",
- "Benin",
- "Bermuda",
- "Brunei Darussalam",
- "Bolivia",
- "Brazil",
- "Bahamas",
- "Bhutan",
- "Bouvet Island",
- "Botswana",
- "Belarus",
- "Belize",
- "Canada",
- "Cocos (Keeling) Islands",
- "Congo, The Democratic Republic of the",
- "Central African Republic",
- "Congo",
- "Switzerland",
- "Cote D'Ivoire",
- "Cook Islands",
- "Chile",
- "Cameroon",
- "China",
- "Colombia",
- "Costa Rica",
- "Cuba",
- "Cape Verde",
- "Christmas Island",
- "Cyprus",
- "Czech Republic",
- "Germany",
- "Djibouti",
- "Denmark",
- "Dominica",
- "Dominican Republic",
- "Algeria",
- "Ecuador",
- "Estonia",
- "Egypt",
- "Western Sahara",
- "Eritrea",
- "Spain",
- "Ethiopia",
- "Finland",
- "Fiji",
- "Falkland Islands (Malvinas)",
- "Micronesia, Federated States of",
- "Faroe Islands",
- "France",
- "Sint Maarten (Dutch part)",
- "Gabon",
- "United Kingdom",
- "Grenada",
- "Georgia",
- "French Guiana",
- "Ghana",
- "Gibraltar",
- "Greenland",
- "Gambia",
- "Guinea",
- "Guadeloupe",
- "Equatorial Guinea",
- "Greece",
- "South Georgia and the South Sandwich Islands",
- "Guatemala",
- "Guam",
- "Guinea-Bissau",
- "Guyana",
- "Hong Kong",
- "Heard Island and McDonald Islands",
- "Honduras",
- "Croatia",
- "Haiti",
- "Hungary",
- "Indonesia",
- "Ireland",
- "Israel",
- "India",
- "British Indian Ocean Territory",
- "Iraq",
- "Iran, Islamic Republic of",
- "Iceland",
- "Italy",
- "Jamaica",
- "Jordan",
- "Japan",
- "Kenya",
- "Kyrgyzstan",
- "Cambodia",
- "Kiribati",
- "Comoros",
- "Saint Kitts and Nevis",
- "Korea, Democratic People's Republic of",
- "Korea, Republic of",
- "Kuwait",
- "Cayman Islands",
- "Kazakhstan",
- "Lao People's Democratic Republic",
- "Lebanon",
- "Saint Lucia",
- "Liechtenstein",
- "Sri Lanka",
- "Liberia",
- "Lesotho",
- "Lithuania",
- "Luxembourg",
- "Latvia",
- "Libya",
- "Morocco",
- "Monaco",
- "Moldova, Republic of",
- "Madagascar",
- "Marshall Islands",
- "Macedonia",
- "Mali",
- "Myanmar",
- "Mongolia",
- "Macau",
- "Northern Mariana Islands",
- "Martinique",
- "Mauritania",
- "Montserrat",
- "Malta",
- "Mauritius",
- "Maldives",
- "Malawi",
- "Mexico",
- "Malaysia",
- "Mozambique",
- "Namibia",
- "New Caledonia",
- "Niger",
- "Norfolk Island",
- "Nigeria",
- "Nicaragua",
- "Netherlands",
- "Norway",
- "Nepal",
- "Nauru",
- "Niue",
- "New Zealand",
- "Oman",
- "Panama",
- "Peru",
- "French Polynesia",
- "Papua New Guinea",
- "Philippines",
- "Pakistan",
- "Poland",
- "Saint Pierre and Miquelon",
- "Pitcairn Islands",
- "Puerto Rico",
- "Palestinian Territory",
- "Portugal",
- "Palau",
- "Paraguay",
- "Qatar",
- "Reunion",
- "Romania",
- "Russian Federation",
- "Rwanda",
- "Saudi Arabia",
- "Solomon Islands",
- "Seychelles",
- "Sudan",
- "Sweden",
- "Singapore",
- "Saint Helena",
- "Slovenia",
- "Svalbard and Jan Mayen",
- "Slovakia",
- "Sierra Leone",
- "San Marino",
- "Senegal",
- "Somalia",
- "Suriname",
- "Sao Tome and Principe",
- "El Salvador",
- "Syrian Arab Republic",
- "Swaziland",
- "Turks and Caicos Islands",
- "Chad",
- "French Southern Territories",
- "Togo",
- "Thailand",
- "Tajikistan",
- "Tokelau",
- "Turkmenistan",
- "Tunisia",
- "Tonga",
- "Timor-Leste",
- "Turkey",
- "Trinidad and Tobago",
- "Tuvalu",
- "Taiwan",
- "Tanzania, United Republic of",
- "Ukraine",
- "Uganda",
- "United States Minor Outlying Islands",
- "United States",
- "Uruguay",
- "Uzbekistan",
- "Holy See (Vatican City State)",
- "Saint Vincent and the Grenadines",
- "Venezuela",
- "Virgin Islands, British",
- "Virgin Islands, U.S.",
- "Vietnam",
- "Vanuatu",
- "Wallis and Futuna",
- "Samoa",
- "Yemen",
- "Mayotte",
- "Serbia",
- "South Africa",
- "Zambia",
- "Montenegro",
- "Zimbabwe",
- "Anonymous Proxy",
- "Satellite Provider",
- "Other",
- "Aland Islands",
- "Guernsey",
- "Isle of Man",
- "Jersey",
- "Saint Barthelemy",
- "Saint Martin",
- "Bonaire, Saint Eustatius and Saba",
- "South Sudan",
- "Other"
- );
-
- public $GEOIP_CONTINENT_CODES = array(
- "--",
- "AS",
- "EU",
- "EU",
- "AS",
- "AS",
- "NA",
- "NA",
- "EU",
- "AS",
- "NA",
- "AF",
- "AN",
- "SA",
- "OC",
- "EU",
- "OC",
- "NA",
- "AS",
- "EU",
- "NA",
- "AS",
- "EU",
- "AF",
- "EU",
- "AS",
- "AF",
- "AF",
- "NA",
- "AS",
- "SA",
- "SA",
- "NA",
- "AS",
- "AN",
- "AF",
- "EU",
- "NA",
- "NA",
- "AS",
- "AF",
- "AF",
- "AF",
- "EU",
- "AF",
- "OC",
- "SA",
- "AF",
- "AS",
- "SA",
- "NA",
- "NA",
- "AF",
- "AS",
- "AS",
- "EU",
- "EU",
- "AF",
- "EU",
- "NA",
- "NA",
- "AF",
- "SA",
- "EU",
- "AF",
- "AF",
- "AF",
- "EU",
- "AF",
- "EU",
- "OC",
- "SA",
- "OC",
- "EU",
- "EU",
- "NA",
- "AF",
- "EU",
- "NA",
- "AS",
- "SA",
- "AF",
- "EU",
- "NA",
- "AF",
- "AF",
- "NA",
- "AF",
- "EU",
- "AN",
- "NA",
- "OC",
- "AF",
- "SA",
- "AS",
- "AN",
- "NA",
- "EU",
- "NA",
- "EU",
- "AS",
- "EU",
- "AS",
- "AS",
- "AS",
- "AS",
- "AS",
- "EU",
- "EU",
- "NA",
- "AS",
- "AS",
- "AF",
- "AS",
- "AS",
- "OC",
- "AF",
- "NA",
- "AS",
- "AS",
- "AS",
- "NA",
- "AS",
- "AS",
- "AS",
- "NA",
- "EU",
- "AS",
- "AF",
- "AF",
- "EU",
- "EU",
- "EU",
- "AF",
- "AF",
- "EU",
- "EU",
- "AF",
- "OC",
- "EU",
- "AF",
- "AS",
- "AS",
- "AS",
- "OC",
- "NA",
- "AF",
- "NA",
- "EU",
- "AF",
- "AS",
- "AF",
- "NA",
- "AS",
- "AF",
- "AF",
- "OC",
- "AF",
- "OC",
- "AF",
- "NA",
- "EU",
- "EU",
- "AS",
- "OC",
- "OC",
- "OC",
- "AS",
- "NA",
- "SA",
- "OC",
- "OC",
- "AS",
- "AS",
- "EU",
- "NA",
- "OC",
- "NA",
- "AS",
- "EU",
- "OC",
- "SA",
- "AS",
- "AF",
- "EU",
- "EU",
- "AF",
- "AS",
- "OC",
- "AF",
- "AF",
- "EU",
- "AS",
- "AF",
- "EU",
- "EU",
- "EU",
- "AF",
- "EU",
- "AF",
- "AF",
- "SA",
- "AF",
- "NA",
- "AS",
- "AF",
- "NA",
- "AF",
- "AN",
- "AF",
- "AS",
- "AS",
- "OC",
- "AS",
- "AF",
- "OC",
- "AS",
- "EU",
- "NA",
- "OC",
- "AS",
- "AF",
- "EU",
- "AF",
- "OC",
- "NA",
- "SA",
- "AS",
- "EU",
- "NA",
- "SA",
- "NA",
- "NA",
- "AS",
- "OC",
- "OC",
- "OC",
- "AS",
- "AF",
- "EU",
- "AF",
- "AF",
- "EU",
- "AF",
- "--",
- "--",
- "--",
- "EU",
- "EU",
- "EU",
- "EU",
- "NA",
- "NA",
- "NA",
- "AF",
- "--"
- );
+define("GEOIP_CITY_EDITION_REV0_V6",31);
+define("GEOIP_NETSPEED_EDITION_REV1",32);
+define("GEOIP_NETSPEED_EDITION_REV1_V6",33);
+define("GEOIP_USERTYPE_EDITION",28);
+define("GEOIP_USERTYPE_EDITION_V6",29);
+define("GEOIP_ASNUM_EDITION_V6",21);
+define("GEOIP_ISP_EDITION_V6",22);
+define("GEOIP_ORG_EDITION_V6",23);
+define("GEOIP_DOMAIN_EDITION_V6",24);
+
+define("CITYCOMBINED_FIXED_RECORD", 7 );
+
+class GeoIP {
+ var $flags;
+ var $filehandle;
+ var $memory_buffer;
+ var $databaseType;
+ var $databaseSegments;
+ var $record_length;
+ var $shmid;
+ var $GEOIP_COUNTRY_CODE_TO_NUMBER = array(
+"" => 0, "AP" => 1, "EU" => 2, "AD" => 3, "AE" => 4, "AF" => 5,
+"AG" => 6, "AI" => 7, "AL" => 8, "AM" => 9, "CW" => 10, "AO" => 11,
+"AQ" => 12, "AR" => 13, "AS" => 14, "AT" => 15, "AU" => 16, "AW" => 17,
+"AZ" => 18, "BA" => 19, "BB" => 20, "BD" => 21, "BE" => 22, "BF" => 23,
+"BG" => 24, "BH" => 25, "BI" => 26, "BJ" => 27, "BM" => 28, "BN" => 29,
+"BO" => 30, "BR" => 31, "BS" => 32, "BT" => 33, "BV" => 34, "BW" => 35,
+"BY" => 36, "BZ" => 37, "CA" => 38, "CC" => 39, "CD" => 40, "CF" => 41,
+"CG" => 42, "CH" => 43, "CI" => 44, "CK" => 45, "CL" => 46, "CM" => 47,
+"CN" => 48, "CO" => 49, "CR" => 50, "CU" => 51, "CV" => 52, "CX" => 53,
+"CY" => 54, "CZ" => 55, "DE" => 56, "DJ" => 57, "DK" => 58, "DM" => 59,
+"DO" => 60, "DZ" => 61, "EC" => 62, "EE" => 63, "EG" => 64, "EH" => 65,
+"ER" => 66, "ES" => 67, "ET" => 68, "FI" => 69, "FJ" => 70, "FK" => 71,
+"FM" => 72, "FO" => 73, "FR" => 74, "SX" => 75, "GA" => 76, "GB" => 77,
+"GD" => 78, "GE" => 79, "GF" => 80, "GH" => 81, "GI" => 82, "GL" => 83,
+"GM" => 84, "GN" => 85, "GP" => 86, "GQ" => 87, "GR" => 88, "GS" => 89,
+"GT" => 90, "GU" => 91, "GW" => 92, "GY" => 93, "HK" => 94, "HM" => 95,
+"HN" => 96, "HR" => 97, "HT" => 98, "HU" => 99, "ID" => 100, "IE" => 101,
+"IL" => 102, "IN" => 103, "IO" => 104, "IQ" => 105, "IR" => 106, "IS" => 107,
+"IT" => 108, "JM" => 109, "JO" => 110, "JP" => 111, "KE" => 112, "KG" => 113,
+"KH" => 114, "KI" => 115, "KM" => 116, "KN" => 117, "KP" => 118, "KR" => 119,
+"KW" => 120, "KY" => 121, "KZ" => 122, "LA" => 123, "LB" => 124, "LC" => 125,
+"LI" => 126, "LK" => 127, "LR" => 128, "LS" => 129, "LT" => 130, "LU" => 131,
+"LV" => 132, "LY" => 133, "MA" => 134, "MC" => 135, "MD" => 136, "MG" => 137,
+"MH" => 138, "MK" => 139, "ML" => 140, "MM" => 141, "MN" => 142, "MO" => 143,
+"MP" => 144, "MQ" => 145, "MR" => 146, "MS" => 147, "MT" => 148, "MU" => 149,
+"MV" => 150, "MW" => 151, "MX" => 152, "MY" => 153, "MZ" => 154, "NA" => 155,
+"NC" => 156, "NE" => 157, "NF" => 158, "NG" => 159, "NI" => 160, "NL" => 161,
+"NO" => 162, "NP" => 163, "NR" => 164, "NU" => 165, "NZ" => 166, "OM" => 167,
+"PA" => 168, "PE" => 169, "PF" => 170, "PG" => 171, "PH" => 172, "PK" => 173,
+"PL" => 174, "PM" => 175, "PN" => 176, "PR" => 177, "PS" => 178, "PT" => 179,
+"PW" => 180, "PY" => 181, "QA" => 182, "RE" => 183, "RO" => 184, "RU" => 185,
+"RW" => 186, "SA" => 187, "SB" => 188, "SC" => 189, "SD" => 190, "SE" => 191,
+"SG" => 192, "SH" => 193, "SI" => 194, "SJ" => 195, "SK" => 196, "SL" => 197,
+"SM" => 198, "SN" => 199, "SO" => 200, "SR" => 201, "ST" => 202, "SV" => 203,
+"SY" => 204, "SZ" => 205, "TC" => 206, "TD" => 207, "TF" => 208, "TG" => 209,
+"TH" => 210, "TJ" => 211, "TK" => 212, "TM" => 213, "TN" => 214, "TO" => 215,
+"TL" => 216, "TR" => 217, "TT" => 218, "TV" => 219, "TW" => 220, "TZ" => 221,
+"UA" => 222, "UG" => 223, "UM" => 224, "US" => 225, "UY" => 226, "UZ" => 227,
+"VA" => 228, "VC" => 229, "VE" => 230, "VG" => 231, "VI" => 232, "VN" => 233,
+"VU" => 234, "WF" => 235, "WS" => 236, "YE" => 237, "YT" => 238, "RS" => 239,
+"ZA" => 240, "ZM" => 241, "ME" => 242, "ZW" => 243, "A1" => 244, "A2" => 245,
+"O1" => 246, "AX" => 247, "GG" => 248, "IM" => 249, "JE" => 250, "BL" => 251,
+"MF" => 252, "BQ" => 253,
+);
+ var $GEOIP_COUNTRY_CODES = array(
+ "","AP","EU","AD","AE","AF","AG","AI","AL","AM","CW",
+ "AO","AQ","AR","AS","AT","AU","AW","AZ","BA","BB",
+ "BD","BE","BF","BG","BH","BI","BJ","BM","BN","BO",
+ "BR","BS","BT","BV","BW","BY","BZ","CA","CC","CD",
+ "CF","CG","CH","CI","CK","CL","CM","CN","CO","CR",
+ "CU","CV","CX","CY","CZ","DE","DJ","DK","DM","DO",
+ "DZ","EC","EE","EG","EH","ER","ES","ET","FI","FJ",
+ "FK","FM","FO","FR","SX","GA","GB","GD","GE","GF",
+ "GH","GI","GL","GM","GN","GP","GQ","GR","GS","GT",
+ "GU","GW","GY","HK","HM","HN","HR","HT","HU","ID",
+ "IE","IL","IN","IO","IQ","IR","IS","IT","JM","JO",
+ "JP","KE","KG","KH","KI","KM","KN","KP","KR","KW",
+ "KY","KZ","LA","LB","LC","LI","LK","LR","LS","LT",
+ "LU","LV","LY","MA","MC","MD","MG","MH","MK","ML",
+ "MM","MN","MO","MP","MQ","MR","MS","MT","MU","MV",
+ "MW","MX","MY","MZ","NA","NC","NE","NF","NG","NI",
+ "NL","NO","NP","NR","NU","NZ","OM","PA","PE","PF",
+ "PG","PH","PK","PL","PM","PN","PR","PS","PT","PW",
+ "PY","QA","RE","RO","RU","RW","SA","SB","SC","SD",
+ "SE","SG","SH","SI","SJ","SK","SL","SM","SN","SO",
+ "SR","ST","SV","SY","SZ","TC","TD","TF","TG","TH",
+ "TJ","TK","TM","TN","TO","TL","TR","TT","TV","TW",
+ "TZ","UA","UG","UM","US","UY","UZ","VA","VC","VE",
+ "VG","VI","VN","VU","WF","WS","YE","YT","RS","ZA",
+ "ZM","ME","ZW","A1","A2","O1","AX","GG","IM","JE",
+ "BL","MF", "BQ");
+ var $GEOIP_COUNTRY_CODES3 = array(
+ "","AP","EU","AND","ARE","AFG","ATG","AIA","ALB","ARM","CUW",
+ "AGO","ATA","ARG","ASM","AUT","AUS","ABW","AZE","BIH","BRB",
+ "BGD","BEL","BFA","BGR","BHR","BDI","BEN","BMU","BRN","BOL",
+ "BRA","BHS","BTN","BVT","BWA","BLR","BLZ","CAN","CCK","COD",
+ "CAF","COG","CHE","CIV","COK","CHL","CMR","CHN","COL","CRI",
+ "CUB","CPV","CXR","CYP","CZE","DEU","DJI","DNK","DMA","DOM",
+ "DZA","ECU","EST","EGY","ESH","ERI","ESP","ETH","FIN","FJI",
+ "FLK","FSM","FRO","FRA","SXM","GAB","GBR","GRD","GEO","GUF",
+ "GHA","GIB","GRL","GMB","GIN","GLP","GNQ","GRC","SGS","GTM",
+ "GUM","GNB","GUY","HKG","HMD","HND","HRV","HTI","HUN","IDN",
+ "IRL","ISR","IND","IOT","IRQ","IRN","ISL","ITA","JAM","JOR",
+ "JPN","KEN","KGZ","KHM","KIR","COM","KNA","PRK","KOR","KWT",
+ "CYM","KAZ","LAO","LBN","LCA","LIE","LKA","LBR","LSO","LTU",
+ "LUX","LVA","LBY","MAR","MCO","MDA","MDG","MHL","MKD","MLI",
+ "MMR","MNG","MAC","MNP","MTQ","MRT","MSR","MLT","MUS","MDV",
+ "MWI","MEX","MYS","MOZ","NAM","NCL","NER","NFK","NGA","NIC",
+ "NLD","NOR","NPL","NRU","NIU","NZL","OMN","PAN","PER","PYF",
+ "PNG","PHL","PAK","POL","SPM","PCN","PRI","PSE","PRT","PLW",
+ "PRY","QAT","REU","ROU","RUS","RWA","SAU","SLB","SYC","SDN",
+ "SWE","SGP","SHN","SVN","SJM","SVK","SLE","SMR","SEN","SOM",
+ "SUR","STP","SLV","SYR","SWZ","TCA","TCD","ATF","TGO","THA",
+ "TJK","TKL","TKM","TUN","TON","TLS","TUR","TTO","TUV","TWN",
+ "TZA","UKR","UGA","UMI","USA","URY","UZB","VAT","VCT","VEN",
+ "VGB","VIR","VNM","VUT","WLF","WSM","YEM","MYT","SRB","ZAF",
+ "ZMB","MNE","ZWE","A1","A2","O1","ALA","GGY","IMN","JEY",
+ "BLM","MAF", "BES"
+ );
+ var $GEOIP_COUNTRY_NAMES = array(
+ "","Asia/Pacific Region","Europe","Andorra","United Arab Emirates","Afghanistan","Antigua and Barbuda","Anguilla","Albania","Armenia","Curacao",
+ "Angola","Antarctica","Argentina","American Samoa","Austria","Australia","Aruba","Azerbaijan","Bosnia and Herzegovina","Barbados",
+ "Bangladesh","Belgium","Burkina Faso","Bulgaria","Bahrain","Burundi","Benin","Bermuda","Brunei Darussalam","Bolivia",
+ "Brazil","Bahamas","Bhutan","Bouvet Island","Botswana","Belarus","Belize","Canada","Cocos (Keeling) Islands","Congo, The Democratic Republic of the",
+ "Central African Republic","Congo","Switzerland","Cote D'Ivoire","Cook Islands","Chile","Cameroon","China","Colombia","Costa Rica",
+ "Cuba","Cape Verde","Christmas Island","Cyprus","Czech Republic","Germany","Djibouti","Denmark","Dominica","Dominican Republic",
+ "Algeria","Ecuador","Estonia","Egypt","Western Sahara","Eritrea","Spain","Ethiopia","Finland","Fiji",
+ "Falkland Islands (Malvinas)","Micronesia, Federated States of","Faroe Islands","France","Sint Maarten (Dutch part)","Gabon","United Kingdom","Grenada","Georgia","French Guiana",
+ "Ghana","Gibraltar","Greenland","Gambia","Guinea","Guadeloupe","Equatorial Guinea","Greece","South Georgia and the South Sandwich Islands","Guatemala",
+ "Guam","Guinea-Bissau","Guyana","Hong Kong","Heard Island and McDonald Islands","Honduras","Croatia","Haiti","Hungary","Indonesia",
+ "Ireland","Israel","India","British Indian Ocean Territory","Iraq","Iran, Islamic Republic of","Iceland","Italy","Jamaica","Jordan",
+ "Japan","Kenya","Kyrgyzstan","Cambodia","Kiribati","Comoros","Saint Kitts and Nevis","Korea, Democratic People's Republic of","Korea, Republic of","Kuwait",
+ "Cayman Islands","Kazakhstan","Lao People's Democratic Republic","Lebanon","Saint Lucia","Liechtenstein","Sri Lanka","Liberia","Lesotho","Lithuania",
+ "Luxembourg","Latvia","Libya","Morocco","Monaco","Moldova, Republic of","Madagascar","Marshall Islands","Macedonia","Mali",
+ "Myanmar","Mongolia","Macau","Northern Mariana Islands","Martinique","Mauritania","Montserrat","Malta","Mauritius","Maldives",
+ "Malawi","Mexico","Malaysia","Mozambique","Namibia","New Caledonia","Niger","Norfolk Island","Nigeria","Nicaragua",
+ "Netherlands","Norway","Nepal","Nauru","Niue","New Zealand","Oman","Panama","Peru","French Polynesia",
+ "Papua New Guinea","Philippines","Pakistan","Poland","Saint Pierre and Miquelon","Pitcairn Islands","Puerto Rico","Palestinian Territory","Portugal","Palau",
+ "Paraguay","Qatar","Reunion","Romania","Russian Federation","Rwanda","Saudi Arabia","Solomon Islands","Seychelles","Sudan",
+ "Sweden","Singapore","Saint Helena","Slovenia","Svalbard and Jan Mayen","Slovakia","Sierra Leone","San Marino","Senegal","Somalia","Suriname",
+ "Sao Tome and Principe","El Salvador","Syrian Arab Republic","Swaziland","Turks and Caicos Islands","Chad","French Southern Territories","Togo","Thailand",
+ "Tajikistan","Tokelau","Turkmenistan","Tunisia","Tonga","Timor-Leste","Turkey","Trinidad and Tobago","Tuvalu","Taiwan",
+ "Tanzania, United Republic of","Ukraine","Uganda","United States Minor Outlying Islands","United States","Uruguay","Uzbekistan","Holy See (Vatican City State)","Saint Vincent and the Grenadines","Venezuela",
+ "Virgin Islands, British","Virgin Islands, U.S.","Vietnam","Vanuatu","Wallis and Futuna","Samoa","Yemen","Mayotte","Serbia","South Africa",
+ "Zambia","Montenegro","Zimbabwe","Anonymous Proxy","Satellite Provider","Other","Aland Islands","Guernsey","Isle of Man","Jersey",
+ "Saint Barthelemy","Saint Martin", "Bonaire, Saint Eustatius and Saba"
+);
+
+ var $GEOIP_CONTINENT_CODES = array(
+ "--", "AS","EU","EU","AS","AS","NA","NA","EU","AS","NA",
+ "AF","AN","SA","OC","EU","OC","NA","AS","EU","NA",
+ "AS","EU","AF","EU","AS","AF","AF","NA","AS","SA",
+ "SA","NA","AS","AN","AF","EU","NA","NA","AS","AF",
+ "AF","AF","EU","AF","OC","SA","AF","AS","SA","NA",
+ "NA","AF","AS","AS","EU","EU","AF","EU","NA","NA",
+ "AF","SA","EU","AF","AF","AF","EU","AF","EU","OC",
+ "SA","OC","EU","EU","NA","AF","EU","NA","AS","SA",
+ "AF","EU","NA","AF","AF","NA","AF","EU","AN","NA",
+ "OC","AF","SA","AS","AN","NA","EU","NA","EU","AS",
+ "EU","AS","AS","AS","AS","AS","EU","EU","NA","AS",
+ "AS","AF","AS","AS","OC","AF","NA","AS","AS","AS",
+ "NA","AS","AS","AS","NA","EU","AS","AF","AF","EU",
+ "EU","EU","AF","AF","EU","EU","AF","OC","EU","AF",
+ "AS","AS","AS","OC","NA","AF","NA","EU","AF","AS",
+ "AF","NA","AS","AF","AF","OC","AF","OC","AF","NA",
+ "EU","EU","AS","OC","OC","OC","AS","NA","SA","OC",
+ "OC","AS","AS","EU","NA","OC","NA","AS","EU","OC",
+ "SA","AS","AF","EU","EU","AF","AS","OC","AF","AF",
+ "EU","AS","AF","EU","EU","EU","AF","EU","AF","AF",
+ "SA","AF","NA","AS","AF","NA","AF","AN","AF","AS",
+ "AS","OC","AS","AF","OC","AS","EU","NA","OC","AS",
+ "AF","EU","AF","OC","NA","SA","AS","EU","NA","SA",
+ "NA","NA","AS","OC","OC","OC","AS","AF","EU","AF",
+ "AF","EU","AF","--","--","--","EU","EU","EU","EU",
+ "NA","NA","NA"
+);
+
}
-
-function geoip_load_shared_mem($file)
-{
- $fp = fopen($file, "rb");
- if (!$fp) {
- print "error opening $file: $php_errormsg\n";
- exit;
- }
- $s_array = fstat($fp);
- $size = $s_array['size'];
- if (($shmid = @shmop_open(GEOIP_SHM_KEY, "w", 0, 0))) {
- shmop_delete($shmid);
- shmop_close($shmid);
- }
- $shmid = shmop_open(GEOIP_SHM_KEY, "c", 0644, $size);
- shmop_write($shmid, fread($fp, $size), 0);
- shmop_close($shmid);
+function geoip_load_shared_mem ($file) {
+
+ $fp = fopen($file, "rb");
+ if (!$fp) {
+ print "error opening $file: $php_errormsg\n";
+ exit;
+ }
+ $s_array = fstat($fp);
+ $size = $s_array['size'];
+ if ($shmid = @shmop_open (GEOIP_SHM_KEY, "w", 0, 0)) {
+ shmop_delete ($shmid);
+ shmop_close ($shmid);
+ }
+ $shmid = shmop_open (GEOIP_SHM_KEY, "c", 0644, $size);
+ shmop_write ($shmid, fread($fp, $size), 0);
+ shmop_close ($shmid);
}
-function _setup_segments($gi)
-{
- $gi->databaseType = GEOIP_COUNTRY_EDITION;
- $gi->record_length = STANDARD_RECORD_LENGTH;
- if ($gi->flags & GEOIP_SHARED_MEMORY) {
- $offset = @shmop_size($gi->shmid) - 3;
- for ($i = 0; $i < STRUCTURE_INFO_MAX_SIZE; $i++) {
- $delim = @shmop_read($gi->shmid, $offset, 3);
- $offset += 3;
- if ($delim == (chr(255) . chr(255) . chr(255))) {
- $gi->databaseType = ord(@shmop_read($gi->shmid, $offset, 1));
- if ($gi->databaseType >= 106) {
- $gi->databaseType -= 105;
- }
- $offset++;
-
- if ($gi->databaseType == GEOIP_REGION_EDITION_REV0) {
- $gi->databaseSegments = GEOIP_STATE_BEGIN_REV0;
- } elseif ($gi->databaseType == GEOIP_REGION_EDITION_REV1) {
- $gi->databaseSegments = GEOIP_STATE_BEGIN_REV1;
- } elseif (($gi->databaseType == GEOIP_CITY_EDITION_REV0)
- || ($gi->databaseType == GEOIP_CITY_EDITION_REV1)
+function _setup_segments($gi){
+ $gi->databaseType = GEOIP_COUNTRY_EDITION;
+ $gi->record_length = STANDARD_RECORD_LENGTH;
+ if ($gi->flags & GEOIP_SHARED_MEMORY) {
+ $offset = @shmop_size ($gi->shmid) - 3;
+ for ($i = 0; $i < STRUCTURE_INFO_MAX_SIZE; $i++) {
+ $delim = @shmop_read ($gi->shmid, $offset, 3);
+ $offset += 3;
+ if ($delim == (chr(255).chr(255).chr(255))) {
+ $gi->databaseType = ord(@shmop_read ($gi->shmid, $offset, 1));
+ $offset++;
+
+ if ($gi->databaseType == GEOIP_REGION_EDITION_REV0){
+ $gi->databaseSegments = GEOIP_STATE_BEGIN_REV0;
+ } else if ($gi->databaseType == GEOIP_REGION_EDITION_REV1){
+ $gi->databaseSegments = GEOIP_STATE_BEGIN_REV1;
+ } else if (($gi->databaseType == GEOIP_CITY_EDITION_REV0)||
+ ($gi->databaseType == GEOIP_CITY_EDITION_REV1)
|| ($gi->databaseType == GEOIP_ORG_EDITION)
|| ($gi->databaseType == GEOIP_ORG_EDITION_V6)
|| ($gi->databaseType == GEOIP_DOMAIN_EDITION)
|| ($gi->databaseType == GEOIP_DOMAIN_EDITION_V6)
- || ($gi->databaseType == GEOIP_ISP_EDITION)
- || ($gi->databaseType == GEOIP_ISP_EDITION_V6)
- || ($gi->databaseType == GEOIP_USERTYPE_EDITION)
- || ($gi->databaseType == GEOIP_USERTYPE_EDITION_V6)
- || ($gi->databaseType == GEOIP_LOCATIONA_EDITION)
- || ($gi->databaseType == GEOIP_ACCURACYRADIUS_EDITION)
- || ($gi->databaseType == GEOIP_CITY_EDITION_REV0_V6)
- || ($gi->databaseType == GEOIP_CITY_EDITION_REV1_V6)
- || ($gi->databaseType == GEOIP_NETSPEED_EDITION_REV1)
- || ($gi->databaseType == GEOIP_NETSPEED_EDITION_REV1_V6)
- || ($gi->databaseType == GEOIP_ASNUM_EDITION)
- || ($gi->databaseType == GEOIP_ASNUM_EDITION_V6)
- ) {
- $gi->databaseSegments = 0;
- $buf = @shmop_read($gi->shmid, $offset, SEGMENT_RECORD_LENGTH);
- for ($j = 0; $j < SEGMENT_RECORD_LENGTH; $j++) {
- $gi->databaseSegments += (ord($buf[$j]) << ($j * 8));
- }
- if (($gi->databaseType == GEOIP_ORG_EDITION)
- || ($gi->databaseType == GEOIP_ORG_EDITION_V6)
+ || ($gi->databaseType == GEOIP_ISP_EDITION)
+ || ($gi->databaseType == GEOIP_ISP_EDITION_V6)
+ || ($gi->databaseType == GEOIP_USERTYPE_EDITION)
+ || ($gi->databaseType == GEOIP_USERTYPE_EDITION_V6)
+ || ($gi->databaseType == GEOIP_LOCATIONA_EDITION)
+ || ($gi->databaseType == GEOIP_ACCURACYRADIUS_EDITION)
+ || ($gi->databaseType == GEOIP_CITY_EDITION_REV0_V6)
+ || ($gi->databaseType == GEOIP_CITY_EDITION_REV1_V6)
+ || ($gi->databaseType == GEOIP_NETSPEED_EDITION_REV1)
+ || ($gi->databaseType == GEOIP_NETSPEED_EDITION_REV1_V6)
+ || ($gi->databaseType == GEOIP_ASNUM_EDITION)
+ || ($gi->databaseType == GEOIP_ASNUM_EDITION_V6)){
+ $gi->databaseSegments = 0;
+ $buf = @shmop_read ($gi->shmid, $offset, SEGMENT_RECORD_LENGTH);
+ for ($j = 0;$j < SEGMENT_RECORD_LENGTH;$j++){
+ $gi->databaseSegments += (ord($buf[$j]) << ($j * 8));
+ }
+ if (($gi->databaseType == GEOIP_ORG_EDITION)
+ || ($gi->databaseType == GEOIP_ORG_EDITION_V6)
|| ($gi->databaseType == GEOIP_DOMAIN_EDITION)
|| ($gi->databaseType == GEOIP_DOMAIN_EDITION_V6)
- || ($gi->databaseType == GEOIP_ISP_EDITION)
- || ($gi->databaseType == GEOIP_ISP_EDITION_V6)
- ) {
- $gi->record_length = ORG_RECORD_LENGTH;
- }
+ || ($gi->databaseType == GEOIP_ISP_EDITION)
+ || ($gi->databaseType == GEOIP_ISP_EDITION_V6)) {
+ $gi->record_length = ORG_RECORD_LENGTH;
}
- break;
- } else {
- $offset -= 4;
}
+ break;
+ } else {
+ $offset -= 4;
}
- if (($gi->databaseType == GEOIP_COUNTRY_EDITION) ||
- ($gi->databaseType == GEOIP_COUNTRY_EDITION_V6) ||
- ($gi->databaseType == GEOIP_PROXY_EDITION) ||
- ($gi->databaseType == GEOIP_NETSPEED_EDITION)
- ) {
- $gi->databaseSegments = GEOIP_COUNTRY_BEGIN;
+ }
+ if (($gi->databaseType == GEOIP_COUNTRY_EDITION)||
+ ($gi->databaseType == GEOIP_COUNTRY_EDITION_V6)||
+ ($gi->databaseType == GEOIP_PROXY_EDITION)||
+ ($gi->databaseType == GEOIP_NETSPEED_EDITION)){
+ $gi->databaseSegments = GEOIP_COUNTRY_BEGIN;
+ }
+ } else {
+ $filepos = ftell($gi->filehandle);
+ fseek($gi->filehandle, -3, SEEK_END);
+ for ($i = 0; $i < STRUCTURE_INFO_MAX_SIZE; $i++) {
+ $delim = fread($gi->filehandle,3);
+ if ($delim == (chr(255).chr(255).chr(255))){
+ $gi->databaseType = ord(fread($gi->filehandle,1));
+ if ($gi->databaseType == GEOIP_REGION_EDITION_REV0){
+ $gi->databaseSegments = GEOIP_STATE_BEGIN_REV0;
}
- } else {
- $filepos = ftell($gi->filehandle);
- fseek($gi->filehandle, -3, SEEK_END);
- for ($i = 0; $i < STRUCTURE_INFO_MAX_SIZE; $i++) {
- $delim = fread($gi->filehandle, 3);
- if ($delim == (chr(255) . chr(255) . chr(255))) {
- $gi->databaseType = ord(fread($gi->filehandle, 1));
- if ($gi->databaseType >= 106) {
- $gi->databaseType -= 105;
- }
- if ($gi->databaseType == GEOIP_REGION_EDITION_REV0) {
- $gi->databaseSegments = GEOIP_STATE_BEGIN_REV0;
- } elseif ($gi->databaseType == GEOIP_REGION_EDITION_REV1) {
- $gi->databaseSegments = GEOIP_STATE_BEGIN_REV1;
- } elseif (($gi->databaseType == GEOIP_CITY_EDITION_REV0)
+ else if ($gi->databaseType == GEOIP_REGION_EDITION_REV1){
+ $gi->databaseSegments = GEOIP_STATE_BEGIN_REV1;
+ } else if (($gi->databaseType == GEOIP_CITY_EDITION_REV0)
|| ($gi->databaseType == GEOIP_CITY_EDITION_REV1)
|| ($gi->databaseType == GEOIP_CITY_EDITION_REV0_V6)
|| ($gi->databaseType == GEOIP_CITY_EDITION_REV1_V6)
- || ($gi->databaseType == GEOIP_ORG_EDITION)
+ || ($gi->databaseType == GEOIP_ORG_EDITION)
|| ($gi->databaseType == GEOIP_DOMAIN_EDITION)
- || ($gi->databaseType == GEOIP_ISP_EDITION)
- || ($gi->databaseType == GEOIP_ORG_EDITION_V6)
+ || ($gi->databaseType == GEOIP_ISP_EDITION)
+ || ($gi->databaseType == GEOIP_ORG_EDITION_V6)
|| ($gi->databaseType == GEOIP_DOMAIN_EDITION_V6)
- || ($gi->databaseType == GEOIP_ISP_EDITION_V6)
- || ($gi->databaseType == GEOIP_LOCATIONA_EDITION)
- || ($gi->databaseType == GEOIP_ACCURACYRADIUS_EDITION)
+ || ($gi->databaseType == GEOIP_ISP_EDITION_V6)
+ || ($gi->databaseType == GEOIP_LOCATIONA_EDITION)
+ || ($gi->databaseType == GEOIP_ACCURACYRADIUS_EDITION)
|| ($gi->databaseType == GEOIP_CITY_EDITION_REV0_V6)
- || ($gi->databaseType == GEOIP_CITY_EDITION_REV1_V6)
- || ($gi->databaseType == GEOIP_NETSPEED_EDITION_REV1)
- || ($gi->databaseType == GEOIP_NETSPEED_EDITION_REV1_V6)
- || ($gi->databaseType == GEOIP_USERTYPE_EDITION)
- || ($gi->databaseType == GEOIP_USERTYPE_EDITION_V6)
+ || ($gi->databaseType == GEOIP_CITY_EDITION_REV1_V6)
+ || ($gi->databaseType == GEOIP_NETSPEED_EDITION_REV1)
+ || ($gi->databaseType == GEOIP_NETSPEED_EDITION_REV1_V6)
+ || ($gi->databaseType == GEOIP_USERTYPE_EDITION)
+ || ($gi->databaseType == GEOIP_USERTYPE_EDITION_V6)
|| ($gi->databaseType == GEOIP_ASNUM_EDITION)
- || ($gi->databaseType == GEOIP_ASNUM_EDITION_V6)
- ) {
- $gi->databaseSegments = 0;
- $buf = fread($gi->filehandle, SEGMENT_RECORD_LENGTH);
- for ($j = 0; $j < SEGMENT_RECORD_LENGTH; $j++) {
- $gi->databaseSegments += (ord($buf[$j]) << ($j * 8));
- }
- if (($gi->databaseType == GEOIP_ORG_EDITION)
- || ($gi->databaseType == GEOIP_DOMAIN_EDITION)
- || ($gi->databaseType == GEOIP_ISP_EDITION)
- || ($gi->databaseType == GEOIP_ORG_EDITION_V6)
- || ($gi->databaseType == GEOIP_DOMAIN_EDITION_V6)
- || ($gi->databaseType == GEOIP_ISP_EDITION_V6)
- ) {
- $gi->record_length = ORG_RECORD_LENGTH;
- }
- }
- break;
- } else {
- fseek($gi->filehandle, -4, SEEK_CUR);
+ || ($gi->databaseType == GEOIP_ASNUM_EDITION_V6)){
+ $gi->databaseSegments = 0;
+ $buf = fread($gi->filehandle,SEGMENT_RECORD_LENGTH);
+ for ($j = 0;$j < SEGMENT_RECORD_LENGTH;$j++){
+ $gi->databaseSegments += (ord($buf[$j]) << ($j * 8));
+ }
+ if ( ( $gi->databaseType == GEOIP_ORG_EDITION )
+ || ( $gi->databaseType == GEOIP_DOMAIN_EDITION )
+ || ( $gi->databaseType == GEOIP_ISP_EDITION )
+ || ( $gi->databaseType == GEOIP_ORG_EDITION_V6 )
+ || ( $gi->databaseType == GEOIP_DOMAIN_EDITION_V6 )
+ || ( $gi->databaseType == GEOIP_ISP_EDITION_V6 )) {
+ $gi->record_length = ORG_RECORD_LENGTH;
}
}
- if (($gi->databaseType == GEOIP_COUNTRY_EDITION) ||
- ($gi->databaseType == GEOIP_COUNTRY_EDITION_V6) ||
- ($gi->databaseType == GEOIP_PROXY_EDITION) ||
- ($gi->databaseType == GEOIP_NETSPEED_EDITION)
- ) {
- $gi->databaseSegments = GEOIP_COUNTRY_BEGIN;
+ break;
+ } else {
+ fseek($gi->filehandle, -4, SEEK_CUR);
}
- fseek($gi->filehandle, $filepos, SEEK_SET);
}
- return $gi;
+ if (($gi->databaseType == GEOIP_COUNTRY_EDITION)||
+ ($gi->databaseType == GEOIP_COUNTRY_EDITION_V6)||
+ ($gi->databaseType == GEOIP_PROXY_EDITION)||
+ ($gi->databaseType == GEOIP_NETSPEED_EDITION)){
+ $gi->databaseSegments = GEOIP_COUNTRY_BEGIN;
+ }
+ fseek($gi->filehandle,$filepos,SEEK_SET);
+ }
+ return $gi;
}
-function geoip_open($filename, $flags)
-{
- $gi = new GeoIP;
- $gi->flags = $flags;
- if ($gi->flags & GEOIP_SHARED_MEMORY) {
- $gi->shmid = @shmop_open(GEOIP_SHM_KEY, "a", 0, 0);
+function geoip_open($filename, $flags) {
+ $gi = new GeoIP;
+ $gi->flags = $flags;
+ if ($gi->flags & GEOIP_SHARED_MEMORY) {
+ $gi->shmid = @shmop_open (GEOIP_SHM_KEY, "a", 0, 0);
} else {
- $gi->filehandle = fopen($filename, "rb") or die("Can not open $filename\n");
- if ($gi->flags & GEOIP_MEMORY_CACHE) {
- $s_array = fstat($gi->filehandle);
- $gi->memory_buffer = fread($gi->filehandle, $s_array['size']);
- }
+ $gi->filehandle = fopen($filename,"rb") or die( "Can not open $filename\n" );
+ if ($gi->flags & GEOIP_MEMORY_CACHE) {
+ $s_array = fstat($gi->filehandle);
+ $gi->memory_buffer = fread($gi->filehandle, $s_array['size']);
}
+ }
- $gi = _setup_segments($gi);
- return $gi;
+ $gi = _setup_segments($gi);
+ return $gi;
}
-function geoip_close($gi)
-{
- if ($gi->flags & GEOIP_SHARED_MEMORY) {
- return true;
- }
+function geoip_close($gi) {
+ if ($gi->flags & GEOIP_SHARED_MEMORY) {
+ return true;
+ }
- return fclose($gi->filehandle);
+ return fclose($gi->filehandle);
}
-function geoip_country_id_by_name_v6($gi, $name)
-{
- $rec = dns_get_record($name, DNS_AAAA);
- if (!$rec) {
- return false;
- }
- $addr = $rec[0]["ipv6"];
- if (!$addr || $addr == $name) {
- return false;
- }
- return geoip_country_id_by_addr_v6($gi, $addr);
+function geoip_country_id_by_name_v6($gi, $name) {
+ $rec = dns_get_record($name, DNS_AAAA);
+ if ( !$rec ) {
+ return false;
+ }
+ $addr = $rec[0]["ipv6"];
+ if (!$addr || $addr == $name) {
+ return false;
+ }
+ return geoip_country_id_by_addr_v6($gi, $addr);
}
-function geoip_country_id_by_name($gi, $name)
-{
- $addr = gethostbyname($name);
- if (!$addr || $addr == $name) {
- return false;
- }
- return geoip_country_id_by_addr($gi, $addr);
+function geoip_country_id_by_name($gi, $name) {
+ $addr = gethostbyname($name);
+ if (!$addr || $addr == $name) {
+ return false;
+ }
+ return geoip_country_id_by_addr($gi, $addr);
}
-function geoip_country_code_by_name_v6($gi, $name)
-{
- $country_id = geoip_country_id_by_name_v6($gi, $name);
- if ($country_id !== false) {
+function geoip_country_code_by_name_v6($gi, $name) {
+ $country_id = geoip_country_id_by_name_v6($gi,$name);
+ if ($country_id !== false) {
return $gi->GEOIP_COUNTRY_CODES[$country_id];
- }
- return false;
+ }
+ return false;
}
-function geoip_country_code_by_name($gi, $name)
-{
- $country_id = geoip_country_id_by_name($gi, $name);
+if (!function_exists('geoip_country_code_by_name')) { // added for Piwik
+ function geoip_country_code_by_name($gi, $name) {
+ $country_id = geoip_country_id_by_name($gi,$name);
if ($country_id !== false) {
- return $gi->GEOIP_COUNTRY_CODES[$country_id];
+ return $gi->GEOIP_COUNTRY_CODES[$country_id];
}
return false;
+ }
}
-function geoip_country_name_by_name_v6($gi, $name)
-{
- $country_id = geoip_country_id_by_name_v6($gi, $name);
- if ($country_id !== false) {
+function geoip_country_name_by_name_v6($gi, $name) {
+ $country_id = geoip_country_id_by_name_v6($gi,$name);
+ if ($country_id !== false) {
return $gi->GEOIP_COUNTRY_NAMES[$country_id];
- }
- return false;
+ }
+ return false;
}
-function geoip_country_name_by_name($gi, $name)
-{
- $country_id = geoip_country_id_by_name($gi, $name);
+if (!function_exists('geoip_country_name_by_name')) { // added for Piwik
+ function geoip_country_name_by_name($gi, $name) {
+ $country_id = geoip_country_id_by_name($gi,$name);
if ($country_id !== false) {
- return $gi->GEOIP_COUNTRY_NAMES[$country_id];
+ return $gi->GEOIP_COUNTRY_NAMES[$country_id];
}
return false;
+ }
}
-function geoip_country_id_by_addr_v6($gi, $addr)
-{
- $ipnum = inet_pton($addr);
- return _geoip_seek_country_v6($gi, $ipnum) - GEOIP_COUNTRY_BEGIN;
+function geoip_country_id_by_addr_v6($gi, $addr) {
+ $ipnum = inet_pton($addr);
+ return _geoip_seek_country_v6($gi, $ipnum) - GEOIP_COUNTRY_BEGIN;
}
-function geoip_country_id_by_addr($gi, $addr)
-{
- $ipnum = ip2long($addr);
- return _geoip_seek_country($gi, $ipnum) - GEOIP_COUNTRY_BEGIN;
+function geoip_country_id_by_addr($gi, $addr) {
+ $ipnum = ip2long($addr);
+ return _geoip_seek_country($gi, $ipnum) - GEOIP_COUNTRY_BEGIN;
}
-function geoip_country_code_by_addr_v6($gi, $addr)
-{
- $country_id = geoip_country_id_by_addr_v6($gi, $addr);
+function geoip_country_code_by_addr_v6($gi, $addr) {
+ $country_id = geoip_country_id_by_addr_v6($gi,$addr);
if ($country_id !== false) {
- return $gi->GEOIP_COUNTRY_CODES[$country_id];
+ return $gi->GEOIP_COUNTRY_CODES[$country_id];
}
- return false;
+ return false;
}
-function geoip_country_code_by_addr($gi, $addr)
-{
- if ($gi->databaseType == GEOIP_CITY_EDITION_REV1) {
- $record = geoip_record_by_addr($gi, $addr);
- if ($record !== false) {
- return $record->country_code;
- }
- } else {
- $country_id = geoip_country_id_by_addr($gi, $addr);
- if ($country_id !== false) {
- return $gi->GEOIP_COUNTRY_CODES[$country_id];
- }
+function geoip_country_code_by_addr($gi, $addr) {
+ if ($gi->databaseType == GEOIP_CITY_EDITION_REV1) {
+ $record = geoip_record_by_addr($gi,$addr);
+ if ( $record !== false ) {
+ return $record->country_code;
}
- return false;
+ } else {
+ $country_id = geoip_country_id_by_addr($gi,$addr);
+ if ($country_id !== false) {
+ return $gi->GEOIP_COUNTRY_CODES[$country_id];
+ }
+ }
+ return false;
}
-function geoip_country_name_by_addr_v6($gi, $addr)
-{
- $country_id = geoip_country_id_by_addr_v6($gi, $addr);
+function geoip_country_name_by_addr_v6($gi, $addr) {
+ $country_id = geoip_country_id_by_addr_v6($gi,$addr);
if ($country_id !== false) {
- return $gi->GEOIP_COUNTRY_NAMES[$country_id];
+ return $gi->GEOIP_COUNTRY_NAMES[$country_id];
}
- return false;
+ return false;
}
-function geoip_country_name_by_addr($gi, $addr)
-{
- if ($gi->databaseType == GEOIP_CITY_EDITION_REV1) {
- $record = geoip_record_by_addr($gi, $addr);
- return $record->country_name;
- } else {
- $country_id = geoip_country_id_by_addr($gi, $addr);
- if ($country_id !== false) {
- return $gi->GEOIP_COUNTRY_NAMES[$country_id];
- }
+function geoip_country_name_by_addr($gi, $addr) {
+ if ($gi->databaseType == GEOIP_CITY_EDITION_REV1) {
+ $record = geoip_record_by_addr($gi,$addr);
+ return $record->country_name;
+ } else {
+ $country_id = geoip_country_id_by_addr($gi,$addr);
+ if ($country_id !== false) {
+ return $gi->GEOIP_COUNTRY_NAMES[$country_id];
}
- return false;
+ }
+ return false;
}
-function _geoip_seek_country_v6($gi, $ipnum)
-{
- # arrays from unpack start with offset 1
- # yet another php mystery. array_merge work around
- # this broken behaviour
- $v6vec = array_merge(unpack("C16", $ipnum));
-
- $offset = 0;
- for ($depth = 127; $depth >= 0; --$depth) {
- if ($gi->flags & GEOIP_MEMORY_CACHE) {
- $buf = _safe_substr(
- $gi->memory_buffer,
- 2 * $gi->record_length * $offset,
- 2 * $gi->record_length
- );
- } elseif ($gi->flags & GEOIP_SHARED_MEMORY) {
- $buf = @shmop_read(
- $gi->shmid,
- 2 * $gi->record_length * $offset,
- 2 * $gi->record_length
- );
+function _geoip_seek_country_v6($gi, $ipnum) {
+
+ # arrays from unpack start with offset 1
+ # yet another php mystery. array_merge work around
+ # this broken behaviour
+ $v6vec = array_merge(unpack( "C16", $ipnum));
+
+ $offset = 0;
+ for ($depth = 127; $depth >= 0; --$depth) {
+ if ($gi->flags & GEOIP_MEMORY_CACHE) {
+ // workaround php's broken substr, strpos, etc handling with
+ // mbstring.func_overload and mbstring.internal_encoding
+ $enc = mb_internal_encoding();
+ mb_internal_encoding('ISO-8859-1');
+
+ $buf = substr($gi->memory_buffer,
+ 2 * $gi->record_length * $offset,
+ 2 * $gi->record_length);
+
+ mb_internal_encoding($enc);
+ } elseif ($gi->flags & GEOIP_SHARED_MEMORY) {
+ $buf = @shmop_read ($gi->shmid,
+ 2 * $gi->record_length * $offset,
+ 2 * $gi->record_length );
} else {
- fseek($gi->filehandle, 2 * $gi->record_length * $offset, SEEK_SET) == 0
- or die("fseek failed");
- $buf = fread($gi->filehandle, 2 * $gi->record_length);
- }
- $x = array(0, 0);
- for ($i = 0; $i < 2; ++$i) {
- for ($j = 0; $j < $gi->record_length; ++$j) {
- $x[$i] += ord($buf[$gi->record_length * $i + $j]) << ($j * 8);
- }
- }
+ fseek($gi->filehandle, 2 * $gi->record_length * $offset, SEEK_SET) == 0
+ or die("fseek failed");
+ $buf = fread($gi->filehandle, 2 * $gi->record_length);
+ }
+ $x = array(0,0);
+ for ($i = 0; $i < 2; ++$i) {
+ for ($j = 0; $j < $gi->record_length; ++$j) {
+ $x[$i] += ord($buf[$gi->record_length * $i + $j]) << ($j * 8);
+ }
+ }
- $bnum = 127 - $depth;
- $idx = $bnum >> 3;
- $b_mask = 1 << ($bnum & 7 ^ 7);
- if (($v6vec[$idx] & $b_mask) > 0) {
- if ($x[1] >= $gi->databaseSegments) {
- return $x[1];
- }
- $offset = $x[1];
- } else {
- if ($x[0] >= $gi->databaseSegments) {
- return $x[0];
- }
- $offset = $x[0];
- }
+ $bnum = 127 - $depth;
+ $idx = $bnum >> 3;
+ $b_mask = 1 << ( $bnum & 7 ^ 7 );
+ if (($v6vec[$idx] & $b_mask) > 0) {
+ if ($x[1] >= $gi->databaseSegments) {
+ return $x[1];
+ }
+ $offset = $x[1];
+ } else {
+ if ($x[0] >= $gi->databaseSegments) {
+ return $x[0];
+ }
+ $offset = $x[0];
}
- trigger_error("error traversing database - perhaps it is corrupt?", E_USER_ERROR);
- return false;
+ }
+ trigger_error("error traversing database - perhaps it is corrupt?", E_USER_ERROR);
+ return false;
}
-function _geoip_seek_country($gi, $ipnum)
-{
- $offset = 0;
- for ($depth = 31; $depth >= 0; --$depth) {
- if ($gi->flags & GEOIP_MEMORY_CACHE) {
- $buf = _safe_substr(
- $gi->memory_buffer,
- 2 * $gi->record_length * $offset,
- 2 * $gi->record_length
- );
- } elseif ($gi->flags & GEOIP_SHARED_MEMORY) {
- $buf = @shmop_read(
- $gi->shmid,
- 2 * $gi->record_length * $offset,
- 2 * $gi->record_length
- );
+function _geoip_seek_country($gi, $ipnum) {
+ $offset = 0;
+ for ($depth = 31; $depth >= 0; --$depth) {
+ if ($gi->flags & GEOIP_MEMORY_CACHE) {
+ // workaround php's broken substr, strpos, etc handling with
+ // mbstring.func_overload and mbstring.internal_encoding
+ $enc = mb_internal_encoding();
+ mb_internal_encoding('ISO-8859-1');
+
+ $buf = substr($gi->memory_buffer,
+ 2 * $gi->record_length * $offset,
+ 2 * $gi->record_length);
+
+ mb_internal_encoding($enc);
+ } elseif ($gi->flags & GEOIP_SHARED_MEMORY) {
+ $buf = @shmop_read ($gi->shmid,
+ 2 * $gi->record_length * $offset,
+ 2 * $gi->record_length );
} else {
- fseek($gi->filehandle, 2 * $gi->record_length * $offset, SEEK_SET) == 0
- or die("fseek failed");
- $buf = fread($gi->filehandle, 2 * $gi->record_length);
- }
- $x = array(0, 0);
- for ($i = 0; $i < 2; ++$i) {
- for ($j = 0; $j < $gi->record_length; ++$j) {
- $x[$i] += ord($buf[$gi->record_length * $i + $j]) << ($j * 8);
- }
- }
- if ($ipnum & (1 << $depth)) {
- if ($x[1] >= $gi->databaseSegments) {
- return $x[1];
- }
- $offset = $x[1];
+ fseek($gi->filehandle, 2 * $gi->record_length * $offset, SEEK_SET) == 0
+ or die("fseek failed");
+ $buf = fread($gi->filehandle, 2 * $gi->record_length);
+ }
+ $x = array(0,0);
+ for ($i = 0; $i < 2; ++$i) {
+ for ($j = 0; $j < $gi->record_length; ++$j) {
+ $x[$i] += ord($buf[$gi->record_length * $i + $j]) << ($j * 8);
+ }
+ }
+ if ($ipnum & (1 << $depth)) {
+ if ($x[1] >= $gi->databaseSegments) {
+ return $x[1];
+ }
+ $offset = $x[1];
} else {
- if ($x[0] >= $gi->databaseSegments) {
- return $x[0];
- }
- $offset = $x[0];
- }
+ if ($x[0] >= $gi->databaseSegments) {
+ return $x[0];
+ }
+ $offset = $x[0];
}
- trigger_error("error traversing database - perhaps it is corrupt?", E_USER_ERROR);
- return false;
+ }
+ trigger_error("error traversing database - perhaps it is corrupt?", E_USER_ERROR);
+ return false;
}
-function _common_get_org($gi, $seek_org)
-{
- $record_pointer = $seek_org + (2 * $gi->record_length - 1) * $gi->databaseSegments;
- if ($gi->flags & GEOIP_SHARED_MEMORY) {
- $org_buf = @shmop_read($gi->shmid, $record_pointer, MAX_ORG_RECORD_LENGTH);
+function _common_get_org($gi, $seek_org){
+ $record_pointer = $seek_org + (2 * $gi->record_length - 1) * $gi->databaseSegments;
+ if ($gi->flags & GEOIP_SHARED_MEMORY) {
+ $org_buf = @shmop_read ($gi->shmid, $record_pointer, MAX_ORG_RECORD_LENGTH);
} else {
- fseek($gi->filehandle, $record_pointer, SEEK_SET);
- $org_buf = fread($gi->filehandle, MAX_ORG_RECORD_LENGTH);
- }
- $org_buf = _safe_substr($org_buf, 0, strpos($org_buf, "\0"));
- return $org_buf;
+ fseek($gi->filehandle, $record_pointer, SEEK_SET);
+ $org_buf = fread($gi->filehandle,MAX_ORG_RECORD_LENGTH);
+ }
+ // workaround php's broken substr, strpos, etc handling with
+ // mbstring.func_overload and mbstring.internal_encoding
+ $enc = mb_internal_encoding();
+ mb_internal_encoding('ISO-8859-1');
+ $org_buf = substr($org_buf, 0, strpos($org_buf, "\0"));
+ mb_internal_encoding($enc);
+ return $org_buf;
}
-function _get_org_v6($gi, $ipnum)
-{
- $seek_org = _geoip_seek_country_v6($gi, $ipnum);
- if ($seek_org == $gi->databaseSegments) {
- return null;
- }
- return _common_get_org($gi, $seek_org);
+function _get_org_v6($gi,$ipnum){
+ $seek_org = _geoip_seek_country_v6($gi,$ipnum);
+ if ($seek_org == $gi->databaseSegments) {
+ return NULL;
+ }
+ return _common_get_org($gi, $seek_org);
}
-function _get_org($gi, $ipnum)
-{
- $seek_org = _geoip_seek_country($gi, $ipnum);
- if ($seek_org == $gi->databaseSegments) {
- return null;
- }
- return _common_get_org($gi, $seek_org);
+function _get_org($gi,$ipnum){
+ $seek_org = _geoip_seek_country($gi,$ipnum);
+ if ($seek_org == $gi->databaseSegments) {
+ return NULL;
+ }
+ return _common_get_org($gi, $seek_org);
}
-function geoip_name_by_addr_v6($gi, $addr)
-{
- if ($addr == null) {
- return 0;
- }
- $ipnum = inet_pton($addr);
- return _get_org_v6($gi, $ipnum);
+
+function geoip_name_by_addr_v6 ($gi,$addr) {
+ if ($addr == NULL) {
+ return 0;
+ }
+ $ipnum = inet_pton($addr);
+ return _get_org_v6($gi, $ipnum);
}
-function geoip_name_by_addr($gi, $addr)
-{
- if ($addr == null) {
- return 0;
- }
- $ipnum = ip2long($addr);
- return _get_org($gi, $ipnum);
+function geoip_name_by_addr ($gi,$addr) {
+ if ($addr == NULL) {
+ return 0;
+ }
+ $ipnum = ip2long($addr);
+ return _get_org($gi, $ipnum);
}
-function geoip_org_by_addr($gi, $addr)
-{
- return geoip_name_by_addr($gi, $addr);
+function geoip_org_by_addr ($gi,$addr) {
+ return geoip_name_by_addr($gi, $addr);
}
-function _get_region($gi, $ipnum)
-{
- if ($gi->databaseType == GEOIP_REGION_EDITION_REV0) {
- $seek_region = _geoip_seek_country($gi, $ipnum) - GEOIP_STATE_BEGIN_REV0;
- if ($seek_region >= 1000) {
- $country_code = "US";
- $region = chr(($seek_region - 1000) / 26 + 65) . chr(($seek_region - 1000) % 26 + 65);
- } else {
+function _get_region($gi,$ipnum){
+ if ($gi->databaseType == GEOIP_REGION_EDITION_REV0){
+ $seek_region = _geoip_seek_country($gi,$ipnum) - GEOIP_STATE_BEGIN_REV0;
+ if ($seek_region >= 1000){
+ $country_code = "US";
+ $region = chr(($seek_region - 1000)/26 + 65) . chr(($seek_region - 1000)%26 + 65);
+ } else {
$country_code = $gi->GEOIP_COUNTRY_CODES[$seek_region];
- $region = "";
- }
- return array($country_code, $region);
- } elseif ($gi->databaseType == GEOIP_REGION_EDITION_REV1) {
- $seek_region = _geoip_seek_country($gi, $ipnum) - GEOIP_STATE_BEGIN_REV1;
- if ($seek_region < US_OFFSET) {
- $country_code = "";
- $region = "";
- } elseif ($seek_region < CANADA_OFFSET) {
- $country_code = "US";
- $region = chr(($seek_region - US_OFFSET) / 26 + 65) . chr(($seek_region - US_OFFSET) % 26 + 65);
- } elseif ($seek_region < WORLD_OFFSET) {
- $country_code = "CA";
- $region = chr(($seek_region - CANADA_OFFSET) / 26 + 65) . chr(($seek_region - CANADA_OFFSET) % 26 + 65);
- } else {
+ $region = "";
+ }
+ return array ($country_code,$region);
+ } else if ($gi->databaseType == GEOIP_REGION_EDITION_REV1) {
+ $seek_region = _geoip_seek_country($gi,$ipnum) - GEOIP_STATE_BEGIN_REV1;
+ //print $seek_region;
+ if ($seek_region < US_OFFSET){
+ $country_code = "";
+ $region = "";
+ } else if ($seek_region < CANADA_OFFSET) {
+ $country_code = "US";
+ $region = chr(($seek_region - US_OFFSET)/26 + 65) . chr(($seek_region - US_OFFSET)%26 + 65);
+ } else if ($seek_region < WORLD_OFFSET) {
+ $country_code = "CA";
+ $region = chr(($seek_region - CANADA_OFFSET)/26 + 65) . chr(($seek_region - CANADA_OFFSET)%26 + 65);
+ } else {
$country_code = $gi->GEOIP_COUNTRY_CODES[($seek_region - WORLD_OFFSET) / FIPS_RANGE];
- $region = "";
- }
- return array($country_code, $region);
+ $region = "";
}
+ return array ($country_code,$region);
+ }
}
-function geoip_region_by_addr($gi, $addr)
-{
- if ($addr == null) {
- return 0;
- }
- $ipnum = ip2long($addr);
- return _get_region($gi, $ipnum);
+function geoip_region_by_addr ($gi,$addr) {
+ if ($addr == NULL) {
+ return 0;
+ }
+ $ipnum = ip2long($addr);
+ return _get_region($gi, $ipnum);
}
-function getdnsattributes($l, $ip)
-{
- $r = new Net_DNS_Resolver();
- $r->nameservers = array("ws1.maxmind.com");
- $p = $r->search($l . "." . $ip . ".s.maxmind.com", "TXT", "IN");
- $str = is_object($p->answer[0]) ? $p->answer[0]->string() : '';
- $str = substr($str, 1, -1);
- return $str;
+function getdnsattributes ($l,$ip){
+ $r = new Net_DNS_Resolver();
+ $r->nameservers = array("ws1.maxmind.com");
+ $p = $r->search($l."." . $ip .".s.maxmind.com","TXT","IN");
+ $str = is_object($p->answer[0])?$p->answer[0]->string():'';
+ $str = substr( $str, 1, -1 );
+ return $str;
}
-function _safe_substr($string, $start, $length)
-{
- // workaround php's broken substr, strpos, etc handling with
- // mbstring.func_overload and mbstring.internal_encoding
- $mbExists = extension_loaded('mbstring');
-
- if ($mbExists) {
- $enc = mb_internal_encoding();
- mb_internal_encoding('ISO-8859-1');
- }
-
- $buf = substr($string, $start, $length);
-
- if ($mbExists) {
- mb_internal_encoding($enc);
- }
-
- return $buf;
-}
+?>
diff --git a/libs/MaxMindGeoIP/geoipcity.inc b/libs/MaxMindGeoIP/geoipcity.inc
index 44ed49b878..a93c3d35dd 100755
--- a/libs/MaxMindGeoIP/geoipcity.inc
+++ b/libs/MaxMindGeoIP/geoipcity.inc
@@ -2,7 +2,7 @@
/* geoipcity.inc
*
- * Copyright (C) 2013 MaxMind, Inc.
+ * Copyright (C) 2004 Maxmind LLC
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -11,231 +11,227 @@
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+/*
+ * Changelog:
+ *
+ * 2005-01-13 Andrew Hill, Awarez Ltd. (http://www.awarez.net)
+ * Formatted file according to PEAR library standards.
+ * Changed inclusion of geoip.inc file to require_once, so that
+ * this library can be used in the same script as geoip.inc.
+ */
-define("FULL_RECORD_LENGTH", 50);
+define("FULL_RECORD_LENGTH",50);
require_once 'geoip.inc';
require_once 'geoipregionvars.php';
-class geoiprecord
-{
- public $country_code;
- public $country_code3;
- public $country_name;
- public $region;
- public $city;
- public $postal_code;
- public $latitude;
- public $longitude;
- public $area_code;
- public $dma_code; # metro and dma code are the same. use metro_code
- public $metro_code;
- public $continent_code;
+class geoiprecord {
+ var $country_code;
+ var $country_code3;
+ var $country_name;
+ var $region;
+ var $city;
+ var $postal_code;
+ var $latitude;
+ var $longitude;
+ var $area_code;
+ var $dma_code; # metro and dma code are the same. use metro_code
+ var $metro_code;
+ var $continent_code;
}
-class geoipdnsrecord
-{
- public $country_code;
- public $country_code3;
- public $country_name;
- public $region;
- public $regionname;
- public $city;
- public $postal_code;
- public $latitude;
- public $longitude;
- public $areacode;
- public $dmacode;
- public $isp;
- public $org;
- public $metrocode;
+class geoipdnsrecord {
+ var $country_code;
+ var $country_code3;
+ var $country_name;
+ var $region;
+ var $regionname;
+ var $city;
+ var $postal_code;
+ var $latitude;
+ var $longitude;
+ var $areacode;
+ var $dmacode;
+ var $isp;
+ var $org;
+ var $metrocode;
}
-function getrecordwithdnsservice($str)
-{
- $record = new geoipdnsrecord;
- $keyvalue = explode(";", $str);
- foreach ($keyvalue as $keyvalue2) {
- list($key, $value) = explode("=", $keyvalue2);
- if ($key == "co") {
- $record->country_code = $value;
- }
- if ($key == "ci") {
- $record->city = $value;
- }
- if ($key == "re") {
- $record->region = $value;
- }
- if ($key == "ac") {
- $record->areacode = $value;
- }
- if ($key == "dm" || $key == "me") {
- $record->dmacode = $value;
- $record->metrocode = $value;
- }
- if ($key == "is") {
- $record->isp = $value;
- }
- if ($key == "or") {
- $record->org = $value;
- }
- if ($key == "zi") {
- $record->postal_code = $value;
- }
- if ($key == "la") {
- $record->latitude = $value;
- }
- if ($key == "lo") {
- $record->longitude = $value;
- }
+function getrecordwithdnsservice($str){
+ $record = new geoipdnsrecord;
+ $keyvalue = explode(";",$str);
+ foreach ($keyvalue as $keyvalue2){
+ list($key,$value) = explode("=",$keyvalue2);
+ if ($key == "co"){
+ $record->country_code = $value;
}
- $number = $GLOBALS['GEOIP_COUNTRY_CODE_TO_NUMBER'][$record->country_code];
- $record->country_code3 = $GLOBALS['GEOIP_COUNTRY_CODES3'][$number];
- $record->country_name = $GLOBALS['GEOIP_COUNTRY_NAMES'][$number];
- if ($record->region != "") {
- if (($record->country_code == "US") || ($record->country_code == "CA")) {
- $record->regionname = $GLOBALS['ISO'][$record->country_code][$record->region];
- } else {
- $record->regionname = $GLOBALS['FIPS'][$record->country_code][$record->region];
- }
+ if ($key == "ci"){
+ $record->city = $value;
}
- return $record;
-}
-
-
-function _get_record_v6($gi, $ipnum)
-{
- $seek_country = _geoip_seek_country_v6($gi, $ipnum);
- if ($seek_country == $gi->databaseSegments) {
- return null;
+ if ($key == "re"){
+ $record->region = $value;
+ }
+ if ($key == "ac"){
+ $record->areacode = $value;
+ }
+ if ($key == "dm" || $key == "me" ){
+ $record->dmacode = $value;
+ $record->metrocode = $value;
+ }
+ if ($key == "is"){
+ $record->isp = $value;
+ }
+ if ($key == "or"){
+ $record->org = $value;
}
- return _common_get_record($gi, $seek_country);
+ if ($key == "zi"){
+ $record->postal_code = $value;
+ }
+ if ($key == "la"){
+ $record->latitude = $value;
+ }
+ if ($key == "lo"){
+ $record->longitude = $value;
+ }
+ }
+ $number = $GLOBALS['GEOIP_COUNTRY_CODE_TO_NUMBER'][$record->country_code];
+ $record->country_code3 = $GLOBALS['GEOIP_COUNTRY_CODES3'][$number];
+ $record->country_name = $GLOBALS['GEOIP_COUNTRY_NAMES'][$number];
+ if ($record->region != "") {
+ if (($record->country_code == "US") || ($record->country_code == "CA")){
+ $record->regionname = $GLOBALS['ISO'][$record->country_code][$record->region];
+ } else {
+ $record->regionname = $GLOBALS['FIPS'][$record->country_code][$record->region];
+ }
+ }
+ return $record;
}
-function _common_get_record($gi, $seek_country)
-{
- // workaround php's broken substr, strpos, etc handling with
- // mbstring.func_overload and mbstring.internal_encoding
- $mbExists = extension_loaded('mbstring');
- if ($mbExists) {
- $enc = mb_internal_encoding();
- mb_internal_encoding('ISO-8859-1');
- }
- $record_pointer = $seek_country + (2 * $gi->record_length - 1) * $gi->databaseSegments;
+function _get_record_v6($gi,$ipnum){
+ $seek_country = _geoip_seek_country_v6($gi,$ipnum);
+ if ($seek_country == $gi->databaseSegments) {
+ return NULL;
+ }
+ return _common_get_record($gi, $seek_country);
+}
- if ($gi->flags & GEOIP_MEMORY_CACHE) {
- $record_buf = substr($gi->memory_buffer, $record_pointer, FULL_RECORD_LENGTH);
- } elseif ($gi->flags & GEOIP_SHARED_MEMORY) {
- $record_buf = @shmop_read($gi->shmid, $record_pointer, FULL_RECORD_LENGTH);
- } else {
- fseek($gi->filehandle, $record_pointer, SEEK_SET);
- $record_buf = fread($gi->filehandle, FULL_RECORD_LENGTH);
- }
- $record = new geoiprecord;
- $record_buf_pos = 0;
- $char = ord(substr($record_buf, $record_buf_pos, 1));
+function _common_get_record($gi, $seek_country){
+ // workaround php's broken substr, strpos, etc handling with
+ // mbstring.func_overload and mbstring.internal_encoding
+ $enc = mb_internal_encoding();
+ mb_internal_encoding('ISO-8859-1');
+
+ $record_pointer = $seek_country + (2 * $gi->record_length - 1) * $gi->databaseSegments;
+
+ if ($gi->flags & GEOIP_MEMORY_CACHE) {
+ $record_buf = substr($gi->memory_buffer,$record_pointer,FULL_RECORD_LENGTH);
+ } elseif ($gi->flags & GEOIP_SHARED_MEMORY){
+ $record_buf = @shmop_read($gi->shmid,$record_pointer,FULL_RECORD_LENGTH);
+ } else {
+ fseek($gi->filehandle, $record_pointer, SEEK_SET);
+ $record_buf = fread($gi->filehandle,FULL_RECORD_LENGTH);
+ }
+ $record = new geoiprecord;
+ $record_buf_pos = 0;
+ $char = ord(substr($record_buf,$record_buf_pos,1));
$record->country_code = $gi->GEOIP_COUNTRY_CODES[$char];
$record->country_code3 = $gi->GEOIP_COUNTRY_CODES3[$char];
$record->country_name = $gi->GEOIP_COUNTRY_NAMES[$char];
- $record->continent_code = $gi->GEOIP_CONTINENT_CODES[$char];
- $record_buf_pos++;
- $str_length = 0;
-
+ $record->continent_code = $gi->GEOIP_CONTINENT_CODES[$char];
+ $record_buf_pos++;
+ $str_length = 0;
// Get region
- $char = ord(substr($record_buf, $record_buf_pos + $str_length, 1));
- while ($char != 0) {
- $str_length++;
- $char = ord(substr($record_buf, $record_buf_pos + $str_length, 1));
- }
- if ($str_length > 0) {
- $record->region = substr($record_buf, $record_buf_pos, $str_length);
- }
- $record_buf_pos += $str_length + 1;
- $str_length = 0;
+ $char = ord(substr($record_buf,$record_buf_pos+$str_length,1));
+ while ($char != 0){
+ $str_length++;
+ $char = ord(substr($record_buf,$record_buf_pos+$str_length,1));
+ }
+ if ($str_length > 0){
+ $record->region = substr($record_buf,$record_buf_pos,$str_length);
+ }
+ $record_buf_pos += $str_length + 1;
+ $str_length = 0;
// Get city
- $char = ord(substr($record_buf, $record_buf_pos + $str_length, 1));
- while ($char != 0) {
- $str_length++;
- $char = ord(substr($record_buf, $record_buf_pos + $str_length, 1));
- }
- if ($str_length > 0) {
- $record->city = substr($record_buf, $record_buf_pos, $str_length);
- }
- $record_buf_pos += $str_length + 1;
- $str_length = 0;
+ $char = ord(substr($record_buf,$record_buf_pos+$str_length,1));
+ while ($char != 0){
+ $str_length++;
+ $char = ord(substr($record_buf,$record_buf_pos+$str_length,1));
+ }
+ if ($str_length > 0){
+ $record->city = substr($record_buf,$record_buf_pos,$str_length);
+ }
+ $record_buf_pos += $str_length + 1;
+ $str_length = 0;
// Get postal code
- $char = ord(substr($record_buf, $record_buf_pos + $str_length, 1));
- while ($char != 0) {
- $str_length++;
- $char = ord(substr($record_buf, $record_buf_pos + $str_length, 1));
- }
- if ($str_length > 0) {
- $record->postal_code = substr($record_buf, $record_buf_pos, $str_length);
- }
- $record_buf_pos += $str_length + 1;
- $str_length = 0;
+ $char = ord(substr($record_buf,$record_buf_pos+$str_length,1));
+ while ($char != 0){
+ $str_length++;
+ $char = ord(substr($record_buf,$record_buf_pos+$str_length,1));
+ }
+ if ($str_length > 0){
+ $record->postal_code = substr($record_buf,$record_buf_pos,$str_length);
+ }
+ $record_buf_pos += $str_length + 1;
+ $str_length = 0;
// Get latitude and longitude
- $latitude = 0;
- $longitude = 0;
- for ($j = 0; $j < 3; ++$j) {
- $char = ord(substr($record_buf, $record_buf_pos++, 1));
- $latitude += ($char << ($j * 8));
- }
- $record->latitude = ($latitude / 10000) - 180;
- for ($j = 0; $j < 3; ++$j) {
- $char = ord(substr($record_buf, $record_buf_pos++, 1));
- $longitude += ($char << ($j * 8));
- }
- $record->longitude = ($longitude / 10000) - 180;
- if (GEOIP_CITY_EDITION_REV1 == $gi->databaseType) {
- $metroarea_combo = 0;
- if ($record->country_code == "US") {
- for ($j = 0; $j < 3; ++$j) {
- $char = ord(substr($record_buf, $record_buf_pos++, 1));
- $metroarea_combo += ($char << ($j * 8));
- }
- $record->metro_code = $record->dma_code = floor($metroarea_combo / 1000);
- $record->area_code = $metroarea_combo % 1000;
- }
- }
- if ($mbExists) {
- mb_internal_encoding($enc);
- }
- return $record;
+ $latitude = 0;
+ $longitude = 0;
+ for ($j = 0;$j < 3; ++$j){
+ $char = ord(substr($record_buf,$record_buf_pos++,1));
+ $latitude += ($char << ($j * 8));
+ }
+ $record->latitude = ($latitude/10000) - 180;
+ for ($j = 0;$j < 3; ++$j){
+ $char = ord(substr($record_buf,$record_buf_pos++,1));
+ $longitude += ($char << ($j * 8));
+ }
+ $record->longitude = ($longitude/10000) - 180;
+ if (GEOIP_CITY_EDITION_REV1 == $gi->databaseType){
+ $metroarea_combo = 0;
+ if ($record->country_code == "US"){
+ for ($j = 0;$j < 3;++$j){
+ $char = ord(substr($record_buf,$record_buf_pos++,1));
+ $metroarea_combo += ($char << ($j * 8));
+ }
+ $record->metro_code = $record->dma_code = floor($metroarea_combo/1000);
+ $record->area_code = $metroarea_combo%1000;
+ }
+ }
+ mb_internal_encoding($enc);
+ return $record;
}
-function GeoIP_record_by_addr_v6($gi, $addr)
-{
- if ($addr == null) {
- return 0;
- }
- $ipnum = inet_pton($addr);
- return _get_record_v6($gi, $ipnum);
+function GeoIP_record_by_addr_v6 ($gi,$addr){
+ if ($addr == NULL){
+ return 0;
+ }
+ $ipnum = inet_pton($addr);
+ return _get_record_v6($gi, $ipnum);
}
-function _get_record($gi, $ipnum)
-{
- $seek_country = _geoip_seek_country($gi, $ipnum);
- if ($seek_country == $gi->databaseSegments) {
- return null;
- }
- return _common_get_record($gi, $seek_country);
+function _get_record($gi,$ipnum){
+ $seek_country = _geoip_seek_country($gi,$ipnum);
+ if ($seek_country == $gi->databaseSegments) {
+ return NULL;
+ }
+ return _common_get_record($gi, $seek_country);
}
-function GeoIP_record_by_addr($gi, $addr)
-{
- if ($addr == null) {
- return 0;
- }
- $ipnum = ip2long($addr);
- return _get_record($gi, $ipnum);
+function GeoIP_record_by_addr ($gi,$addr){
+ if ($addr == NULL){
+ return 0;
+ }
+ $ipnum = ip2long($addr);
+ return _get_record($gi, $ipnum);
}
+
+?>
diff --git a/libs/MaxMindGeoIP/geoipregionvars.php b/libs/MaxMindGeoIP/geoipregionvars.php
index 9cbfd61ce6..c18a4aff8e 100755
--- a/libs/MaxMindGeoIP/geoipregionvars.php
+++ b/libs/MaxMindGeoIP/geoipregionvars.php
@@ -1,4447 +1,4192 @@
<?php
-# Copyright 2013 MaxMind, Inc. All Rights Reserved
+# Copyright 2012 Maxmind LLC All Rights Reserved
$GEOIP_REGION_NAME = array(
- "AD" => array(
- "02" => "Canillo",
- "03" => "Encamp",
- "04" => "La Massana",
- "05" => "Ordino",
- "06" => "Sant Julia de Loria",
- "07" => "Andorra la Vella",
- "08" => "Escaldes-Engordany"
- ),
- "AE" => array(
- "01" => "Abu Dhabi",
- "02" => "Ajman",
- "03" => "Dubai",
- "04" => "Fujairah",
- "05" => "Ras Al Khaimah",
- "06" => "Sharjah",
- "07" => "Umm Al Quwain"
- ),
- "AF" => array(
- "01" => "Badakhshan",
- "02" => "Badghis",
- "03" => "Baghlan",
- "05" => "Bamian",
- "06" => "Farah",
- "07" => "Faryab",
- "08" => "Ghazni",
- "09" => "Ghowr",
- "10" => "Helmand",
- "11" => "Herat",
- "13" => "Kabol",
- "14" => "Kapisa",
- "17" => "Lowgar",
- "18" => "Nangarhar",
- "19" => "Nimruz",
- "23" => "Kandahar",
- "24" => "Kondoz",
- "26" => "Takhar",
- "27" => "Vardak",
- "28" => "Zabol",
- "29" => "Paktika",
- "30" => "Balkh",
- "31" => "Jowzjan",
- "32" => "Samangan",
- "33" => "Sar-e Pol",
- "34" => "Konar",
- "35" => "Laghman",
- "36" => "Paktia",
- "37" => "Khowst",
- "38" => "Nurestan",
- "39" => "Oruzgan",
- "40" => "Parvan",
- "41" => "Daykondi",
- "42" => "Panjshir"
- ),
- "AG" => array(
- "01" => "Barbuda",
- "03" => "Saint George",
- "04" => "Saint John",
- "05" => "Saint Mary",
- "06" => "Saint Paul",
- "07" => "Saint Peter",
- "08" => "Saint Philip",
- "09" => "Redonda"
- ),
- "AL" => array(
- "40" => "Berat",
- "41" => "Diber",
- "42" => "Durres",
- "43" => "Elbasan",
- "44" => "Fier",
- "45" => "Gjirokaster",
- "46" => "Korce",
- "47" => "Kukes",
- "48" => "Lezhe",
- "49" => "Shkoder",
- "50" => "Tirane",
- "51" => "Vlore"
- ),
- "AM" => array(
- "01" => "Aragatsotn",
- "02" => "Ararat",
- "03" => "Armavir",
- "04" => "Geghark'unik'",
- "05" => "Kotayk'",
- "06" => "Lorri",
- "07" => "Shirak",
- "08" => "Syunik'",
- "09" => "Tavush",
- "10" => "Vayots' Dzor",
- "11" => "Yerevan"
- ),
- "AO" => array(
- "01" => "Benguela",
- "02" => "Bie",
- "03" => "Cabinda",
- "04" => "Cuando Cubango",
- "05" => "Cuanza Norte",
- "06" => "Cuanza Sul",
- "07" => "Cunene",
- "08" => "Huambo",
- "09" => "Huila",
- "12" => "Malanje",
- "13" => "Namibe",
- "14" => "Moxico",
- "15" => "Uige",
- "16" => "Zaire",
- "17" => "Lunda Norte",
- "18" => "Lunda Sul",
- "19" => "Bengo",
- "20" => "Luanda"
- ),
- "AR" => array(
- "01" => "Buenos Aires",
- "02" => "Catamarca",
- "03" => "Chaco",
- "04" => "Chubut",
- "05" => "Cordoba",
- "06" => "Corrientes",
- "07" => "Distrito Federal",
- "08" => "Entre Rios",
- "09" => "Formosa",
- "10" => "Jujuy",
- "11" => "La Pampa",
- "12" => "La Rioja",
- "13" => "Mendoza",
- "14" => "Misiones",
- "15" => "Neuquen",
- "16" => "Rio Negro",
- "17" => "Salta",
- "18" => "San Juan",
- "19" => "San Luis",
- "20" => "Santa Cruz",
- "21" => "Santa Fe",
- "22" => "Santiago del Estero",
- "23" => "Tierra del Fuego",
- "24" => "Tucuman"
- ),
- "AT" => array(
- "01" => "Burgenland",
- "02" => "Karnten",
- "03" => "Niederosterreich",
- "04" => "Oberosterreich",
- "05" => "Salzburg",
- "06" => "Steiermark",
- "07" => "Tirol",
- "08" => "Vorarlberg",
- "09" => "Wien"
- ),
- "AU" => array(
- "01" => "Australian Capital Territory",
- "02" => "New South Wales",
- "03" => "Northern Territory",
- "04" => "Queensland",
- "05" => "South Australia",
- "06" => "Tasmania",
- "07" => "Victoria",
- "08" => "Western Australia"
- ),
- "AZ" => array(
- "01" => "Abseron",
- "02" => "Agcabadi",
- "03" => "Agdam",
- "04" => "Agdas",
- "05" => "Agstafa",
- "06" => "Agsu",
- "07" => "Ali Bayramli",
- "08" => "Astara",
- "09" => "Baki",
- "10" => "Balakan",
- "11" => "Barda",
- "12" => "Beylaqan",
- "13" => "Bilasuvar",
- "14" => "Cabrayil",
- "15" => "Calilabad",
- "16" => "Daskasan",
- "17" => "Davaci",
- "18" => "Fuzuli",
- "19" => "Gadabay",
- "20" => "Ganca",
- "21" => "Goranboy",
- "22" => "Goycay",
- "23" => "Haciqabul",
- "24" => "Imisli",
- "25" => "Ismayilli",
- "26" => "Kalbacar",
- "27" => "Kurdamir",
- "28" => "Lacin",
- "29" => "Lankaran",
- "30" => "Lankaran",
- "31" => "Lerik",
- "32" => "Masalli",
- "33" => "Mingacevir",
- "34" => "Naftalan",
- "35" => "Naxcivan",
- "36" => "Neftcala",
- "37" => "Oguz",
- "38" => "Qabala",
- "39" => "Qax",
- "40" => "Qazax",
- "41" => "Qobustan",
- "42" => "Quba",
- "43" => "Qubadli",
- "44" => "Qusar",
- "45" => "Saatli",
- "46" => "Sabirabad",
- "47" => "Saki",
- "48" => "Saki",
- "49" => "Salyan",
- "50" => "Samaxi",
- "51" => "Samkir",
- "52" => "Samux",
- "53" => "Siyazan",
- "54" => "Sumqayit",
- "55" => "Susa",
- "56" => "Susa",
- "57" => "Tartar",
- "58" => "Tovuz",
- "59" => "Ucar",
- "60" => "Xacmaz",
- "61" => "Xankandi",
- "62" => "Xanlar",
- "63" => "Xizi",
- "64" => "Xocali",
- "65" => "Xocavand",
- "66" => "Yardimli",
- "67" => "Yevlax",
- "68" => "Yevlax",
- "69" => "Zangilan",
- "70" => "Zaqatala",
- "71" => "Zardab"
- ),
- "BA" => array(
- "01" => "Federation of Bosnia and Herzegovina",
- "02" => "Republika Srpska"
- ),
- "BB" => array(
- "01" => "Christ Church",
- "02" => "Saint Andrew",
- "03" => "Saint George",
- "04" => "Saint James",
- "05" => "Saint John",
- "06" => "Saint Joseph",
- "07" => "Saint Lucy",
- "08" => "Saint Michael",
- "09" => "Saint Peter",
- "10" => "Saint Philip",
- "11" => "Saint Thomas"
- ),
- "BD" => array(
- "81" => "Dhaka",
- "82" => "Khulna",
- "83" => "Rajshahi",
- "84" => "Chittagong",
- "85" => "Barisal",
- "86" => "Sylhet"
- ),
- "BE" => array(
- "01" => "Antwerpen",
- "03" => "Hainaut",
- "04" => "Liege",
- "05" => "Limburg",
- "06" => "Luxembourg",
- "07" => "Namur",
- "08" => "Oost-Vlaanderen",
- "09" => "West-Vlaanderen",
- "10" => "Brabant Wallon",
- "11" => "Brussels Hoofdstedelijk Gewest",
- "12" => "Vlaams-Brabant",
- "13" => "Flanders",
- "14" => "Wallonia"
- ),
- "BF" => array(
- "15" => "Bam",
- "19" => "Boulkiemde",
- "20" => "Ganzourgou",
- "21" => "Gnagna",
- "28" => "Kouritenga",
- "33" => "Oudalan",
- "34" => "Passore",
- "36" => "Sanguie",
- "40" => "Soum",
- "42" => "Tapoa",
- "44" => "Zoundweogo",
- "45" => "Bale",
- "46" => "Banwa",
- "47" => "Bazega",
- "48" => "Bougouriba",
- "49" => "Boulgou",
- "50" => "Gourma",
- "51" => "Houet",
- "52" => "Ioba",
- "53" => "Kadiogo",
- "54" => "Kenedougou",
- "55" => "Komoe",
- "56" => "Komondjari",
- "57" => "Kompienga",
- "58" => "Kossi",
- "59" => "Koulpelogo",
- "60" => "Kourweogo",
- "61" => "Leraba",
- "62" => "Loroum",
- "63" => "Mouhoun",
- "64" => "Namentenga",
- "65" => "Naouri",
- "66" => "Nayala",
- "67" => "Noumbiel",
- "68" => "Oubritenga",
- "69" => "Poni",
- "70" => "Sanmatenga",
- "71" => "Seno",
- "72" => "Sissili",
- "73" => "Sourou",
- "74" => "Tuy",
- "75" => "Yagha",
- "76" => "Yatenga",
- "77" => "Ziro",
- "78" => "Zondoma"
- ),
- "BG" => array(
- "33" => "Mikhaylovgrad",
- "38" => "Blagoevgrad",
- "39" => "Burgas",
- "40" => "Dobrich",
- "41" => "Gabrovo",
- "42" => "Grad Sofiya",
- "43" => "Khaskovo",
- "44" => "Kurdzhali",
- "45" => "Kyustendil",
- "46" => "Lovech",
- "47" => "Montana",
- "48" => "Pazardzhik",
- "49" => "Pernik",
- "50" => "Pleven",
- "51" => "Plovdiv",
- "52" => "Razgrad",
- "53" => "Ruse",
- "54" => "Shumen",
- "55" => "Silistra",
- "56" => "Sliven",
- "57" => "Smolyan",
- "58" => "Sofiya",
- "59" => "Stara Zagora",
- "60" => "Turgovishte",
- "61" => "Varna",
- "62" => "Veliko Turnovo",
- "63" => "Vidin",
- "64" => "Vratsa",
- "65" => "Yambol"
- ),
- "BH" => array(
- "01" => "Al Hadd",
- "02" => "Al Manamah",
- "05" => "Jidd Hafs",
- "06" => "Sitrah",
- "08" => "Al Mintaqah al Gharbiyah",
- "09" => "Mintaqat Juzur Hawar",
- "10" => "Al Mintaqah ash Shamaliyah",
- "11" => "Al Mintaqah al Wusta",
- "12" => "Madinat",
- "13" => "Ar Rifa",
- "14" => "Madinat Hamad",
- "15" => "Al Muharraq",
- "16" => "Al Asimah",
- "17" => "Al Janubiyah",
- "18" => "Ash Shamaliyah",
- "19" => "Al Wusta"
- ),
- "BI" => array(
- "02" => "Bujumbura",
- "09" => "Bubanza",
- "10" => "Bururi",
- "11" => "Cankuzo",
- "12" => "Cibitoke",
- "13" => "Gitega",
- "14" => "Karuzi",
- "15" => "Kayanza",
- "16" => "Kirundo",
- "17" => "Makamba",
- "18" => "Muyinga",
- "19" => "Ngozi",
- "20" => "Rutana",
- "21" => "Ruyigi",
- "22" => "Muramvya",
- "23" => "Mwaro"
- ),
- "BJ" => array(
- "07" => "Alibori",
- "08" => "Atakora",
- "09" => "Atlanyique",
- "10" => "Borgou",
- "11" => "Collines",
- "12" => "Kouffo",
- "13" => "Donga",
- "14" => "Littoral",
- "15" => "Mono",
- "16" => "Oueme",
- "17" => "Plateau",
- "18" => "Zou"
- ),
- "BM" => array(
- "01" => "Devonshire",
- "02" => "Hamilton",
- "03" => "Hamilton",
- "04" => "Paget",
- "05" => "Pembroke",
- "06" => "Saint George",
- "07" => "Saint George's",
- "08" => "Sandys",
- "09" => "Smiths",
- "10" => "Southampton",
- "11" => "Warwick"
- ),
- "BN" => array(
- "07" => "Alibori",
- "08" => "Belait",
- "09" => "Brunei and Muara",
- "10" => "Temburong",
- "11" => "Collines",
- "12" => "Kouffo",
- "13" => "Donga",
- "14" => "Littoral",
- "15" => "Tutong",
- "16" => "Oueme",
- "17" => "Plateau",
- "18" => "Zou"
- ),
- "BO" => array(
- "01" => "Chuquisaca",
- "02" => "Cochabamba",
- "03" => "El Beni",
- "04" => "La Paz",
- "05" => "Oruro",
- "06" => "Pando",
- "07" => "Potosi",
- "08" => "Santa Cruz",
- "09" => "Tarija"
- ),
- "BR" => array(
- "01" => "Acre",
- "02" => "Alagoas",
- "03" => "Amapa",
- "04" => "Amazonas",
- "05" => "Bahia",
- "06" => "Ceara",
- "07" => "Distrito Federal",
- "08" => "Espirito Santo",
- "11" => "Mato Grosso do Sul",
- "13" => "Maranhao",
- "14" => "Mato Grosso",
- "15" => "Minas Gerais",
- "16" => "Para",
- "17" => "Paraiba",
- "18" => "Parana",
- "20" => "Piaui",
- "21" => "Rio de Janeiro",
- "22" => "Rio Grande do Norte",
- "23" => "Rio Grande do Sul",
- "24" => "Rondonia",
- "25" => "Roraima",
- "26" => "Santa Catarina",
- "27" => "Sao Paulo",
- "28" => "Sergipe",
- "29" => "Goias",
- "30" => "Pernambuco",
- "31" => "Tocantins"
- ),
- "BS" => array(
- "05" => "Bimini",
- "06" => "Cat Island",
- "10" => "Exuma",
- "13" => "Inagua",
- "15" => "Long Island",
- "16" => "Mayaguana",
- "18" => "Ragged Island",
- "22" => "Harbour Island",
- "23" => "New Providence",
- "24" => "Acklins and Crooked Islands",
- "25" => "Freeport",
- "26" => "Fresh Creek",
- "27" => "Governor's Harbour",
- "28" => "Green Turtle Cay",
- "29" => "High Rock",
- "30" => "Kemps Bay",
- "31" => "Marsh Harbour",
- "32" => "Nichollstown and Berry Islands",
- "33" => "Rock Sound",
- "34" => "Sandy Point",
- "35" => "San Salvador and Rum Cay"
- ),
- "BT" => array(
- "05" => "Bumthang",
- "06" => "Chhukha",
- "07" => "Chirang",
- "08" => "Daga",
- "09" => "Geylegphug",
- "10" => "Ha",
- "11" => "Lhuntshi",
- "12" => "Mongar",
- "13" => "Paro",
- "14" => "Pemagatsel",
- "15" => "Punakha",
- "16" => "Samchi",
- "17" => "Samdrup",
- "18" => "Shemgang",
- "19" => "Tashigang",
- "20" => "Thimphu",
- "21" => "Tongsa",
- "22" => "Wangdi Phodrang"
- ),
- "BW" => array(
- "01" => "Central",
- "03" => "Ghanzi",
- "04" => "Kgalagadi",
- "05" => "Kgatleng",
- "06" => "Kweneng",
- "08" => "North-East",
- "09" => "South-East",
- "10" => "Southern",
- "11" => "North-West"
- ),
- "BY" => array(
- "01" => "Brestskaya Voblasts'",
- "02" => "Homyel'skaya Voblasts'",
- "03" => "Hrodzyenskaya Voblasts'",
- "04" => "Minsk",
- "05" => "Minskaya Voblasts'",
- "06" => "Mahilyowskaya Voblasts'",
- "07" => "Vitsyebskaya Voblasts'"
- ),
- "BZ" => array(
- "01" => "Belize",
- "02" => "Cayo",
- "03" => "Corozal",
- "04" => "Orange Walk",
- "05" => "Stann Creek",
- "06" => "Toledo"
- ),
- "CA" => array(
- "AB" => "Alberta",
- "BC" => "British Columbia",
- "MB" => "Manitoba",
- "NB" => "New Brunswick",
- "NL" => "Newfoundland",
- "NS" => "Nova Scotia",
- "NT" => "Northwest Territories",
- "NU" => "Nunavut",
- "ON" => "Ontario",
- "PE" => "Prince Edward Island",
- "QC" => "Quebec",
- "SK" => "Saskatchewan",
- "YT" => "Yukon Territory"
- ),
- "CD" => array(
- "01" => "Bandundu",
- "02" => "Equateur",
- "04" => "Kasai-Oriental",
- "05" => "Katanga",
- "06" => "Kinshasa",
- "08" => "Bas-Congo",
- "09" => "Orientale",
- "10" => "Maniema",
- "11" => "Nord-Kivu",
- "12" => "Sud-Kivu"
- ),
- "CF" => array(
- "01" => "Bamingui-Bangoran",
- "02" => "Basse-Kotto",
- "03" => "Haute-Kotto",
- "04" => "Mambere-Kadei",
- "05" => "Haut-Mbomou",
- "06" => "Kemo",
- "07" => "Lobaye",
- "08" => "Mbomou",
- "09" => "Nana-Mambere",
- "11" => "Ouaka",
- "12" => "Ouham",
- "13" => "Ouham-Pende",
- "14" => "Cuvette-Ouest",
- "15" => "Nana-Grebizi",
- "16" => "Sangha-Mbaere",
- "17" => "Ombella-Mpoko",
- "18" => "Bangui"
- ),
- "CG" => array(
- "01" => "Bouenza",
- "04" => "Kouilou",
- "05" => "Lekoumou",
- "06" => "Likouala",
- "07" => "Niari",
- "08" => "Plateaux",
- "10" => "Sangha",
- "11" => "Pool",
- "12" => "Brazzaville",
- "13" => "Cuvette",
- "14" => "Cuvette-Ouest"
- ),
- "CH" => array(
- "01" => "Aargau",
- "02" => "Ausser-Rhoden",
- "03" => "Basel-Landschaft",
- "04" => "Basel-Stadt",
- "05" => "Bern",
- "06" => "Fribourg",
- "07" => "Geneve",
- "08" => "Glarus",
- "09" => "Graubunden",
- "10" => "Inner-Rhoden",
- "11" => "Luzern",
- "12" => "Neuchatel",
- "13" => "Nidwalden",
- "14" => "Obwalden",
- "15" => "Sankt Gallen",
- "16" => "Schaffhausen",
- "17" => "Schwyz",
- "18" => "Solothurn",
- "19" => "Thurgau",
- "20" => "Ticino",
- "21" => "Uri",
- "22" => "Valais",
- "23" => "Vaud",
- "24" => "Zug",
- "25" => "Zurich",
- "26" => "Jura"
- ),
- "CI" => array(
- "74" => "Agneby",
- "75" => "Bafing",
- "76" => "Bas-Sassandra",
- "77" => "Denguele",
- "78" => "Dix-Huit Montagnes",
- "79" => "Fromager",
- "80" => "Haut-Sassandra",
- "81" => "Lacs",
- "82" => "Lagunes",
- "83" => "Marahoue",
- "84" => "Moyen-Cavally",
- "85" => "Moyen-Comoe",
- "86" => "N'zi-Comoe",
- "87" => "Savanes",
- "88" => "Sud-Bandama",
- "89" => "Sud-Comoe",
- "90" => "Vallee du Bandama",
- "91" => "Worodougou",
- "92" => "Zanzan"
- ),
- "CL" => array(
- "01" => "Valparaiso",
- "02" => "Aisen del General Carlos Ibanez del Campo",
- "03" => "Antofagasta",
- "04" => "Araucania",
- "05" => "Atacama",
- "06" => "Bio-Bio",
- "07" => "Coquimbo",
- "08" => "Libertador General Bernardo O'Higgins",
- "09" => "Los Lagos",
- "10" => "Magallanes y de la Antartica Chilena",
- "11" => "Maule",
- "12" => "Region Metropolitana",
- "13" => "Tarapaca",
- "14" => "Los Lagos",
- "15" => "Tarapaca",
- "16" => "Arica y Parinacota",
- "17" => "Los Rios"
- ),
- "CM" => array(
- "04" => "Est",
- "05" => "Littoral",
- "07" => "Nord-Ouest",
- "08" => "Ouest",
- "09" => "Sud-Ouest",
- "10" => "Adamaoua",
- "11" => "Centre",
- "12" => "Extreme-Nord",
- "13" => "Nord",
- "14" => "Sud"
- ),
- "CN" => array(
- "01" => "Anhui",
- "02" => "Zhejiang",
- "03" => "Jiangxi",
- "04" => "Jiangsu",
- "05" => "Jilin",
- "06" => "Qinghai",
- "07" => "Fujian",
- "08" => "Heilongjiang",
- "09" => "Henan",
- "10" => "Hebei",
- "11" => "Hunan",
- "12" => "Hubei",
- "13" => "Xinjiang",
- "14" => "Xizang",
- "15" => "Gansu",
- "16" => "Guangxi",
- "18" => "Guizhou",
- "19" => "Liaoning",
- "20" => "Nei Mongol",
- "21" => "Ningxia",
- "22" => "Beijing",
- "23" => "Shanghai",
- "24" => "Shanxi",
- "25" => "Shandong",
- "26" => "Shaanxi",
- "28" => "Tianjin",
- "29" => "Yunnan",
- "30" => "Guangdong",
- "31" => "Hainan",
- "32" => "Sichuan",
- "33" => "Chongqing"
- ),
- "CO" => array(
- "01" => "Amazonas",
- "02" => "Antioquia",
- "03" => "Arauca",
- "04" => "Atlantico",
- "08" => "Caqueta",
- "09" => "Cauca",
- "10" => "Cesar",
- "11" => "Choco",
- "12" => "Cordoba",
- "14" => "Guaviare",
- "15" => "Guainia",
- "16" => "Huila",
- "17" => "La Guajira",
- "19" => "Meta",
- "20" => "Narino",
- "21" => "Norte de Santander",
- "22" => "Putumayo",
- "23" => "Quindio",
- "24" => "Risaralda",
- "25" => "San Andres y Providencia",
- "26" => "Santander",
- "27" => "Sucre",
- "28" => "Tolima",
- "29" => "Valle del Cauca",
- "30" => "Vaupes",
- "31" => "Vichada",
- "32" => "Casanare",
- "33" => "Cundinamarca",
- "34" => "Distrito Especial",
- "35" => "Bolivar",
- "36" => "Boyaca",
- "37" => "Caldas",
- "38" => "Magdalena"
- ),
- "CR" => array(
- "01" => "Alajuela",
- "02" => "Cartago",
- "03" => "Guanacaste",
- "04" => "Heredia",
- "06" => "Limon",
- "07" => "Puntarenas",
- "08" => "San Jose"
- ),
- "CU" => array(
- "01" => "Pinar del Rio",
- "02" => "Ciudad de la Habana",
- "03" => "Matanzas",
- "04" => "Isla de la Juventud",
- "05" => "Camaguey",
- "07" => "Ciego de Avila",
- "08" => "Cienfuegos",
- "09" => "Granma",
- "10" => "Guantanamo",
- "11" => "La Habana",
- "12" => "Holguin",
- "13" => "Las Tunas",
- "14" => "Sancti Spiritus",
- "15" => "Santiago de Cuba",
- "16" => "Villa Clara"
- ),
- "CV" => array(
- "01" => "Boa Vista",
- "02" => "Brava",
- "04" => "Maio",
- "05" => "Paul",
- "07" => "Ribeira Grande",
- "08" => "Sal",
- "10" => "Sao Nicolau",
- "11" => "Sao Vicente",
- "13" => "Mosteiros",
- "14" => "Praia",
- "15" => "Santa Catarina",
- "16" => "Santa Cruz",
- "17" => "Sao Domingos",
- "18" => "Sao Filipe",
- "19" => "Sao Miguel",
- "20" => "Tarrafal"
- ),
- "CY" => array(
- "01" => "Famagusta",
- "02" => "Kyrenia",
- "03" => "Larnaca",
- "04" => "Nicosia",
- "05" => "Limassol",
- "06" => "Paphos"
- ),
- "CZ" => array(
- "52" => "Hlavni mesto Praha",
- "78" => "Jihomoravsky kraj",
- "79" => "Jihocesky kraj",
- "80" => "Vysocina",
- "81" => "Karlovarsky kraj",
- "82" => "Kralovehradecky kraj",
- "83" => "Liberecky kraj",
- "84" => "Olomoucky kraj",
- "85" => "Moravskoslezsky kraj",
- "86" => "Pardubicky kraj",
- "87" => "Plzensky kraj",
- "88" => "Stredocesky kraj",
- "89" => "Ustecky kraj",
- "90" => "Zlinsky kraj"
- ),
- "DE" => array(
- "01" => "Baden-Wurttemberg",
- "02" => "Bayern",
- "03" => "Bremen",
- "04" => "Hamburg",
- "05" => "Hessen",
- "06" => "Niedersachsen",
- "07" => "Nordrhein-Westfalen",
- "08" => "Rheinland-Pfalz",
- "09" => "Saarland",
- "10" => "Schleswig-Holstein",
- "11" => "Brandenburg",
- "12" => "Mecklenburg-Vorpommern",
- "13" => "Sachsen",
- "14" => "Sachsen-Anhalt",
- "15" => "Thuringen",
- "16" => "Berlin"
- ),
- "DJ" => array(
- "01" => "Ali Sabieh",
- "04" => "Obock",
- "05" => "Tadjoura",
- "06" => "Dikhil",
- "07" => "Djibouti",
- "08" => "Arta"
- ),
- "DK" => array(
- "17" => "Hovedstaden",
- "18" => "Midtjylland",
- "19" => "Nordjylland",
- "20" => "Sjelland",
- "21" => "Syddanmark"
- ),
- "DM" => array(
- "02" => "Saint Andrew",
- "03" => "Saint David",
- "04" => "Saint George",
- "05" => "Saint John",
- "06" => "Saint Joseph",
- "07" => "Saint Luke",
- "08" => "Saint Mark",
- "09" => "Saint Patrick",
- "10" => "Saint Paul",
- "11" => "Saint Peter"
- ),
- "DO" => array(
- "01" => "Azua",
- "02" => "Baoruco",
- "03" => "Barahona",
- "04" => "Dajabon",
- "05" => "Distrito Nacional",
- "06" => "Duarte",
- "08" => "Espaillat",
- "09" => "Independencia",
- "10" => "La Altagracia",
- "11" => "Elias Pina",
- "12" => "La Romana",
- "14" => "Maria Trinidad Sanchez",
- "15" => "Monte Cristi",
- "16" => "Pedernales",
- "17" => "Peravia",
- "18" => "Puerto Plata",
- "19" => "Salcedo",
- "20" => "Samana",
- "21" => "Sanchez Ramirez",
- "23" => "San Juan",
- "24" => "San Pedro De Macoris",
- "25" => "Santiago",
- "26" => "Santiago Rodriguez",
- "27" => "Valverde",
- "28" => "El Seibo",
- "29" => "Hato Mayor",
- "30" => "La Vega",
- "31" => "Monsenor Nouel",
- "32" => "Monte Plata",
- "33" => "San Cristobal",
- "34" => "Distrito Nacional",
- "35" => "Peravia",
- "36" => "San Jose de Ocoa",
- "37" => "Santo Domingo"
- ),
- "DZ" => array(
- "01" => "Alger",
- "03" => "Batna",
- "04" => "Constantine",
- "06" => "Medea",
- "07" => "Mostaganem",
- "09" => "Oran",
- "10" => "Saida",
- "12" => "Setif",
- "13" => "Tiaret",
- "14" => "Tizi Ouzou",
- "15" => "Tlemcen",
- "18" => "Bejaia",
- "19" => "Biskra",
- "20" => "Blida",
- "21" => "Bouira",
- "22" => "Djelfa",
- "23" => "Guelma",
- "24" => "Jijel",
- "25" => "Laghouat",
- "26" => "Mascara",
- "27" => "M'sila",
- "29" => "Oum el Bouaghi",
- "30" => "Sidi Bel Abbes",
- "31" => "Skikda",
- "33" => "Tebessa",
- "34" => "Adrar",
- "35" => "Ain Defla",
- "36" => "Ain Temouchent",
- "37" => "Annaba",
- "38" => "Bechar",
- "39" => "Bordj Bou Arreridj",
- "40" => "Boumerdes",
- "41" => "Chlef",
- "42" => "El Bayadh",
- "43" => "El Oued",
- "44" => "El Tarf",
- "45" => "Ghardaia",
- "46" => "Illizi",
- "47" => "Khenchela",
- "48" => "Mila",
- "49" => "Naama",
- "50" => "Ouargla",
- "51" => "Relizane",
- "52" => "Souk Ahras",
- "53" => "Tamanghasset",
- "54" => "Tindouf",
- "55" => "Tipaza",
- "56" => "Tissemsilt"
- ),
- "EC" => array(
- "01" => "Galapagos",
- "02" => "Azuay",
- "03" => "Bolivar",
- "04" => "Canar",
- "05" => "Carchi",
- "06" => "Chimborazo",
- "07" => "Cotopaxi",
- "08" => "El Oro",
- "09" => "Esmeraldas",
- "10" => "Guayas",
- "11" => "Imbabura",
- "12" => "Loja",
- "13" => "Los Rios",
- "14" => "Manabi",
- "15" => "Morona-Santiago",
- "17" => "Pastaza",
- "18" => "Pichincha",
- "19" => "Tungurahua",
- "20" => "Zamora-Chinchipe",
- "22" => "Sucumbios",
- "23" => "Napo",
- "24" => "Orellana"
- ),
- "EE" => array(
- "01" => "Harjumaa",
- "02" => "Hiiumaa",
- "03" => "Ida-Virumaa",
- "04" => "Jarvamaa",
- "05" => "Jogevamaa",
- "06" => "Kohtla-Jarve",
- "07" => "Laanemaa",
- "08" => "Laane-Virumaa",
- "09" => "Narva",
- "10" => "Parnu",
- "11" => "Parnumaa",
- "12" => "Polvamaa",
- "13" => "Raplamaa",
- "14" => "Saaremaa",
- "15" => "Sillamae",
- "16" => "Tallinn",
- "17" => "Tartu",
- "18" => "Tartumaa",
- "19" => "Valgamaa",
- "20" => "Viljandimaa",
- "21" => "Vorumaa"
- ),
- "EG" => array(
- "01" => "Ad Daqahliyah",
- "02" => "Al Bahr al Ahmar",
- "03" => "Al Buhayrah",
- "04" => "Al Fayyum",
- "05" => "Al Gharbiyah",
- "06" => "Al Iskandariyah",
- "07" => "Al Isma'iliyah",
- "08" => "Al Jizah",
- "09" => "Al Minufiyah",
- "10" => "Al Minya",
- "11" => "Al Qahirah",
- "12" => "Al Qalyubiyah",
- "13" => "Al Wadi al Jadid",
- "14" => "Ash Sharqiyah",
- "15" => "As Suways",
- "16" => "Aswan",
- "17" => "Asyut",
- "18" => "Bani Suwayf",
- "19" => "Bur Sa'id",
- "20" => "Dumyat",
- "21" => "Kafr ash Shaykh",
- "22" => "Matruh",
- "23" => "Qina",
- "24" => "Suhaj",
- "26" => "Janub Sina'",
- "27" => "Shamal Sina'"
- ),
- "ER" => array(
- "01" => "Anseba",
- "02" => "Debub",
- "03" => "Debubawi K'eyih Bahri",
- "04" => "Gash Barka",
- "05" => "Ma'akel",
- "06" => "Semenawi K'eyih Bahri"
- ),
- "ES" => array(
- "07" => "Islas Baleares",
- "27" => "La Rioja",
- "29" => "Madrid",
- "31" => "Murcia",
- "32" => "Navarra",
- "34" => "Asturias",
- "39" => "Cantabria",
- "51" => "Andalucia",
- "52" => "Aragon",
- "53" => "Canarias",
- "54" => "Castilla-La Mancha",
- "55" => "Castilla y Leon",
- "56" => "Catalonia",
- "57" => "Extremadura",
- "58" => "Galicia",
- "59" => "Pais Vasco",
- "60" => "Comunidad Valenciana"
- ),
- "ET" => array(
- "44" => "Adis Abeba",
- "45" => "Afar",
- "46" => "Amara",
- "47" => "Binshangul Gumuz",
- "48" => "Dire Dawa",
- "49" => "Gambela Hizboch",
- "50" => "Hareri Hizb",
- "51" => "Oromiya",
- "52" => "Sumale",
- "53" => "Tigray",
- "54" => "YeDebub Biheroch Bihereseboch na Hizboch"
- ),
- "FI" => array(
- "01" => "Aland",
- "06" => "Lapland",
- "08" => "Oulu",
- "13" => "Southern Finland",
- "14" => "Eastern Finland",
- "15" => "Western Finland"
- ),
- "FJ" => array(
- "01" => "Central",
- "02" => "Eastern",
- "03" => "Northern",
- "04" => "Rotuma",
- "05" => "Western"
- ),
- "FM" => array(
- "01" => "Kosrae",
- "02" => "Pohnpei",
- "03" => "Chuuk",
- "04" => "Yap"
- ),
- "FR" => array(
- "97" => "Aquitaine",
- "98" => "Auvergne",
- "99" => "Basse-Normandie",
- "A1" => "Bourgogne",
- "A2" => "Bretagne",
- "A3" => "Centre",
- "A4" => "Champagne-Ardenne",
- "A5" => "Corse",
- "A6" => "Franche-Comte",
- "A7" => "Haute-Normandie",
- "A8" => "Ile-de-France",
- "A9" => "Languedoc-Roussillon",
- "B1" => "Limousin",
- "B2" => "Lorraine",
- "B3" => "Midi-Pyrenees",
- "B4" => "Nord-Pas-de-Calais",
- "B5" => "Pays de la Loire",
- "B6" => "Picardie",
- "B7" => "Poitou-Charentes",
- "B8" => "Provence-Alpes-Cote d'Azur",
- "B9" => "Rhone-Alpes",
- "C1" => "Alsace"
- ),
- "GA" => array(
- "01" => "Estuaire",
- "02" => "Haut-Ogooue",
- "03" => "Moyen-Ogooue",
- "04" => "Ngounie",
- "05" => "Nyanga",
- "06" => "Ogooue-Ivindo",
- "07" => "Ogooue-Lolo",
- "08" => "Ogooue-Maritime",
- "09" => "Woleu-Ntem"
- ),
- "GB" => array(
- "A1" => "Barking and Dagenham",
- "A2" => "Barnet",
- "A3" => "Barnsley",
- "A4" => "Bath and North East Somerset",
- "A5" => "Bedfordshire",
- "A6" => "Bexley",
- "A7" => "Birmingham",
- "A8" => "Blackburn with Darwen",
- "A9" => "Blackpool",
- "B1" => "Bolton",
- "B2" => "Bournemouth",
- "B3" => "Bracknell Forest",
- "B4" => "Bradford",
- "B5" => "Brent",
- "B6" => "Brighton and Hove",
- "B7" => "Bristol, City of",
- "B8" => "Bromley",
- "B9" => "Buckinghamshire",
- "C1" => "Bury",
- "C2" => "Calderdale",
- "C3" => "Cambridgeshire",
- "C4" => "Camden",
- "C5" => "Cheshire",
- "C6" => "Cornwall",
- "C7" => "Coventry",
- "C8" => "Croydon",
- "C9" => "Cumbria",
- "D1" => "Darlington",
- "D2" => "Derby",
- "D3" => "Derbyshire",
- "D4" => "Devon",
- "D5" => "Doncaster",
- "D6" => "Dorset",
- "D7" => "Dudley",
- "D8" => "Durham",
- "D9" => "Ealing",
- "E1" => "East Riding of Yorkshire",
- "E2" => "East Sussex",
- "E3" => "Enfield",
- "E4" => "Essex",
- "E5" => "Gateshead",
- "E6" => "Gloucestershire",
- "E7" => "Greenwich",
- "E8" => "Hackney",
- "E9" => "Halton",
- "F1" => "Hammersmith and Fulham",
- "F2" => "Hampshire",
- "F3" => "Haringey",
- "F4" => "Harrow",
- "F5" => "Hartlepool",
- "F6" => "Havering",
- "F7" => "Herefordshire",
- "F8" => "Hertford",
- "F9" => "Hillingdon",
- "G1" => "Hounslow",
- "G2" => "Isle of Wight",
- "G3" => "Islington",
- "G4" => "Kensington and Chelsea",
- "G5" => "Kent",
- "G6" => "Kingston upon Hull, City of",
- "G7" => "Kingston upon Thames",
- "G8" => "Kirklees",
- "G9" => "Knowsley",
- "H1" => "Lambeth",
- "H2" => "Lancashire",
- "H3" => "Leeds",
- "H4" => "Leicester",
- "H5" => "Leicestershire",
- "H6" => "Lewisham",
- "H7" => "Lincolnshire",
- "H8" => "Liverpool",
- "H9" => "London, City of",
- "I1" => "Luton",
- "I2" => "Manchester",
- "I3" => "Medway",
- "I4" => "Merton",
- "I5" => "Middlesbrough",
- "I6" => "Milton Keynes",
- "I7" => "Newcastle upon Tyne",
- "I8" => "Newham",
- "I9" => "Norfolk",
- "J1" => "Northamptonshire",
- "J2" => "North East Lincolnshire",
- "J3" => "North Lincolnshire",
- "J4" => "North Somerset",
- "J5" => "North Tyneside",
- "J6" => "Northumberland",
- "J7" => "North Yorkshire",
- "J8" => "Nottingham",
- "J9" => "Nottinghamshire",
- "K1" => "Oldham",
- "K2" => "Oxfordshire",
- "K3" => "Peterborough",
- "K4" => "Plymouth",
- "K5" => "Poole",
- "K6" => "Portsmouth",
- "K7" => "Reading",
- "K8" => "Redbridge",
- "K9" => "Redcar and Cleveland",
- "L1" => "Richmond upon Thames",
- "L2" => "Rochdale",
- "L3" => "Rotherham",
- "L4" => "Rutland",
- "L5" => "Salford",
- "L6" => "Shropshire",
- "L7" => "Sandwell",
- "L8" => "Sefton",
- "L9" => "Sheffield",
- "M1" => "Slough",
- "M2" => "Solihull",
- "M3" => "Somerset",
- "M4" => "Southampton",
- "M5" => "Southend-on-Sea",
- "M6" => "South Gloucestershire",
- "M7" => "South Tyneside",
- "M8" => "Southwark",
- "M9" => "Staffordshire",
- "N1" => "St. Helens",
- "N2" => "Stockport",
- "N3" => "Stockton-on-Tees",
- "N4" => "Stoke-on-Trent",
- "N5" => "Suffolk",
- "N6" => "Sunderland",
- "N7" => "Surrey",
- "N8" => "Sutton",
- "N9" => "Swindon",
- "O1" => "Tameside",
- "O2" => "Telford and Wrekin",
- "O3" => "Thurrock",
- "O4" => "Torbay",
- "O5" => "Tower Hamlets",
- "O6" => "Trafford",
- "O7" => "Wakefield",
- "O8" => "Walsall",
- "O9" => "Waltham Forest",
- "P1" => "Wandsworth",
- "P2" => "Warrington",
- "P3" => "Warwickshire",
- "P4" => "West Berkshire",
- "P5" => "Westminster",
- "P6" => "West Sussex",
- "P7" => "Wigan",
- "P8" => "Wiltshire",
- "P9" => "Windsor and Maidenhead",
- "Q1" => "Wirral",
- "Q2" => "Wokingham",
- "Q3" => "Wolverhampton",
- "Q4" => "Worcestershire",
- "Q5" => "York",
- "Q6" => "Antrim",
- "Q7" => "Ards",
- "Q8" => "Armagh",
- "Q9" => "Ballymena",
- "R1" => "Ballymoney",
- "R2" => "Banbridge",
- "R3" => "Belfast",
- "R4" => "Carrickfergus",
- "R5" => "Castlereagh",
- "R6" => "Coleraine",
- "R7" => "Cookstown",
- "R8" => "Craigavon",
- "R9" => "Down",
- "S1" => "Dungannon",
- "S2" => "Fermanagh",
- "S3" => "Larne",
- "S4" => "Limavady",
- "S5" => "Lisburn",
- "S6" => "Derry",
- "S7" => "Magherafelt",
- "S8" => "Moyle",
- "S9" => "Newry and Mourne",
- "T1" => "Newtownabbey",
- "T2" => "North Down",
- "T3" => "Omagh",
- "T4" => "Strabane",
- "T5" => "Aberdeen City",
- "T6" => "Aberdeenshire",
- "T7" => "Angus",
- "T8" => "Argyll and Bute",
- "T9" => "Scottish Borders, The",
- "U1" => "Clackmannanshire",
- "U2" => "Dumfries and Galloway",
- "U3" => "Dundee City",
- "U4" => "East Ayrshire",
- "U5" => "East Dunbartonshire",
- "U6" => "East Lothian",
- "U7" => "East Renfrewshire",
- "U8" => "Edinburgh, City of",
- "U9" => "Falkirk",
- "V1" => "Fife",
- "V2" => "Glasgow City",
- "V3" => "Highland",
- "V4" => "Inverclyde",
- "V5" => "Midlothian",
- "V6" => "Moray",
- "V7" => "North Ayrshire",
- "V8" => "North Lanarkshire",
- "V9" => "Orkney",
- "W1" => "Perth and Kinross",
- "W2" => "Renfrewshire",
- "W3" => "Shetland Islands",
- "W4" => "South Ayrshire",
- "W5" => "South Lanarkshire",
- "W6" => "Stirling",
- "W7" => "West Dunbartonshire",
- "W8" => "Eilean Siar",
- "W9" => "West Lothian",
- "X1" => "Isle of Anglesey",
- "X2" => "Blaenau Gwent",
- "X3" => "Bridgend",
- "X4" => "Caerphilly",
- "X5" => "Cardiff",
- "X6" => "Ceredigion",
- "X7" => "Carmarthenshire",
- "X8" => "Conwy",
- "X9" => "Denbighshire",
- "Y1" => "Flintshire",
- "Y2" => "Gwynedd",
- "Y3" => "Merthyr Tydfil",
- "Y4" => "Monmouthshire",
- "Y5" => "Neath Port Talbot",
- "Y6" => "Newport",
- "Y7" => "Pembrokeshire",
- "Y8" => "Powys",
- "Y9" => "Rhondda Cynon Taff",
- "Z1" => "Swansea",
- "Z2" => "Torfaen",
- "Z3" => "Vale of Glamorgan, The",
- "Z4" => "Wrexham",
- "Z5" => "Bedfordshire",
- "Z6" => "Central Bedfordshire",
- "Z7" => "Cheshire East",
- "Z8" => "Cheshire West and Chester",
- "Z9" => "Isles of Scilly"
- ),
- "GD" => array(
- "01" => "Saint Andrew",
- "02" => "Saint David",
- "03" => "Saint George",
- "04" => "Saint John",
- "05" => "Saint Mark",
- "06" => "Saint Patrick"
- ),
- "GE" => array(
- "01" => "Abashis Raioni",
- "02" => "Abkhazia",
- "03" => "Adigenis Raioni",
- "04" => "Ajaria",
- "05" => "Akhalgoris Raioni",
- "06" => "Akhalk'alak'is Raioni",
- "07" => "Akhalts'ikhis Raioni",
- "08" => "Akhmetis Raioni",
- "09" => "Ambrolauris Raioni",
- "10" => "Aspindzis Raioni",
- "11" => "Baghdat'is Raioni",
- "12" => "Bolnisis Raioni",
- "13" => "Borjomis Raioni",
- "14" => "Chiat'ura",
- "15" => "Ch'khorotsqus Raioni",
- "16" => "Ch'okhatauris Raioni",
- "17" => "Dedop'listsqaros Raioni",
- "18" => "Dmanisis Raioni",
- "19" => "Dushet'is Raioni",
- "20" => "Gardabanis Raioni",
- "21" => "Gori",
- "22" => "Goris Raioni",
- "23" => "Gurjaanis Raioni",
- "24" => "Javis Raioni",
- "25" => "K'arelis Raioni",
- "26" => "Kaspis Raioni",
- "27" => "Kharagaulis Raioni",
- "28" => "Khashuris Raioni",
- "29" => "Khobis Raioni",
- "30" => "Khonis Raioni",
- "31" => "K'ut'aisi",
- "32" => "Lagodekhis Raioni",
- "33" => "Lanch'khut'is Raioni",
- "34" => "Lentekhis Raioni",
- "35" => "Marneulis Raioni",
- "36" => "Martvilis Raioni",
- "37" => "Mestiis Raioni",
- "38" => "Mts'khet'is Raioni",
- "39" => "Ninotsmindis Raioni",
- "40" => "Onis Raioni",
- "41" => "Ozurget'is Raioni",
- "42" => "P'ot'i",
- "43" => "Qazbegis Raioni",
- "44" => "Qvarlis Raioni",
- "45" => "Rust'avi",
- "46" => "Sach'kheris Raioni",
- "47" => "Sagarejos Raioni",
- "48" => "Samtrediis Raioni",
- "49" => "Senakis Raioni",
- "50" => "Sighnaghis Raioni",
- "51" => "T'bilisi",
- "52" => "T'elavis Raioni",
- "53" => "T'erjolis Raioni",
- "54" => "T'et'ritsqaros Raioni",
- "55" => "T'ianet'is Raioni",
- "56" => "Tqibuli",
- "57" => "Ts'ageris Raioni",
- "58" => "Tsalenjikhis Raioni",
- "59" => "Tsalkis Raioni",
- "60" => "Tsqaltubo",
- "61" => "Vanis Raioni",
- "62" => "Zestap'onis Raioni",
- "63" => "Zugdidi",
- "64" => "Zugdidis Raioni"
- ),
- "GH" => array(
- "01" => "Greater Accra",
- "02" => "Ashanti",
- "03" => "Brong-Ahafo",
- "04" => "Central",
- "05" => "Eastern",
- "06" => "Northern",
- "08" => "Volta",
- "09" => "Western",
- "10" => "Upper East",
- "11" => "Upper West"
- ),
- "GL" => array(
- "01" => "Nordgronland",
- "02" => "Ostgronland",
- "03" => "Vestgronland"
- ),
- "GM" => array(
- "01" => "Banjul",
- "02" => "Lower River",
- "03" => "Central River",
- "04" => "Upper River",
- "05" => "Western",
- "07" => "North Bank"
- ),
- "GN" => array(
- "01" => "Beyla",
- "02" => "Boffa",
- "03" => "Boke",
- "04" => "Conakry",
- "05" => "Dabola",
- "06" => "Dalaba",
- "07" => "Dinguiraye",
- "09" => "Faranah",
- "10" => "Forecariah",
- "11" => "Fria",
- "12" => "Gaoual",
- "13" => "Gueckedou",
- "15" => "Kerouane",
- "16" => "Kindia",
- "17" => "Kissidougou",
- "18" => "Koundara",
- "19" => "Kouroussa",
- "21" => "Macenta",
- "22" => "Mali",
- "23" => "Mamou",
- "25" => "Pita",
- "27" => "Telimele",
- "28" => "Tougue",
- "29" => "Yomou",
- "30" => "Coyah",
- "31" => "Dubreka",
- "32" => "Kankan",
- "33" => "Koubia",
- "34" => "Labe",
- "35" => "Lelouma",
- "36" => "Lola",
- "37" => "Mandiana",
- "38" => "Nzerekore",
- "39" => "Siguiri"
- ),
- "GQ" => array(
- "03" => "Annobon",
- "04" => "Bioko Norte",
- "05" => "Bioko Sur",
- "06" => "Centro Sur",
- "07" => "Kie-Ntem",
- "08" => "Litoral",
- "09" => "Wele-Nzas"
- ),
- "GR" => array(
- "01" => "Evros",
- "02" => "Rodhopi",
- "03" => "Xanthi",
- "04" => "Drama",
- "05" => "Serrai",
- "06" => "Kilkis",
- "07" => "Pella",
- "08" => "Florina",
- "09" => "Kastoria",
- "10" => "Grevena",
- "11" => "Kozani",
- "12" => "Imathia",
- "13" => "Thessaloniki",
- "14" => "Kavala",
- "15" => "Khalkidhiki",
- "16" => "Pieria",
- "17" => "Ioannina",
- "18" => "Thesprotia",
- "19" => "Preveza",
- "20" => "Arta",
- "21" => "Larisa",
- "22" => "Trikala",
- "23" => "Kardhitsa",
- "24" => "Magnisia",
- "25" => "Kerkira",
- "26" => "Levkas",
- "27" => "Kefallinia",
- "28" => "Zakinthos",
- "29" => "Fthiotis",
- "30" => "Evritania",
- "31" => "Aitolia kai Akarnania",
- "32" => "Fokis",
- "33" => "Voiotia",
- "34" => "Evvoia",
- "35" => "Attiki",
- "36" => "Argolis",
- "37" => "Korinthia",
- "38" => "Akhaia",
- "39" => "Ilia",
- "40" => "Messinia",
- "41" => "Arkadhia",
- "42" => "Lakonia",
- "43" => "Khania",
- "44" => "Rethimni",
- "45" => "Iraklion",
- "46" => "Lasithi",
- "47" => "Dhodhekanisos",
- "48" => "Samos",
- "49" => "Kikladhes",
- "50" => "Khios",
- "51" => "Lesvos"
- ),
- "GT" => array(
- "01" => "Alta Verapaz",
- "02" => "Baja Verapaz",
- "03" => "Chimaltenango",
- "04" => "Chiquimula",
- "05" => "El Progreso",
- "06" => "Escuintla",
- "07" => "Guatemala",
- "08" => "Huehuetenango",
- "09" => "Izabal",
- "10" => "Jalapa",
- "11" => "Jutiapa",
- "12" => "Peten",
- "13" => "Quetzaltenango",
- "14" => "Quiche",
- "15" => "Retalhuleu",
- "16" => "Sacatepequez",
- "17" => "San Marcos",
- "18" => "Santa Rosa",
- "19" => "Solola",
- "20" => "Suchitepequez",
- "21" => "Totonicapan",
- "22" => "Zacapa"
- ),
- "GW" => array(
- "01" => "Bafata",
- "02" => "Quinara",
- "04" => "Oio",
- "05" => "Bolama",
- "06" => "Cacheu",
- "07" => "Tombali",
- "10" => "Gabu",
- "11" => "Bissau",
- "12" => "Biombo"
- ),
- "GY" => array(
- "10" => "Barima-Waini",
- "11" => "Cuyuni-Mazaruni",
- "12" => "Demerara-Mahaica",
- "13" => "East Berbice-Corentyne",
- "14" => "Essequibo Islands-West Demerara",
- "15" => "Mahaica-Berbice",
- "16" => "Pomeroon-Supenaam",
- "17" => "Potaro-Siparuni",
- "18" => "Upper Demerara-Berbice",
- "19" => "Upper Takutu-Upper Essequibo"
- ),
- "HN" => array(
- "01" => "Atlantida",
- "02" => "Choluteca",
- "03" => "Colon",
- "04" => "Comayagua",
- "05" => "Copan",
- "06" => "Cortes",
- "07" => "El Paraiso",
- "08" => "Francisco Morazan",
- "09" => "Gracias a Dios",
- "10" => "Intibuca",
- "11" => "Islas de la Bahia",
- "12" => "La Paz",
- "13" => "Lempira",
- "14" => "Ocotepeque",
- "15" => "Olancho",
- "16" => "Santa Barbara",
- "17" => "Valle",
- "18" => "Yoro"
- ),
- "HR" => array(
- "01" => "Bjelovarsko-Bilogorska",
- "02" => "Brodsko-Posavska",
- "03" => "Dubrovacko-Neretvanska",
- "04" => "Istarska",
- "05" => "Karlovacka",
- "06" => "Koprivnicko-Krizevacka",
- "07" => "Krapinsko-Zagorska",
- "08" => "Licko-Senjska",
- "09" => "Medimurska",
- "10" => "Osjecko-Baranjska",
- "11" => "Pozesko-Slavonska",
- "12" => "Primorsko-Goranska",
- "13" => "Sibensko-Kninska",
- "14" => "Sisacko-Moslavacka",
- "15" => "Splitsko-Dalmatinska",
- "16" => "Varazdinska",
- "17" => "Viroviticko-Podravska",
- "18" => "Vukovarsko-Srijemska",
- "19" => "Zadarska",
- "20" => "Zagrebacka",
- "21" => "Grad Zagreb"
- ),
- "HT" => array(
- "03" => "Nord-Ouest",
- "06" => "Artibonite",
- "07" => "Centre",
- "09" => "Nord",
- "10" => "Nord-Est",
- "11" => "Ouest",
- "12" => "Sud",
- "13" => "Sud-Est",
- "14" => "Grand' Anse",
- "15" => "Nippes"
- ),
- "HU" => array(
- "01" => "Bacs-Kiskun",
- "02" => "Baranya",
- "03" => "Bekes",
- "04" => "Borsod-Abauj-Zemplen",
- "05" => "Budapest",
- "06" => "Csongrad",
- "07" => "Debrecen",
- "08" => "Fejer",
- "09" => "Gyor-Moson-Sopron",
- "10" => "Hajdu-Bihar",
- "11" => "Heves",
- "12" => "Komarom-Esztergom",
- "13" => "Miskolc",
- "14" => "Nograd",
- "15" => "Pecs",
- "16" => "Pest",
- "17" => "Somogy",
- "18" => "Szabolcs-Szatmar-Bereg",
- "19" => "Szeged",
- "20" => "Jasz-Nagykun-Szolnok",
- "21" => "Tolna",
- "22" => "Vas",
- "23" => "Veszprem",
- "24" => "Zala",
- "25" => "Gyor",
- "26" => "Bekescsaba",
- "27" => "Dunaujvaros",
- "28" => "Eger",
- "29" => "Hodmezovasarhely",
- "30" => "Kaposvar",
- "31" => "Kecskemet",
- "32" => "Nagykanizsa",
- "33" => "Nyiregyhaza",
- "34" => "Sopron",
- "35" => "Szekesfehervar",
- "36" => "Szolnok",
- "37" => "Szombathely",
- "38" => "Tatabanya",
- "39" => "Veszprem",
- "40" => "Zalaegerszeg",
- "41" => "Salgotarjan",
- "42" => "Szekszard",
- "43" => "Erd"
- ),
- "ID" => array(
- "01" => "Aceh",
- "02" => "Bali",
- "03" => "Bengkulu",
- "04" => "Jakarta Raya",
- "05" => "Jambi",
- "07" => "Jawa Tengah",
- "08" => "Jawa Timur",
- "10" => "Yogyakarta",
- "11" => "Kalimantan Barat",
- "12" => "Kalimantan Selatan",
- "13" => "Kalimantan Tengah",
- "14" => "Kalimantan Timur",
- "15" => "Lampung",
- "17" => "Nusa Tenggara Barat",
- "18" => "Nusa Tenggara Timur",
- "21" => "Sulawesi Tengah",
- "22" => "Sulawesi Tenggara",
- "24" => "Sumatera Barat",
- "26" => "Sumatera Utara",
- "28" => "Maluku",
- "29" => "Maluku Utara",
- "30" => "Jawa Barat",
- "31" => "Sulawesi Utara",
- "32" => "Sumatera Selatan",
- "33" => "Banten",
- "34" => "Gorontalo",
- "35" => "Kepulauan Bangka Belitung",
- "36" => "Papua",
- "37" => "Riau",
- "38" => "Sulawesi Selatan",
- "39" => "Irian Jaya Barat",
- "40" => "Kepulauan Riau",
- "41" => "Sulawesi Barat"
- ),
- "IE" => array(
- "01" => "Carlow",
- "02" => "Cavan",
- "03" => "Clare",
- "04" => "Cork",
- "06" => "Donegal",
- "07" => "Dublin",
- "10" => "Galway",
- "11" => "Kerry",
- "12" => "Kildare",
- "13" => "Kilkenny",
- "14" => "Leitrim",
- "15" => "Laois",
- "16" => "Limerick",
- "18" => "Longford",
- "19" => "Louth",
- "20" => "Mayo",
- "21" => "Meath",
- "22" => "Monaghan",
- "23" => "Offaly",
- "24" => "Roscommon",
- "25" => "Sligo",
- "26" => "Tipperary",
- "27" => "Waterford",
- "29" => "Westmeath",
- "30" => "Wexford",
- "31" => "Wicklow"
- ),
- "IL" => array(
- "01" => "HaDarom",
- "02" => "HaMerkaz",
- "03" => "HaZafon",
- "04" => "Hefa",
- "05" => "Tel Aviv",
- "06" => "Yerushalayim"
- ),
- "IN" => array(
- "01" => "Andaman and Nicobar Islands",
- "02" => "Andhra Pradesh",
- "03" => "Assam",
- "05" => "Chandigarh",
- "06" => "Dadra and Nagar Haveli",
- "07" => "Delhi",
- "09" => "Gujarat",
- "10" => "Haryana",
- "11" => "Himachal Pradesh",
- "12" => "Jammu and Kashmir",
- "13" => "Kerala",
- "14" => "Lakshadweep",
- "16" => "Maharashtra",
- "17" => "Manipur",
- "18" => "Meghalaya",
- "19" => "Karnataka",
- "20" => "Nagaland",
- "21" => "Orissa",
- "22" => "Puducherry",
- "23" => "Punjab",
- "24" => "Rajasthan",
- "25" => "Tamil Nadu",
- "26" => "Tripura",
- "28" => "West Bengal",
- "29" => "Sikkim",
- "30" => "Arunachal Pradesh",
- "31" => "Mizoram",
- "32" => "Daman and Diu",
- "33" => "Goa",
- "34" => "Bihar",
- "35" => "Madhya Pradesh",
- "36" => "Uttar Pradesh",
- "37" => "Chhattisgarh",
- "38" => "Jharkhand",
- "39" => "Uttarakhand"
- ),
- "IQ" => array(
- "01" => "Al Anbar",
- "02" => "Al Basrah",
- "03" => "Al Muthanna",
- "04" => "Al Qadisiyah",
- "05" => "As Sulaymaniyah",
- "06" => "Babil",
- "07" => "Baghdad",
- "08" => "Dahuk",
- "09" => "Dhi Qar",
- "10" => "Diyala",
- "11" => "Arbil",
- "12" => "Karbala'",
- "13" => "At Ta'mim",
- "14" => "Maysan",
- "15" => "Ninawa",
- "16" => "Wasit",
- "17" => "An Najaf",
- "18" => "Salah ad Din"
- ),
- "IR" => array(
- "01" => "Azarbayjan-e Bakhtari",
- "03" => "Chahar Mahall va Bakhtiari",
- "04" => "Sistan va Baluchestan",
- "05" => "Kohkiluyeh va Buyer Ahmadi",
- "07" => "Fars",
- "08" => "Gilan",
- "09" => "Hamadan",
- "10" => "Ilam",
- "11" => "Hormozgan",
- "12" => "Kerman",
- "13" => "Bakhtaran",
- "15" => "Khuzestan",
- "16" => "Kordestan",
- "17" => "Mazandaran",
- "18" => "Semnan Province",
- "19" => "Markazi",
- "21" => "Zanjan",
- "22" => "Bushehr",
- "23" => "Lorestan",
- "24" => "Markazi",
- "25" => "Semnan",
- "26" => "Tehran",
- "27" => "Zanjan",
- "28" => "Esfahan",
- "29" => "Kerman",
- "30" => "Khorasan",
- "31" => "Yazd",
- "32" => "Ardabil",
- "33" => "East Azarbaijan",
- "34" => "Markazi",
- "35" => "Mazandaran",
- "36" => "Zanjan",
- "37" => "Golestan",
- "38" => "Qazvin",
- "39" => "Qom",
- "40" => "Yazd",
- "41" => "Khorasan-e Janubi",
- "42" => "Khorasan-e Razavi",
- "43" => "Khorasan-e Shemali",
- "44" => "Alborz"
- ),
- "IS" => array(
- "03" => "Arnessysla",
- "05" => "Austur-Hunavatnssysla",
- "06" => "Austur-Skaftafellssysla",
- "07" => "Borgarfjardarsysla",
- "09" => "Eyjafjardarsysla",
- "10" => "Gullbringusysla",
- "15" => "Kjosarsysla",
- "17" => "Myrasysla",
- "20" => "Nordur-Mulasysla",
- "21" => "Nordur-Tingeyjarsysla",
- "23" => "Rangarvallasysla",
- "28" => "Skagafjardarsysla",
- "29" => "Snafellsnes- og Hnappadalssysla",
- "30" => "Strandasysla",
- "31" => "Sudur-Mulasysla",
- "32" => "Sudur-Tingeyjarsysla",
- "34" => "Vestur-Bardastrandarsysla",
- "35" => "Vestur-Hunavatnssysla",
- "36" => "Vestur-Isafjardarsysla",
- "37" => "Vestur-Skaftafellssysla",
- "38" => "Austurland",
- "39" => "Hofuoborgarsvaoio",
- "40" => "Norourland Eystra",
- "41" => "Norourland Vestra",
- "42" => "Suourland",
- "43" => "Suournes",
- "44" => "Vestfiroir",
- "45" => "Vesturland"
- ),
- "IT" => array(
- "01" => "Abruzzi",
- "02" => "Basilicata",
- "03" => "Calabria",
- "04" => "Campania",
- "05" => "Emilia-Romagna",
- "06" => "Friuli-Venezia Giulia",
- "07" => "Lazio",
- "08" => "Liguria",
- "09" => "Lombardia",
- "10" => "Marche",
- "11" => "Molise",
- "12" => "Piemonte",
- "13" => "Puglia",
- "14" => "Sardegna",
- "15" => "Sicilia",
- "16" => "Toscana",
- "17" => "Trentino-Alto Adige",
- "18" => "Umbria",
- "19" => "Valle d'Aosta",
- "20" => "Veneto"
- ),
- "JM" => array(
- "01" => "Clarendon",
- "02" => "Hanover",
- "04" => "Manchester",
- "07" => "Portland",
- "08" => "Saint Andrew",
- "09" => "Saint Ann",
- "10" => "Saint Catherine",
- "11" => "Saint Elizabeth",
- "12" => "Saint James",
- "13" => "Saint Mary",
- "14" => "Saint Thomas",
- "15" => "Trelawny",
- "16" => "Westmoreland",
- "17" => "Kingston"
- ),
- "JO" => array(
- "02" => "Al Balqa'",
- "09" => "Al Karak",
- "12" => "At Tafilah",
- "15" => "Al Mafraq",
- "16" => "Amman",
- "17" => "Az Zaraqa",
- "18" => "Irbid",
- "19" => "Ma'an",
- "20" => "Ajlun",
- "21" => "Al Aqabah",
- "22" => "Jarash",
- "23" => "Madaba"
- ),
- "JP" => array(
- "01" => "Aichi",
- "02" => "Akita",
- "03" => "Aomori",
- "04" => "Chiba",
- "05" => "Ehime",
- "06" => "Fukui",
- "07" => "Fukuoka",
- "08" => "Fukushima",
- "09" => "Gifu",
- "10" => "Gumma",
- "11" => "Hiroshima",
- "12" => "Hokkaido",
- "13" => "Hyogo",
- "14" => "Ibaraki",
- "15" => "Ishikawa",
- "16" => "Iwate",
- "17" => "Kagawa",
- "18" => "Kagoshima",
- "19" => "Kanagawa",
- "20" => "Kochi",
- "21" => "Kumamoto",
- "22" => "Kyoto",
- "23" => "Mie",
- "24" => "Miyagi",
- "25" => "Miyazaki",
- "26" => "Nagano",
- "27" => "Nagasaki",
- "28" => "Nara",
- "29" => "Niigata",
- "30" => "Oita",
- "31" => "Okayama",
- "32" => "Osaka",
- "33" => "Saga",
- "34" => "Saitama",
- "35" => "Shiga",
- "36" => "Shimane",
- "37" => "Shizuoka",
- "38" => "Tochigi",
- "39" => "Tokushima",
- "40" => "Tokyo",
- "41" => "Tottori",
- "42" => "Toyama",
- "43" => "Wakayama",
- "44" => "Yamagata",
- "45" => "Yamaguchi",
- "46" => "Yamanashi",
- "47" => "Okinawa"
- ),
- "KE" => array(
- "01" => "Central",
- "02" => "Coast",
- "03" => "Eastern",
- "05" => "Nairobi Area",
- "06" => "North-Eastern",
- "07" => "Nyanza",
- "08" => "Rift Valley",
- "09" => "Western"
- ),
- "KG" => array(
- "01" => "Bishkek",
- "02" => "Chuy",
- "03" => "Jalal-Abad",
- "04" => "Naryn",
- "05" => "Osh",
- "06" => "Talas",
- "07" => "Ysyk-Kol",
- "08" => "Osh",
- "09" => "Batken"
- ),
- "KH" => array(
- "01" => "Batdambang",
- "02" => "Kampong Cham",
- "03" => "Kampong Chhnang",
- "04" => "Kampong Speu",
- "05" => "Kampong Thum",
- "06" => "Kampot",
- "07" => "Kandal",
- "08" => "Koh Kong",
- "09" => "Kracheh",
- "10" => "Mondulkiri",
- "11" => "Phnum Penh",
- "12" => "Pursat",
- "13" => "Preah Vihear",
- "14" => "Prey Veng",
- "15" => "Ratanakiri Kiri",
- "16" => "Siem Reap",
- "17" => "Stung Treng",
- "18" => "Svay Rieng",
- "19" => "Takeo",
- "25" => "Banteay Meanchey",
- "29" => "Batdambang",
- "30" => "Pailin"
- ),
- "KI" => array(
- "01" => "Gilbert Islands",
- "02" => "Line Islands",
- "03" => "Phoenix Islands"
- ),
- "KM" => array(
- "01" => "Anjouan",
- "02" => "Grande Comore",
- "03" => "Moheli"
- ),
- "KN" => array(
- "01" => "Christ Church Nichola Town",
- "02" => "Saint Anne Sandy Point",
- "03" => "Saint George Basseterre",
- "04" => "Saint George Gingerland",
- "05" => "Saint James Windward",
- "06" => "Saint John Capisterre",
- "07" => "Saint John Figtree",
- "08" => "Saint Mary Cayon",
- "09" => "Saint Paul Capisterre",
- "10" => "Saint Paul Charlestown",
- "11" => "Saint Peter Basseterre",
- "12" => "Saint Thomas Lowland",
- "13" => "Saint Thomas Middle Island",
- "15" => "Trinity Palmetto Point"
- ),
- "KP" => array(
- "01" => "Chagang-do",
- "03" => "Hamgyong-namdo",
- "06" => "Hwanghae-namdo",
- "07" => "Hwanghae-bukto",
- "08" => "Kaesong-si",
- "09" => "Kangwon-do",
- "11" => "P'yongan-bukto",
- "12" => "P'yongyang-si",
- "13" => "Yanggang-do",
- "14" => "Namp'o-si",
- "15" => "P'yongan-namdo",
- "17" => "Hamgyong-bukto",
- "18" => "Najin Sonbong-si"
- ),
- "KR" => array(
- "01" => "Cheju-do",
- "03" => "Cholla-bukto",
- "05" => "Ch'ungch'ong-bukto",
- "06" => "Kangwon-do",
- "10" => "Pusan-jikhalsi",
- "11" => "Seoul-t'ukpyolsi",
- "12" => "Inch'on-jikhalsi",
- "13" => "Kyonggi-do",
- "14" => "Kyongsang-bukto",
- "15" => "Taegu-jikhalsi",
- "16" => "Cholla-namdo",
- "17" => "Ch'ungch'ong-namdo",
- "18" => "Kwangju-jikhalsi",
- "19" => "Taejon-jikhalsi",
- "20" => "Kyongsang-namdo",
- "21" => "Ulsan-gwangyoksi"
- ),
- "KW" => array(
- "01" => "Al Ahmadi",
- "02" => "Al Kuwayt",
- "05" => "Al Jahra",
- "07" => "Al Farwaniyah",
- "08" => "Hawalli",
- "09" => "Mubarak al Kabir"
- ),
- "KY" => array(
- "01" => "Creek",
- "02" => "Eastern",
- "03" => "Midland",
- "04" => "South Town",
- "05" => "Spot Bay",
- "06" => "Stake Bay",
- "07" => "West End",
- "08" => "Western"
- ),
- "KZ" => array(
- "01" => "Almaty",
- "02" => "Almaty City",
- "03" => "Aqmola",
- "04" => "Aqtobe",
- "05" => "Astana",
- "06" => "Atyrau",
- "07" => "West Kazakhstan",
- "08" => "Bayqonyr",
- "09" => "Mangghystau",
- "10" => "South Kazakhstan",
- "11" => "Pavlodar",
- "12" => "Qaraghandy",
- "13" => "Qostanay",
- "14" => "Qyzylorda",
- "15" => "East Kazakhstan",
- "16" => "North Kazakhstan",
- "17" => "Zhambyl"
- ),
- "LA" => array(
- "01" => "Attapu",
- "02" => "Champasak",
- "03" => "Houaphan",
- "04" => "Khammouan",
- "05" => "Louang Namtha",
- "07" => "Oudomxai",
- "08" => "Phongsali",
- "09" => "Saravan",
- "10" => "Savannakhet",
- "11" => "Vientiane",
- "13" => "Xaignabouri",
- "14" => "Xiangkhoang",
- "17" => "Louangphrabang"
- ),
- "LB" => array(
- "01" => "Beqaa",
- "02" => "Al Janub",
- "03" => "Liban-Nord",
- "04" => "Beyrouth",
- "05" => "Mont-Liban",
- "06" => "Liban-Sud",
- "07" => "Nabatiye",
- "08" => "Beqaa",
- "09" => "Liban-Nord",
- "10" => "Aakk,r",
- "11" => "Baalbek-Hermel"
- ),
- "LC" => array(
- "01" => "Anse-la-Raye",
- "02" => "Dauphin",
- "03" => "Castries",
- "04" => "Choiseul",
- "05" => "Dennery",
- "06" => "Gros-Islet",
- "07" => "Laborie",
- "08" => "Micoud",
- "09" => "Soufriere",
- "10" => "Vieux-Fort",
- "11" => "Praslin"
- ),
- "LI" => array(
- "01" => "Balzers",
- "02" => "Eschen",
- "03" => "Gamprin",
- "04" => "Mauren",
- "05" => "Planken",
- "06" => "Ruggell",
- "07" => "Schaan",
- "08" => "Schellenberg",
- "09" => "Triesen",
- "10" => "Triesenberg",
- "11" => "Vaduz",
- "21" => "Gbarpolu",
- "22" => "River Gee"
- ),
- "LK" => array(
- "29" => "Central",
- "30" => "North Central",
- "32" => "North Western",
- "33" => "Sabaragamuwa",
- "34" => "Southern",
- "35" => "Uva",
- "36" => "Western",
- "37" => "Eastern",
- "38" => "Northern"
- ),
- "LR" => array(
- "01" => "Bong",
- "04" => "Grand Cape Mount",
- "05" => "Lofa",
- "06" => "Maryland",
- "07" => "Monrovia",
- "09" => "Nimba",
- "10" => "Sino",
- "11" => "Grand Bassa",
- "12" => "Grand Cape Mount",
- "13" => "Maryland",
- "14" => "Montserrado",
- "17" => "Margibi",
- "18" => "River Cess",
- "19" => "Grand Gedeh",
- "20" => "Lofa",
- "21" => "Gbarpolu",
- "22" => "River Gee"
- ),
- "LS" => array(
- "10" => "Berea",
- "11" => "Butha-Buthe",
- "12" => "Leribe",
- "13" => "Mafeteng",
- "14" => "Maseru",
- "15" => "Mohales Hoek",
- "16" => "Mokhotlong",
- "17" => "Qachas Nek",
- "18" => "Quthing",
- "19" => "Thaba-Tseka"
- ),
- "LT" => array(
- "56" => "Alytaus Apskritis",
- "57" => "Kauno Apskritis",
- "58" => "Klaipedos Apskritis",
- "59" => "Marijampoles Apskritis",
- "60" => "Panevezio Apskritis",
- "61" => "Siauliu Apskritis",
- "62" => "Taurages Apskritis",
- "63" => "Telsiu Apskritis",
- "64" => "Utenos Apskritis",
- "65" => "Vilniaus Apskritis"
- ),
- "LU" => array(
- "01" => "Diekirch",
- "02" => "Grevenmacher",
- "03" => "Luxembourg"
- ),
- "LV" => array(
- "01" => "Aizkraukles",
- "02" => "Aluksnes",
- "03" => "Balvu",
- "04" => "Bauskas",
- "05" => "Cesu",
- "06" => "Daugavpils",
- "07" => "Daugavpils",
- "08" => "Dobeles",
- "09" => "Gulbenes",
- "10" => "Jekabpils",
- "11" => "Jelgava",
- "12" => "Jelgavas",
- "13" => "Jurmala",
- "14" => "Kraslavas",
- "15" => "Kuldigas",
- "16" => "Liepaja",
- "17" => "Liepajas",
- "18" => "Limbazu",
- "19" => "Ludzas",
- "20" => "Madonas",
- "21" => "Ogres",
- "22" => "Preilu",
- "23" => "Rezekne",
- "24" => "Rezeknes",
- "25" => "Riga",
- "26" => "Rigas",
- "27" => "Saldus",
- "28" => "Talsu",
- "29" => "Tukuma",
- "30" => "Valkas",
- "31" => "Valmieras",
- "32" => "Ventspils",
- "33" => "Ventspils"
- ),
- "LY" => array(
- "03" => "Al Aziziyah",
- "05" => "Al Jufrah",
- "08" => "Al Kufrah",
- "13" => "Ash Shati'",
- "30" => "Murzuq",
- "34" => "Sabha",
- "41" => "Tarhunah",
- "42" => "Tubruq",
- "45" => "Zlitan",
- "47" => "Ajdabiya",
- "48" => "Al Fatih",
- "49" => "Al Jabal al Akhdar",
- "50" => "Al Khums",
- "51" => "An Nuqat al Khams",
- "52" => "Awbari",
- "53" => "Az Zawiyah",
- "54" => "Banghazi",
- "55" => "Darnah",
- "56" => "Ghadamis",
- "57" => "Gharyan",
- "58" => "Misratah",
- "59" => "Sawfajjin",
- "60" => "Surt",
- "61" => "Tarabulus",
- "62" => "Yafran"
- ),
- "MA" => array(
- "45" => "Grand Casablanca",
- "46" => "Fes-Boulemane",
- "47" => "Marrakech-Tensift-Al Haouz",
- "48" => "Meknes-Tafilalet",
- "49" => "Rabat-Sale-Zemmour-Zaer",
- "50" => "Chaouia-Ouardigha",
- "51" => "Doukkala-Abda",
- "52" => "Gharb-Chrarda-Beni Hssen",
- "53" => "Guelmim-Es Smara",
- "54" => "Oriental",
- "55" => "Souss-Massa-Dr,a",
- "56" => "Tadla-Azilal",
- "57" => "Tanger-Tetouan",
- "58" => "Taza-Al Hoceima-Taounate",
- "59" => "La,youne-Boujdour-Sakia El Hamra"
- ),
- "MC" => array(
- "01" => "La Condamine",
- "02" => "Monaco",
- "03" => "Monte-Carlo"
- ),
- "MD" => array(
- "51" => "Gagauzia",
- "57" => "Chisinau",
- "58" => "Stinga Nistrului",
- "59" => "Anenii Noi",
- "60" => "Balti",
- "61" => "Basarabeasca",
- "62" => "Bender",
- "63" => "Briceni",
- "64" => "Cahul",
- "65" => "Cantemir",
- "66" => "Calarasi",
- "67" => "Causeni",
- "68" => "Cimislia",
- "69" => "Criuleni",
- "70" => "Donduseni",
- "71" => "Drochia",
- "72" => "Dubasari",
- "73" => "Edinet",
- "74" => "Falesti",
- "75" => "Floresti",
- "76" => "Glodeni",
- "77" => "Hincesti",
- "78" => "Ialoveni",
- "79" => "Leova",
- "80" => "Nisporeni",
- "81" => "Ocnita",
- "82" => "Orhei",
- "83" => "Rezina",
- "84" => "Riscani",
- "85" => "Singerei",
- "86" => "Soldanesti",
- "87" => "Soroca",
- "88" => "Stefan-Voda",
- "89" => "Straseni",
- "90" => "Taraclia",
- "91" => "Telenesti",
- "92" => "Ungheni"
- ),
- "MG" => array(
- "01" => "Antsiranana",
- "02" => "Fianarantsoa",
- "03" => "Mahajanga",
- "04" => "Toamasina",
- "05" => "Antananarivo",
- "06" => "Toliara"
- ),
- "MK" => array(
- "01" => "Aracinovo",
- "02" => "Bac",
- "03" => "Belcista",
- "04" => "Berovo",
- "05" => "Bistrica",
- "06" => "Bitola",
- "07" => "Blatec",
- "08" => "Bogdanci",
- "09" => "Bogomila",
- "10" => "Bogovinje",
- "11" => "Bosilovo",
- "12" => "Brvenica",
- "13" => "Cair",
- "14" => "Capari",
- "15" => "Caska",
- "16" => "Cegrane",
- "17" => "Centar",
- "18" => "Centar Zupa",
- "19" => "Cesinovo",
- "20" => "Cucer-Sandevo",
- "21" => "Debar",
- "22" => "Delcevo",
- "23" => "Delogozdi",
- "24" => "Demir Hisar",
- "25" => "Demir Kapija",
- "26" => "Dobrusevo",
- "27" => "Dolna Banjica",
- "28" => "Dolneni",
- "29" => "Dorce Petrov",
- "30" => "Drugovo",
- "31" => "Dzepciste",
- "32" => "Gazi Baba",
- "33" => "Gevgelija",
- "34" => "Gostivar",
- "35" => "Gradsko",
- "36" => "Ilinden",
- "37" => "Izvor",
- "38" => "Jegunovce",
- "39" => "Kamenjane",
- "40" => "Karbinci",
- "41" => "Karpos",
- "42" => "Kavadarci",
- "43" => "Kicevo",
- "44" => "Kisela Voda",
- "45" => "Klecevce",
- "46" => "Kocani",
- "47" => "Konce",
- "48" => "Kondovo",
- "49" => "Konopiste",
- "50" => "Kosel",
- "51" => "Kratovo",
- "52" => "Kriva Palanka",
- "53" => "Krivogastani",
- "54" => "Krusevo",
- "55" => "Kuklis",
- "56" => "Kukurecani",
- "57" => "Kumanovo",
- "58" => "Labunista",
- "59" => "Lipkovo",
- "60" => "Lozovo",
- "61" => "Lukovo",
- "62" => "Makedonska Kamenica",
- "63" => "Makedonski Brod",
- "64" => "Mavrovi Anovi",
- "65" => "Meseista",
- "66" => "Miravci",
- "67" => "Mogila",
- "68" => "Murtino",
- "69" => "Negotino",
- "70" => "Negotino-Polosko",
- "71" => "Novaci",
- "72" => "Novo Selo",
- "73" => "Oblesevo",
- "74" => "Ohrid",
- "75" => "Orasac",
- "76" => "Orizari",
- "77" => "Oslomej",
- "78" => "Pehcevo",
- "79" => "Petrovec",
- "80" => "Plasnica",
- "81" => "Podares",
- "82" => "Prilep",
- "83" => "Probistip",
- "84" => "Radovis",
- "85" => "Rankovce",
- "86" => "Resen",
- "87" => "Rosoman",
- "88" => "Rostusa",
- "89" => "Samokov",
- "90" => "Saraj",
- "91" => "Sipkovica",
- "92" => "Sopiste",
- "93" => "Sopotnica",
- "94" => "Srbinovo",
- "95" => "Staravina",
- "96" => "Star Dojran",
- "97" => "Staro Nagoricane",
- "98" => "Stip",
- "99" => "Struga",
- "A1" => "Strumica",
- "A2" => "Studenicani",
- "A3" => "Suto Orizari",
- "A4" => "Sveti Nikole",
- "A5" => "Tearce",
- "A6" => "Tetovo",
- "A7" => "Topolcani",
- "A8" => "Valandovo",
- "A9" => "Vasilevo",
- "B1" => "Veles",
- "B2" => "Velesta",
- "B3" => "Vevcani",
- "B4" => "Vinica",
- "B5" => "Vitoliste",
- "B6" => "Vranestica",
- "B7" => "Vrapciste",
- "B8" => "Vratnica",
- "B9" => "Vrutok",
- "C1" => "Zajas",
- "C2" => "Zelenikovo",
- "C3" => "Zelino",
- "C4" => "Zitose",
- "C5" => "Zletovo",
- "C6" => "Zrnovci"
- ),
- "ML" => array(
- "01" => "Bamako",
- "03" => "Kayes",
- "04" => "Mopti",
- "05" => "Segou",
- "06" => "Sikasso",
- "07" => "Koulikoro",
- "08" => "Tombouctou",
- "09" => "Gao",
- "10" => "Kidal"
- ),
- "MM" => array(
- "01" => "Rakhine State",
- "02" => "Chin State",
- "03" => "Irrawaddy",
- "04" => "Kachin State",
- "05" => "Karan State",
- "06" => "Kayah State",
- "07" => "Magwe",
- "08" => "Mandalay",
- "09" => "Pegu",
- "10" => "Sagaing",
- "11" => "Shan State",
- "12" => "Tenasserim",
- "13" => "Mon State",
- "14" => "Rangoon",
- "17" => "Yangon"
- ),
- "MN" => array(
- "01" => "Arhangay",
- "02" => "Bayanhongor",
- "03" => "Bayan-Olgiy",
- "05" => "Darhan",
- "06" => "Dornod",
- "07" => "Dornogovi",
- "08" => "Dundgovi",
- "09" => "Dzavhan",
- "10" => "Govi-Altay",
- "11" => "Hentiy",
- "12" => "Hovd",
- "13" => "Hovsgol",
- "14" => "Omnogovi",
- "15" => "Ovorhangay",
- "16" => "Selenge",
- "17" => "Suhbaatar",
- "18" => "Tov",
- "19" => "Uvs",
- "20" => "Ulaanbaatar",
- "21" => "Bulgan",
- "22" => "Erdenet",
- "23" => "Darhan-Uul",
- "24" => "Govisumber",
- "25" => "Orhon"
- ),
- "MO" => array(
- "01" => "Ilhas",
- "02" => "Macau"
- ),
- "MR" => array(
- "01" => "Hodh Ech Chargui",
- "02" => "Hodh El Gharbi",
- "03" => "Assaba",
- "04" => "Gorgol",
- "05" => "Brakna",
- "06" => "Trarza",
- "07" => "Adrar",
- "08" => "Dakhlet Nouadhibou",
- "09" => "Tagant",
- "10" => "Guidimaka",
- "11" => "Tiris Zemmour",
- "12" => "Inchiri"
- ),
- "MS" => array(
- "01" => "Saint Anthony",
- "02" => "Saint Georges",
- "03" => "Saint Peter"
- ),
- "MU" => array(
- "12" => "Black River",
- "13" => "Flacq",
- "14" => "Grand Port",
- "15" => "Moka",
- "16" => "Pamplemousses",
- "17" => "Plaines Wilhems",
- "18" => "Port Louis",
- "19" => "Riviere du Rempart",
- "20" => "Savanne",
- "21" => "Agalega Islands",
- "22" => "Cargados Carajos",
- "23" => "Rodrigues"
- ),
- "MV" => array(
- "01" => "Seenu",
- "05" => "Laamu",
- "30" => "Alifu",
- "31" => "Baa",
- "32" => "Dhaalu",
- "33" => "Faafu ",
- "34" => "Gaafu Alifu",
- "35" => "Gaafu Dhaalu",
- "36" => "Haa Alifu",
- "37" => "Haa Dhaalu",
- "38" => "Kaafu",
- "39" => "Lhaviyani",
- "40" => "Maale",
- "41" => "Meemu",
- "42" => "Gnaviyani",
- "43" => "Noonu",
- "44" => "Raa",
- "45" => "Shaviyani",
- "46" => "Thaa",
- "47" => "Vaavu"
- ),
- "MW" => array(
- "02" => "Chikwawa",
- "03" => "Chiradzulu",
- "04" => "Chitipa",
- "05" => "Thyolo",
- "06" => "Dedza",
- "07" => "Dowa",
- "08" => "Karonga",
- "09" => "Kasungu",
- "11" => "Lilongwe",
- "12" => "Mangochi",
- "13" => "Mchinji",
- "15" => "Mzimba",
- "16" => "Ntcheu",
- "17" => "Nkhata Bay",
- "18" => "Nkhotakota",
- "19" => "Nsanje",
- "20" => "Ntchisi",
- "21" => "Rumphi",
- "22" => "Salima",
- "23" => "Zomba",
- "24" => "Blantyre",
- "25" => "Mwanza",
- "26" => "Balaka",
- "27" => "Likoma",
- "28" => "Machinga",
- "29" => "Mulanje",
- "30" => "Phalombe"
- ),
- "MX" => array(
- "01" => "Aguascalientes",
- "02" => "Baja California",
- "03" => "Baja California Sur",
- "04" => "Campeche",
- "05" => "Chiapas",
- "06" => "Chihuahua",
- "07" => "Coahuila de Zaragoza",
- "08" => "Colima",
- "09" => "Distrito Federal",
- "10" => "Durango",
- "11" => "Guanajuato",
- "12" => "Guerrero",
- "13" => "Hidalgo",
- "14" => "Jalisco",
- "15" => "Mexico",
- "16" => "Michoacan de Ocampo",
- "17" => "Morelos",
- "18" => "Nayarit",
- "19" => "Nuevo Leon",
- "20" => "Oaxaca",
- "21" => "Puebla",
- "22" => "Queretaro de Arteaga",
- "23" => "Quintana Roo",
- "24" => "San Luis Potosi",
- "25" => "Sinaloa",
- "26" => "Sonora",
- "27" => "Tabasco",
- "28" => "Tamaulipas",
- "29" => "Tlaxcala",
- "30" => "Veracruz-Llave",
- "31" => "Yucatan",
- "32" => "Zacatecas"
- ),
- "MY" => array(
- "01" => "Johor",
- "02" => "Kedah",
- "03" => "Kelantan",
- "04" => "Melaka",
- "05" => "Negeri Sembilan",
- "06" => "Pahang",
- "07" => "Perak",
- "08" => "Perlis",
- "09" => "Pulau Pinang",
- "11" => "Sarawak",
- "12" => "Selangor",
- "13" => "Terengganu",
- "14" => "Kuala Lumpur",
- "15" => "Labuan",
- "16" => "Sabah",
- "17" => "Putrajaya"
- ),
- "MZ" => array(
- "01" => "Cabo Delgado",
- "02" => "Gaza",
- "03" => "Inhambane",
- "04" => "Maputo",
- "05" => "Sofala",
- "06" => "Nampula",
- "07" => "Niassa",
- "08" => "Tete",
- "09" => "Zambezia",
- "10" => "Manica",
- "11" => "Maputo"
- ),
- "NA" => array(
- "01" => "Bethanien",
- "02" => "Caprivi Oos",
- "03" => "Boesmanland",
- "04" => "Gobabis",
- "05" => "Grootfontein",
- "06" => "Kaokoland",
- "07" => "Karibib",
- "08" => "Keetmanshoop",
- "09" => "Luderitz",
- "10" => "Maltahohe",
- "11" => "Okahandja",
- "12" => "Omaruru",
- "13" => "Otjiwarongo",
- "14" => "Outjo",
- "15" => "Owambo",
- "16" => "Rehoboth",
- "17" => "Swakopmund",
- "18" => "Tsumeb",
- "20" => "Karasburg",
- "21" => "Windhoek",
- "22" => "Damaraland",
- "23" => "Hereroland Oos",
- "24" => "Hereroland Wes",
- "25" => "Kavango",
- "26" => "Mariental",
- "27" => "Namaland",
- "28" => "Caprivi",
- "29" => "Erongo",
- "30" => "Hardap",
- "31" => "Karas",
- "32" => "Kunene",
- "33" => "Ohangwena",
- "34" => "Okavango",
- "35" => "Omaheke",
- "36" => "Omusati",
- "37" => "Oshana",
- "38" => "Oshikoto",
- "39" => "Otjozondjupa"
- ),
- "NE" => array(
- "01" => "Agadez",
- "02" => "Diffa",
- "03" => "Dosso",
- "04" => "Maradi",
- "05" => "Niamey",
- "06" => "Tahoua",
- "07" => "Zinder",
- "08" => "Niamey"
- ),
- "NG" => array(
- "05" => "Lagos",
- "11" => "Federal Capital Territory",
- "16" => "Ogun",
- "21" => "Akwa Ibom",
- "22" => "Cross River",
- "23" => "Kaduna",
- "24" => "Katsina",
- "25" => "Anambra",
- "26" => "Benue",
- "27" => "Borno",
- "28" => "Imo",
- "29" => "Kano",
- "30" => "Kwara",
- "31" => "Niger",
- "32" => "Oyo",
- "35" => "Adamawa",
- "36" => "Delta",
- "37" => "Edo",
- "39" => "Jigawa",
- "40" => "Kebbi",
- "41" => "Kogi",
- "42" => "Osun",
- "43" => "Taraba",
- "44" => "Yobe",
- "45" => "Abia",
- "46" => "Bauchi",
- "47" => "Enugu",
- "48" => "Ondo",
- "49" => "Plateau",
- "50" => "Rivers",
- "51" => "Sokoto",
- "52" => "Bayelsa",
- "53" => "Ebonyi",
- "54" => "Ekiti",
- "55" => "Gombe",
- "56" => "Nassarawa",
- "57" => "Zamfara"
- ),
- "NI" => array(
- "01" => "Boaco",
- "02" => "Carazo",
- "03" => "Chinandega",
- "04" => "Chontales",
- "05" => "Esteli",
- "06" => "Granada",
- "07" => "Jinotega",
- "08" => "Leon",
- "09" => "Madriz",
- "10" => "Managua",
- "11" => "Masaya",
- "12" => "Matagalpa",
- "13" => "Nueva Segovia",
- "14" => "Rio San Juan",
- "15" => "Rivas",
- "16" => "Zelaya",
- "17" => "Autonoma Atlantico Norte",
- "18" => "Region Autonoma Atlantico Sur"
- ),
- "NL" => array(
- "01" => "Drenthe",
- "02" => "Friesland",
- "03" => "Gelderland",
- "04" => "Groningen",
- "05" => "Limburg",
- "06" => "Noord-Brabant",
- "07" => "Noord-Holland",
- "09" => "Utrecht",
- "10" => "Zeeland",
- "11" => "Zuid-Holland",
- "15" => "Overijssel",
- "16" => "Flevoland"
- ),
- "NO" => array(
- "01" => "Akershus",
- "02" => "Aust-Agder",
- "04" => "Buskerud",
- "05" => "Finnmark",
- "06" => "Hedmark",
- "07" => "Hordaland",
- "08" => "More og Romsdal",
- "09" => "Nordland",
- "10" => "Nord-Trondelag",
- "11" => "Oppland",
- "12" => "Oslo",
- "13" => "Ostfold",
- "14" => "Rogaland",
- "15" => "Sogn og Fjordane",
- "16" => "Sor-Trondelag",
- "17" => "Telemark",
- "18" => "Troms",
- "19" => "Vest-Agder",
- "20" => "Vestfold"
- ),
- "NP" => array(
- "01" => "Bagmati",
- "02" => "Bheri",
- "03" => "Dhawalagiri",
- "04" => "Gandaki",
- "05" => "Janakpur",
- "06" => "Karnali",
- "07" => "Kosi",
- "08" => "Lumbini",
- "09" => "Mahakali",
- "10" => "Mechi",
- "11" => "Narayani",
- "12" => "Rapti",
- "13" => "Sagarmatha",
- "14" => "Seti"
- ),
- "NR" => array(
- "01" => "Aiwo",
- "02" => "Anabar",
- "03" => "Anetan",
- "04" => "Anibare",
- "05" => "Baiti",
- "06" => "Boe",
- "07" => "Buada",
- "08" => "Denigomodu",
- "09" => "Ewa",
- "10" => "Ijuw",
- "11" => "Meneng",
- "12" => "Nibok",
- "13" => "Uaboe",
- "14" => "Yaren"
- ),
- "NZ" => array(
- "10" => "Chatham Islands",
- "E7" => "Auckland",
- "E8" => "Bay of Plenty",
- "E9" => "Canterbury",
- "F1" => "Gisborne",
- "F2" => "Hawke's Bay",
- "F3" => "Manawatu-Wanganui",
- "F4" => "Marlborough",
- "F5" => "Nelson",
- "F6" => "Northland",
- "F7" => "Otago",
- "F8" => "Southland",
- "F9" => "Taranaki",
- "G1" => "Waikato",
- "G2" => "Wellington",
- "G3" => "West Coast"
- ),
- "OM" => array(
- "01" => "Ad Dakhiliyah",
- "02" => "Al Batinah",
- "03" => "Al Wusta",
- "04" => "Ash Sharqiyah",
- "05" => "Az Zahirah",
- "06" => "Masqat",
- "07" => "Musandam",
- "08" => "Zufar"
- ),
- "PA" => array(
- "01" => "Bocas del Toro",
- "02" => "Chiriqui",
- "03" => "Cocle",
- "04" => "Colon",
- "05" => "Darien",
- "06" => "Herrera",
- "07" => "Los Santos",
- "08" => "Panama",
- "09" => "San Blas",
- "10" => "Veraguas"
- ),
- "PE" => array(
- "01" => "Amazonas",
- "02" => "Ancash",
- "03" => "Apurimac",
- "04" => "Arequipa",
- "05" => "Ayacucho",
- "06" => "Cajamarca",
- "07" => "Callao",
- "08" => "Cusco",
- "09" => "Huancavelica",
- "10" => "Huanuco",
- "11" => "Ica",
- "12" => "Junin",
- "13" => "La Libertad",
- "14" => "Lambayeque",
- "15" => "Lima",
- "16" => "Loreto",
- "17" => "Madre de Dios",
- "18" => "Moquegua",
- "19" => "Pasco",
- "20" => "Piura",
- "21" => "Puno",
- "22" => "San Martin",
- "23" => "Tacna",
- "24" => "Tumbes",
- "25" => "Ucayali"
- ),
- "PG" => array(
- "01" => "Central",
- "02" => "Gulf",
- "03" => "Milne Bay",
- "04" => "Northern",
- "05" => "Southern Highlands",
- "06" => "Western",
- "07" => "North Solomons",
- "08" => "Chimbu",
- "09" => "Eastern Highlands",
- "10" => "East New Britain",
- "11" => "East Sepik",
- "12" => "Madang",
- "13" => "Manus",
- "14" => "Morobe",
- "15" => "New Ireland",
- "16" => "Western Highlands",
- "17" => "West New Britain",
- "18" => "Sandaun",
- "19" => "Enga",
- "20" => "National Capital"
- ),
- "PH" => array(
- "01" => "Abra",
- "02" => "Agusan del Norte",
- "03" => "Agusan del Sur",
- "04" => "Aklan",
- "05" => "Albay",
- "06" => "Antique",
- "07" => "Bataan",
- "08" => "Batanes",
- "09" => "Batangas",
- "10" => "Benguet",
- "11" => "Bohol",
- "12" => "Bukidnon",
- "13" => "Bulacan",
- "14" => "Cagayan",
- "15" => "Camarines Norte",
- "16" => "Camarines Sur",
- "17" => "Camiguin",
- "18" => "Capiz",
- "19" => "Catanduanes",
- "20" => "Cavite",
- "21" => "Cebu",
- "22" => "Basilan",
- "23" => "Eastern Samar",
- "24" => "Davao",
- "25" => "Davao del Sur",
- "26" => "Davao Oriental",
- "27" => "Ifugao",
- "28" => "Ilocos Norte",
- "29" => "Ilocos Sur",
- "30" => "Iloilo",
- "31" => "Isabela",
- "32" => "Kalinga-Apayao",
- "33" => "Laguna",
- "34" => "Lanao del Norte",
- "35" => "Lanao del Sur",
- "36" => "La Union",
- "37" => "Leyte",
- "38" => "Marinduque",
- "39" => "Masbate",
- "40" => "Mindoro Occidental",
- "41" => "Mindoro Oriental",
- "42" => "Misamis Occidental",
- "43" => "Misamis Oriental",
- "44" => "Mountain",
- "45" => "Negros Occidental",
- "46" => "Negros Oriental",
- "47" => "Nueva Ecija",
- "48" => "Nueva Vizcaya",
- "49" => "Palawan",
- "50" => "Pampanga",
- "51" => "Pangasinan",
- "53" => "Rizal",
- "54" => "Romblon",
- "55" => "Samar",
- "56" => "Maguindanao",
- "57" => "North Cotabato",
- "58" => "Sorsogon",
- "59" => "Southern Leyte",
- "60" => "Sulu",
- "61" => "Surigao del Norte",
- "62" => "Surigao del Sur",
- "63" => "Tarlac",
- "64" => "Zambales",
- "65" => "Zamboanga del Norte",
- "66" => "Zamboanga del Sur",
- "67" => "Northern Samar",
- "68" => "Quirino",
- "69" => "Siquijor",
- "70" => "South Cotabato",
- "71" => "Sultan Kudarat",
- "72" => "Tawitawi",
- "A1" => "Angeles",
- "A2" => "Bacolod",
- "A3" => "Bago",
- "A4" => "Baguio",
- "A5" => "Bais",
- "A6" => "Basilan City",
- "A7" => "Batangas City",
- "A8" => "Butuan",
- "A9" => "Cabanatuan",
- "B1" => "Cadiz",
- "B2" => "Cagayan de Oro",
- "B3" => "Calbayog",
- "B4" => "Caloocan",
- "B5" => "Canlaon",
- "B6" => "Cavite City",
- "B7" => "Cebu City",
- "B8" => "Cotabato",
- "B9" => "Dagupan",
- "C1" => "Danao",
- "C2" => "Dapitan",
- "C3" => "Davao City",
- "C4" => "Dipolog",
- "C5" => "Dumaguete",
- "C6" => "General Santos",
- "C7" => "Gingoog",
- "C8" => "Iligan",
- "C9" => "Iloilo City",
- "D1" => "Iriga",
- "D2" => "La Carlota",
- "D3" => "Laoag",
- "D4" => "Lapu-Lapu",
- "D5" => "Legaspi",
- "D6" => "Lipa",
- "D7" => "Lucena",
- "D8" => "Mandaue",
- "D9" => "Manila",
- "E1" => "Marawi",
- "E2" => "Naga",
- "E3" => "Olongapo",
- "E4" => "Ormoc",
- "E5" => "Oroquieta",
- "E6" => "Ozamis",
- "E7" => "Pagadian",
- "E8" => "Palayan",
- "E9" => "Pasay",
- "F1" => "Puerto Princesa",
- "F2" => "Quezon City",
- "F3" => "Roxas",
- "F4" => "San Carlos",
- "F5" => "San Carlos",
- "F6" => "San Jose",
- "F7" => "San Pablo",
- "F8" => "Silay",
- "F9" => "Surigao",
- "G1" => "Tacloban",
- "G2" => "Tagaytay",
- "G3" => "Tagbilaran",
- "G4" => "Tangub",
- "G5" => "Toledo",
- "G6" => "Trece Martires",
- "G7" => "Zamboanga",
- "G8" => "Aurora",
- "H2" => "Quezon",
- "H3" => "Negros Occidental",
- "I6" => "Compostela Valley",
- "I7" => "Davao del Norte",
- "J7" => "Kalinga",
- "K6" => "Malaybalay",
- "M5" => "San Jose del Monte",
- "M6" => "San Juan",
- "M8" => "Santiago",
- "M9" => "Sarangani",
- "N1" => "Sipalay",
- "N3" => "Surigao del Norte",
- "P1" => "Zambales",
- "P2" => "Zamboanga"
- ),
- "PK" => array(
- "01" => "Federally Administered Tribal Areas",
- "02" => "Balochistan",
- "03" => "North-West Frontier",
- "04" => "Punjab",
- "05" => "Sindh",
- "06" => "Azad Kashmir",
- "07" => "Northern Areas",
- "08" => "Islamabad"
- ),
- "PL" => array(
- "72" => "Dolnoslaskie",
- "73" => "Kujawsko-Pomorskie",
- "74" => "Lodzkie",
- "75" => "Lubelskie",
- "76" => "Lubuskie",
- "77" => "Malopolskie",
- "78" => "Mazowieckie",
- "79" => "Opolskie",
- "80" => "Podkarpackie",
- "81" => "Podlaskie",
- "82" => "Pomorskie",
- "83" => "Slaskie",
- "84" => "Swietokrzyskie",
- "85" => "Warminsko-Mazurskie",
- "86" => "Wielkopolskie",
- "87" => "Zachodniopomorskie"
- ),
- "PS" => array(
- "GZ" => "Gaza",
- "WE" => "West Bank"
- ),
- "PT" => array(
- "02" => "Aveiro",
- "03" => "Beja",
- "04" => "Braga",
- "05" => "Braganca",
- "06" => "Castelo Branco",
- "07" => "Coimbra",
- "08" => "Evora",
- "09" => "Faro",
- "10" => "Madeira",
- "11" => "Guarda",
- "13" => "Leiria",
- "14" => "Lisboa",
- "16" => "Portalegre",
- "17" => "Porto",
- "18" => "Santarem",
- "19" => "Setubal",
- "20" => "Viana do Castelo",
- "21" => "Vila Real",
- "22" => "Viseu",
- "23" => "Azores"
- ),
- "PY" => array(
- "01" => "Alto Parana",
- "02" => "Amambay",
- "03" => "Boqueron",
- "04" => "Caaguazu",
- "05" => "Caazapa",
- "06" => "Central",
- "07" => "Concepcion",
- "08" => "Cordillera",
- "10" => "Guaira",
- "11" => "Itapua",
- "12" => "Misiones",
- "13" => "Neembucu",
- "15" => "Paraguari",
- "16" => "Presidente Hayes",
- "17" => "San Pedro",
- "19" => "Canindeyu",
- "20" => "Chaco",
- "21" => "Nueva Asuncion",
- "23" => "Alto Paraguay"
- ),
- "QA" => array(
- "01" => "Ad Dawhah",
- "02" => "Al Ghuwariyah",
- "03" => "Al Jumaliyah",
- "04" => "Al Khawr",
- "05" => "Al Wakrah Municipality",
- "06" => "Ar Rayyan",
- "08" => "Madinat ach Shamal",
- "09" => "Umm Salal",
- "10" => "Al Wakrah",
- "11" => "Jariyan al Batnah",
- "12" => "Umm Sa'id"
- ),
- "RO" => array(
- "01" => "Alba",
- "02" => "Arad",
- "03" => "Arges",
- "04" => "Bacau",
- "05" => "Bihor",
- "06" => "Bistrita-Nasaud",
- "07" => "Botosani",
- "08" => "Braila",
- "09" => "Brasov",
- "10" => "Bucuresti",
- "11" => "Buzau",
- "12" => "Caras-Severin",
- "13" => "Cluj",
- "14" => "Constanta",
- "15" => "Covasna",
- "16" => "Dambovita",
- "17" => "Dolj",
- "18" => "Galati",
- "19" => "Gorj",
- "20" => "Harghita",
- "21" => "Hunedoara",
- "22" => "Ialomita",
- "23" => "Iasi",
- "25" => "Maramures",
- "26" => "Mehedinti",
- "27" => "Mures",
- "28" => "Neamt",
- "29" => "Olt",
- "30" => "Prahova",
- "31" => "Salaj",
- "32" => "Satu Mare",
- "33" => "Sibiu",
- "34" => "Suceava",
- "35" => "Teleorman",
- "36" => "Timis",
- "37" => "Tulcea",
- "38" => "Vaslui",
- "39" => "Valcea",
- "40" => "Vrancea",
- "41" => "Calarasi",
- "42" => "Giurgiu",
- "43" => "Ilfov"
- ),
- "RS" => array(
- "01" => "Kosovo",
- "02" => "Vojvodina"
- ),
- "RU" => array(
- "01" => "Adygeya, Republic of",
- "02" => "Aginsky Buryatsky AO",
- "03" => "Gorno-Altay",
- "04" => "Altaisky krai",
- "05" => "Amur",
- "06" => "Arkhangel'sk",
- "07" => "Astrakhan'",
- "08" => "Bashkortostan",
- "09" => "Belgorod",
- "10" => "Bryansk",
- "11" => "Buryat",
- "12" => "Chechnya",
- "13" => "Chelyabinsk",
- "14" => "Chita",
- "15" => "Chukot",
- "16" => "Chuvashia",
- "17" => "Dagestan",
- "18" => "Evenk",
- "19" => "Ingush",
- "20" => "Irkutsk",
- "21" => "Ivanovo",
- "22" => "Kabardin-Balkar",
- "23" => "Kaliningrad",
- "24" => "Kalmyk",
- "25" => "Kaluga",
- "26" => "Kamchatka",
- "27" => "Karachay-Cherkess",
- "28" => "Karelia",
- "29" => "Kemerovo",
- "30" => "Khabarovsk",
- "31" => "Khakass",
- "32" => "Khanty-Mansiy",
- "33" => "Kirov",
- "34" => "Komi",
- "35" => "Komi-Permyak",
- "36" => "Koryak",
- "37" => "Kostroma",
- "38" => "Krasnodar",
- "39" => "Krasnoyarsk",
- "40" => "Kurgan",
- "41" => "Kursk",
- "42" => "Leningrad",
- "43" => "Lipetsk",
- "44" => "Magadan",
- "45" => "Mariy-El",
- "46" => "Mordovia",
- "47" => "Moskva",
- "48" => "Moscow City",
- "49" => "Murmansk",
- "50" => "Nenets",
- "51" => "Nizhegorod",
- "52" => "Novgorod",
- "53" => "Novosibirsk",
- "54" => "Omsk",
- "55" => "Orenburg",
- "56" => "Orel",
- "57" => "Penza",
- "58" => "Perm'",
- "59" => "Primor'ye",
- "60" => "Pskov",
- "61" => "Rostov",
- "62" => "Ryazan'",
- "63" => "Sakha",
- "64" => "Sakhalin",
- "65" => "Samara",
- "66" => "Saint Petersburg City",
- "67" => "Saratov",
- "68" => "North Ossetia",
- "69" => "Smolensk",
- "70" => "Stavropol'",
- "71" => "Sverdlovsk",
- "72" => "Tambovskaya oblast",
- "73" => "Tatarstan",
- "74" => "Taymyr",
- "75" => "Tomsk",
- "76" => "Tula",
- "77" => "Tver'",
- "78" => "Tyumen'",
- "79" => "Tuva",
- "80" => "Udmurt",
- "81" => "Ul'yanovsk",
- "82" => "Ust-Orda Buryat",
- "83" => "Vladimir",
- "84" => "Volgograd",
- "85" => "Vologda",
- "86" => "Voronezh",
- "87" => "Yamal-Nenets",
- "88" => "Yaroslavl'",
- "89" => "Yevrey",
- "90" => "Permskiy Kray",
- "91" => "Krasnoyarskiy Kray",
- "92" => "Kamchatskiy Kray",
- "93" => "Zabaykal'skiy Kray"
- ),
- "RW" => array(
- "01" => "Butare",
- "06" => "Gitarama",
- "07" => "Kibungo",
- "09" => "Kigali",
- "11" => "Est",
- "12" => "Kigali",
- "13" => "Nord",
- "14" => "Ouest",
- "15" => "Sud"
- ),
- "SA" => array(
- "02" => "Al Bahah",
- "05" => "Al Madinah",
- "06" => "Ash Sharqiyah",
- "08" => "Al Qasim",
- "10" => "Ar Riyad",
- "11" => "Asir Province",
- "13" => "Ha'il",
- "14" => "Makkah",
- "15" => "Al Hudud ash Shamaliyah",
- "16" => "Najran",
- "17" => "Jizan",
- "19" => "Tabuk",
- "20" => "Al Jawf"
- ),
- "SB" => array(
- "03" => "Malaita",
- "06" => "Guadalcanal",
- "07" => "Isabel",
- "08" => "Makira",
- "09" => "Temotu",
- "10" => "Central",
- "11" => "Western",
- "12" => "Choiseul",
- "13" => "Rennell and Bellona"
- ),
- "SC" => array(
- "01" => "Anse aux Pins",
- "02" => "Anse Boileau",
- "03" => "Anse Etoile",
- "04" => "Anse Louis",
- "05" => "Anse Royale",
- "06" => "Baie Lazare",
- "07" => "Baie Sainte Anne",
- "08" => "Beau Vallon",
- "09" => "Bel Air",
- "10" => "Bel Ombre",
- "11" => "Cascade",
- "12" => "Glacis",
- "13" => "Grand' Anse",
- "14" => "Grand' Anse",
- "15" => "La Digue",
- "16" => "La Riviere Anglaise",
- "17" => "Mont Buxton",
- "18" => "Mont Fleuri",
- "19" => "Plaisance",
- "20" => "Pointe La Rue",
- "21" => "Port Glaud",
- "22" => "Saint Louis",
- "23" => "Takamaka"
- ),
- "SD" => array(
- "27" => "Al Wusta",
- "28" => "Al Istiwa'iyah",
- "29" => "Al Khartum",
- "30" => "Ash Shamaliyah",
- "31" => "Ash Sharqiyah",
- "32" => "Bahr al Ghazal",
- "33" => "Darfur",
- "34" => "Kurdufan",
- "35" => "Upper Nile",
- "40" => "Al Wahadah State",
- "44" => "Central Equatoria State"
- ),
- "SE" => array(
- "02" => "Blekinge Lan",
- "03" => "Gavleborgs Lan",
- "05" => "Gotlands Lan",
- "06" => "Hallands Lan",
- "07" => "Jamtlands Lan",
- "08" => "Jonkopings Lan",
- "09" => "Kalmar Lan",
- "10" => "Dalarnas Lan",
- "12" => "Kronobergs Lan",
- "14" => "Norrbottens Lan",
- "15" => "Orebro Lan",
- "16" => "Ostergotlands Lan",
- "18" => "Sodermanlands Lan",
- "21" => "Uppsala Lan",
- "22" => "Varmlands Lan",
- "23" => "Vasterbottens Lan",
- "24" => "Vasternorrlands Lan",
- "25" => "Vastmanlands Lan",
- "26" => "Stockholms Lan",
- "27" => "Skane Lan",
- "28" => "Vastra Gotaland"
- ),
- "SH" => array(
- "01" => "Ascension",
- "02" => "Saint Helena",
- "03" => "Tristan da Cunha"
- ),
- "SI" => array(
- "01" => "Ajdovscina Commune",
- "02" => "Beltinci Commune",
- "03" => "Bled Commune",
- "04" => "Bohinj Commune",
- "05" => "Borovnica Commune",
- "06" => "Bovec Commune",
- "07" => "Brda Commune",
- "08" => "Brezice Commune",
- "09" => "Brezovica Commune",
- "11" => "Celje Commune",
- "12" => "Cerklje na Gorenjskem Commune",
- "13" => "Cerknica Commune",
- "14" => "Cerkno Commune",
- "15" => "Crensovci Commune",
- "16" => "Crna na Koroskem Commune",
- "17" => "Crnomelj Commune",
- "19" => "Divaca Commune",
- "20" => "Dobrepolje Commune",
- "22" => "Dol pri Ljubljani Commune",
- "24" => "Dornava Commune",
- "25" => "Dravograd Commune",
- "26" => "Duplek Commune",
- "27" => "Gorenja vas-Poljane Commune",
- "28" => "Gorisnica Commune",
- "29" => "Gornja Radgona Commune",
- "30" => "Gornji Grad Commune",
- "31" => "Gornji Petrovci Commune",
- "32" => "Grosuplje Commune",
- "34" => "Hrastnik Commune",
- "35" => "Hrpelje-Kozina Commune",
- "36" => "Idrija Commune",
- "37" => "Ig Commune",
- "38" => "Ilirska Bistrica Commune",
- "39" => "Ivancna Gorica Commune",
- "40" => "Izola-Isola Commune",
- "42" => "Jursinci Commune",
- "44" => "Kanal Commune",
- "45" => "Kidricevo Commune",
- "46" => "Kobarid Commune",
- "47" => "Kobilje Commune",
- "49" => "Komen Commune",
- "50" => "Koper-Capodistria Urban Commune",
- "51" => "Kozje Commune",
- "52" => "Kranj Commune",
- "53" => "Kranjska Gora Commune",
- "54" => "Krsko Commune",
- "55" => "Kungota Commune",
- "57" => "Lasko Commune",
- "61" => "Ljubljana Urban Commune",
- "62" => "Ljubno Commune",
- "64" => "Logatec Commune",
- "66" => "Loski Potok Commune",
- "68" => "Lukovica Commune",
- "71" => "Medvode Commune",
- "72" => "Menges Commune",
- "73" => "Metlika Commune",
- "74" => "Mezica Commune",
- "76" => "Mislinja Commune",
- "77" => "Moravce Commune",
- "78" => "Moravske Toplice Commune",
- "79" => "Mozirje Commune",
- "80" => "Murska Sobota Urban Commune",
- "81" => "Muta Commune",
- "82" => "Naklo Commune",
- "83" => "Nazarje Commune",
- "84" => "Nova Gorica Urban Commune",
- "86" => "Odranci Commune",
- "87" => "Ormoz Commune",
- "88" => "Osilnica Commune",
- "89" => "Pesnica Commune",
- "91" => "Pivka Commune",
- "92" => "Podcetrtek Commune",
- "94" => "Postojna Commune",
- "97" => "Puconci Commune",
- "98" => "Race-Fram Commune",
- "99" => "Radece Commune",
- "A1" => "Radenci Commune",
- "A2" => "Radlje ob Dravi Commune",
- "A3" => "Radovljica Commune",
- "A6" => "Rogasovci Commune",
- "A7" => "Rogaska Slatina Commune",
- "A8" => "Rogatec Commune",
- "B1" => "Semic Commune",
- "B2" => "Sencur Commune",
- "B3" => "Sentilj Commune",
- "B4" => "Sentjernej Commune",
- "B6" => "Sevnica Commune",
- "B7" => "Sezana Commune",
- "B8" => "Skocjan Commune",
- "B9" => "Skofja Loka Commune",
- "C1" => "Skofljica Commune",
- "C2" => "Slovenj Gradec Urban Commune",
- "C4" => "Slovenske Konjice Commune",
- "C5" => "Smarje pri Jelsah Commune",
- "C6" => "Smartno ob Paki Commune",
- "C7" => "Sostanj Commune",
- "C8" => "Starse Commune",
- "C9" => "Store Commune",
- "D1" => "Sveti Jurij Commune",
- "D2" => "Tolmin Commune",
- "D3" => "Trbovlje Commune",
- "D4" => "Trebnje Commune",
- "D5" => "Trzic Commune",
- "D6" => "Turnisce Commune",
- "D7" => "Velenje Urban Commune",
- "D8" => "Velike Lasce Commune",
- "E1" => "Vipava Commune",
- "E2" => "Vitanje Commune",
- "E3" => "Vodice Commune",
- "E5" => "Vrhnika Commune",
- "E6" => "Vuzenica Commune",
- "E7" => "Zagorje ob Savi Commune",
- "E9" => "Zavrc Commune",
- "F1" => "Zelezniki Commune",
- "F2" => "Ziri Commune",
- "F3" => "Zrece Commune",
- "F4" => "Benedikt Commune",
- "F5" => "Bistrica ob Sotli Commune",
- "F6" => "Bloke Commune",
- "F7" => "Braslovce Commune",
- "F8" => "Cankova Commune",
- "F9" => "Cerkvenjak Commune",
- "G1" => "Destrnik Commune",
- "G2" => "Dobje Commune",
- "G3" => "Dobrna Commune",
- "G4" => "Dobrova-Horjul-Polhov Gradec Commune",
- "G5" => "Dobrovnik-Dobronak Commune",
- "G6" => "Dolenjske Toplice Commune",
- "G7" => "Domzale Commune",
- "G8" => "Grad Commune",
- "G9" => "Hajdina Commune",
- "H1" => "Hoce-Slivnica Commune",
- "H2" => "Hodos-Hodos Commune",
- "H3" => "Horjul Commune",
- "H4" => "Jesenice Commune",
- "H5" => "Jezersko Commune",
- "H6" => "Kamnik Commune",
- "H7" => "Kocevje Commune",
- "H8" => "Komenda Commune",
- "H9" => "Kostel Commune",
- "I1" => "Krizevci Commune",
- "I2" => "Kuzma Commune",
- "I3" => "Lenart Commune",
- "I4" => "Lendava-Lendva Commune",
- "I5" => "Litija Commune",
- "I6" => "Ljutomer Commune",
- "I7" => "Loska Dolina Commune",
- "I8" => "Lovrenc na Pohorju Commune",
- "I9" => "Luce Commune",
- "J1" => "Majsperk Commune",
- "J2" => "Maribor Commune",
- "J3" => "Markovci Commune",
- "J4" => "Miklavz na Dravskem polju Commune",
- "J5" => "Miren-Kostanjevica Commune",
- "J6" => "Mirna Pec Commune",
- "J7" => "Novo mesto Urban Commune",
- "J8" => "Oplotnica Commune",
- "J9" => "Piran-Pirano Commune",
- "K1" => "Podlehnik Commune",
- "K2" => "Podvelka Commune",
- "K3" => "Polzela Commune",
- "K4" => "Prebold Commune",
- "K5" => "Preddvor Commune",
- "K6" => "Prevalje Commune",
- "K7" => "Ptuj Urban Commune",
- "K8" => "Ravne na Koroskem Commune",
- "K9" => "Razkrizje Commune",
- "L1" => "Ribnica Commune",
- "L2" => "Ribnica na Pohorju Commune",
- "L3" => "Ruse Commune",
- "L4" => "Salovci Commune",
- "L5" => "Selnica ob Dravi Commune",
- "L6" => "Sempeter-Vrtojba Commune",
- "L7" => "Sentjur pri Celju Commune",
- "L8" => "Slovenska Bistrica Commune",
- "L9" => "Smartno pri Litiji Commune",
- "M1" => "Sodrazica Commune",
- "M2" => "Solcava Commune",
- "M3" => "Sveta Ana Commune",
- "M4" => "Sveti Andraz v Slovenskih goricah Commune",
- "M5" => "Tabor Commune",
- "M6" => "Tisina Commune",
- "M7" => "Trnovska vas Commune",
- "M8" => "Trzin Commune",
- "M9" => "Velika Polana Commune",
- "N1" => "Verzej Commune",
- "N2" => "Videm Commune",
- "N3" => "Vojnik Commune",
- "N4" => "Vransko Commune",
- "N5" => "Zalec Commune",
- "N6" => "Zetale Commune",
- "N7" => "Zirovnica Commune",
- "N8" => "Zuzemberk Commune",
- "N9" => "Apace Commune",
- "O1" => "Cirkulane Commune"
- ),
- "SK" => array(
- "01" => "Banska Bystrica",
- "02" => "Bratislava",
- "03" => "Kosice",
- "04" => "Nitra",
- "05" => "Presov",
- "06" => "Trencin",
- "07" => "Trnava",
- "08" => "Zilina"
- ),
- "SL" => array(
- "01" => "Eastern",
- "02" => "Northern",
- "03" => "Southern",
- "04" => "Western Area"
- ),
- "SM" => array(
- "01" => "Acquaviva",
- "02" => "Chiesanuova",
- "03" => "Domagnano",
- "04" => "Faetano",
- "05" => "Fiorentino",
- "06" => "Borgo Maggiore",
- "07" => "San Marino",
- "08" => "Monte Giardino",
- "09" => "Serravalle"
- ),
- "SN" => array(
- "01" => "Dakar",
- "03" => "Diourbel",
- "05" => "Tambacounda",
- "07" => "Thies",
- "09" => "Fatick",
- "10" => "Kaolack",
- "11" => "Kolda",
- "12" => "Ziguinchor",
- "13" => "Louga",
- "14" => "Saint-Louis",
- "15" => "Matam"
- ),
- "SO" => array(
- "01" => "Bakool",
- "02" => "Banaadir",
- "03" => "Bari",
- "04" => "Bay",
- "05" => "Galguduud",
- "06" => "Gedo",
- "07" => "Hiiraan",
- "08" => "Jubbada Dhexe",
- "09" => "Jubbada Hoose",
- "10" => "Mudug",
- "11" => "Nugaal",
- "12" => "Sanaag",
- "13" => "Shabeellaha Dhexe",
- "14" => "Shabeellaha Hoose",
- "16" => "Woqooyi Galbeed",
- "18" => "Nugaal",
- "19" => "Togdheer",
- "20" => "Woqooyi Galbeed",
- "21" => "Awdal",
- "22" => "Sool"
- ),
- "SR" => array(
- "10" => "Brokopondo",
- "11" => "Commewijne",
- "12" => "Coronie",
- "13" => "Marowijne",
- "14" => "Nickerie",
- "15" => "Para",
- "16" => "Paramaribo",
- "17" => "Saramacca",
- "18" => "Sipaliwini",
- "19" => "Wanica"
- ),
- "SS" => array(
- "01" => "Central Equatoria",
- "02" => "Eastern Equatoria",
- "03" => "Jonglei",
- "04" => "Lakes",
- "05" => "Northern Bahr el Ghazal",
- "06" => "Unity",
- "07" => "Upper Nile",
- "08" => "Warrap",
- "09" => "Western Bahr el Ghazal",
- "10" => "Western Equatoria"
- ),
- "ST" => array(
- "01" => "Principe",
- "02" => "Sao Tome"
- ),
- "SV" => array(
- "01" => "Ahuachapan",
- "02" => "Cabanas",
- "03" => "Chalatenango",
- "04" => "Cuscatlan",
- "05" => "La Libertad",
- "06" => "La Paz",
- "07" => "La Union",
- "08" => "Morazan",
- "09" => "San Miguel",
- "10" => "San Salvador",
- "11" => "Santa Ana",
- "12" => "San Vicente",
- "13" => "Sonsonate",
- "14" => "Usulutan"
- ),
- "SY" => array(
- "01" => "Al Hasakah",
- "02" => "Al Ladhiqiyah",
- "03" => "Al Qunaytirah",
- "04" => "Ar Raqqah",
- "05" => "As Suwayda'",
- "06" => "Dar",
- "07" => "Dayr az Zawr",
- "08" => "Rif Dimashq",
- "09" => "Halab",
- "10" => "Hamah",
- "11" => "Hims",
- "12" => "Idlib",
- "13" => "Dimashq",
- "14" => "Tartus"
- ),
- "SZ" => array(
- "01" => "Hhohho",
- "02" => "Lubombo",
- "03" => "Manzini",
- "04" => "Shiselweni",
- "05" => "Praslin"
- ),
- "TD" => array(
- "01" => "Batha",
- "02" => "Biltine",
- "03" => "Borkou-Ennedi-Tibesti",
- "04" => "Chari-Baguirmi",
- "05" => "Guera",
- "06" => "Kanem",
- "07" => "Lac",
- "08" => "Logone Occidental",
- "09" => "Logone Oriental",
- "10" => "Mayo-Kebbi",
- "11" => "Moyen-Chari",
- "12" => "Ouaddai",
- "13" => "Salamat",
- "14" => "Tandjile"
- ),
- "TG" => array(
- "22" => "Centrale",
- "23" => "Kara",
- "24" => "Maritime",
- "25" => "Plateaux",
- "26" => "Savanes"
- ),
- "TH" => array(
- "01" => "Mae Hong Son",
- "02" => "Chiang Mai",
- "03" => "Chiang Rai",
- "04" => "Nan",
- "05" => "Lamphun",
- "06" => "Lampang",
- "07" => "Phrae",
- "08" => "Tak",
- "09" => "Sukhothai",
- "10" => "Uttaradit",
- "11" => "Kamphaeng Phet",
- "12" => "Phitsanulok",
- "13" => "Phichit",
- "14" => "Phetchabun",
- "15" => "Uthai Thani",
- "16" => "Nakhon Sawan",
- "17" => "Nong Khai",
- "18" => "Loei",
- "20" => "Sakon Nakhon",
- "21" => "Nakhon Phanom",
- "22" => "Khon Kaen",
- "23" => "Kalasin",
- "24" => "Maha Sarakham",
- "25" => "Roi Et",
- "26" => "Chaiyaphum",
- "27" => "Nakhon Ratchasima",
- "28" => "Buriram",
- "29" => "Surin",
- "30" => "Sisaket",
- "31" => "Narathiwat",
- "32" => "Chai Nat",
- "33" => "Sing Buri",
- "34" => "Lop Buri",
- "35" => "Ang Thong",
- "36" => "Phra Nakhon Si Ayutthaya",
- "37" => "Saraburi",
- "38" => "Nonthaburi",
- "39" => "Pathum Thani",
- "40" => "Krung Thep",
- "41" => "Phayao",
- "42" => "Samut Prakan",
- "43" => "Nakhon Nayok",
- "44" => "Chachoengsao",
- "45" => "Prachin Buri",
- "46" => "Chon Buri",
- "47" => "Rayong",
- "48" => "Chanthaburi",
- "49" => "Trat",
- "50" => "Kanchanaburi",
- "51" => "Suphan Buri",
- "52" => "Ratchaburi",
- "53" => "Nakhon Pathom",
- "54" => "Samut Songkhram",
- "55" => "Samut Sakhon",
- "56" => "Phetchaburi",
- "57" => "Prachuap Khiri Khan",
- "58" => "Chumphon",
- "59" => "Ranong",
- "60" => "Surat Thani",
- "61" => "Phangnga",
- "62" => "Phuket",
- "63" => "Krabi",
- "64" => "Nakhon Si Thammarat",
- "65" => "Trang",
- "66" => "Phatthalung",
- "67" => "Satun",
- "68" => "Songkhla",
- "69" => "Pattani",
- "70" => "Yala",
- "71" => "Ubon Ratchathani",
- "72" => "Yasothon",
- "73" => "Nakhon Phanom",
- "74" => "Prachin Buri",
- "75" => "Ubon Ratchathani",
- "76" => "Udon Thani",
- "77" => "Amnat Charoen",
- "78" => "Mukdahan",
- "79" => "Nong Bua Lamphu",
- "80" => "Sa Kaeo"
- ),
- "TJ" => array(
- "01" => "Kuhistoni Badakhshon",
- "02" => "Khatlon",
- "03" => "Sughd"
- ),
- "TM" => array(
- "01" => "Ahal",
- "02" => "Balkan",
- "03" => "Dashoguz",
- "04" => "Lebap",
- "05" => "Mary"
- ),
- "TN" => array(
- "02" => "Kasserine",
- "03" => "Kairouan",
- "06" => "Jendouba",
- "10" => "Qafsah",
- "14" => "El Kef",
- "15" => "Al Mahdia",
- "16" => "Al Munastir",
- "17" => "Bajah",
- "18" => "Bizerte",
- "19" => "Nabeul",
- "22" => "Siliana",
- "23" => "Sousse",
- "27" => "Ben Arous",
- "28" => "Madanin",
- "29" => "Gabes",
- "31" => "Kebili",
- "32" => "Sfax",
- "33" => "Sidi Bou Zid",
- "34" => "Tataouine",
- "35" => "Tozeur",
- "36" => "Tunis",
- "37" => "Zaghouan",
- "38" => "Aiana",
- "39" => "Manouba"
- ),
- "TO" => array(
- "01" => "Ha",
- "02" => "Tongatapu",
- "03" => "Vava"
- ),
- "TR" => array(
- "02" => "Adiyaman",
- "03" => "Afyonkarahisar",
- "04" => "Agri",
- "05" => "Amasya",
- "07" => "Antalya",
- "08" => "Artvin",
- "09" => "Aydin",
- "10" => "Balikesir",
- "11" => "Bilecik",
- "12" => "Bingol",
- "13" => "Bitlis",
- "14" => "Bolu",
- "15" => "Burdur",
- "16" => "Bursa",
- "17" => "Canakkale",
- "19" => "Corum",
- "20" => "Denizli",
- "21" => "Diyarbakir",
- "22" => "Edirne",
- "23" => "Elazig",
- "24" => "Erzincan",
- "25" => "Erzurum",
- "26" => "Eskisehir",
- "28" => "Giresun",
- "31" => "Hatay",
- "32" => "Mersin",
- "33" => "Isparta",
- "34" => "Istanbul",
- "35" => "Izmir",
- "37" => "Kastamonu",
- "38" => "Kayseri",
- "39" => "Kirklareli",
- "40" => "Kirsehir",
- "41" => "Kocaeli",
- "43" => "Kutahya",
- "44" => "Malatya",
- "45" => "Manisa",
- "46" => "Kahramanmaras",
- "48" => "Mugla",
- "49" => "Mus",
- "50" => "Nevsehir",
- "52" => "Ordu",
- "53" => "Rize",
- "54" => "Sakarya",
- "55" => "Samsun",
- "57" => "Sinop",
- "58" => "Sivas",
- "59" => "Tekirdag",
- "60" => "Tokat",
- "61" => "Trabzon",
- "62" => "Tunceli",
- "63" => "Sanliurfa",
- "64" => "Usak",
- "65" => "Van",
- "66" => "Yozgat",
- "68" => "Ankara",
- "69" => "Gumushane",
- "70" => "Hakkari",
- "71" => "Konya",
- "72" => "Mardin",
- "73" => "Nigde",
- "74" => "Siirt",
- "75" => "Aksaray",
- "76" => "Batman",
- "77" => "Bayburt",
- "78" => "Karaman",
- "79" => "Kirikkale",
- "80" => "Sirnak",
- "81" => "Adana",
- "82" => "Cankiri",
- "83" => "Gaziantep",
- "84" => "Kars",
- "85" => "Zonguldak",
- "86" => "Ardahan",
- "87" => "Bartin",
- "88" => "Igdir",
- "89" => "Karabuk",
- "90" => "Kilis",
- "91" => "Osmaniye",
- "92" => "Yalova",
- "93" => "Duzce"
- ),
- "TT" => array(
- "01" => "Arima",
- "02" => "Caroni",
- "03" => "Mayaro",
- "04" => "Nariva",
- "05" => "Port-of-Spain",
- "06" => "Saint Andrew",
- "07" => "Saint David",
- "08" => "Saint George",
- "09" => "Saint Patrick",
- "10" => "San Fernando",
- "11" => "Tobago",
- "12" => "Victoria"
- ),
- "TW" => array(
- "01" => "Fu-chien",
- "02" => "Kao-hsiung",
- "03" => "T'ai-pei",
- "04" => "T'ai-wan"
- ),
- "TZ" => array(
- "02" => "Pwani",
- "03" => "Dodoma",
- "04" => "Iringa",
- "05" => "Kigoma",
- "06" => "Kilimanjaro",
- "07" => "Lindi",
- "08" => "Mara",
- "09" => "Mbeya",
- "10" => "Morogoro",
- "11" => "Mtwara",
- "12" => "Mwanza",
- "13" => "Pemba North",
- "14" => "Ruvuma",
- "15" => "Shinyanga",
- "16" => "Singida",
- "17" => "Tabora",
- "18" => "Tanga",
- "19" => "Kagera",
- "20" => "Pemba South",
- "21" => "Zanzibar Central",
- "22" => "Zanzibar North",
- "23" => "Dar es Salaam",
- "24" => "Rukwa",
- "25" => "Zanzibar Urban",
- "26" => "Arusha",
- "27" => "Manyara"
- ),
- "UA" => array(
- "01" => "Cherkas'ka Oblast'",
- "02" => "Chernihivs'ka Oblast'",
- "03" => "Chernivets'ka Oblast'",
- "04" => "Dnipropetrovs'ka Oblast'",
- "05" => "Donets'ka Oblast'",
- "06" => "Ivano-Frankivs'ka Oblast'",
- "07" => "Kharkivs'ka Oblast'",
- "08" => "Khersons'ka Oblast'",
- "09" => "Khmel'nyts'ka Oblast'",
- "10" => "Kirovohrads'ka Oblast'",
- "11" => "Krym",
- "12" => "Kyyiv",
- "13" => "Kyyivs'ka Oblast'",
- "14" => "Luhans'ka Oblast'",
- "15" => "L'vivs'ka Oblast'",
- "16" => "Mykolayivs'ka Oblast'",
- "17" => "Odes'ka Oblast'",
- "18" => "Poltavs'ka Oblast'",
- "19" => "Rivnens'ka Oblast'",
- "20" => "Sevastopol'",
- "21" => "Sums'ka Oblast'",
- "22" => "Ternopil's'ka Oblast'",
- "23" => "Vinnyts'ka Oblast'",
- "24" => "Volyns'ka Oblast'",
- "25" => "Zakarpats'ka Oblast'",
- "26" => "Zaporiz'ka Oblast'",
- "27" => "Zhytomyrs'ka Oblast'"
- ),
- "UG" => array(
- "26" => "Apac",
- "28" => "Bundibugyo",
- "29" => "Bushenyi",
- "30" => "Gulu",
- "31" => "Hoima",
- "33" => "Jinja",
- "36" => "Kalangala",
- "37" => "Kampala",
- "38" => "Kamuli",
- "39" => "Kapchorwa",
- "40" => "Kasese",
- "41" => "Kibale",
- "42" => "Kiboga",
- "43" => "Kisoro",
- "45" => "Kotido",
- "46" => "Kumi",
- "47" => "Lira",
- "50" => "Masindi",
- "52" => "Mbarara",
- "56" => "Mubende",
- "58" => "Nebbi",
- "59" => "Ntungamo",
- "60" => "Pallisa",
- "61" => "Rakai",
- "65" => "Adjumani",
- "66" => "Bugiri",
- "67" => "Busia",
- "69" => "Katakwi",
- "70" => "Luwero",
- "71" => "Masaka",
- "72" => "Moyo",
- "73" => "Nakasongola",
- "74" => "Sembabule",
- "76" => "Tororo",
- "77" => "Arua",
- "78" => "Iganga",
- "79" => "Kabarole",
- "80" => "Kaberamaido",
- "81" => "Kamwenge",
- "82" => "Kanungu",
- "83" => "Kayunga",
- "84" => "Kitgum",
- "85" => "Kyenjojo",
- "86" => "Mayuge",
- "87" => "Mbale",
- "88" => "Moroto",
- "89" => "Mpigi",
- "90" => "Mukono",
- "91" => "Nakapiripirit",
- "92" => "Pader",
- "93" => "Rukungiri",
- "94" => "Sironko",
- "95" => "Soroti",
- "96" => "Wakiso",
- "97" => "Yumbe"
- ),
- "US" => array(
- "AA" => "Armed Forces Americas",
- "AE" => "Armed Forces Europe, Middle East, & Canada",
- "AK" => "Alaska",
- "AL" => "Alabama",
- "AP" => "Armed Forces Pacific",
- "AR" => "Arkansas",
- "AS" => "American Samoa",
- "AZ" => "Arizona",
- "CA" => "California",
- "CO" => "Colorado",
- "CT" => "Connecticut",
- "DC" => "District of Columbia",
- "DE" => "Delaware",
- "FL" => "Florida",
- "FM" => "Federated States of Micronesia",
- "GA" => "Georgia",
- "GU" => "Guam",
- "HI" => "Hawaii",
- "IA" => "Iowa",
- "ID" => "Idaho",
- "IL" => "Illinois",
- "IN" => "Indiana",
- "KS" => "Kansas",
- "KY" => "Kentucky",
- "LA" => "Louisiana",
- "MA" => "Massachusetts",
- "MD" => "Maryland",
- "ME" => "Maine",
- "MH" => "Marshall Islands",
- "MI" => "Michigan",
- "MN" => "Minnesota",
- "MO" => "Missouri",
- "MP" => "Northern Mariana Islands",
- "MS" => "Mississippi",
- "MT" => "Montana",
- "NC" => "North Carolina",
- "ND" => "North Dakota",
- "NE" => "Nebraska",
- "NH" => "New Hampshire",
- "NJ" => "New Jersey",
- "NM" => "New Mexico",
- "NV" => "Nevada",
- "NY" => "New York",
- "OH" => "Ohio",
- "OK" => "Oklahoma",
- "OR" => "Oregon",
- "PA" => "Pennsylvania",
- "PR" => "Puerto Rico",
- "PW" => "Palau",
- "RI" => "Rhode Island",
- "SC" => "South Carolina",
- "SD" => "South Dakota",
- "TN" => "Tennessee",
- "TX" => "Texas",
- "UT" => "Utah",
- "VA" => "Virginia",
- "VI" => "Virgin Islands",
- "VT" => "Vermont",
- "WA" => "Washington",
- "WI" => "Wisconsin",
- "WV" => "West Virginia",
- "WY" => "Wyoming"
- ),
- "UY" => array(
- "01" => "Artigas",
- "02" => "Canelones",
- "03" => "Cerro Largo",
- "04" => "Colonia",
- "05" => "Durazno",
- "06" => "Flores",
- "07" => "Florida",
- "08" => "Lavalleja",
- "09" => "Maldonado",
- "10" => "Montevideo",
- "11" => "Paysandu",
- "12" => "Rio Negro",
- "13" => "Rivera",
- "14" => "Rocha",
- "15" => "Salto",
- "16" => "San Jose",
- "17" => "Soriano",
- "18" => "Tacuarembo",
- "19" => "Treinta y Tres"
- ),
- "UZ" => array(
- "01" => "Andijon",
- "02" => "Bukhoro",
- "03" => "Farghona",
- "04" => "Jizzakh",
- "05" => "Khorazm",
- "06" => "Namangan",
- "07" => "Nawoiy",
- "08" => "Qashqadaryo",
- "09" => "Qoraqalpoghiston",
- "10" => "Samarqand",
- "11" => "Sirdaryo",
- "12" => "Surkhondaryo",
- "13" => "Toshkent",
- "14" => "Toshkent"
- ),
- "VC" => array(
- "01" => "Charlotte",
- "02" => "Saint Andrew",
- "03" => "Saint David",
- "04" => "Saint George",
- "05" => "Saint Patrick",
- "06" => "Grenadines"
- ),
- "VE" => array(
- "01" => "Amazonas",
- "02" => "Anzoategui",
- "03" => "Apure",
- "04" => "Aragua",
- "05" => "Barinas",
- "06" => "Bolivar",
- "07" => "Carabobo",
- "08" => "Cojedes",
- "09" => "Delta Amacuro",
- "11" => "Falcon",
- "12" => "Guarico",
- "13" => "Lara",
- "14" => "Merida",
- "15" => "Miranda",
- "16" => "Monagas",
- "17" => "Nueva Esparta",
- "18" => "Portuguesa",
- "19" => "Sucre",
- "20" => "Tachira",
- "21" => "Trujillo",
- "22" => "Yaracuy",
- "23" => "Zulia",
- "24" => "Dependencias Federales",
- "25" => "Distrito Federal",
- "26" => "Vargas"
- ),
- "VN" => array(
- "01" => "An Giang",
- "03" => "Ben Tre",
- "05" => "Cao Bang",
- "09" => "Dong Thap",
- "13" => "Hai Phong",
- "20" => "Ho Chi Minh",
- "21" => "Kien Giang",
- "23" => "Lam Dong",
- "24" => "Long An",
- "30" => "Quang Ninh",
- "32" => "Son La",
- "33" => "Tay Ninh",
- "34" => "Thanh Hoa",
- "35" => "Thai Binh",
- "37" => "Tien Giang",
- "39" => "Lang Son",
- "43" => "Dong Nai",
- "44" => "Ha Noi",
- "45" => "Ba Ria-Vung Tau",
- "46" => "Binh Dinh",
- "47" => "Binh Thuan",
- "49" => "Gia Lai",
- "50" => "Ha Giang",
- "52" => "Ha Tinh",
- "53" => "Hoa Binh",
- "54" => "Khanh Hoa",
- "55" => "Kon Tum",
- "58" => "Nghe An",
- "59" => "Ninh Binh",
- "60" => "Ninh Thuan",
- "61" => "Phu Yen",
- "62" => "Quang Binh",
- "63" => "Quang Ngai",
- "64" => "Quang Tri",
- "65" => "Soc Trang",
- "66" => "Thua Thien-Hue",
- "67" => "Tra Vinh",
- "68" => "Tuyen Quang",
- "69" => "Vinh Long",
- "70" => "Yen Bai",
- "71" => "Bac Giang",
- "72" => "Bac Kan",
- "73" => "Bac Lieu",
- "74" => "Bac Ninh",
- "75" => "Binh Duong",
- "76" => "Binh Phuoc",
- "77" => "Ca Mau",
- "78" => "Da Nang",
- "79" => "Hai Duong",
- "80" => "Ha Nam",
- "81" => "Hung Yen",
- "82" => "Nam Dinh",
- "83" => "Phu Tho",
- "84" => "Quang Nam",
- "85" => "Thai Nguyen",
- "86" => "Vinh Phuc",
- "87" => "Can Tho",
- "88" => "Dac Lak",
- "89" => "Lai Chau",
- "90" => "Lao Cai",
- "91" => "Dak Nong",
- "92" => "Dien Bien",
- "93" => "Hau Giang"
- ),
- "VU" => array(
- "05" => "Ambrym",
- "06" => "Aoba",
- "07" => "Torba",
- "08" => "Efate",
- "09" => "Epi",
- "10" => "Malakula",
- "11" => "Paama",
- "12" => "Pentecote",
- "13" => "Sanma",
- "14" => "Shepherd",
- "15" => "Tafea",
- "16" => "Malampa",
- "17" => "Penama",
- "18" => "Shefa"
- ),
- "WS" => array(
- "02" => "Aiga-i-le-Tai",
- "03" => "Atua",
- "04" => "Fa",
- "05" => "Gaga",
- "06" => "Va",
- "07" => "Gagaifomauga",
- "08" => "Palauli",
- "09" => "Satupa",
- "10" => "Tuamasaga",
- "11" => "Vaisigano"
- ),
- "YE" => array(
- "01" => "Abyan",
- "02" => "Adan",
- "03" => "Al Mahrah",
- "04" => "Hadramawt",
- "05" => "Shabwah",
- "06" => "Lahij",
- "07" => "Al Bayda'",
- "08" => "Al Hudaydah",
- "09" => "Al Jawf",
- "10" => "Al Mahwit",
- "11" => "Dhamar",
- "12" => "Hajjah",
- "13" => "Ibb",
- "14" => "Ma'rib",
- "15" => "Sa'dah",
- "16" => "San'a'",
- "17" => "Taizz",
- "18" => "Ad Dali",
- "19" => "Amran",
- "20" => "Al Bayda'",
- "21" => "Al Jawf",
- "22" => "Hajjah",
- "23" => "Ibb",
- "24" => "Lahij",
- "25" => "Taizz"
- ),
- "ZA" => array(
- "01" => "North-Western Province",
- "02" => "KwaZulu-Natal",
- "03" => "Free State",
- "05" => "Eastern Cape",
- "06" => "Gauteng",
- "07" => "Mpumalanga",
- "08" => "Northern Cape",
- "09" => "Limpopo",
- "10" => "North-West",
- "11" => "Western Cape"
- ),
- "ZM" => array(
- "01" => "Western",
- "02" => "Central",
- "03" => "Eastern",
- "04" => "Luapula",
- "05" => "Northern",
- "06" => "North-Western",
- "07" => "Southern",
- "08" => "Copperbelt",
- "09" => "Lusaka"
- ),
- "ZW" => array(
- "01" => "Manicaland",
- "02" => "Midlands",
- "03" => "Mashonaland Central",
- "04" => "Mashonaland East",
- "05" => "Mashonaland West",
- "06" => "Matabeleland North",
- "07" => "Matabeleland South",
- "08" => "Masvingo",
- "09" => "Bulawayo",
- "10" => "Harare"
- )
+"AD" => array(
+ "02" => "Canillo",
+ "03" => "Encamp",
+ "04" => "La Massana",
+ "05" => "Ordino",
+ "06" => "Sant Julia de Loria",
+ "07" => "Andorra la Vella",
+ "08" => "Escaldes-Engordany"),
+"AE" => array(
+ "01" => "Abu Dhabi",
+ "02" => "Ajman",
+ "03" => "Dubai",
+ "04" => "Fujairah",
+ "05" => "Ras Al Khaimah",
+ "06" => "Sharjah",
+ "07" => "Umm Al Quwain"),
+"AF" => array(
+ "01" => "Badakhshan",
+ "02" => "Badghis",
+ "03" => "Baghlan",
+ "05" => "Bamian",
+ "06" => "Farah",
+ "07" => "Faryab",
+ "08" => "Ghazni",
+ "09" => "Ghowr",
+ "10" => "Helmand",
+ "11" => "Herat",
+ "13" => "Kabol",
+ "14" => "Kapisa",
+ "17" => "Lowgar",
+ "18" => "Nangarhar",
+ "19" => "Nimruz",
+ "23" => "Kandahar",
+ "24" => "Kondoz",
+ "26" => "Takhar",
+ "27" => "Vardak",
+ "28" => "Zabol",
+ "29" => "Paktika",
+ "30" => "Balkh",
+ "31" => "Jowzjan",
+ "32" => "Samangan",
+ "33" => "Sar-e Pol",
+ "34" => "Konar",
+ "35" => "Laghman",
+ "36" => "Paktia",
+ "37" => "Khowst",
+ "38" => "Nurestan",
+ "39" => "Oruzgan",
+ "40" => "Parvan",
+ "41" => "Daykondi",
+ "42" => "Panjshir"),
+"AG" => array(
+ "01" => "Barbuda",
+ "03" => "Saint George",
+ "04" => "Saint John",
+ "05" => "Saint Mary",
+ "06" => "Saint Paul",
+ "07" => "Saint Peter",
+ "08" => "Saint Philip",
+ "09" => "Redonda"),
+"AL" => array(
+ "40" => "Berat",
+ "41" => "Diber",
+ "42" => "Durres",
+ "43" => "Elbasan",
+ "44" => "Fier",
+ "45" => "Gjirokaster",
+ "46" => "Korce",
+ "47" => "Kukes",
+ "48" => "Lezhe",
+ "49" => "Shkoder",
+ "50" => "Tirane",
+ "51" => "Vlore"),
+"AM" => array(
+ "01" => "Aragatsotn",
+ "02" => "Ararat",
+ "03" => "Armavir",
+ "04" => "Geghark'unik'",
+ "05" => "Kotayk'",
+ "06" => "Lorri",
+ "07" => "Shirak",
+ "08" => "Syunik'",
+ "09" => "Tavush",
+ "10" => "Vayots' Dzor",
+ "11" => "Yerevan"),
+"AO" => array(
+ "01" => "Benguela",
+ "02" => "Bie",
+ "03" => "Cabinda",
+ "04" => "Cuando Cubango",
+ "05" => "Cuanza Norte",
+ "06" => "Cuanza Sul",
+ "07" => "Cunene",
+ "08" => "Huambo",
+ "09" => "Huila",
+ "12" => "Malanje",
+ "13" => "Namibe",
+ "14" => "Moxico",
+ "15" => "Uige",
+ "16" => "Zaire",
+ "17" => "Lunda Norte",
+ "18" => "Lunda Sul",
+ "19" => "Bengo",
+ "20" => "Luanda"),
+"AR" => array(
+ "01" => "Buenos Aires",
+ "02" => "Catamarca",
+ "03" => "Chaco",
+ "04" => "Chubut",
+ "05" => "Cordoba",
+ "06" => "Corrientes",
+ "07" => "Distrito Federal",
+ "08" => "Entre Rios",
+ "09" => "Formosa",
+ "10" => "Jujuy",
+ "11" => "La Pampa",
+ "12" => "La Rioja",
+ "13" => "Mendoza",
+ "14" => "Misiones",
+ "15" => "Neuquen",
+ "16" => "Rio Negro",
+ "17" => "Salta",
+ "18" => "San Juan",
+ "19" => "San Luis",
+ "20" => "Santa Cruz",
+ "21" => "Santa Fe",
+ "22" => "Santiago del Estero",
+ "23" => "Tierra del Fuego",
+ "24" => "Tucuman"),
+"AT" => array(
+ "01" => "Burgenland",
+ "02" => "Karnten",
+ "03" => "Niederosterreich",
+ "04" => "Oberosterreich",
+ "05" => "Salzburg",
+ "06" => "Steiermark",
+ "07" => "Tirol",
+ "08" => "Vorarlberg",
+ "09" => "Wien"),
+"AU" => array(
+ "01" => "Australian Capital Territory",
+ "02" => "New South Wales",
+ "03" => "Northern Territory",
+ "04" => "Queensland",
+ "05" => "South Australia",
+ "06" => "Tasmania",
+ "07" => "Victoria",
+ "08" => "Western Australia"),
+"AZ" => array(
+ "01" => "Abseron",
+ "02" => "Agcabadi",
+ "03" => "Agdam",
+ "04" => "Agdas",
+ "05" => "Agstafa",
+ "06" => "Agsu",
+ "07" => "Ali Bayramli",
+ "08" => "Astara",
+ "09" => "Baki",
+ "10" => "Balakan",
+ "11" => "Barda",
+ "12" => "Beylaqan",
+ "13" => "Bilasuvar",
+ "14" => "Cabrayil",
+ "15" => "Calilabad",
+ "16" => "Daskasan",
+ "17" => "Davaci",
+ "18" => "Fuzuli",
+ "19" => "Gadabay",
+ "20" => "Ganca",
+ "21" => "Goranboy",
+ "22" => "Goycay",
+ "23" => "Haciqabul",
+ "24" => "Imisli",
+ "25" => "Ismayilli",
+ "26" => "Kalbacar",
+ "27" => "Kurdamir",
+ "28" => "Lacin",
+ "29" => "Lankaran",
+ "30" => "Lankaran",
+ "31" => "Lerik",
+ "32" => "Masalli",
+ "33" => "Mingacevir",
+ "34" => "Naftalan",
+ "35" => "Naxcivan",
+ "36" => "Neftcala",
+ "37" => "Oguz",
+ "38" => "Qabala",
+ "39" => "Qax",
+ "40" => "Qazax",
+ "41" => "Qobustan",
+ "42" => "Quba",
+ "43" => "Qubadli",
+ "44" => "Qusar",
+ "45" => "Saatli",
+ "46" => "Sabirabad",
+ "47" => "Saki",
+ "48" => "Saki",
+ "49" => "Salyan",
+ "50" => "Samaxi",
+ "51" => "Samkir",
+ "52" => "Samux",
+ "53" => "Siyazan",
+ "54" => "Sumqayit",
+ "55" => "Susa",
+ "56" => "Susa",
+ "57" => "Tartar",
+ "58" => "Tovuz",
+ "59" => "Ucar",
+ "60" => "Xacmaz",
+ "61" => "Xankandi",
+ "62" => "Xanlar",
+ "63" => "Xizi",
+ "64" => "Xocali",
+ "65" => "Xocavand",
+ "66" => "Yardimli",
+ "67" => "Yevlax",
+ "68" => "Yevlax",
+ "69" => "Zangilan",
+ "70" => "Zaqatala",
+ "71" => "Zardab"),
+"BA" => array(
+ "01" => "Federation of Bosnia and Herzegovina",
+ "02" => "Republika Srpska"),
+"BB" => array(
+ "01" => "Christ Church",
+ "02" => "Saint Andrew",
+ "03" => "Saint George",
+ "04" => "Saint James",
+ "05" => "Saint John",
+ "06" => "Saint Joseph",
+ "07" => "Saint Lucy",
+ "08" => "Saint Michael",
+ "09" => "Saint Peter",
+ "10" => "Saint Philip",
+ "11" => "Saint Thomas"),
+"BD" => array(
+ "81" => "Dhaka",
+ "82" => "Khulna",
+ "83" => "Rajshahi",
+ "84" => "Chittagong",
+ "85" => "Barisal",
+ "86" => "Sylhet"),
+"BE" => array(
+ "01" => "Antwerpen",
+ "03" => "Hainaut",
+ "04" => "Liege",
+ "05" => "Limburg",
+ "06" => "Luxembourg",
+ "07" => "Namur",
+ "08" => "Oost-Vlaanderen",
+ "09" => "West-Vlaanderen",
+ "10" => "Brabant Wallon",
+ "11" => "Brussels Hoofdstedelijk Gewest",
+ "12" => "Vlaams-Brabant",
+ "13" => "Flanders",
+ "14" => "Wallonia"),
+"BF" => array(
+ "15" => "Bam",
+ "19" => "Boulkiemde",
+ "20" => "Ganzourgou",
+ "21" => "Gnagna",
+ "28" => "Kouritenga",
+ "33" => "Oudalan",
+ "34" => "Passore",
+ "36" => "Sanguie",
+ "40" => "Soum",
+ "42" => "Tapoa",
+ "44" => "Zoundweogo",
+ "45" => "Bale",
+ "46" => "Banwa",
+ "47" => "Bazega",
+ "48" => "Bougouriba",
+ "49" => "Boulgou",
+ "50" => "Gourma",
+ "51" => "Houet",
+ "52" => "Ioba",
+ "53" => "Kadiogo",
+ "54" => "Kenedougou",
+ "55" => "Komoe",
+ "56" => "Komondjari",
+ "57" => "Kompienga",
+ "58" => "Kossi",
+ "59" => "Koulpelogo",
+ "60" => "Kourweogo",
+ "61" => "Leraba",
+ "62" => "Loroum",
+ "63" => "Mouhoun",
+ "64" => "Namentenga",
+ "65" => "Naouri",
+ "66" => "Nayala",
+ "67" => "Noumbiel",
+ "68" => "Oubritenga",
+ "69" => "Poni",
+ "70" => "Sanmatenga",
+ "71" => "Seno",
+ "72" => "Sissili",
+ "73" => "Sourou",
+ "74" => "Tuy",
+ "75" => "Yagha",
+ "76" => "Yatenga",
+ "77" => "Ziro",
+ "78" => "Zondoma"),
+"BG" => array(
+ "33" => "Mikhaylovgrad",
+ "38" => "Blagoevgrad",
+ "39" => "Burgas",
+ "40" => "Dobrich",
+ "41" => "Gabrovo",
+ "42" => "Grad Sofiya",
+ "43" => "Khaskovo",
+ "44" => "Kurdzhali",
+ "45" => "Kyustendil",
+ "46" => "Lovech",
+ "47" => "Montana",
+ "48" => "Pazardzhik",
+ "49" => "Pernik",
+ "50" => "Pleven",
+ "51" => "Plovdiv",
+ "52" => "Razgrad",
+ "53" => "Ruse",
+ "54" => "Shumen",
+ "55" => "Silistra",
+ "56" => "Sliven",
+ "57" => "Smolyan",
+ "58" => "Sofiya",
+ "59" => "Stara Zagora",
+ "60" => "Turgovishte",
+ "61" => "Varna",
+ "62" => "Veliko Turnovo",
+ "63" => "Vidin",
+ "64" => "Vratsa",
+ "65" => "Yambol"),
+"BH" => array(
+ "01" => "Al Hadd",
+ "02" => "Al Manamah",
+ "05" => "Jidd Hafs",
+ "06" => "Sitrah",
+ "08" => "Al Mintaqah al Gharbiyah",
+ "09" => "Mintaqat Juzur Hawar",
+ "10" => "Al Mintaqah ash Shamaliyah",
+ "11" => "Al Mintaqah al Wusta",
+ "12" => "Madinat",
+ "13" => "Ar Rifa",
+ "14" => "Madinat Hamad",
+ "15" => "Al Muharraq",
+ "16" => "Al Asimah",
+ "17" => "Al Janubiyah",
+ "18" => "Ash Shamaliyah",
+ "19" => "Al Wusta"),
+"BI" => array(
+ "02" => "Bujumbura",
+ "09" => "Bubanza",
+ "10" => "Bururi",
+ "11" => "Cankuzo",
+ "12" => "Cibitoke",
+ "13" => "Gitega",
+ "14" => "Karuzi",
+ "15" => "Kayanza",
+ "16" => "Kirundo",
+ "17" => "Makamba",
+ "18" => "Muyinga",
+ "19" => "Ngozi",
+ "20" => "Rutana",
+ "21" => "Ruyigi",
+ "22" => "Muramvya",
+ "23" => "Mwaro"),
+"BJ" => array(
+ "07" => "Alibori",
+ "08" => "Atakora",
+ "09" => "Atlanyique",
+ "10" => "Borgou",
+ "11" => "Collines",
+ "12" => "Kouffo",
+ "13" => "Donga",
+ "14" => "Littoral",
+ "15" => "Mono",
+ "16" => "Oueme",
+ "17" => "Plateau",
+ "18" => "Zou"),
+"BM" => array(
+ "01" => "Devonshire",
+ "02" => "Hamilton",
+ "03" => "Hamilton",
+ "04" => "Paget",
+ "05" => "Pembroke",
+ "06" => "Saint George",
+ "07" => "Saint George's",
+ "08" => "Sandys",
+ "09" => "Smiths",
+ "10" => "Southampton",
+ "11" => "Warwick"),
+"BN" => array(
+ "07" => "Alibori",
+ "08" => "Belait",
+ "09" => "Brunei and Muara",
+ "10" => "Temburong",
+ "11" => "Collines",
+ "12" => "Kouffo",
+ "13" => "Donga",
+ "14" => "Littoral",
+ "15" => "Tutong",
+ "16" => "Oueme",
+ "17" => "Plateau",
+ "18" => "Zou"),
+"BO" => array(
+ "01" => "Chuquisaca",
+ "02" => "Cochabamba",
+ "03" => "El Beni",
+ "04" => "La Paz",
+ "05" => "Oruro",
+ "06" => "Pando",
+ "07" => "Potosi",
+ "08" => "Santa Cruz",
+ "09" => "Tarija"),
+"BR" => array(
+ "01" => "Acre",
+ "02" => "Alagoas",
+ "03" => "Amapa",
+ "04" => "Amazonas",
+ "05" => "Bahia",
+ "06" => "Ceara",
+ "07" => "Distrito Federal",
+ "08" => "Espirito Santo",
+ "11" => "Mato Grosso do Sul",
+ "13" => "Maranhao",
+ "14" => "Mato Grosso",
+ "15" => "Minas Gerais",
+ "16" => "Para",
+ "17" => "Paraiba",
+ "18" => "Parana",
+ "20" => "Piaui",
+ "21" => "Rio de Janeiro",
+ "22" => "Rio Grande do Norte",
+ "23" => "Rio Grande do Sul",
+ "24" => "Rondonia",
+ "25" => "Roraima",
+ "26" => "Santa Catarina",
+ "27" => "Sao Paulo",
+ "28" => "Sergipe",
+ "29" => "Goias",
+ "30" => "Pernambuco",
+ "31" => "Tocantins"),
+"BS" => array(
+ "05" => "Bimini",
+ "06" => "Cat Island",
+ "10" => "Exuma",
+ "13" => "Inagua",
+ "15" => "Long Island",
+ "16" => "Mayaguana",
+ "18" => "Ragged Island",
+ "22" => "Harbour Island",
+ "23" => "New Providence",
+ "24" => "Acklins and Crooked Islands",
+ "25" => "Freeport",
+ "26" => "Fresh Creek",
+ "27" => "Governor's Harbour",
+ "28" => "Green Turtle Cay",
+ "29" => "High Rock",
+ "30" => "Kemps Bay",
+ "31" => "Marsh Harbour",
+ "32" => "Nichollstown and Berry Islands",
+ "33" => "Rock Sound",
+ "34" => "Sandy Point",
+ "35" => "San Salvador and Rum Cay"),
+"BT" => array(
+ "05" => "Bumthang",
+ "06" => "Chhukha",
+ "07" => "Chirang",
+ "08" => "Daga",
+ "09" => "Geylegphug",
+ "10" => "Ha",
+ "11" => "Lhuntshi",
+ "12" => "Mongar",
+ "13" => "Paro",
+ "14" => "Pemagatsel",
+ "15" => "Punakha",
+ "16" => "Samchi",
+ "17" => "Samdrup",
+ "18" => "Shemgang",
+ "19" => "Tashigang",
+ "20" => "Thimphu",
+ "21" => "Tongsa",
+ "22" => "Wangdi Phodrang"),
+"BW" => array(
+ "01" => "Central",
+ "03" => "Ghanzi",
+ "04" => "Kgalagadi",
+ "05" => "Kgatleng",
+ "06" => "Kweneng",
+ "08" => "North-East",
+ "09" => "South-East",
+ "10" => "Southern",
+ "11" => "North-West"),
+"BY" => array(
+ "01" => "Brestskaya Voblasts'",
+ "02" => "Homyel'skaya Voblasts'",
+ "03" => "Hrodzyenskaya Voblasts'",
+ "04" => "Minsk",
+ "05" => "Minskaya Voblasts'",
+ "06" => "Mahilyowskaya Voblasts'",
+ "07" => "Vitsyebskaya Voblasts'"),
+"BZ" => array(
+ "01" => "Belize",
+ "02" => "Cayo",
+ "03" => "Corozal",
+ "04" => "Orange Walk",
+ "05" => "Stann Creek",
+ "06" => "Toledo"),
+"CA" => array(
+ "AB" => "Alberta",
+ "BC" => "British Columbia",
+ "MB" => "Manitoba",
+ "NB" => "New Brunswick",
+ "NL" => "Newfoundland",
+ "NS" => "Nova Scotia",
+ "NT" => "Northwest Territories",
+ "NU" => "Nunavut",
+ "ON" => "Ontario",
+ "PE" => "Prince Edward Island",
+ "QC" => "Quebec",
+ "SK" => "Saskatchewan",
+ "YT" => "Yukon Territory"),
+"CD" => array(
+ "01" => "Bandundu",
+ "02" => "Equateur",
+ "04" => "Kasai-Oriental",
+ "05" => "Katanga",
+ "06" => "Kinshasa",
+ "08" => "Bas-Congo",
+ "09" => "Orientale",
+ "10" => "Maniema",
+ "11" => "Nord-Kivu",
+ "12" => "Sud-Kivu"),
+"CF" => array(
+ "01" => "Bamingui-Bangoran",
+ "02" => "Basse-Kotto",
+ "03" => "Haute-Kotto",
+ "04" => "Mambere-Kadei",
+ "05" => "Haut-Mbomou",
+ "06" => "Kemo",
+ "07" => "Lobaye",
+ "08" => "Mbomou",
+ "09" => "Nana-Mambere",
+ "11" => "Ouaka",
+ "12" => "Ouham",
+ "13" => "Ouham-Pende",
+ "14" => "Cuvette-Ouest",
+ "15" => "Nana-Grebizi",
+ "16" => "Sangha-Mbaere",
+ "17" => "Ombella-Mpoko",
+ "18" => "Bangui"),
+"CG" => array(
+ "01" => "Bouenza",
+ "04" => "Kouilou",
+ "05" => "Lekoumou",
+ "06" => "Likouala",
+ "07" => "Niari",
+ "08" => "Plateaux",
+ "10" => "Sangha",
+ "11" => "Pool",
+ "12" => "Brazzaville",
+ "13" => "Cuvette",
+ "14" => "Cuvette-Ouest"),
+"CH" => array(
+ "01" => "Aargau",
+ "02" => "Ausser-Rhoden",
+ "03" => "Basel-Landschaft",
+ "04" => "Basel-Stadt",
+ "05" => "Bern",
+ "06" => "Fribourg",
+ "07" => "Geneve",
+ "08" => "Glarus",
+ "09" => "Graubunden",
+ "10" => "Inner-Rhoden",
+ "11" => "Luzern",
+ "12" => "Neuchatel",
+ "13" => "Nidwalden",
+ "14" => "Obwalden",
+ "15" => "Sankt Gallen",
+ "16" => "Schaffhausen",
+ "17" => "Schwyz",
+ "18" => "Solothurn",
+ "19" => "Thurgau",
+ "20" => "Ticino",
+ "21" => "Uri",
+ "22" => "Valais",
+ "23" => "Vaud",
+ "24" => "Zug",
+ "25" => "Zurich",
+ "26" => "Jura"),
+"CI" => array(
+ "74" => "Agneby",
+ "75" => "Bafing",
+ "76" => "Bas-Sassandra",
+ "77" => "Denguele",
+ "78" => "Dix-Huit Montagnes",
+ "79" => "Fromager",
+ "80" => "Haut-Sassandra",
+ "81" => "Lacs",
+ "82" => "Lagunes",
+ "83" => "Marahoue",
+ "84" => "Moyen-Cavally",
+ "85" => "Moyen-Comoe",
+ "86" => "N'zi-Comoe",
+ "87" => "Savanes",
+ "88" => "Sud-Bandama",
+ "89" => "Sud-Comoe",
+ "90" => "Vallee du Bandama",
+ "91" => "Worodougou",
+ "92" => "Zanzan"),
+"CL" => array(
+ "01" => "Valparaiso",
+ "02" => "Aisen del General Carlos Ibanez del Campo",
+ "03" => "Antofagasta",
+ "04" => "Araucania",
+ "05" => "Atacama",
+ "06" => "Bio-Bio",
+ "07" => "Coquimbo",
+ "08" => "Libertador General Bernardo O'Higgins",
+ "09" => "Los Lagos",
+ "10" => "Magallanes y de la Antartica Chilena",
+ "11" => "Maule",
+ "12" => "Region Metropolitana",
+ "13" => "Tarapaca",
+ "14" => "Los Lagos",
+ "15" => "Tarapaca",
+ "16" => "Arica y Parinacota",
+ "17" => "Los Rios"),
+"CM" => array(
+ "04" => "Est",
+ "05" => "Littoral",
+ "07" => "Nord-Ouest",
+ "08" => "Ouest",
+ "09" => "Sud-Ouest",
+ "10" => "Adamaoua",
+ "11" => "Centre",
+ "12" => "Extreme-Nord",
+ "13" => "Nord",
+ "14" => "Sud"),
+"CN" => array(
+ "01" => "Anhui",
+ "02" => "Zhejiang",
+ "03" => "Jiangxi",
+ "04" => "Jiangsu",
+ "05" => "Jilin",
+ "06" => "Qinghai",
+ "07" => "Fujian",
+ "08" => "Heilongjiang",
+ "09" => "Henan",
+ "10" => "Hebei",
+ "11" => "Hunan",
+ "12" => "Hubei",
+ "13" => "Xinjiang",
+ "14" => "Xizang",
+ "15" => "Gansu",
+ "16" => "Guangxi",
+ "18" => "Guizhou",
+ "19" => "Liaoning",
+ "20" => "Nei Mongol",
+ "21" => "Ningxia",
+ "22" => "Beijing",
+ "23" => "Shanghai",
+ "24" => "Shanxi",
+ "25" => "Shandong",
+ "26" => "Shaanxi",
+ "28" => "Tianjin",
+ "29" => "Yunnan",
+ "30" => "Guangdong",
+ "31" => "Hainan",
+ "32" => "Sichuan",
+ "33" => "Chongqing"),
+"CO" => array(
+ "01" => "Amazonas",
+ "02" => "Antioquia",
+ "03" => "Arauca",
+ "04" => "Atlantico",
+ "08" => "Caqueta",
+ "09" => "Cauca",
+ "10" => "Cesar",
+ "11" => "Choco",
+ "12" => "Cordoba",
+ "14" => "Guaviare",
+ "15" => "Guainia",
+ "16" => "Huila",
+ "17" => "La Guajira",
+ "19" => "Meta",
+ "20" => "Narino",
+ "21" => "Norte de Santander",
+ "22" => "Putumayo",
+ "23" => "Quindio",
+ "24" => "Risaralda",
+ "25" => "San Andres y Providencia",
+ "26" => "Santander",
+ "27" => "Sucre",
+ "28" => "Tolima",
+ "29" => "Valle del Cauca",
+ "30" => "Vaupes",
+ "31" => "Vichada",
+ "32" => "Casanare",
+ "33" => "Cundinamarca",
+ "34" => "Distrito Especial",
+ "35" => "Bolivar",
+ "36" => "Boyaca",
+ "37" => "Caldas",
+ "38" => "Magdalena"),
+"CR" => array(
+ "01" => "Alajuela",
+ "02" => "Cartago",
+ "03" => "Guanacaste",
+ "04" => "Heredia",
+ "06" => "Limon",
+ "07" => "Puntarenas",
+ "08" => "San Jose"),
+"CU" => array(
+ "01" => "Pinar del Rio",
+ "02" => "Ciudad de la Habana",
+ "03" => "Matanzas",
+ "04" => "Isla de la Juventud",
+ "05" => "Camaguey",
+ "07" => "Ciego de Avila",
+ "08" => "Cienfuegos",
+ "09" => "Granma",
+ "10" => "Guantanamo",
+ "11" => "La Habana",
+ "12" => "Holguin",
+ "13" => "Las Tunas",
+ "14" => "Sancti Spiritus",
+ "15" => "Santiago de Cuba",
+ "16" => "Villa Clara"),
+"CV" => array(
+ "01" => "Boa Vista",
+ "02" => "Brava",
+ "04" => "Maio",
+ "05" => "Paul",
+ "07" => "Ribeira Grande",
+ "08" => "Sal",
+ "10" => "Sao Nicolau",
+ "11" => "Sao Vicente",
+ "13" => "Mosteiros",
+ "14" => "Praia",
+ "15" => "Santa Catarina",
+ "16" => "Santa Cruz",
+ "17" => "Sao Domingos",
+ "18" => "Sao Filipe",
+ "19" => "Sao Miguel",
+ "20" => "Tarrafal"),
+"CY" => array(
+ "01" => "Famagusta",
+ "02" => "Kyrenia",
+ "03" => "Larnaca",
+ "04" => "Nicosia",
+ "05" => "Limassol",
+ "06" => "Paphos"),
+"CZ" => array(
+ "52" => "Hlavni mesto Praha",
+ "78" => "Jihomoravsky kraj",
+ "79" => "Jihocesky kraj",
+ "80" => "Vysocina",
+ "81" => "Karlovarsky kraj",
+ "82" => "Kralovehradecky kraj",
+ "83" => "Liberecky kraj",
+ "84" => "Olomoucky kraj",
+ "85" => "Moravskoslezsky kraj",
+ "86" => "Pardubicky kraj",
+ "87" => "Plzensky kraj",
+ "88" => "Stredocesky kraj",
+ "89" => "Ustecky kraj",
+ "90" => "Zlinsky kraj"),
+"DE" => array(
+ "01" => "Baden-Wurttemberg",
+ "02" => "Bayern",
+ "03" => "Bremen",
+ "04" => "Hamburg",
+ "05" => "Hessen",
+ "06" => "Niedersachsen",
+ "07" => "Nordrhein-Westfalen",
+ "08" => "Rheinland-Pfalz",
+ "09" => "Saarland",
+ "10" => "Schleswig-Holstein",
+ "11" => "Brandenburg",
+ "12" => "Mecklenburg-Vorpommern",
+ "13" => "Sachsen",
+ "14" => "Sachsen-Anhalt",
+ "15" => "Thuringen",
+ "16" => "Berlin"),
+"DJ" => array(
+ "01" => "Ali Sabieh",
+ "04" => "Obock",
+ "05" => "Tadjoura",
+ "06" => "Dikhil",
+ "07" => "Djibouti",
+ "08" => "Arta"),
+"DK" => array(
+ "17" => "Hovedstaden",
+ "18" => "Midtjylland",
+ "19" => "Nordjylland",
+ "20" => "Sjelland",
+ "21" => "Syddanmark"),
+"DM" => array(
+ "02" => "Saint Andrew",
+ "03" => "Saint David",
+ "04" => "Saint George",
+ "05" => "Saint John",
+ "06" => "Saint Joseph",
+ "07" => "Saint Luke",
+ "08" => "Saint Mark",
+ "09" => "Saint Patrick",
+ "10" => "Saint Paul",
+ "11" => "Saint Peter"),
+"DO" => array(
+ "01" => "Azua",
+ "02" => "Baoruco",
+ "03" => "Barahona",
+ "04" => "Dajabon",
+ "05" => "Distrito Nacional",
+ "06" => "Duarte",
+ "08" => "Espaillat",
+ "09" => "Independencia",
+ "10" => "La Altagracia",
+ "11" => "Elias Pina",
+ "12" => "La Romana",
+ "14" => "Maria Trinidad Sanchez",
+ "15" => "Monte Cristi",
+ "16" => "Pedernales",
+ "17" => "Peravia",
+ "18" => "Puerto Plata",
+ "19" => "Salcedo",
+ "20" => "Samana",
+ "21" => "Sanchez Ramirez",
+ "23" => "San Juan",
+ "24" => "San Pedro De Macoris",
+ "25" => "Santiago",
+ "26" => "Santiago Rodriguez",
+ "27" => "Valverde",
+ "28" => "El Seibo",
+ "29" => "Hato Mayor",
+ "30" => "La Vega",
+ "31" => "Monsenor Nouel",
+ "32" => "Monte Plata",
+ "33" => "San Cristobal",
+ "34" => "Distrito Nacional",
+ "35" => "Peravia",
+ "36" => "San Jose de Ocoa",
+ "37" => "Santo Domingo"),
+"DZ" => array(
+ "01" => "Alger",
+ "03" => "Batna",
+ "04" => "Constantine",
+ "06" => "Medea",
+ "07" => "Mostaganem",
+ "09" => "Oran",
+ "10" => "Saida",
+ "12" => "Setif",
+ "13" => "Tiaret",
+ "14" => "Tizi Ouzou",
+ "15" => "Tlemcen",
+ "18" => "Bejaia",
+ "19" => "Biskra",
+ "20" => "Blida",
+ "21" => "Bouira",
+ "22" => "Djelfa",
+ "23" => "Guelma",
+ "24" => "Jijel",
+ "25" => "Laghouat",
+ "26" => "Mascara",
+ "27" => "M'sila",
+ "29" => "Oum el Bouaghi",
+ "30" => "Sidi Bel Abbes",
+ "31" => "Skikda",
+ "33" => "Tebessa",
+ "34" => "Adrar",
+ "35" => "Ain Defla",
+ "36" => "Ain Temouchent",
+ "37" => "Annaba",
+ "38" => "Bechar",
+ "39" => "Bordj Bou Arreridj",
+ "40" => "Boumerdes",
+ "41" => "Chlef",
+ "42" => "El Bayadh",
+ "43" => "El Oued",
+ "44" => "El Tarf",
+ "45" => "Ghardaia",
+ "46" => "Illizi",
+ "47" => "Khenchela",
+ "48" => "Mila",
+ "49" => "Naama",
+ "50" => "Ouargla",
+ "51" => "Relizane",
+ "52" => "Souk Ahras",
+ "53" => "Tamanghasset",
+ "54" => "Tindouf",
+ "55" => "Tipaza",
+ "56" => "Tissemsilt"),
+"EC" => array(
+ "01" => "Galapagos",
+ "02" => "Azuay",
+ "03" => "Bolivar",
+ "04" => "Canar",
+ "05" => "Carchi",
+ "06" => "Chimborazo",
+ "07" => "Cotopaxi",
+ "08" => "El Oro",
+ "09" => "Esmeraldas",
+ "10" => "Guayas",
+ "11" => "Imbabura",
+ "12" => "Loja",
+ "13" => "Los Rios",
+ "14" => "Manabi",
+ "15" => "Morona-Santiago",
+ "17" => "Pastaza",
+ "18" => "Pichincha",
+ "19" => "Tungurahua",
+ "20" => "Zamora-Chinchipe",
+ "22" => "Sucumbios",
+ "23" => "Napo",
+ "24" => "Orellana"),
+"EE" => array(
+ "01" => "Harjumaa",
+ "02" => "Hiiumaa",
+ "03" => "Ida-Virumaa",
+ "04" => "Jarvamaa",
+ "05" => "Jogevamaa",
+ "06" => "Kohtla-Jarve",
+ "07" => "Laanemaa",
+ "08" => "Laane-Virumaa",
+ "09" => "Narva",
+ "10" => "Parnu",
+ "11" => "Parnumaa",
+ "12" => "Polvamaa",
+ "13" => "Raplamaa",
+ "14" => "Saaremaa",
+ "15" => "Sillamae",
+ "16" => "Tallinn",
+ "17" => "Tartu",
+ "18" => "Tartumaa",
+ "19" => "Valgamaa",
+ "20" => "Viljandimaa",
+ "21" => "Vorumaa"),
+"EG" => array(
+ "01" => "Ad Daqahliyah",
+ "02" => "Al Bahr al Ahmar",
+ "03" => "Al Buhayrah",
+ "04" => "Al Fayyum",
+ "05" => "Al Gharbiyah",
+ "06" => "Al Iskandariyah",
+ "07" => "Al Isma'iliyah",
+ "08" => "Al Jizah",
+ "09" => "Al Minufiyah",
+ "10" => "Al Minya",
+ "11" => "Al Qahirah",
+ "12" => "Al Qalyubiyah",
+ "13" => "Al Wadi al Jadid",
+ "14" => "Ash Sharqiyah",
+ "15" => "As Suways",
+ "16" => "Aswan",
+ "17" => "Asyut",
+ "18" => "Bani Suwayf",
+ "19" => "Bur Sa'id",
+ "20" => "Dumyat",
+ "21" => "Kafr ash Shaykh",
+ "22" => "Matruh",
+ "23" => "Qina",
+ "24" => "Suhaj",
+ "26" => "Janub Sina'",
+ "27" => "Shamal Sina'"),
+"ER" => array(
+ "01" => "Anseba",
+ "02" => "Debub",
+ "03" => "Debubawi K'eyih Bahri",
+ "04" => "Gash Barka",
+ "05" => "Ma'akel",
+ "06" => "Semenawi K'eyih Bahri"),
+"ES" => array(
+ "07" => "Islas Baleares",
+ "27" => "La Rioja",
+ "29" => "Madrid",
+ "31" => "Murcia",
+ "32" => "Navarra",
+ "34" => "Asturias",
+ "39" => "Cantabria",
+ "51" => "Andalucia",
+ "52" => "Aragon",
+ "53" => "Canarias",
+ "54" => "Castilla-La Mancha",
+ "55" => "Castilla y Leon",
+ "56" => "Catalonia",
+ "57" => "Extremadura",
+ "58" => "Galicia",
+ "59" => "Pais Vasco",
+ "60" => "Comunidad Valenciana"),
+"ET" => array(
+ "44" => "Adis Abeba",
+ "45" => "Afar",
+ "46" => "Amara",
+ "47" => "Binshangul Gumuz",
+ "48" => "Dire Dawa",
+ "49" => "Gambela Hizboch",
+ "50" => "Hareri Hizb",
+ "51" => "Oromiya",
+ "52" => "Sumale",
+ "53" => "Tigray",
+ "54" => "YeDebub Biheroch Bihereseboch na Hizboch"),
+"FI" => array(
+ "01" => "Aland",
+ "06" => "Lapland",
+ "08" => "Oulu",
+ "13" => "Southern Finland",
+ "14" => "Eastern Finland",
+ "15" => "Western Finland"),
+"FJ" => array(
+ "01" => "Central",
+ "02" => "Eastern",
+ "03" => "Northern",
+ "04" => "Rotuma",
+ "05" => "Western"),
+"FM" => array(
+ "01" => "Kosrae",
+ "02" => "Pohnpei",
+ "03" => "Chuuk",
+ "04" => "Yap"),
+"FR" => array(
+ "97" => "Aquitaine",
+ "98" => "Auvergne",
+ "99" => "Basse-Normandie",
+ "A1" => "Bourgogne",
+ "A2" => "Bretagne",
+ "A3" => "Centre",
+ "A4" => "Champagne-Ardenne",
+ "A5" => "Corse",
+ "A6" => "Franche-Comte",
+ "A7" => "Haute-Normandie",
+ "A8" => "Ile-de-France",
+ "A9" => "Languedoc-Roussillon",
+ "B1" => "Limousin",
+ "B2" => "Lorraine",
+ "B3" => "Midi-Pyrenees",
+ "B4" => "Nord-Pas-de-Calais",
+ "B5" => "Pays de la Loire",
+ "B6" => "Picardie",
+ "B7" => "Poitou-Charentes",
+ "B8" => "Provence-Alpes-Cote d'Azur",
+ "B9" => "Rhone-Alpes",
+ "C1" => "Alsace"),
+"GA" => array(
+ "01" => "Estuaire",
+ "02" => "Haut-Ogooue",
+ "03" => "Moyen-Ogooue",
+ "04" => "Ngounie",
+ "05" => "Nyanga",
+ "06" => "Ogooue-Ivindo",
+ "07" => "Ogooue-Lolo",
+ "08" => "Ogooue-Maritime",
+ "09" => "Woleu-Ntem"),
+"GB" => array(
+ "A1" => "Barking and Dagenham",
+ "A2" => "Barnet",
+ "A3" => "Barnsley",
+ "A4" => "Bath and North East Somerset",
+ "A5" => "Bedfordshire",
+ "A6" => "Bexley",
+ "A7" => "Birmingham",
+ "A8" => "Blackburn with Darwen",
+ "A9" => "Blackpool",
+ "B1" => "Bolton",
+ "B2" => "Bournemouth",
+ "B3" => "Bracknell Forest",
+ "B4" => "Bradford",
+ "B5" => "Brent",
+ "B6" => "Brighton and Hove",
+ "B7" => "Bristol, City of",
+ "B8" => "Bromley",
+ "B9" => "Buckinghamshire",
+ "C1" => "Bury",
+ "C2" => "Calderdale",
+ "C3" => "Cambridgeshire",
+ "C4" => "Camden",
+ "C5" => "Cheshire",
+ "C6" => "Cornwall",
+ "C7" => "Coventry",
+ "C8" => "Croydon",
+ "C9" => "Cumbria",
+ "D1" => "Darlington",
+ "D2" => "Derby",
+ "D3" => "Derbyshire",
+ "D4" => "Devon",
+ "D5" => "Doncaster",
+ "D6" => "Dorset",
+ "D7" => "Dudley",
+ "D8" => "Durham",
+ "D9" => "Ealing",
+ "E1" => "East Riding of Yorkshire",
+ "E2" => "East Sussex",
+ "E3" => "Enfield",
+ "E4" => "Essex",
+ "E5" => "Gateshead",
+ "E6" => "Gloucestershire",
+ "E7" => "Greenwich",
+ "E8" => "Hackney",
+ "E9" => "Halton",
+ "F1" => "Hammersmith and Fulham",
+ "F2" => "Hampshire",
+ "F3" => "Haringey",
+ "F4" => "Harrow",
+ "F5" => "Hartlepool",
+ "F6" => "Havering",
+ "F7" => "Herefordshire",
+ "F8" => "Hertford",
+ "F9" => "Hillingdon",
+ "G1" => "Hounslow",
+ "G2" => "Isle of Wight",
+ "G3" => "Islington",
+ "G4" => "Kensington and Chelsea",
+ "G5" => "Kent",
+ "G6" => "Kingston upon Hull, City of",
+ "G7" => "Kingston upon Thames",
+ "G8" => "Kirklees",
+ "G9" => "Knowsley",
+ "H1" => "Lambeth",
+ "H2" => "Lancashire",
+ "H3" => "Leeds",
+ "H4" => "Leicester",
+ "H5" => "Leicestershire",
+ "H6" => "Lewisham",
+ "H7" => "Lincolnshire",
+ "H8" => "Liverpool",
+ "H9" => "London, City of",
+ "I1" => "Luton",
+ "I2" => "Manchester",
+ "I3" => "Medway",
+ "I4" => "Merton",
+ "I5" => "Middlesbrough",
+ "I6" => "Milton Keynes",
+ "I7" => "Newcastle upon Tyne",
+ "I8" => "Newham",
+ "I9" => "Norfolk",
+ "J1" => "Northamptonshire",
+ "J2" => "North East Lincolnshire",
+ "J3" => "North Lincolnshire",
+ "J4" => "North Somerset",
+ "J5" => "North Tyneside",
+ "J6" => "Northumberland",
+ "J7" => "North Yorkshire",
+ "J8" => "Nottingham",
+ "J9" => "Nottinghamshire",
+ "K1" => "Oldham",
+ "K2" => "Oxfordshire",
+ "K3" => "Peterborough",
+ "K4" => "Plymouth",
+ "K5" => "Poole",
+ "K6" => "Portsmouth",
+ "K7" => "Reading",
+ "K8" => "Redbridge",
+ "K9" => "Redcar and Cleveland",
+ "L1" => "Richmond upon Thames",
+ "L2" => "Rochdale",
+ "L3" => "Rotherham",
+ "L4" => "Rutland",
+ "L5" => "Salford",
+ "L6" => "Shropshire",
+ "L7" => "Sandwell",
+ "L8" => "Sefton",
+ "L9" => "Sheffield",
+ "M1" => "Slough",
+ "M2" => "Solihull",
+ "M3" => "Somerset",
+ "M4" => "Southampton",
+ "M5" => "Southend-on-Sea",
+ "M6" => "South Gloucestershire",
+ "M7" => "South Tyneside",
+ "M8" => "Southwark",
+ "M9" => "Staffordshire",
+ "N1" => "St. Helens",
+ "N2" => "Stockport",
+ "N3" => "Stockton-on-Tees",
+ "N4" => "Stoke-on-Trent",
+ "N5" => "Suffolk",
+ "N6" => "Sunderland",
+ "N7" => "Surrey",
+ "N8" => "Sutton",
+ "N9" => "Swindon",
+ "O1" => "Tameside",
+ "O2" => "Telford and Wrekin",
+ "O3" => "Thurrock",
+ "O4" => "Torbay",
+ "O5" => "Tower Hamlets",
+ "O6" => "Trafford",
+ "O7" => "Wakefield",
+ "O8" => "Walsall",
+ "O9" => "Waltham Forest",
+ "P1" => "Wandsworth",
+ "P2" => "Warrington",
+ "P3" => "Warwickshire",
+ "P4" => "West Berkshire",
+ "P5" => "Westminster",
+ "P6" => "West Sussex",
+ "P7" => "Wigan",
+ "P8" => "Wiltshire",
+ "P9" => "Windsor and Maidenhead",
+ "Q1" => "Wirral",
+ "Q2" => "Wokingham",
+ "Q3" => "Wolverhampton",
+ "Q4" => "Worcestershire",
+ "Q5" => "York",
+ "Q6" => "Antrim",
+ "Q7" => "Ards",
+ "Q8" => "Armagh",
+ "Q9" => "Ballymena",
+ "R1" => "Ballymoney",
+ "R2" => "Banbridge",
+ "R3" => "Belfast",
+ "R4" => "Carrickfergus",
+ "R5" => "Castlereagh",
+ "R6" => "Coleraine",
+ "R7" => "Cookstown",
+ "R8" => "Craigavon",
+ "R9" => "Down",
+ "S1" => "Dungannon",
+ "S2" => "Fermanagh",
+ "S3" => "Larne",
+ "S4" => "Limavady",
+ "S5" => "Lisburn",
+ "S6" => "Derry",
+ "S7" => "Magherafelt",
+ "S8" => "Moyle",
+ "S9" => "Newry and Mourne",
+ "T1" => "Newtownabbey",
+ "T2" => "North Down",
+ "T3" => "Omagh",
+ "T4" => "Strabane",
+ "T5" => "Aberdeen City",
+ "T6" => "Aberdeenshire",
+ "T7" => "Angus",
+ "T8" => "Argyll and Bute",
+ "T9" => "Scottish Borders, The",
+ "U1" => "Clackmannanshire",
+ "U2" => "Dumfries and Galloway",
+ "U3" => "Dundee City",
+ "U4" => "East Ayrshire",
+ "U5" => "East Dunbartonshire",
+ "U6" => "East Lothian",
+ "U7" => "East Renfrewshire",
+ "U8" => "Edinburgh, City of",
+ "U9" => "Falkirk",
+ "V1" => "Fife",
+ "V2" => "Glasgow City",
+ "V3" => "Highland",
+ "V4" => "Inverclyde",
+ "V5" => "Midlothian",
+ "V6" => "Moray",
+ "V7" => "North Ayrshire",
+ "V8" => "North Lanarkshire",
+ "V9" => "Orkney",
+ "W1" => "Perth and Kinross",
+ "W2" => "Renfrewshire",
+ "W3" => "Shetland Islands",
+ "W4" => "South Ayrshire",
+ "W5" => "South Lanarkshire",
+ "W6" => "Stirling",
+ "W7" => "West Dunbartonshire",
+ "W8" => "Eilean Siar",
+ "W9" => "West Lothian",
+ "X1" => "Isle of Anglesey",
+ "X2" => "Blaenau Gwent",
+ "X3" => "Bridgend",
+ "X4" => "Caerphilly",
+ "X5" => "Cardiff",
+ "X6" => "Ceredigion",
+ "X7" => "Carmarthenshire",
+ "X8" => "Conwy",
+ "X9" => "Denbighshire",
+ "Y1" => "Flintshire",
+ "Y2" => "Gwynedd",
+ "Y3" => "Merthyr Tydfil",
+ "Y4" => "Monmouthshire",
+ "Y5" => "Neath Port Talbot",
+ "Y6" => "Newport",
+ "Y7" => "Pembrokeshire",
+ "Y8" => "Powys",
+ "Y9" => "Rhondda Cynon Taff",
+ "Z1" => "Swansea",
+ "Z2" => "Torfaen",
+ "Z3" => "Vale of Glamorgan, The",
+ "Z4" => "Wrexham"),
+"GD" => array(
+ "01" => "Saint Andrew",
+ "02" => "Saint David",
+ "03" => "Saint George",
+ "04" => "Saint John",
+ "05" => "Saint Mark",
+ "06" => "Saint Patrick"),
+"GE" => array(
+ "01" => "Abashis Raioni",
+ "02" => "Abkhazia",
+ "03" => "Adigenis Raioni",
+ "04" => "Ajaria",
+ "05" => "Akhalgoris Raioni",
+ "06" => "Akhalk'alak'is Raioni",
+ "07" => "Akhalts'ikhis Raioni",
+ "08" => "Akhmetis Raioni",
+ "09" => "Ambrolauris Raioni",
+ "10" => "Aspindzis Raioni",
+ "11" => "Baghdat'is Raioni",
+ "12" => "Bolnisis Raioni",
+ "13" => "Borjomis Raioni",
+ "14" => "Chiat'ura",
+ "15" => "Ch'khorotsqus Raioni",
+ "16" => "Ch'okhatauris Raioni",
+ "17" => "Dedop'listsqaros Raioni",
+ "18" => "Dmanisis Raioni",
+ "19" => "Dushet'is Raioni",
+ "20" => "Gardabanis Raioni",
+ "21" => "Gori",
+ "22" => "Goris Raioni",
+ "23" => "Gurjaanis Raioni",
+ "24" => "Javis Raioni",
+ "25" => "K'arelis Raioni",
+ "26" => "Kaspis Raioni",
+ "27" => "Kharagaulis Raioni",
+ "28" => "Khashuris Raioni",
+ "29" => "Khobis Raioni",
+ "30" => "Khonis Raioni",
+ "31" => "K'ut'aisi",
+ "32" => "Lagodekhis Raioni",
+ "33" => "Lanch'khut'is Raioni",
+ "34" => "Lentekhis Raioni",
+ "35" => "Marneulis Raioni",
+ "36" => "Martvilis Raioni",
+ "37" => "Mestiis Raioni",
+ "38" => "Mts'khet'is Raioni",
+ "39" => "Ninotsmindis Raioni",
+ "40" => "Onis Raioni",
+ "41" => "Ozurget'is Raioni",
+ "42" => "P'ot'i",
+ "43" => "Qazbegis Raioni",
+ "44" => "Qvarlis Raioni",
+ "45" => "Rust'avi",
+ "46" => "Sach'kheris Raioni",
+ "47" => "Sagarejos Raioni",
+ "48" => "Samtrediis Raioni",
+ "49" => "Senakis Raioni",
+ "50" => "Sighnaghis Raioni",
+ "51" => "T'bilisi",
+ "52" => "T'elavis Raioni",
+ "53" => "T'erjolis Raioni",
+ "54" => "T'et'ritsqaros Raioni",
+ "55" => "T'ianet'is Raioni",
+ "56" => "Tqibuli",
+ "57" => "Ts'ageris Raioni",
+ "58" => "Tsalenjikhis Raioni",
+ "59" => "Tsalkis Raioni",
+ "60" => "Tsqaltubo",
+ "61" => "Vanis Raioni",
+ "62" => "Zestap'onis Raioni",
+ "63" => "Zugdidi",
+ "64" => "Zugdidis Raioni"),
+"GH" => array(
+ "01" => "Greater Accra",
+ "02" => "Ashanti",
+ "03" => "Brong-Ahafo",
+ "04" => "Central",
+ "05" => "Eastern",
+ "06" => "Northern",
+ "08" => "Volta",
+ "09" => "Western",
+ "10" => "Upper East",
+ "11" => "Upper West"),
+"GL" => array(
+ "01" => "Nordgronland",
+ "02" => "Ostgronland",
+ "03" => "Vestgronland"),
+"GM" => array(
+ "01" => "Banjul",
+ "02" => "Lower River",
+ "03" => "Central River",
+ "04" => "Upper River",
+ "05" => "Western",
+ "07" => "North Bank"),
+"GN" => array(
+ "01" => "Beyla",
+ "02" => "Boffa",
+ "03" => "Boke",
+ "04" => "Conakry",
+ "05" => "Dabola",
+ "06" => "Dalaba",
+ "07" => "Dinguiraye",
+ "09" => "Faranah",
+ "10" => "Forecariah",
+ "11" => "Fria",
+ "12" => "Gaoual",
+ "13" => "Gueckedou",
+ "15" => "Kerouane",
+ "16" => "Kindia",
+ "17" => "Kissidougou",
+ "18" => "Koundara",
+ "19" => "Kouroussa",
+ "21" => "Macenta",
+ "22" => "Mali",
+ "23" => "Mamou",
+ "25" => "Pita",
+ "27" => "Telimele",
+ "28" => "Tougue",
+ "29" => "Yomou",
+ "30" => "Coyah",
+ "31" => "Dubreka",
+ "32" => "Kankan",
+ "33" => "Koubia",
+ "34" => "Labe",
+ "35" => "Lelouma",
+ "36" => "Lola",
+ "37" => "Mandiana",
+ "38" => "Nzerekore",
+ "39" => "Siguiri"),
+"GQ" => array(
+ "03" => "Annobon",
+ "04" => "Bioko Norte",
+ "05" => "Bioko Sur",
+ "06" => "Centro Sur",
+ "07" => "Kie-Ntem",
+ "08" => "Litoral",
+ "09" => "Wele-Nzas"),
+"GR" => array(
+ "01" => "Evros",
+ "02" => "Rodhopi",
+ "03" => "Xanthi",
+ "04" => "Drama",
+ "05" => "Serrai",
+ "06" => "Kilkis",
+ "07" => "Pella",
+ "08" => "Florina",
+ "09" => "Kastoria",
+ "10" => "Grevena",
+ "11" => "Kozani",
+ "12" => "Imathia",
+ "13" => "Thessaloniki",
+ "14" => "Kavala",
+ "15" => "Khalkidhiki",
+ "16" => "Pieria",
+ "17" => "Ioannina",
+ "18" => "Thesprotia",
+ "19" => "Preveza",
+ "20" => "Arta",
+ "21" => "Larisa",
+ "22" => "Trikala",
+ "23" => "Kardhitsa",
+ "24" => "Magnisia",
+ "25" => "Kerkira",
+ "26" => "Levkas",
+ "27" => "Kefallinia",
+ "28" => "Zakinthos",
+ "29" => "Fthiotis",
+ "30" => "Evritania",
+ "31" => "Aitolia kai Akarnania",
+ "32" => "Fokis",
+ "33" => "Voiotia",
+ "34" => "Evvoia",
+ "35" => "Attiki",
+ "36" => "Argolis",
+ "37" => "Korinthia",
+ "38" => "Akhaia",
+ "39" => "Ilia",
+ "40" => "Messinia",
+ "41" => "Arkadhia",
+ "42" => "Lakonia",
+ "43" => "Khania",
+ "44" => "Rethimni",
+ "45" => "Iraklion",
+ "46" => "Lasithi",
+ "47" => "Dhodhekanisos",
+ "48" => "Samos",
+ "49" => "Kikladhes",
+ "50" => "Khios",
+ "51" => "Lesvos"),
+"GT" => array(
+ "01" => "Alta Verapaz",
+ "02" => "Baja Verapaz",
+ "03" => "Chimaltenango",
+ "04" => "Chiquimula",
+ "05" => "El Progreso",
+ "06" => "Escuintla",
+ "07" => "Guatemala",
+ "08" => "Huehuetenango",
+ "09" => "Izabal",
+ "10" => "Jalapa",
+ "11" => "Jutiapa",
+ "12" => "Peten",
+ "13" => "Quetzaltenango",
+ "14" => "Quiche",
+ "15" => "Retalhuleu",
+ "16" => "Sacatepequez",
+ "17" => "San Marcos",
+ "18" => "Santa Rosa",
+ "19" => "Solola",
+ "20" => "Suchitepequez",
+ "21" => "Totonicapan",
+ "22" => "Zacapa"),
+"GW" => array(
+ "01" => "Bafata",
+ "02" => "Quinara",
+ "04" => "Oio",
+ "05" => "Bolama",
+ "06" => "Cacheu",
+ "07" => "Tombali",
+ "10" => "Gabu",
+ "11" => "Bissau",
+ "12" => "Biombo"),
+"GY" => array(
+ "10" => "Barima-Waini",
+ "11" => "Cuyuni-Mazaruni",
+ "12" => "Demerara-Mahaica",
+ "13" => "East Berbice-Corentyne",
+ "14" => "Essequibo Islands-West Demerara",
+ "15" => "Mahaica-Berbice",
+ "16" => "Pomeroon-Supenaam",
+ "17" => "Potaro-Siparuni",
+ "18" => "Upper Demerara-Berbice",
+ "19" => "Upper Takutu-Upper Essequibo"),
+"HN" => array(
+ "01" => "Atlantida",
+ "02" => "Choluteca",
+ "03" => "Colon",
+ "04" => "Comayagua",
+ "05" => "Copan",
+ "06" => "Cortes",
+ "07" => "El Paraiso",
+ "08" => "Francisco Morazan",
+ "09" => "Gracias a Dios",
+ "10" => "Intibuca",
+ "11" => "Islas de la Bahia",
+ "12" => "La Paz",
+ "13" => "Lempira",
+ "14" => "Ocotepeque",
+ "15" => "Olancho",
+ "16" => "Santa Barbara",
+ "17" => "Valle",
+ "18" => "Yoro"),
+"HR" => array(
+ "01" => "Bjelovarsko-Bilogorska",
+ "02" => "Brodsko-Posavska",
+ "03" => "Dubrovacko-Neretvanska",
+ "04" => "Istarska",
+ "05" => "Karlovacka",
+ "06" => "Koprivnicko-Krizevacka",
+ "07" => "Krapinsko-Zagorska",
+ "08" => "Licko-Senjska",
+ "09" => "Medimurska",
+ "10" => "Osjecko-Baranjska",
+ "11" => "Pozesko-Slavonska",
+ "12" => "Primorsko-Goranska",
+ "13" => "Sibensko-Kninska",
+ "14" => "Sisacko-Moslavacka",
+ "15" => "Splitsko-Dalmatinska",
+ "16" => "Varazdinska",
+ "17" => "Viroviticko-Podravska",
+ "18" => "Vukovarsko-Srijemska",
+ "19" => "Zadarska",
+ "20" => "Zagrebacka",
+ "21" => "Grad Zagreb"),
+"HT" => array(
+ "03" => "Nord-Ouest",
+ "06" => "Artibonite",
+ "07" => "Centre",
+ "09" => "Nord",
+ "10" => "Nord-Est",
+ "11" => "Ouest",
+ "12" => "Sud",
+ "13" => "Sud-Est",
+ "14" => "Grand' Anse",
+ "15" => "Nippes"),
+"HU" => array(
+ "01" => "Bacs-Kiskun",
+ "02" => "Baranya",
+ "03" => "Bekes",
+ "04" => "Borsod-Abauj-Zemplen",
+ "05" => "Budapest",
+ "06" => "Csongrad",
+ "07" => "Debrecen",
+ "08" => "Fejer",
+ "09" => "Gyor-Moson-Sopron",
+ "10" => "Hajdu-Bihar",
+ "11" => "Heves",
+ "12" => "Komarom-Esztergom",
+ "13" => "Miskolc",
+ "14" => "Nograd",
+ "15" => "Pecs",
+ "16" => "Pest",
+ "17" => "Somogy",
+ "18" => "Szabolcs-Szatmar-Bereg",
+ "19" => "Szeged",
+ "20" => "Jasz-Nagykun-Szolnok",
+ "21" => "Tolna",
+ "22" => "Vas",
+ "23" => "Veszprem",
+ "24" => "Zala",
+ "25" => "Gyor",
+ "26" => "Bekescsaba",
+ "27" => "Dunaujvaros",
+ "28" => "Eger",
+ "29" => "Hodmezovasarhely",
+ "30" => "Kaposvar",
+ "31" => "Kecskemet",
+ "32" => "Nagykanizsa",
+ "33" => "Nyiregyhaza",
+ "34" => "Sopron",
+ "35" => "Szekesfehervar",
+ "36" => "Szolnok",
+ "37" => "Szombathely",
+ "38" => "Tatabanya",
+ "39" => "Veszprem",
+ "40" => "Zalaegerszeg",
+ "41" => "Salgotarjan",
+ "42" => "Szekszard",
+ "43" => "Erd"),
+"ID" => array(
+ "01" => "Aceh",
+ "02" => "Bali",
+ "03" => "Bengkulu",
+ "04" => "Jakarta Raya",
+ "05" => "Jambi",
+ "07" => "Jawa Tengah",
+ "08" => "Jawa Timur",
+ "10" => "Yogyakarta",
+ "11" => "Kalimantan Barat",
+ "12" => "Kalimantan Selatan",
+ "13" => "Kalimantan Tengah",
+ "14" => "Kalimantan Timur",
+ "15" => "Lampung",
+ "17" => "Nusa Tenggara Barat",
+ "18" => "Nusa Tenggara Timur",
+ "21" => "Sulawesi Tengah",
+ "22" => "Sulawesi Tenggara",
+ "24" => "Sumatera Barat",
+ "26" => "Sumatera Utara",
+ "28" => "Maluku",
+ "29" => "Maluku Utara",
+ "30" => "Jawa Barat",
+ "31" => "Sulawesi Utara",
+ "32" => "Sumatera Selatan",
+ "33" => "Banten",
+ "34" => "Gorontalo",
+ "35" => "Kepulauan Bangka Belitung",
+ "36" => "Papua",
+ "37" => "Riau",
+ "38" => "Sulawesi Selatan",
+ "39" => "Irian Jaya Barat",
+ "40" => "Kepulauan Riau",
+ "41" => "Sulawesi Barat"),
+"IE" => array(
+ "01" => "Carlow",
+ "02" => "Cavan",
+ "03" => "Clare",
+ "04" => "Cork",
+ "06" => "Donegal",
+ "07" => "Dublin",
+ "10" => "Galway",
+ "11" => "Kerry",
+ "12" => "Kildare",
+ "13" => "Kilkenny",
+ "14" => "Leitrim",
+ "15" => "Laois",
+ "16" => "Limerick",
+ "18" => "Longford",
+ "19" => "Louth",
+ "20" => "Mayo",
+ "21" => "Meath",
+ "22" => "Monaghan",
+ "23" => "Offaly",
+ "24" => "Roscommon",
+ "25" => "Sligo",
+ "26" => "Tipperary",
+ "27" => "Waterford",
+ "29" => "Westmeath",
+ "30" => "Wexford",
+ "31" => "Wicklow"),
+"IL" => array(
+ "01" => "HaDarom",
+ "02" => "HaMerkaz",
+ "03" => "HaZafon",
+ "04" => "Hefa",
+ "05" => "Tel Aviv",
+ "06" => "Yerushalayim"),
+"IN" => array(
+ "01" => "Andaman and Nicobar Islands",
+ "02" => "Andhra Pradesh",
+ "03" => "Assam",
+ "05" => "Chandigarh",
+ "06" => "Dadra and Nagar Haveli",
+ "07" => "Delhi",
+ "09" => "Gujarat",
+ "10" => "Haryana",
+ "11" => "Himachal Pradesh",
+ "12" => "Jammu and Kashmir",
+ "13" => "Kerala",
+ "14" => "Lakshadweep",
+ "16" => "Maharashtra",
+ "17" => "Manipur",
+ "18" => "Meghalaya",
+ "19" => "Karnataka",
+ "20" => "Nagaland",
+ "21" => "Orissa",
+ "22" => "Puducherry",
+ "23" => "Punjab",
+ "24" => "Rajasthan",
+ "25" => "Tamil Nadu",
+ "26" => "Tripura",
+ "28" => "West Bengal",
+ "29" => "Sikkim",
+ "30" => "Arunachal Pradesh",
+ "31" => "Mizoram",
+ "32" => "Daman and Diu",
+ "33" => "Goa",
+ "34" => "Bihar",
+ "35" => "Madhya Pradesh",
+ "36" => "Uttar Pradesh",
+ "37" => "Chhattisgarh",
+ "38" => "Jharkhand",
+ "39" => "Uttarakhand"),
+"IQ" => array(
+ "01" => "Al Anbar",
+ "02" => "Al Basrah",
+ "03" => "Al Muthanna",
+ "04" => "Al Qadisiyah",
+ "05" => "As Sulaymaniyah",
+ "06" => "Babil",
+ "07" => "Baghdad",
+ "08" => "Dahuk",
+ "09" => "Dhi Qar",
+ "10" => "Diyala",
+ "11" => "Arbil",
+ "12" => "Karbala'",
+ "13" => "At Ta'mim",
+ "14" => "Maysan",
+ "15" => "Ninawa",
+ "16" => "Wasit",
+ "17" => "An Najaf",
+ "18" => "Salah ad Din"),
+"IR" => array(
+ "01" => "Azarbayjan-e Bakhtari",
+ "03" => "Chahar Mahall va Bakhtiari",
+ "04" => "Sistan va Baluchestan",
+ "05" => "Kohkiluyeh va Buyer Ahmadi",
+ "07" => "Fars",
+ "08" => "Gilan",
+ "09" => "Hamadan",
+ "10" => "Ilam",
+ "11" => "Hormozgan",
+ "12" => "Kerman",
+ "13" => "Bakhtaran",
+ "15" => "Khuzestan",
+ "16" => "Kordestan",
+ "17" => "Mazandaran",
+ "18" => "Semnan Province",
+ "19" => "Markazi",
+ "21" => "Zanjan",
+ "22" => "Bushehr",
+ "23" => "Lorestan",
+ "24" => "Markazi",
+ "25" => "Semnan",
+ "26" => "Tehran",
+ "27" => "Zanjan",
+ "28" => "Esfahan",
+ "29" => "Kerman",
+ "30" => "Khorasan",
+ "31" => "Yazd",
+ "32" => "Ardabil",
+ "33" => "East Azarbaijan",
+ "34" => "Markazi",
+ "35" => "Mazandaran",
+ "36" => "Zanjan",
+ "37" => "Golestan",
+ "38" => "Qazvin",
+ "39" => "Qom",
+ "40" => "Yazd",
+ "41" => "Khorasan-e Janubi",
+ "42" => "Khorasan-e Razavi",
+ "43" => "Khorasan-e Shemali"),
+"IS" => array(
+ "03" => "Arnessysla",
+ "05" => "Austur-Hunavatnssysla",
+ "06" => "Austur-Skaftafellssysla",
+ "07" => "Borgarfjardarsysla",
+ "09" => "Eyjafjardarsysla",
+ "10" => "Gullbringusysla",
+ "15" => "Kjosarsysla",
+ "17" => "Myrasysla",
+ "20" => "Nordur-Mulasysla",
+ "21" => "Nordur-Tingeyjarsysla",
+ "23" => "Rangarvallasysla",
+ "28" => "Skagafjardarsysla",
+ "29" => "Snafellsnes- og Hnappadalssysla",
+ "30" => "Strandasysla",
+ "31" => "Sudur-Mulasysla",
+ "32" => "Sudur-Tingeyjarsysla",
+ "34" => "Vestur-Bardastrandarsysla",
+ "35" => "Vestur-Hunavatnssysla",
+ "36" => "Vestur-Isafjardarsysla",
+ "37" => "Vestur-Skaftafellssysla",
+ "40" => "Norourland Eystra",
+ "41" => "Norourland Vestra",
+ "42" => "Suourland",
+ "43" => "Suournes",
+ "44" => "Vestfiroir",
+ "45" => "Vesturland"),
+"IT" => array(
+ "01" => "Abruzzi",
+ "02" => "Basilicata",
+ "03" => "Calabria",
+ "04" => "Campania",
+ "05" => "Emilia-Romagna",
+ "06" => "Friuli-Venezia Giulia",
+ "07" => "Lazio",
+ "08" => "Liguria",
+ "09" => "Lombardia",
+ "10" => "Marche",
+ "11" => "Molise",
+ "12" => "Piemonte",
+ "13" => "Puglia",
+ "14" => "Sardegna",
+ "15" => "Sicilia",
+ "16" => "Toscana",
+ "17" => "Trentino-Alto Adige",
+ "18" => "Umbria",
+ "19" => "Valle d'Aosta",
+ "20" => "Veneto"),
+"JM" => array(
+ "01" => "Clarendon",
+ "02" => "Hanover",
+ "04" => "Manchester",
+ "07" => "Portland",
+ "08" => "Saint Andrew",
+ "09" => "Saint Ann",
+ "10" => "Saint Catherine",
+ "11" => "Saint Elizabeth",
+ "12" => "Saint James",
+ "13" => "Saint Mary",
+ "14" => "Saint Thomas",
+ "15" => "Trelawny",
+ "16" => "Westmoreland",
+ "17" => "Kingston"),
+"JO" => array(
+ "02" => "Al Balqa'",
+ "09" => "Al Karak",
+ "12" => "At Tafilah",
+ "15" => "Al Mafraq",
+ "16" => "Amman",
+ "17" => "Az Zaraqa",
+ "18" => "Irbid",
+ "19" => "Ma'an",
+ "20" => "Ajlun",
+ "21" => "Al Aqabah",
+ "22" => "Jarash",
+ "23" => "Madaba"),
+"JP" => array(
+ "01" => "Aichi",
+ "02" => "Akita",
+ "03" => "Aomori",
+ "04" => "Chiba",
+ "05" => "Ehime",
+ "06" => "Fukui",
+ "07" => "Fukuoka",
+ "08" => "Fukushima",
+ "09" => "Gifu",
+ "10" => "Gumma",
+ "11" => "Hiroshima",
+ "12" => "Hokkaido",
+ "13" => "Hyogo",
+ "14" => "Ibaraki",
+ "15" => "Ishikawa",
+ "16" => "Iwate",
+ "17" => "Kagawa",
+ "18" => "Kagoshima",
+ "19" => "Kanagawa",
+ "20" => "Kochi",
+ "21" => "Kumamoto",
+ "22" => "Kyoto",
+ "23" => "Mie",
+ "24" => "Miyagi",
+ "25" => "Miyazaki",
+ "26" => "Nagano",
+ "27" => "Nagasaki",
+ "28" => "Nara",
+ "29" => "Niigata",
+ "30" => "Oita",
+ "31" => "Okayama",
+ "32" => "Osaka",
+ "33" => "Saga",
+ "34" => "Saitama",
+ "35" => "Shiga",
+ "36" => "Shimane",
+ "37" => "Shizuoka",
+ "38" => "Tochigi",
+ "39" => "Tokushima",
+ "40" => "Tokyo",
+ "41" => "Tottori",
+ "42" => "Toyama",
+ "43" => "Wakayama",
+ "44" => "Yamagata",
+ "45" => "Yamaguchi",
+ "46" => "Yamanashi",
+ "47" => "Okinawa"),
+"KE" => array(
+ "01" => "Central",
+ "02" => "Coast",
+ "03" => "Eastern",
+ "05" => "Nairobi Area",
+ "06" => "North-Eastern",
+ "07" => "Nyanza",
+ "08" => "Rift Valley",
+ "09" => "Western"),
+"KG" => array(
+ "01" => "Bishkek",
+ "02" => "Chuy",
+ "03" => "Jalal-Abad",
+ "04" => "Naryn",
+ "05" => "Osh",
+ "06" => "Talas",
+ "07" => "Ysyk-Kol",
+ "08" => "Osh",
+ "09" => "Batken"),
+"KH" => array(
+ "01" => "Batdambang",
+ "02" => "Kampong Cham",
+ "03" => "Kampong Chhnang",
+ "04" => "Kampong Speu",
+ "05" => "Kampong Thum",
+ "06" => "Kampot",
+ "07" => "Kandal",
+ "08" => "Koh Kong",
+ "09" => "Kracheh",
+ "10" => "Mondulkiri",
+ "11" => "Phnum Penh",
+ "12" => "Pursat",
+ "13" => "Preah Vihear",
+ "14" => "Prey Veng",
+ "15" => "Ratanakiri Kiri",
+ "16" => "Siem Reap",
+ "17" => "Stung Treng",
+ "18" => "Svay Rieng",
+ "19" => "Takeo",
+ "25" => "Banteay Meanchey",
+ "29" => "Batdambang",
+ "30" => "Pailin"),
+"KI" => array(
+ "01" => "Gilbert Islands",
+ "02" => "Line Islands",
+ "03" => "Phoenix Islands"),
+"KM" => array(
+ "01" => "Anjouan",
+ "02" => "Grande Comore",
+ "03" => "Moheli"),
+"KN" => array(
+ "01" => "Christ Church Nichola Town",
+ "02" => "Saint Anne Sandy Point",
+ "03" => "Saint George Basseterre",
+ "04" => "Saint George Gingerland",
+ "05" => "Saint James Windward",
+ "06" => "Saint John Capisterre",
+ "07" => "Saint John Figtree",
+ "08" => "Saint Mary Cayon",
+ "09" => "Saint Paul Capisterre",
+ "10" => "Saint Paul Charlestown",
+ "11" => "Saint Peter Basseterre",
+ "12" => "Saint Thomas Lowland",
+ "13" => "Saint Thomas Middle Island",
+ "15" => "Trinity Palmetto Point"),
+"KP" => array(
+ "01" => "Chagang-do",
+ "03" => "Hamgyong-namdo",
+ "06" => "Hwanghae-namdo",
+ "07" => "Hwanghae-bukto",
+ "08" => "Kaesong-si",
+ "09" => "Kangwon-do",
+ "11" => "P'yongan-bukto",
+ "12" => "P'yongyang-si",
+ "13" => "Yanggang-do",
+ "14" => "Namp'o-si",
+ "15" => "P'yongan-namdo",
+ "17" => "Hamgyong-bukto",
+ "18" => "Najin Sonbong-si"),
+"KR" => array(
+ "01" => "Cheju-do",
+ "03" => "Cholla-bukto",
+ "05" => "Ch'ungch'ong-bukto",
+ "06" => "Kangwon-do",
+ "10" => "Pusan-jikhalsi",
+ "11" => "Seoul-t'ukpyolsi",
+ "12" => "Inch'on-jikhalsi",
+ "13" => "Kyonggi-do",
+ "14" => "Kyongsang-bukto",
+ "15" => "Taegu-jikhalsi",
+ "16" => "Cholla-namdo",
+ "17" => "Ch'ungch'ong-namdo",
+ "18" => "Kwangju-jikhalsi",
+ "19" => "Taejon-jikhalsi",
+ "20" => "Kyongsang-namdo",
+ "21" => "Ulsan-gwangyoksi"),
+"KW" => array(
+ "01" => "Al Ahmadi",
+ "02" => "Al Kuwayt",
+ "05" => "Al Jahra",
+ "07" => "Al Farwaniyah",
+ "08" => "Hawalli",
+ "09" => "Mubarak al Kabir"),
+"KY" => array(
+ "01" => "Creek",
+ "02" => "Eastern",
+ "03" => "Midland",
+ "04" => "South Town",
+ "05" => "Spot Bay",
+ "06" => "Stake Bay",
+ "07" => "West End",
+ "08" => "Western"),
+"KZ" => array(
+ "01" => "Almaty",
+ "02" => "Almaty City",
+ "03" => "Aqmola",
+ "04" => "Aqtobe",
+ "05" => "Astana",
+ "06" => "Atyrau",
+ "07" => "West Kazakhstan",
+ "08" => "Bayqonyr",
+ "09" => "Mangghystau",
+ "10" => "South Kazakhstan",
+ "11" => "Pavlodar",
+ "12" => "Qaraghandy",
+ "13" => "Qostanay",
+ "14" => "Qyzylorda",
+ "15" => "East Kazakhstan",
+ "16" => "North Kazakhstan",
+ "17" => "Zhambyl"),
+"LA" => array(
+ "01" => "Attapu",
+ "02" => "Champasak",
+ "03" => "Houaphan",
+ "04" => "Khammouan",
+ "05" => "Louang Namtha",
+ "07" => "Oudomxai",
+ "08" => "Phongsali",
+ "09" => "Saravan",
+ "10" => "Savannakhet",
+ "11" => "Vientiane",
+ "13" => "Xaignabouri",
+ "14" => "Xiangkhoang",
+ "17" => "Louangphrabang"),
+"LB" => array(
+ "01" => "Beqaa",
+ "02" => "Al Janub",
+ "03" => "Liban-Nord",
+ "04" => "Beyrouth",
+ "05" => "Mont-Liban",
+ "06" => "Liban-Sud",
+ "07" => "Nabatiye",
+ "08" => "Beqaa",
+ "09" => "Liban-Nord",
+ "10" => "Aakk,r",
+ "11" => "Baalbek-Hermel"),
+"LC" => array(
+ "01" => "Anse-la-Raye",
+ "02" => "Dauphin",
+ "03" => "Castries",
+ "04" => "Choiseul",
+ "05" => "Dennery",
+ "06" => "Gros-Islet",
+ "07" => "Laborie",
+ "08" => "Micoud",
+ "09" => "Soufriere",
+ "10" => "Vieux-Fort",
+ "11" => "Praslin"),
+"LI" => array(
+ "01" => "Balzers",
+ "02" => "Eschen",
+ "03" => "Gamprin",
+ "04" => "Mauren",
+ "05" => "Planken",
+ "06" => "Ruggell",
+ "07" => "Schaan",
+ "08" => "Schellenberg",
+ "09" => "Triesen",
+ "10" => "Triesenberg",
+ "11" => "Vaduz",
+ "21" => "Gbarpolu",
+ "22" => "River Gee"),
+"LK" => array(
+ "01" => "Amparai",
+ "02" => "Anuradhapura",
+ "03" => "Badulla",
+ "04" => "Batticaloa",
+ "06" => "Galle",
+ "07" => "Hambantota",
+ "09" => "Kalutara",
+ "10" => "Kandy",
+ "11" => "Kegalla",
+ "12" => "Kurunegala",
+ "14" => "Matale",
+ "15" => "Matara",
+ "16" => "Moneragala",
+ "17" => "Nuwara Eliya",
+ "18" => "Polonnaruwa",
+ "19" => "Puttalam",
+ "20" => "Ratnapura",
+ "21" => "Trincomalee",
+ "23" => "Colombo",
+ "24" => "Gampaha",
+ "25" => "Jaffna",
+ "26" => "Mannar",
+ "27" => "Mullaittivu",
+ "28" => "Vavuniya",
+ "29" => "Central",
+ "30" => "North Central",
+ "31" => "Northern",
+ "32" => "North Western",
+ "33" => "Sabaragamuwa",
+ "34" => "Southern",
+ "35" => "Uva",
+ "36" => "Western"),
+"LR" => array(
+ "01" => "Bong",
+ "04" => "Grand Cape Mount",
+ "05" => "Lofa",
+ "06" => "Maryland",
+ "07" => "Monrovia",
+ "09" => "Nimba",
+ "10" => "Sino",
+ "11" => "Grand Bassa",
+ "12" => "Grand Cape Mount",
+ "13" => "Maryland",
+ "14" => "Montserrado",
+ "17" => "Margibi",
+ "18" => "River Cess",
+ "19" => "Grand Gedeh",
+ "20" => "Lofa",
+ "21" => "Gbarpolu",
+ "22" => "River Gee"),
+"LS" => array(
+ "10" => "Berea",
+ "11" => "Butha-Buthe",
+ "12" => "Leribe",
+ "13" => "Mafeteng",
+ "14" => "Maseru",
+ "15" => "Mohales Hoek",
+ "16" => "Mokhotlong",
+ "17" => "Qachas Nek",
+ "18" => "Quthing",
+ "19" => "Thaba-Tseka"),
+"LT" => array(
+ "56" => "Alytaus Apskritis",
+ "57" => "Kauno Apskritis",
+ "58" => "Klaipedos Apskritis",
+ "59" => "Marijampoles Apskritis",
+ "60" => "Panevezio Apskritis",
+ "61" => "Siauliu Apskritis",
+ "62" => "Taurages Apskritis",
+ "63" => "Telsiu Apskritis",
+ "64" => "Utenos Apskritis",
+ "65" => "Vilniaus Apskritis"),
+"LU" => array(
+ "01" => "Diekirch",
+ "02" => "Grevenmacher",
+ "03" => "Luxembourg"),
+"LV" => array(
+ "01" => "Aizkraukles",
+ "02" => "Aluksnes",
+ "03" => "Balvu",
+ "04" => "Bauskas",
+ "05" => "Cesu",
+ "06" => "Daugavpils",
+ "07" => "Daugavpils",
+ "08" => "Dobeles",
+ "09" => "Gulbenes",
+ "10" => "Jekabpils",
+ "11" => "Jelgava",
+ "12" => "Jelgavas",
+ "13" => "Jurmala",
+ "14" => "Kraslavas",
+ "15" => "Kuldigas",
+ "16" => "Liepaja",
+ "17" => "Liepajas",
+ "18" => "Limbazu",
+ "19" => "Ludzas",
+ "20" => "Madonas",
+ "21" => "Ogres",
+ "22" => "Preilu",
+ "23" => "Rezekne",
+ "24" => "Rezeknes",
+ "25" => "Riga",
+ "26" => "Rigas",
+ "27" => "Saldus",
+ "28" => "Talsu",
+ "29" => "Tukuma",
+ "30" => "Valkas",
+ "31" => "Valmieras",
+ "32" => "Ventspils",
+ "33" => "Ventspils"),
+"LY" => array(
+ "03" => "Al Aziziyah",
+ "05" => "Al Jufrah",
+ "08" => "Al Kufrah",
+ "13" => "Ash Shati'",
+ "30" => "Murzuq",
+ "34" => "Sabha",
+ "41" => "Tarhunah",
+ "42" => "Tubruq",
+ "45" => "Zlitan",
+ "47" => "Ajdabiya",
+ "48" => "Al Fatih",
+ "49" => "Al Jabal al Akhdar",
+ "50" => "Al Khums",
+ "51" => "An Nuqat al Khams",
+ "52" => "Awbari",
+ "53" => "Az Zawiyah",
+ "54" => "Banghazi",
+ "55" => "Darnah",
+ "56" => "Ghadamis",
+ "57" => "Gharyan",
+ "58" => "Misratah",
+ "59" => "Sawfajjin",
+ "60" => "Surt",
+ "61" => "Tarabulus",
+ "62" => "Yafran"),
+"MA" => array(
+ "45" => "Grand Casablanca",
+ "46" => "Fes-Boulemane",
+ "47" => "Marrakech-Tensift-Al Haouz",
+ "48" => "Meknes-Tafilalet",
+ "49" => "Rabat-Sale-Zemmour-Zaer",
+ "50" => "Chaouia-Ouardigha",
+ "51" => "Doukkala-Abda",
+ "52" => "Gharb-Chrarda-Beni Hssen",
+ "53" => "Guelmim-Es Smara",
+ "54" => "Oriental",
+ "55" => "Souss-Massa-Dr,a",
+ "56" => "Tadla-Azilal",
+ "57" => "Tanger-Tetouan",
+ "58" => "Taza-Al Hoceima-Taounate",
+ "59" => "La,youne-Boujdour-Sakia El Hamra"),
+"MC" => array(
+ "01" => "La Condamine",
+ "02" => "Monaco",
+ "03" => "Monte-Carlo"),
+"MD" => array(
+ "51" => "Gagauzia",
+ "57" => "Chisinau",
+ "58" => "Stinga Nistrului",
+ "59" => "Anenii Noi",
+ "60" => "Balti",
+ "61" => "Basarabeasca",
+ "62" => "Bender",
+ "63" => "Briceni",
+ "64" => "Cahul",
+ "65" => "Cantemir",
+ "66" => "Calarasi",
+ "67" => "Causeni",
+ "68" => "Cimislia",
+ "69" => "Criuleni",
+ "70" => "Donduseni",
+ "71" => "Drochia",
+ "72" => "Dubasari",
+ "73" => "Edinet",
+ "74" => "Falesti",
+ "75" => "Floresti",
+ "76" => "Glodeni",
+ "77" => "Hincesti",
+ "78" => "Ialoveni",
+ "79" => "Leova",
+ "80" => "Nisporeni",
+ "81" => "Ocnita",
+ "82" => "Orhei",
+ "83" => "Rezina",
+ "84" => "Riscani",
+ "85" => "Singerei",
+ "86" => "Soldanesti",
+ "87" => "Soroca",
+ "88" => "Stefan-Voda",
+ "89" => "Straseni",
+ "90" => "Taraclia",
+ "91" => "Telenesti",
+ "92" => "Ungheni"),
+"MG" => array(
+ "01" => "Antsiranana",
+ "02" => "Fianarantsoa",
+ "03" => "Mahajanga",
+ "04" => "Toamasina",
+ "05" => "Antananarivo",
+ "06" => "Toliara"),
+"MK" => array(
+ "01" => "Aracinovo",
+ "02" => "Bac",
+ "03" => "Belcista",
+ "04" => "Berovo",
+ "05" => "Bistrica",
+ "06" => "Bitola",
+ "07" => "Blatec",
+ "08" => "Bogdanci",
+ "09" => "Bogomila",
+ "10" => "Bogovinje",
+ "11" => "Bosilovo",
+ "12" => "Brvenica",
+ "13" => "Cair",
+ "14" => "Capari",
+ "15" => "Caska",
+ "16" => "Cegrane",
+ "17" => "Centar",
+ "18" => "Centar Zupa",
+ "19" => "Cesinovo",
+ "20" => "Cucer-Sandevo",
+ "21" => "Debar",
+ "22" => "Delcevo",
+ "23" => "Delogozdi",
+ "24" => "Demir Hisar",
+ "25" => "Demir Kapija",
+ "26" => "Dobrusevo",
+ "27" => "Dolna Banjica",
+ "28" => "Dolneni",
+ "29" => "Dorce Petrov",
+ "30" => "Drugovo",
+ "31" => "Dzepciste",
+ "32" => "Gazi Baba",
+ "33" => "Gevgelija",
+ "34" => "Gostivar",
+ "35" => "Gradsko",
+ "36" => "Ilinden",
+ "37" => "Izvor",
+ "38" => "Jegunovce",
+ "39" => "Kamenjane",
+ "40" => "Karbinci",
+ "41" => "Karpos",
+ "42" => "Kavadarci",
+ "43" => "Kicevo",
+ "44" => "Kisela Voda",
+ "45" => "Klecevce",
+ "46" => "Kocani",
+ "47" => "Konce",
+ "48" => "Kondovo",
+ "49" => "Konopiste",
+ "50" => "Kosel",
+ "51" => "Kratovo",
+ "52" => "Kriva Palanka",
+ "53" => "Krivogastani",
+ "54" => "Krusevo",
+ "55" => "Kuklis",
+ "56" => "Kukurecani",
+ "57" => "Kumanovo",
+ "58" => "Labunista",
+ "59" => "Lipkovo",
+ "60" => "Lozovo",
+ "61" => "Lukovo",
+ "62" => "Makedonska Kamenica",
+ "63" => "Makedonski Brod",
+ "64" => "Mavrovi Anovi",
+ "65" => "Meseista",
+ "66" => "Miravci",
+ "67" => "Mogila",
+ "68" => "Murtino",
+ "69" => "Negotino",
+ "70" => "Negotino-Polosko",
+ "71" => "Novaci",
+ "72" => "Novo Selo",
+ "73" => "Oblesevo",
+ "74" => "Ohrid",
+ "75" => "Orasac",
+ "76" => "Orizari",
+ "77" => "Oslomej",
+ "78" => "Pehcevo",
+ "79" => "Petrovec",
+ "80" => "Plasnica",
+ "81" => "Podares",
+ "82" => "Prilep",
+ "83" => "Probistip",
+ "84" => "Radovis",
+ "85" => "Rankovce",
+ "86" => "Resen",
+ "87" => "Rosoman",
+ "88" => "Rostusa",
+ "89" => "Samokov",
+ "90" => "Saraj",
+ "91" => "Sipkovica",
+ "92" => "Sopiste",
+ "93" => "Sopotnica",
+ "94" => "Srbinovo",
+ "95" => "Staravina",
+ "96" => "Star Dojran",
+ "97" => "Staro Nagoricane",
+ "98" => "Stip",
+ "99" => "Struga",
+ "A1" => "Strumica",
+ "A2" => "Studenicani",
+ "A3" => "Suto Orizari",
+ "A4" => "Sveti Nikole",
+ "A5" => "Tearce",
+ "A6" => "Tetovo",
+ "A7" => "Topolcani",
+ "A8" => "Valandovo",
+ "A9" => "Vasilevo",
+ "B1" => "Veles",
+ "B2" => "Velesta",
+ "B3" => "Vevcani",
+ "B4" => "Vinica",
+ "B5" => "Vitoliste",
+ "B6" => "Vranestica",
+ "B7" => "Vrapciste",
+ "B8" => "Vratnica",
+ "B9" => "Vrutok",
+ "C1" => "Zajas",
+ "C2" => "Zelenikovo",
+ "C3" => "Zelino",
+ "C4" => "Zitose",
+ "C5" => "Zletovo",
+ "C6" => "Zrnovci"),
+"ML" => array(
+ "01" => "Bamako",
+ "03" => "Kayes",
+ "04" => "Mopti",
+ "05" => "Segou",
+ "06" => "Sikasso",
+ "07" => "Koulikoro",
+ "08" => "Tombouctou",
+ "09" => "Gao",
+ "10" => "Kidal"),
+"MM" => array(
+ "01" => "Rakhine State",
+ "02" => "Chin State",
+ "03" => "Irrawaddy",
+ "04" => "Kachin State",
+ "05" => "Karan State",
+ "06" => "Kayah State",
+ "07" => "Magwe",
+ "08" => "Mandalay",
+ "09" => "Pegu",
+ "10" => "Sagaing",
+ "11" => "Shan State",
+ "12" => "Tenasserim",
+ "13" => "Mon State",
+ "14" => "Rangoon",
+ "17" => "Yangon"),
+"MN" => array(
+ "01" => "Arhangay",
+ "02" => "Bayanhongor",
+ "03" => "Bayan-Olgiy",
+ "05" => "Darhan",
+ "06" => "Dornod",
+ "07" => "Dornogovi",
+ "08" => "Dundgovi",
+ "09" => "Dzavhan",
+ "10" => "Govi-Altay",
+ "11" => "Hentiy",
+ "12" => "Hovd",
+ "13" => "Hovsgol",
+ "14" => "Omnogovi",
+ "15" => "Ovorhangay",
+ "16" => "Selenge",
+ "17" => "Suhbaatar",
+ "18" => "Tov",
+ "19" => "Uvs",
+ "20" => "Ulaanbaatar",
+ "21" => "Bulgan",
+ "22" => "Erdenet",
+ "23" => "Darhan-Uul",
+ "24" => "Govisumber",
+ "25" => "Orhon"),
+"MO" => array(
+ "01" => "Ilhas",
+ "02" => "Macau"),
+"MR" => array(
+ "01" => "Hodh Ech Chargui",
+ "02" => "Hodh El Gharbi",
+ "03" => "Assaba",
+ "04" => "Gorgol",
+ "05" => "Brakna",
+ "06" => "Trarza",
+ "07" => "Adrar",
+ "08" => "Dakhlet Nouadhibou",
+ "09" => "Tagant",
+ "10" => "Guidimaka",
+ "11" => "Tiris Zemmour",
+ "12" => "Inchiri"),
+"MS" => array(
+ "01" => "Saint Anthony",
+ "02" => "Saint Georges",
+ "03" => "Saint Peter"),
+"MU" => array(
+ "12" => "Black River",
+ "13" => "Flacq",
+ "14" => "Grand Port",
+ "15" => "Moka",
+ "16" => "Pamplemousses",
+ "17" => "Plaines Wilhems",
+ "18" => "Port Louis",
+ "19" => "Riviere du Rempart",
+ "20" => "Savanne",
+ "21" => "Agalega Islands",
+ "22" => "Cargados Carajos",
+ "23" => "Rodrigues"),
+"MV" => array(
+ "01" => "Seenu",
+ "05" => "Laamu",
+ "30" => "Alifu",
+ "31" => "Baa",
+ "32" => "Dhaalu",
+ "33" => "Faafu ",
+ "34" => "Gaafu Alifu",
+ "35" => "Gaafu Dhaalu",
+ "36" => "Haa Alifu",
+ "37" => "Haa Dhaalu",
+ "38" => "Kaafu",
+ "39" => "Lhaviyani",
+ "40" => "Maale",
+ "41" => "Meemu",
+ "42" => "Gnaviyani",
+ "43" => "Noonu",
+ "44" => "Raa",
+ "45" => "Shaviyani",
+ "46" => "Thaa",
+ "47" => "Vaavu"),
+"MW" => array(
+ "02" => "Chikwawa",
+ "03" => "Chiradzulu",
+ "04" => "Chitipa",
+ "05" => "Thyolo",
+ "06" => "Dedza",
+ "07" => "Dowa",
+ "08" => "Karonga",
+ "09" => "Kasungu",
+ "11" => "Lilongwe",
+ "12" => "Mangochi",
+ "13" => "Mchinji",
+ "15" => "Mzimba",
+ "16" => "Ntcheu",
+ "17" => "Nkhata Bay",
+ "18" => "Nkhotakota",
+ "19" => "Nsanje",
+ "20" => "Ntchisi",
+ "21" => "Rumphi",
+ "22" => "Salima",
+ "23" => "Zomba",
+ "24" => "Blantyre",
+ "25" => "Mwanza",
+ "26" => "Balaka",
+ "27" => "Likoma",
+ "28" => "Machinga",
+ "29" => "Mulanje",
+ "30" => "Phalombe"),
+"MX" => array(
+ "01" => "Aguascalientes",
+ "02" => "Baja California",
+ "03" => "Baja California Sur",
+ "04" => "Campeche",
+ "05" => "Chiapas",
+ "06" => "Chihuahua",
+ "07" => "Coahuila de Zaragoza",
+ "08" => "Colima",
+ "09" => "Distrito Federal",
+ "10" => "Durango",
+ "11" => "Guanajuato",
+ "12" => "Guerrero",
+ "13" => "Hidalgo",
+ "14" => "Jalisco",
+ "15" => "Mexico",
+ "16" => "Michoacan de Ocampo",
+ "17" => "Morelos",
+ "18" => "Nayarit",
+ "19" => "Nuevo Leon",
+ "20" => "Oaxaca",
+ "21" => "Puebla",
+ "22" => "Queretaro de Arteaga",
+ "23" => "Quintana Roo",
+ "24" => "San Luis Potosi",
+ "25" => "Sinaloa",
+ "26" => "Sonora",
+ "27" => "Tabasco",
+ "28" => "Tamaulipas",
+ "29" => "Tlaxcala",
+ "30" => "Veracruz-Llave",
+ "31" => "Yucatan",
+ "32" => "Zacatecas"),
+"MY" => array(
+ "01" => "Johor",
+ "02" => "Kedah",
+ "03" => "Kelantan",
+ "04" => "Melaka",
+ "05" => "Negeri Sembilan",
+ "06" => "Pahang",
+ "07" => "Perak",
+ "08" => "Perlis",
+ "09" => "Pulau Pinang",
+ "11" => "Sarawak",
+ "12" => "Selangor",
+ "13" => "Terengganu",
+ "14" => "Kuala Lumpur",
+ "15" => "Labuan",
+ "16" => "Sabah",
+ "17" => "Putrajaya"),
+"MZ" => array(
+ "01" => "Cabo Delgado",
+ "02" => "Gaza",
+ "03" => "Inhambane",
+ "04" => "Maputo",
+ "05" => "Sofala",
+ "06" => "Nampula",
+ "07" => "Niassa",
+ "08" => "Tete",
+ "09" => "Zambezia",
+ "10" => "Manica",
+ "11" => "Maputo"),
+"NA" => array(
+ "01" => "Bethanien",
+ "02" => "Caprivi Oos",
+ "03" => "Boesmanland",
+ "04" => "Gobabis",
+ "05" => "Grootfontein",
+ "06" => "Kaokoland",
+ "07" => "Karibib",
+ "08" => "Keetmanshoop",
+ "09" => "Luderitz",
+ "10" => "Maltahohe",
+ "11" => "Okahandja",
+ "12" => "Omaruru",
+ "13" => "Otjiwarongo",
+ "14" => "Outjo",
+ "15" => "Owambo",
+ "16" => "Rehoboth",
+ "17" => "Swakopmund",
+ "18" => "Tsumeb",
+ "20" => "Karasburg",
+ "21" => "Windhoek",
+ "22" => "Damaraland",
+ "23" => "Hereroland Oos",
+ "24" => "Hereroland Wes",
+ "25" => "Kavango",
+ "26" => "Mariental",
+ "27" => "Namaland",
+ "28" => "Caprivi",
+ "29" => "Erongo",
+ "30" => "Hardap",
+ "31" => "Karas",
+ "32" => "Kunene",
+ "33" => "Ohangwena",
+ "34" => "Okavango",
+ "35" => "Omaheke",
+ "36" => "Omusati",
+ "37" => "Oshana",
+ "38" => "Oshikoto",
+ "39" => "Otjozondjupa"),
+"NE" => array(
+ "01" => "Agadez",
+ "02" => "Diffa",
+ "03" => "Dosso",
+ "04" => "Maradi",
+ "05" => "Niamey",
+ "06" => "Tahoua",
+ "07" => "Zinder",
+ "08" => "Niamey"),
+"NG" => array(
+ "05" => "Lagos",
+ "11" => "Federal Capital Territory",
+ "16" => "Ogun",
+ "21" => "Akwa Ibom",
+ "22" => "Cross River",
+ "23" => "Kaduna",
+ "24" => "Katsina",
+ "25" => "Anambra",
+ "26" => "Benue",
+ "27" => "Borno",
+ "28" => "Imo",
+ "29" => "Kano",
+ "30" => "Kwara",
+ "31" => "Niger",
+ "32" => "Oyo",
+ "35" => "Adamawa",
+ "36" => "Delta",
+ "37" => "Edo",
+ "39" => "Jigawa",
+ "40" => "Kebbi",
+ "41" => "Kogi",
+ "42" => "Osun",
+ "43" => "Taraba",
+ "44" => "Yobe",
+ "45" => "Abia",
+ "46" => "Bauchi",
+ "47" => "Enugu",
+ "48" => "Ondo",
+ "49" => "Plateau",
+ "50" => "Rivers",
+ "51" => "Sokoto",
+ "52" => "Bayelsa",
+ "53" => "Ebonyi",
+ "54" => "Ekiti",
+ "55" => "Gombe",
+ "56" => "Nassarawa",
+ "57" => "Zamfara"),
+"NI" => array(
+ "01" => "Boaco",
+ "02" => "Carazo",
+ "03" => "Chinandega",
+ "04" => "Chontales",
+ "05" => "Esteli",
+ "06" => "Granada",
+ "07" => "Jinotega",
+ "08" => "Leon",
+ "09" => "Madriz",
+ "10" => "Managua",
+ "11" => "Masaya",
+ "12" => "Matagalpa",
+ "13" => "Nueva Segovia",
+ "14" => "Rio San Juan",
+ "15" => "Rivas",
+ "16" => "Zelaya",
+ "17" => "Autonoma Atlantico Norte",
+ "18" => "Region Autonoma Atlantico Sur"),
+"NL" => array(
+ "01" => "Drenthe",
+ "02" => "Friesland",
+ "03" => "Gelderland",
+ "04" => "Groningen",
+ "05" => "Limburg",
+ "06" => "Noord-Brabant",
+ "07" => "Noord-Holland",
+ "09" => "Utrecht",
+ "10" => "Zeeland",
+ "11" => "Zuid-Holland",
+ "15" => "Overijssel",
+ "16" => "Flevoland"),
+"NO" => array(
+ "01" => "Akershus",
+ "02" => "Aust-Agder",
+ "04" => "Buskerud",
+ "05" => "Finnmark",
+ "06" => "Hedmark",
+ "07" => "Hordaland",
+ "08" => "More og Romsdal",
+ "09" => "Nordland",
+ "10" => "Nord-Trondelag",
+ "11" => "Oppland",
+ "12" => "Oslo",
+ "13" => "Ostfold",
+ "14" => "Rogaland",
+ "15" => "Sogn og Fjordane",
+ "16" => "Sor-Trondelag",
+ "17" => "Telemark",
+ "18" => "Troms",
+ "19" => "Vest-Agder",
+ "20" => "Vestfold"),
+"NP" => array(
+ "01" => "Bagmati",
+ "02" => "Bheri",
+ "03" => "Dhawalagiri",
+ "04" => "Gandaki",
+ "05" => "Janakpur",
+ "06" => "Karnali",
+ "07" => "Kosi",
+ "08" => "Lumbini",
+ "09" => "Mahakali",
+ "10" => "Mechi",
+ "11" => "Narayani",
+ "12" => "Rapti",
+ "13" => "Sagarmatha",
+ "14" => "Seti"),
+"NR" => array(
+ "01" => "Aiwo",
+ "02" => "Anabar",
+ "03" => "Anetan",
+ "04" => "Anibare",
+ "05" => "Baiti",
+ "06" => "Boe",
+ "07" => "Buada",
+ "08" => "Denigomodu",
+ "09" => "Ewa",
+ "10" => "Ijuw",
+ "11" => "Meneng",
+ "12" => "Nibok",
+ "13" => "Uaboe",
+ "14" => "Yaren"),
+"NZ" => array(
+ "10" => "Chatham Islands",
+ "E7" => "Auckland",
+ "E8" => "Bay of Plenty",
+ "E9" => "Canterbury",
+ "F1" => "Gisborne",
+ "F2" => "Hawke's Bay",
+ "F3" => "Manawatu-Wanganui",
+ "F4" => "Marlborough",
+ "F5" => "Nelson",
+ "F6" => "Northland",
+ "F7" => "Otago",
+ "F8" => "Southland",
+ "F9" => "Taranaki",
+ "G1" => "Waikato",
+ "G2" => "Wellington",
+ "G3" => "West Coast"),
+"OM" => array(
+ "01" => "Ad Dakhiliyah",
+ "02" => "Al Batinah",
+ "03" => "Al Wusta",
+ "04" => "Ash Sharqiyah",
+ "05" => "Az Zahirah",
+ "06" => "Masqat",
+ "07" => "Musandam",
+ "08" => "Zufar"),
+"PA" => array(
+ "01" => "Bocas del Toro",
+ "02" => "Chiriqui",
+ "03" => "Cocle",
+ "04" => "Colon",
+ "05" => "Darien",
+ "06" => "Herrera",
+ "07" => "Los Santos",
+ "08" => "Panama",
+ "09" => "San Blas",
+ "10" => "Veraguas"),
+"PE" => array(
+ "01" => "Amazonas",
+ "02" => "Ancash",
+ "03" => "Apurimac",
+ "04" => "Arequipa",
+ "05" => "Ayacucho",
+ "06" => "Cajamarca",
+ "07" => "Callao",
+ "08" => "Cusco",
+ "09" => "Huancavelica",
+ "10" => "Huanuco",
+ "11" => "Ica",
+ "12" => "Junin",
+ "13" => "La Libertad",
+ "14" => "Lambayeque",
+ "15" => "Lima",
+ "16" => "Loreto",
+ "17" => "Madre de Dios",
+ "18" => "Moquegua",
+ "19" => "Pasco",
+ "20" => "Piura",
+ "21" => "Puno",
+ "22" => "San Martin",
+ "23" => "Tacna",
+ "24" => "Tumbes",
+ "25" => "Ucayali"),
+"PG" => array(
+ "01" => "Central",
+ "02" => "Gulf",
+ "03" => "Milne Bay",
+ "04" => "Northern",
+ "05" => "Southern Highlands",
+ "06" => "Western",
+ "07" => "North Solomons",
+ "08" => "Chimbu",
+ "09" => "Eastern Highlands",
+ "10" => "East New Britain",
+ "11" => "East Sepik",
+ "12" => "Madang",
+ "13" => "Manus",
+ "14" => "Morobe",
+ "15" => "New Ireland",
+ "16" => "Western Highlands",
+ "17" => "West New Britain",
+ "18" => "Sandaun",
+ "19" => "Enga",
+ "20" => "National Capital"),
+"PH" => array(
+ "01" => "Abra",
+ "02" => "Agusan del Norte",
+ "03" => "Agusan del Sur",
+ "04" => "Aklan",
+ "05" => "Albay",
+ "06" => "Antique",
+ "07" => "Bataan",
+ "08" => "Batanes",
+ "09" => "Batangas",
+ "10" => "Benguet",
+ "11" => "Bohol",
+ "12" => "Bukidnon",
+ "13" => "Bulacan",
+ "14" => "Cagayan",
+ "15" => "Camarines Norte",
+ "16" => "Camarines Sur",
+ "17" => "Camiguin",
+ "18" => "Capiz",
+ "19" => "Catanduanes",
+ "20" => "Cavite",
+ "21" => "Cebu",
+ "22" => "Basilan",
+ "23" => "Eastern Samar",
+ "24" => "Davao",
+ "25" => "Davao del Sur",
+ "26" => "Davao Oriental",
+ "27" => "Ifugao",
+ "28" => "Ilocos Norte",
+ "29" => "Ilocos Sur",
+ "30" => "Iloilo",
+ "31" => "Isabela",
+ "32" => "Kalinga-Apayao",
+ "33" => "Laguna",
+ "34" => "Lanao del Norte",
+ "35" => "Lanao del Sur",
+ "36" => "La Union",
+ "37" => "Leyte",
+ "38" => "Marinduque",
+ "39" => "Masbate",
+ "40" => "Mindoro Occidental",
+ "41" => "Mindoro Oriental",
+ "42" => "Misamis Occidental",
+ "43" => "Misamis Oriental",
+ "44" => "Mountain",
+ "45" => "Negros Occidental",
+ "46" => "Negros Oriental",
+ "47" => "Nueva Ecija",
+ "48" => "Nueva Vizcaya",
+ "49" => "Palawan",
+ "50" => "Pampanga",
+ "51" => "Pangasinan",
+ "53" => "Rizal",
+ "54" => "Romblon",
+ "55" => "Samar",
+ "56" => "Maguindanao",
+ "57" => "North Cotabato",
+ "58" => "Sorsogon",
+ "59" => "Southern Leyte",
+ "60" => "Sulu",
+ "61" => "Surigao del Norte",
+ "62" => "Surigao del Sur",
+ "63" => "Tarlac",
+ "64" => "Zambales",
+ "65" => "Zamboanga del Norte",
+ "66" => "Zamboanga del Sur",
+ "67" => "Northern Samar",
+ "68" => "Quirino",
+ "69" => "Siquijor",
+ "70" => "South Cotabato",
+ "71" => "Sultan Kudarat",
+ "72" => "Tawitawi",
+ "A1" => "Angeles",
+ "A2" => "Bacolod",
+ "A3" => "Bago",
+ "A4" => "Baguio",
+ "A5" => "Bais",
+ "A6" => "Basilan City",
+ "A7" => "Batangas City",
+ "A8" => "Butuan",
+ "A9" => "Cabanatuan",
+ "B1" => "Cadiz",
+ "B2" => "Cagayan de Oro",
+ "B3" => "Calbayog",
+ "B4" => "Caloocan",
+ "B5" => "Canlaon",
+ "B6" => "Cavite City",
+ "B7" => "Cebu City",
+ "B8" => "Cotabato",
+ "B9" => "Dagupan",
+ "C1" => "Danao",
+ "C2" => "Dapitan",
+ "C3" => "Davao City",
+ "C4" => "Dipolog",
+ "C5" => "Dumaguete",
+ "C6" => "General Santos",
+ "C7" => "Gingoog",
+ "C8" => "Iligan",
+ "C9" => "Iloilo City",
+ "D1" => "Iriga",
+ "D2" => "La Carlota",
+ "D3" => "Laoag",
+ "D4" => "Lapu-Lapu",
+ "D5" => "Legaspi",
+ "D6" => "Lipa",
+ "D7" => "Lucena",
+ "D8" => "Mandaue",
+ "D9" => "Manila",
+ "E1" => "Marawi",
+ "E2" => "Naga",
+ "E3" => "Olongapo",
+ "E4" => "Ormoc",
+ "E5" => "Oroquieta",
+ "E6" => "Ozamis",
+ "E7" => "Pagadian",
+ "E8" => "Palayan",
+ "E9" => "Pasay",
+ "F1" => "Puerto Princesa",
+ "F2" => "Quezon City",
+ "F3" => "Roxas",
+ "F4" => "San Carlos",
+ "F5" => "San Carlos",
+ "F6" => "San Jose",
+ "F7" => "San Pablo",
+ "F8" => "Silay",
+ "F9" => "Surigao",
+ "G1" => "Tacloban",
+ "G2" => "Tagaytay",
+ "G3" => "Tagbilaran",
+ "G4" => "Tangub",
+ "G5" => "Toledo",
+ "G6" => "Trece Martires",
+ "G7" => "Zamboanga",
+ "G8" => "Aurora",
+ "H2" => "Quezon",
+ "H3" => "Negros Occidental"),
+"PK" => array(
+ "01" => "Federally Administered Tribal Areas",
+ "02" => "Balochistan",
+ "03" => "North-West Frontier",
+ "04" => "Punjab",
+ "05" => "Sindh",
+ "06" => "Azad Kashmir",
+ "07" => "Northern Areas",
+ "08" => "Islamabad"),
+"PL" => array(
+ "72" => "Dolnoslaskie",
+ "73" => "Kujawsko-Pomorskie",
+ "74" => "Lodzkie",
+ "75" => "Lubelskie",
+ "76" => "Lubuskie",
+ "77" => "Malopolskie",
+ "78" => "Mazowieckie",
+ "79" => "Opolskie",
+ "80" => "Podkarpackie",
+ "81" => "Podlaskie",
+ "82" => "Pomorskie",
+ "83" => "Slaskie",
+ "84" => "Swietokrzyskie",
+ "85" => "Warminsko-Mazurskie",
+ "86" => "Wielkopolskie",
+ "87" => "Zachodniopomorskie"),
+"PS" => array(
+ "GZ" => "Gaza",
+ "WE" => "West Bank"),
+"PT" => array(
+ "02" => "Aveiro",
+ "03" => "Beja",
+ "04" => "Braga",
+ "05" => "Braganca",
+ "06" => "Castelo Branco",
+ "07" => "Coimbra",
+ "08" => "Evora",
+ "09" => "Faro",
+ "10" => "Madeira",
+ "11" => "Guarda",
+ "13" => "Leiria",
+ "14" => "Lisboa",
+ "16" => "Portalegre",
+ "17" => "Porto",
+ "18" => "Santarem",
+ "19" => "Setubal",
+ "20" => "Viana do Castelo",
+ "21" => "Vila Real",
+ "22" => "Viseu",
+ "23" => "Azores"),
+"PY" => array(
+ "01" => "Alto Parana",
+ "02" => "Amambay",
+ "03" => "Boqueron",
+ "04" => "Caaguazu",
+ "05" => "Caazapa",
+ "06" => "Central",
+ "07" => "Concepcion",
+ "08" => "Cordillera",
+ "10" => "Guaira",
+ "11" => "Itapua",
+ "12" => "Misiones",
+ "13" => "Neembucu",
+ "15" => "Paraguari",
+ "16" => "Presidente Hayes",
+ "17" => "San Pedro",
+ "19" => "Canindeyu",
+ "20" => "Chaco",
+ "21" => "Nueva Asuncion",
+ "23" => "Alto Paraguay"),
+"QA" => array(
+ "01" => "Ad Dawhah",
+ "02" => "Al Ghuwariyah",
+ "03" => "Al Jumaliyah",
+ "04" => "Al Khawr",
+ "05" => "Al Wakrah Municipality",
+ "06" => "Ar Rayyan",
+ "08" => "Madinat ach Shamal",
+ "09" => "Umm Salal",
+ "10" => "Al Wakrah",
+ "11" => "Jariyan al Batnah",
+ "12" => "Umm Sa'id"),
+"RO" => array(
+ "01" => "Alba",
+ "02" => "Arad",
+ "03" => "Arges",
+ "04" => "Bacau",
+ "05" => "Bihor",
+ "06" => "Bistrita-Nasaud",
+ "07" => "Botosani",
+ "08" => "Braila",
+ "09" => "Brasov",
+ "10" => "Bucuresti",
+ "11" => "Buzau",
+ "12" => "Caras-Severin",
+ "13" => "Cluj",
+ "14" => "Constanta",
+ "15" => "Covasna",
+ "16" => "Dambovita",
+ "17" => "Dolj",
+ "18" => "Galati",
+ "19" => "Gorj",
+ "20" => "Harghita",
+ "21" => "Hunedoara",
+ "22" => "Ialomita",
+ "23" => "Iasi",
+ "25" => "Maramures",
+ "26" => "Mehedinti",
+ "27" => "Mures",
+ "28" => "Neamt",
+ "29" => "Olt",
+ "30" => "Prahova",
+ "31" => "Salaj",
+ "32" => "Satu Mare",
+ "33" => "Sibiu",
+ "34" => "Suceava",
+ "35" => "Teleorman",
+ "36" => "Timis",
+ "37" => "Tulcea",
+ "38" => "Vaslui",
+ "39" => "Valcea",
+ "40" => "Vrancea",
+ "41" => "Calarasi",
+ "42" => "Giurgiu",
+ "43" => "Ilfov"),
+"RS" => array(
+ "01" => "Kosovo",
+ "02" => "Vojvodina"),
+"RU" => array(
+ "01" => "Adygeya, Republic of",
+ "02" => "Aginsky Buryatsky AO",
+ "03" => "Gorno-Altay",
+ "04" => "Altaisky krai",
+ "05" => "Amur",
+ "06" => "Arkhangel'sk",
+ "07" => "Astrakhan'",
+ "08" => "Bashkortostan",
+ "09" => "Belgorod",
+ "10" => "Bryansk",
+ "11" => "Buryat",
+ "12" => "Chechnya",
+ "13" => "Chelyabinsk",
+ "14" => "Chita",
+ "15" => "Chukot",
+ "16" => "Chuvashia",
+ "17" => "Dagestan",
+ "18" => "Evenk",
+ "19" => "Ingush",
+ "20" => "Irkutsk",
+ "21" => "Ivanovo",
+ "22" => "Kabardin-Balkar",
+ "23" => "Kaliningrad",
+ "24" => "Kalmyk",
+ "25" => "Kaluga",
+ "26" => "Kamchatka",
+ "27" => "Karachay-Cherkess",
+ "28" => "Karelia",
+ "29" => "Kemerovo",
+ "30" => "Khabarovsk",
+ "31" => "Khakass",
+ "32" => "Khanty-Mansiy",
+ "33" => "Kirov",
+ "34" => "Komi",
+ "35" => "Komi-Permyak",
+ "36" => "Koryak",
+ "37" => "Kostroma",
+ "38" => "Krasnodar",
+ "39" => "Krasnoyarsk",
+ "40" => "Kurgan",
+ "41" => "Kursk",
+ "42" => "Leningrad",
+ "43" => "Lipetsk",
+ "44" => "Magadan",
+ "45" => "Mariy-El",
+ "46" => "Mordovia",
+ "47" => "Moskva",
+ "48" => "Moscow City",
+ "49" => "Murmansk",
+ "50" => "Nenets",
+ "51" => "Nizhegorod",
+ "52" => "Novgorod",
+ "53" => "Novosibirsk",
+ "54" => "Omsk",
+ "55" => "Orenburg",
+ "56" => "Orel",
+ "57" => "Penza",
+ "58" => "Perm'",
+ "59" => "Primor'ye",
+ "60" => "Pskov",
+ "61" => "Rostov",
+ "62" => "Ryazan'",
+ "63" => "Sakha",
+ "64" => "Sakhalin",
+ "65" => "Samara",
+ "66" => "Saint Petersburg City",
+ "67" => "Saratov",
+ "68" => "North Ossetia",
+ "69" => "Smolensk",
+ "70" => "Stavropol'",
+ "71" => "Sverdlovsk",
+ "72" => "Tambovskaya oblast",
+ "73" => "Tatarstan",
+ "74" => "Taymyr",
+ "75" => "Tomsk",
+ "76" => "Tula",
+ "77" => "Tver'",
+ "78" => "Tyumen'",
+ "79" => "Tuva",
+ "80" => "Udmurt",
+ "81" => "Ul'yanovsk",
+ "82" => "Ust-Orda Buryat",
+ "83" => "Vladimir",
+ "84" => "Volgograd",
+ "85" => "Vologda",
+ "86" => "Voronezh",
+ "87" => "Yamal-Nenets",
+ "88" => "Yaroslavl'",
+ "89" => "Yevrey",
+ "90" => "Permskiy Kray",
+ "91" => "Krasnoyarskiy Kray",
+ "92" => "Kamchatskiy Kray",
+ "93" => "Zabaykal'skiy Kray"),
+"RW" => array(
+ "01" => "Butare",
+ "06" => "Gitarama",
+ "07" => "Kibungo",
+ "09" => "Kigali",
+ "11" => "Est",
+ "12" => "Kigali",
+ "13" => "Nord",
+ "14" => "Ouest",
+ "15" => "Sud"),
+"SA" => array(
+ "02" => "Al Bahah",
+ "05" => "Al Madinah",
+ "06" => "Ash Sharqiyah",
+ "08" => "Al Qasim",
+ "10" => "Ar Riyad",
+ "11" => "Asir Province",
+ "13" => "Ha'il",
+ "14" => "Makkah",
+ "15" => "Al Hudud ash Shamaliyah",
+ "16" => "Najran",
+ "17" => "Jizan",
+ "19" => "Tabuk",
+ "20" => "Al Jawf"),
+"SB" => array(
+ "03" => "Malaita",
+ "06" => "Guadalcanal",
+ "07" => "Isabel",
+ "08" => "Makira",
+ "09" => "Temotu",
+ "10" => "Central",
+ "11" => "Western",
+ "12" => "Choiseul",
+ "13" => "Rennell and Bellona"),
+"SC" => array(
+ "01" => "Anse aux Pins",
+ "02" => "Anse Boileau",
+ "03" => "Anse Etoile",
+ "04" => "Anse Louis",
+ "05" => "Anse Royale",
+ "06" => "Baie Lazare",
+ "07" => "Baie Sainte Anne",
+ "08" => "Beau Vallon",
+ "09" => "Bel Air",
+ "10" => "Bel Ombre",
+ "11" => "Cascade",
+ "12" => "Glacis",
+ "13" => "Grand' Anse",
+ "14" => "Grand' Anse",
+ "15" => "La Digue",
+ "16" => "La Riviere Anglaise",
+ "17" => "Mont Buxton",
+ "18" => "Mont Fleuri",
+ "19" => "Plaisance",
+ "20" => "Pointe La Rue",
+ "21" => "Port Glaud",
+ "22" => "Saint Louis",
+ "23" => "Takamaka"),
+"SD" => array(
+ "27" => "Al Wusta",
+ "28" => "Al Istiwa'iyah",
+ "29" => "Al Khartum",
+ "30" => "Ash Shamaliyah",
+ "31" => "Ash Sharqiyah",
+ "32" => "Bahr al Ghazal",
+ "33" => "Darfur",
+ "34" => "Kurdufan",
+ "35" => "Upper Nile",
+ "40" => "Al Wahadah State",
+ "44" => "Central Equatoria State"),
+"SE" => array(
+ "02" => "Blekinge Lan",
+ "03" => "Gavleborgs Lan",
+ "05" => "Gotlands Lan",
+ "06" => "Hallands Lan",
+ "07" => "Jamtlands Lan",
+ "08" => "Jonkopings Lan",
+ "09" => "Kalmar Lan",
+ "10" => "Dalarnas Lan",
+ "12" => "Kronobergs Lan",
+ "14" => "Norrbottens Lan",
+ "15" => "Orebro Lan",
+ "16" => "Ostergotlands Lan",
+ "18" => "Sodermanlands Lan",
+ "21" => "Uppsala Lan",
+ "22" => "Varmlands Lan",
+ "23" => "Vasterbottens Lan",
+ "24" => "Vasternorrlands Lan",
+ "25" => "Vastmanlands Lan",
+ "26" => "Stockholms Lan",
+ "27" => "Skane Lan",
+ "28" => "Vastra Gotaland"),
+"SH" => array(
+ "01" => "Ascension",
+ "02" => "Saint Helena",
+ "03" => "Tristan da Cunha"),
+"SI" => array(
+ "01" => "Ajdovscina",
+ "02" => "Beltinci",
+ "03" => "Bled",
+ "04" => "Bohinj",
+ "05" => "Borovnica",
+ "06" => "Bovec",
+ "07" => "Brda",
+ "08" => "Brezice",
+ "09" => "Brezovica",
+ "11" => "Celje",
+ "12" => "Cerklje na Gorenjskem",
+ "13" => "Cerknica",
+ "14" => "Cerkno",
+ "15" => "Crensovci",
+ "16" => "Crna na Koroskem",
+ "17" => "Crnomelj",
+ "19" => "Divaca",
+ "20" => "Dobrepolje",
+ "22" => "Dol pri Ljubljani",
+ "24" => "Dornava",
+ "25" => "Dravograd",
+ "26" => "Duplek",
+ "27" => "Gorenja Vas-Poljane",
+ "28" => "Gorisnica",
+ "29" => "Gornja Radgona",
+ "30" => "Gornji Grad",
+ "31" => "Gornji Petrovci",
+ "32" => "Grosuplje",
+ "34" => "Hrastnik",
+ "35" => "Hrpelje-Kozina",
+ "36" => "Idrija",
+ "37" => "Ig",
+ "38" => "Ilirska Bistrica",
+ "39" => "Ivancna Gorica",
+ "40" => "Izola-Isola",
+ "42" => "Jursinci",
+ "44" => "Kanal",
+ "45" => "Kidricevo",
+ "46" => "Kobarid",
+ "47" => "Kobilje",
+ "49" => "Komen",
+ "50" => "Koper-Capodistria",
+ "51" => "Kozje",
+ "52" => "Kranj",
+ "53" => "Kranjska Gora",
+ "54" => "Krsko",
+ "55" => "Kungota",
+ "57" => "Lasko",
+ "61" => "Ljubljana",
+ "62" => "Ljubno",
+ "64" => "Logatec",
+ "66" => "Loski Potok",
+ "68" => "Lukovica",
+ "71" => "Medvode",
+ "72" => "Menges",
+ "73" => "Metlika",
+ "74" => "Mezica",
+ "76" => "Mislinja",
+ "77" => "Moravce",
+ "78" => "Moravske Toplice",
+ "79" => "Mozirje",
+ "80" => "Murska Sobota",
+ "81" => "Muta",
+ "82" => "Naklo",
+ "83" => "Nazarje",
+ "84" => "Nova Gorica",
+ "86" => "Odranci",
+ "87" => "Ormoz",
+ "88" => "Osilnica",
+ "89" => "Pesnica",
+ "91" => "Pivka",
+ "92" => "Podcetrtek",
+ "94" => "Postojna",
+ "97" => "Puconci",
+ "98" => "Racam",
+ "99" => "Radece",
+ "A1" => "Radenci",
+ "A2" => "Radlje ob Dravi",
+ "A3" => "Radovljica",
+ "A6" => "Rogasovci",
+ "A7" => "Rogaska Slatina",
+ "A8" => "Rogatec",
+ "B1" => "Semic",
+ "B2" => "Sencur",
+ "B3" => "Sentilj",
+ "B4" => "Sentjernej",
+ "B6" => "Sevnica",
+ "B7" => "Sezana",
+ "B8" => "Skocjan",
+ "B9" => "Skofja Loka",
+ "C1" => "Skofljica",
+ "C2" => "Slovenj Gradec",
+ "C4" => "Slovenske Konjice",
+ "C5" => "Smarje pri Jelsah",
+ "C6" => "Smartno ob Paki",
+ "C7" => "Sostanj",
+ "C8" => "Starse",
+ "C9" => "Store",
+ "D1" => "Sveti Jurij",
+ "D2" => "Tolmin",
+ "D3" => "Trbovlje",
+ "D4" => "Trebnje",
+ "D5" => "Trzic",
+ "D6" => "Turnisce",
+ "D7" => "Velenje",
+ "D8" => "Velike Lasce",
+ "E1" => "Vipava",
+ "E2" => "Vitanje",
+ "E3" => "Vodice",
+ "E5" => "Vrhnika",
+ "E6" => "Vuzenica",
+ "E7" => "Zagorje ob Savi",
+ "E9" => "Zavrc",
+ "F1" => "Zelezniki",
+ "F2" => "Ziri",
+ "F3" => "Zrece",
+ "G4" => "Dobrova-Horjul-Polhov Gradec",
+ "G7" => "Domzale",
+ "H4" => "Jesenice",
+ "H6" => "Kamnik",
+ "H7" => "Kocevje",
+ "I2" => "Kuzma",
+ "I3" => "Lenart",
+ "I5" => "Litija",
+ "I6" => "Ljutomer",
+ "I7" => "Loska Dolina",
+ "I9" => "Luce",
+ "J1" => "Majsperk",
+ "J2" => "Maribor",
+ "J5" => "Miren-Kostanjevica",
+ "J7" => "Novo Mesto",
+ "J9" => "Piran",
+ "K5" => "Preddvor",
+ "K7" => "Ptuj",
+ "L1" => "Ribnica",
+ "L3" => "Ruse",
+ "L7" => "Sentjur pri Celju",
+ "L8" => "Slovenska Bistrica",
+ "N2" => "Videm",
+ "N3" => "Vojnik",
+ "N5" => "Zalec"),
+"SK" => array(
+ "01" => "Banska Bystrica",
+ "02" => "Bratislava",
+ "03" => "Kosice",
+ "04" => "Nitra",
+ "05" => "Presov",
+ "06" => "Trencin",
+ "07" => "Trnava",
+ "08" => "Zilina"),
+"SL" => array(
+ "01" => "Eastern",
+ "02" => "Northern",
+ "03" => "Southern",
+ "04" => "Western Area"),
+"SM" => array(
+ "01" => "Acquaviva",
+ "02" => "Chiesanuova",
+ "03" => "Domagnano",
+ "04" => "Faetano",
+ "05" => "Fiorentino",
+ "06" => "Borgo Maggiore",
+ "07" => "San Marino",
+ "08" => "Monte Giardino",
+ "09" => "Serravalle"),
+"SN" => array(
+ "01" => "Dakar",
+ "03" => "Diourbel",
+ "05" => "Tambacounda",
+ "07" => "Thies",
+ "09" => "Fatick",
+ "10" => "Kaolack",
+ "11" => "Kolda",
+ "12" => "Ziguinchor",
+ "13" => "Louga",
+ "14" => "Saint-Louis",
+ "15" => "Matam"),
+"SO" => array(
+ "01" => "Bakool",
+ "02" => "Banaadir",
+ "03" => "Bari",
+ "04" => "Bay",
+ "05" => "Galguduud",
+ "06" => "Gedo",
+ "07" => "Hiiraan",
+ "08" => "Jubbada Dhexe",
+ "09" => "Jubbada Hoose",
+ "10" => "Mudug",
+ "11" => "Nugaal",
+ "12" => "Sanaag",
+ "13" => "Shabeellaha Dhexe",
+ "14" => "Shabeellaha Hoose",
+ "16" => "Woqooyi Galbeed",
+ "18" => "Nugaal",
+ "19" => "Togdheer",
+ "20" => "Woqooyi Galbeed",
+ "21" => "Awdal",
+ "22" => "Sool"),
+"SR" => array(
+ "10" => "Brokopondo",
+ "11" => "Commewijne",
+ "12" => "Coronie",
+ "13" => "Marowijne",
+ "14" => "Nickerie",
+ "15" => "Para",
+ "16" => "Paramaribo",
+ "17" => "Saramacca",
+ "18" => "Sipaliwini",
+ "19" => "Wanica"),
+"ST" => array(
+ "01" => "Principe",
+ "02" => "Sao Tome"),
+"SV" => array(
+ "01" => "Ahuachapan",
+ "02" => "Cabanas",
+ "03" => "Chalatenango",
+ "04" => "Cuscatlan",
+ "05" => "La Libertad",
+ "06" => "La Paz",
+ "07" => "La Union",
+ "08" => "Morazan",
+ "09" => "San Miguel",
+ "10" => "San Salvador",
+ "11" => "Santa Ana",
+ "12" => "San Vicente",
+ "13" => "Sonsonate",
+ "14" => "Usulutan"),
+"SY" => array(
+ "01" => "Al Hasakah",
+ "02" => "Al Ladhiqiyah",
+ "03" => "Al Qunaytirah",
+ "04" => "Ar Raqqah",
+ "05" => "As Suwayda'",
+ "06" => "Dar",
+ "07" => "Dayr az Zawr",
+ "08" => "Rif Dimashq",
+ "09" => "Halab",
+ "10" => "Hamah",
+ "11" => "Hims",
+ "12" => "Idlib",
+ "13" => "Dimashq",
+ "14" => "Tartus"),
+"SZ" => array(
+ "01" => "Hhohho",
+ "02" => "Lubombo",
+ "03" => "Manzini",
+ "04" => "Shiselweni",
+ "05" => "Praslin"),
+"TD" => array(
+ "01" => "Batha",
+ "02" => "Biltine",
+ "03" => "Borkou-Ennedi-Tibesti",
+ "04" => "Chari-Baguirmi",
+ "05" => "Guera",
+ "06" => "Kanem",
+ "07" => "Lac",
+ "08" => "Logone Occidental",
+ "09" => "Logone Oriental",
+ "10" => "Mayo-Kebbi",
+ "11" => "Moyen-Chari",
+ "12" => "Ouaddai",
+ "13" => "Salamat",
+ "14" => "Tandjile"),
+"TG" => array(
+ "22" => "Centrale",
+ "23" => "Kara",
+ "24" => "Maritime",
+ "25" => "Plateaux",
+ "26" => "Savanes"),
+"TH" => array(
+ "01" => "Mae Hong Son",
+ "02" => "Chiang Mai",
+ "03" => "Chiang Rai",
+ "04" => "Nan",
+ "05" => "Lamphun",
+ "06" => "Lampang",
+ "07" => "Phrae",
+ "08" => "Tak",
+ "09" => "Sukhothai",
+ "10" => "Uttaradit",
+ "11" => "Kamphaeng Phet",
+ "12" => "Phitsanulok",
+ "13" => "Phichit",
+ "14" => "Phetchabun",
+ "15" => "Uthai Thani",
+ "16" => "Nakhon Sawan",
+ "17" => "Nong Khai",
+ "18" => "Loei",
+ "20" => "Sakon Nakhon",
+ "21" => "Nakhon Phanom",
+ "22" => "Khon Kaen",
+ "23" => "Kalasin",
+ "24" => "Maha Sarakham",
+ "25" => "Roi Et",
+ "26" => "Chaiyaphum",
+ "27" => "Nakhon Ratchasima",
+ "28" => "Buriram",
+ "29" => "Surin",
+ "30" => "Sisaket",
+ "31" => "Narathiwat",
+ "32" => "Chai Nat",
+ "33" => "Sing Buri",
+ "34" => "Lop Buri",
+ "35" => "Ang Thong",
+ "36" => "Phra Nakhon Si Ayutthaya",
+ "37" => "Saraburi",
+ "38" => "Nonthaburi",
+ "39" => "Pathum Thani",
+ "40" => "Krung Thep",
+ "41" => "Phayao",
+ "42" => "Samut Prakan",
+ "43" => "Nakhon Nayok",
+ "44" => "Chachoengsao",
+ "45" => "Prachin Buri",
+ "46" => "Chon Buri",
+ "47" => "Rayong",
+ "48" => "Chanthaburi",
+ "49" => "Trat",
+ "50" => "Kanchanaburi",
+ "51" => "Suphan Buri",
+ "52" => "Ratchaburi",
+ "53" => "Nakhon Pathom",
+ "54" => "Samut Songkhram",
+ "55" => "Samut Sakhon",
+ "56" => "Phetchaburi",
+ "57" => "Prachuap Khiri Khan",
+ "58" => "Chumphon",
+ "59" => "Ranong",
+ "60" => "Surat Thani",
+ "61" => "Phangnga",
+ "62" => "Phuket",
+ "63" => "Krabi",
+ "64" => "Nakhon Si Thammarat",
+ "65" => "Trang",
+ "66" => "Phatthalung",
+ "67" => "Satun",
+ "68" => "Songkhla",
+ "69" => "Pattani",
+ "70" => "Yala",
+ "71" => "Ubon Ratchathani",
+ "72" => "Yasothon",
+ "73" => "Nakhon Phanom",
+ "75" => "Ubon Ratchathani",
+ "76" => "Udon Thani",
+ "77" => "Amnat Charoen",
+ "78" => "Mukdahan",
+ "79" => "Nong Bua Lamphu",
+ "80" => "Sa Kaeo"),
+"TJ" => array(
+ "01" => "Kuhistoni Badakhshon",
+ "02" => "Khatlon",
+ "03" => "Sughd"),
+"TM" => array(
+ "01" => "Ahal",
+ "02" => "Balkan",
+ "03" => "Dashoguz",
+ "04" => "Lebap",
+ "05" => "Mary"),
+"TN" => array(
+ "02" => "Kasserine",
+ "03" => "Kairouan",
+ "06" => "Jendouba",
+ "10" => "Qafsah",
+ "14" => "El Kef",
+ "15" => "Al Mahdia",
+ "16" => "Al Munastir",
+ "17" => "Bajah",
+ "18" => "Bizerte",
+ "19" => "Nabeul",
+ "22" => "Siliana",
+ "23" => "Sousse",
+ "27" => "Ben Arous",
+ "28" => "Madanin",
+ "29" => "Gabes",
+ "31" => "Kebili",
+ "32" => "Sfax",
+ "33" => "Sidi Bou Zid",
+ "34" => "Tataouine",
+ "35" => "Tozeur",
+ "36" => "Tunis",
+ "37" => "Zaghouan",
+ "38" => "Aiana",
+ "39" => "Manouba"),
+"TO" => array(
+ "01" => "Ha",
+ "02" => "Tongatapu",
+ "03" => "Vava"),
+"TR" => array(
+ "02" => "Adiyaman",
+ "03" => "Afyonkarahisar",
+ "04" => "Agri",
+ "05" => "Amasya",
+ "07" => "Antalya",
+ "08" => "Artvin",
+ "09" => "Aydin",
+ "10" => "Balikesir",
+ "11" => "Bilecik",
+ "12" => "Bingol",
+ "13" => "Bitlis",
+ "14" => "Bolu",
+ "15" => "Burdur",
+ "16" => "Bursa",
+ "17" => "Canakkale",
+ "19" => "Corum",
+ "20" => "Denizli",
+ "21" => "Diyarbakir",
+ "22" => "Edirne",
+ "23" => "Elazig",
+ "24" => "Erzincan",
+ "25" => "Erzurum",
+ "26" => "Eskisehir",
+ "28" => "Giresun",
+ "31" => "Hatay",
+ "32" => "Mersin",
+ "33" => "Isparta",
+ "34" => "Istanbul",
+ "35" => "Izmir",
+ "37" => "Kastamonu",
+ "38" => "Kayseri",
+ "39" => "Kirklareli",
+ "40" => "Kirsehir",
+ "41" => "Kocaeli",
+ "43" => "Kutahya",
+ "44" => "Malatya",
+ "45" => "Manisa",
+ "46" => "Kahramanmaras",
+ "48" => "Mugla",
+ "49" => "Mus",
+ "50" => "Nevsehir",
+ "52" => "Ordu",
+ "53" => "Rize",
+ "54" => "Sakarya",
+ "55" => "Samsun",
+ "57" => "Sinop",
+ "58" => "Sivas",
+ "59" => "Tekirdag",
+ "60" => "Tokat",
+ "61" => "Trabzon",
+ "62" => "Tunceli",
+ "63" => "Sanliurfa",
+ "64" => "Usak",
+ "65" => "Van",
+ "66" => "Yozgat",
+ "68" => "Ankara",
+ "69" => "Gumushane",
+ "70" => "Hakkari",
+ "71" => "Konya",
+ "72" => "Mardin",
+ "73" => "Nigde",
+ "74" => "Siirt",
+ "75" => "Aksaray",
+ "76" => "Batman",
+ "77" => "Bayburt",
+ "78" => "Karaman",
+ "79" => "Kirikkale",
+ "80" => "Sirnak",
+ "81" => "Adana",
+ "82" => "Cankiri",
+ "83" => "Gaziantep",
+ "84" => "Kars",
+ "85" => "Zonguldak",
+ "86" => "Ardahan",
+ "87" => "Bartin",
+ "88" => "Igdir",
+ "89" => "Karabuk",
+ "90" => "Kilis",
+ "91" => "Osmaniye",
+ "92" => "Yalova",
+ "93" => "Duzce"),
+"TT" => array(
+ "01" => "Arima",
+ "02" => "Caroni",
+ "03" => "Mayaro",
+ "04" => "Nariva",
+ "05" => "Port-of-Spain",
+ "06" => "Saint Andrew",
+ "07" => "Saint David",
+ "08" => "Saint George",
+ "09" => "Saint Patrick",
+ "10" => "San Fernando",
+ "11" => "Tobago",
+ "12" => "Victoria"),
+"TW" => array(
+ "01" => "Fu-chien",
+ "02" => "Kao-hsiung",
+ "03" => "T'ai-pei",
+ "04" => "T'ai-wan"),
+"TZ" => array(
+ "02" => "Pwani",
+ "03" => "Dodoma",
+ "04" => "Iringa",
+ "05" => "Kigoma",
+ "06" => "Kilimanjaro",
+ "07" => "Lindi",
+ "08" => "Mara",
+ "09" => "Mbeya",
+ "10" => "Morogoro",
+ "11" => "Mtwara",
+ "12" => "Mwanza",
+ "13" => "Pemba North",
+ "14" => "Ruvuma",
+ "15" => "Shinyanga",
+ "16" => "Singida",
+ "17" => "Tabora",
+ "18" => "Tanga",
+ "19" => "Kagera",
+ "20" => "Pemba South",
+ "21" => "Zanzibar Central",
+ "22" => "Zanzibar North",
+ "23" => "Dar es Salaam",
+ "24" => "Rukwa",
+ "25" => "Zanzibar Urban",
+ "26" => "Arusha",
+ "27" => "Manyara"),
+"UA" => array(
+ "01" => "Cherkas'ka Oblast'",
+ "02" => "Chernihivs'ka Oblast'",
+ "03" => "Chernivets'ka Oblast'",
+ "04" => "Dnipropetrovs'ka Oblast'",
+ "05" => "Donets'ka Oblast'",
+ "06" => "Ivano-Frankivs'ka Oblast'",
+ "07" => "Kharkivs'ka Oblast'",
+ "08" => "Khersons'ka Oblast'",
+ "09" => "Khmel'nyts'ka Oblast'",
+ "10" => "Kirovohrads'ka Oblast'",
+ "11" => "Krym",
+ "12" => "Kyyiv",
+ "13" => "Kyyivs'ka Oblast'",
+ "14" => "Luhans'ka Oblast'",
+ "15" => "L'vivs'ka Oblast'",
+ "16" => "Mykolayivs'ka Oblast'",
+ "17" => "Odes'ka Oblast'",
+ "18" => "Poltavs'ka Oblast'",
+ "19" => "Rivnens'ka Oblast'",
+ "20" => "Sevastopol'",
+ "21" => "Sums'ka Oblast'",
+ "22" => "Ternopil's'ka Oblast'",
+ "23" => "Vinnyts'ka Oblast'",
+ "24" => "Volyns'ka Oblast'",
+ "25" => "Zakarpats'ka Oblast'",
+ "26" => "Zaporiz'ka Oblast'",
+ "27" => "Zhytomyrs'ka Oblast'"),
+"UG" => array(
+ "26" => "Apac",
+ "28" => "Bundibugyo",
+ "29" => "Bushenyi",
+ "30" => "Gulu",
+ "31" => "Hoima",
+ "33" => "Jinja",
+ "36" => "Kalangala",
+ "37" => "Kampala",
+ "38" => "Kamuli",
+ "39" => "Kapchorwa",
+ "40" => "Kasese",
+ "41" => "Kibale",
+ "42" => "Kiboga",
+ "43" => "Kisoro",
+ "45" => "Kotido",
+ "46" => "Kumi",
+ "47" => "Lira",
+ "50" => "Masindi",
+ "52" => "Mbarara",
+ "56" => "Mubende",
+ "58" => "Nebbi",
+ "59" => "Ntungamo",
+ "60" => "Pallisa",
+ "61" => "Rakai",
+ "65" => "Adjumani",
+ "66" => "Bugiri",
+ "67" => "Busia",
+ "69" => "Katakwi",
+ "70" => "Luwero",
+ "71" => "Masaka",
+ "72" => "Moyo",
+ "73" => "Nakasongola",
+ "74" => "Sembabule",
+ "76" => "Tororo",
+ "77" => "Arua",
+ "78" => "Iganga",
+ "79" => "Kabarole",
+ "80" => "Kaberamaido",
+ "81" => "Kamwenge",
+ "82" => "Kanungu",
+ "83" => "Kayunga",
+ "84" => "Kitgum",
+ "85" => "Kyenjojo",
+ "86" => "Mayuge",
+ "87" => "Mbale",
+ "88" => "Moroto",
+ "89" => "Mpigi",
+ "90" => "Mukono",
+ "91" => "Nakapiripirit",
+ "92" => "Pader",
+ "93" => "Rukungiri",
+ "94" => "Sironko",
+ "95" => "Soroti",
+ "96" => "Wakiso",
+ "97" => "Yumbe"),
+"US" => array(
+ "AA" => "Armed Forces Americas",
+ "AE" => "Armed Forces Europe, Middle East, & Canada",
+ "AK" => "Alaska",
+ "AL" => "Alabama",
+ "AP" => "Armed Forces Pacific",
+ "AR" => "Arkansas",
+ "AS" => "American Samoa",
+ "AZ" => "Arizona",
+ "CA" => "California",
+ "CO" => "Colorado",
+ "CT" => "Connecticut",
+ "DC" => "District of Columbia",
+ "DE" => "Delaware",
+ "FL" => "Florida",
+ "FM" => "Federated States of Micronesia",
+ "GA" => "Georgia",
+ "GU" => "Guam",
+ "HI" => "Hawaii",
+ "IA" => "Iowa",
+ "ID" => "Idaho",
+ "IL" => "Illinois",
+ "IN" => "Indiana",
+ "KS" => "Kansas",
+ "KY" => "Kentucky",
+ "LA" => "Louisiana",
+ "MA" => "Massachusetts",
+ "MD" => "Maryland",
+ "ME" => "Maine",
+ "MH" => "Marshall Islands",
+ "MI" => "Michigan",
+ "MN" => "Minnesota",
+ "MO" => "Missouri",
+ "MP" => "Northern Mariana Islands",
+ "MS" => "Mississippi",
+ "MT" => "Montana",
+ "NC" => "North Carolina",
+ "ND" => "North Dakota",
+ "NE" => "Nebraska",
+ "NH" => "New Hampshire",
+ "NJ" => "New Jersey",
+ "NM" => "New Mexico",
+ "NV" => "Nevada",
+ "NY" => "New York",
+ "OH" => "Ohio",
+ "OK" => "Oklahoma",
+ "OR" => "Oregon",
+ "PA" => "Pennsylvania",
+ "PR" => "Puerto Rico",
+ "PW" => "Palau",
+ "RI" => "Rhode Island",
+ "SC" => "South Carolina",
+ "SD" => "South Dakota",
+ "TN" => "Tennessee",
+ "TX" => "Texas",
+ "UT" => "Utah",
+ "VA" => "Virginia",
+ "VI" => "Virgin Islands",
+ "VT" => "Vermont",
+ "WA" => "Washington",
+ "WI" => "Wisconsin",
+ "WV" => "West Virginia",
+ "WY" => "Wyoming"),
+"UY" => array(
+ "01" => "Artigas",
+ "02" => "Canelones",
+ "03" => "Cerro Largo",
+ "04" => "Colonia",
+ "05" => "Durazno",
+ "06" => "Flores",
+ "07" => "Florida",
+ "08" => "Lavalleja",
+ "09" => "Maldonado",
+ "10" => "Montevideo",
+ "11" => "Paysandu",
+ "12" => "Rio Negro",
+ "13" => "Rivera",
+ "14" => "Rocha",
+ "15" => "Salto",
+ "16" => "San Jose",
+ "17" => "Soriano",
+ "18" => "Tacuarembo",
+ "19" => "Treinta y Tres"),
+"UZ" => array(
+ "01" => "Andijon",
+ "02" => "Bukhoro",
+ "03" => "Farghona",
+ "04" => "Jizzakh",
+ "05" => "Khorazm",
+ "06" => "Namangan",
+ "07" => "Nawoiy",
+ "08" => "Qashqadaryo",
+ "09" => "Qoraqalpoghiston",
+ "10" => "Samarqand",
+ "11" => "Sirdaryo",
+ "12" => "Surkhondaryo",
+ "13" => "Toshkent",
+ "14" => "Toshkent"),
+"VC" => array(
+ "01" => "Charlotte",
+ "02" => "Saint Andrew",
+ "03" => "Saint David",
+ "04" => "Saint George",
+ "05" => "Saint Patrick",
+ "06" => "Grenadines"),
+"VE" => array(
+ "01" => "Amazonas",
+ "02" => "Anzoategui",
+ "03" => "Apure",
+ "04" => "Aragua",
+ "05" => "Barinas",
+ "06" => "Bolivar",
+ "07" => "Carabobo",
+ "08" => "Cojedes",
+ "09" => "Delta Amacuro",
+ "11" => "Falcon",
+ "12" => "Guarico",
+ "13" => "Lara",
+ "14" => "Merida",
+ "15" => "Miranda",
+ "16" => "Monagas",
+ "17" => "Nueva Esparta",
+ "18" => "Portuguesa",
+ "19" => "Sucre",
+ "20" => "Tachira",
+ "21" => "Trujillo",
+ "22" => "Yaracuy",
+ "23" => "Zulia",
+ "24" => "Dependencias Federales",
+ "25" => "Distrito Federal",
+ "26" => "Vargas"),
+"VN" => array(
+ "01" => "An Giang",
+ "03" => "Ben Tre",
+ "05" => "Cao Bang",
+ "09" => "Dong Thap",
+ "13" => "Hai Phong",
+ "20" => "Ho Chi Minh",
+ "21" => "Kien Giang",
+ "23" => "Lam Dong",
+ "24" => "Long An",
+ "30" => "Quang Ninh",
+ "32" => "Son La",
+ "33" => "Tay Ninh",
+ "34" => "Thanh Hoa",
+ "35" => "Thai Binh",
+ "37" => "Tien Giang",
+ "39" => "Lang Son",
+ "43" => "An Giang",
+ "44" => "Dac Lac",
+ "45" => "Dong Nai",
+ "46" => "Dong Thap",
+ "47" => "Kien Giang",
+ "49" => "Song Be",
+ "50" => "Vinh Phu",
+ "51" => "Ha Noi",
+ "52" => "Ho Chi Minh",
+ "53" => "Ba Ria-Vung Tau",
+ "54" => "Binh Dinh",
+ "55" => "Binh Thuan",
+ "58" => "Ha Giang",
+ "59" => "Ha Tay",
+ "60" => "Ha Tinh",
+ "61" => "Hoa Binh",
+ "62" => "Khanh Hoa",
+ "63" => "Kon Tum",
+ "64" => "Quang Tri",
+ "65" => "Nam Ha",
+ "66" => "Nghe An",
+ "67" => "Ninh Binh",
+ "68" => "Ninh Thuan",
+ "69" => "Phu Yen",
+ "70" => "Quang Binh",
+ "71" => "Quang Ngai",
+ "72" => "Quang Tri",
+ "73" => "Soc Trang",
+ "74" => "Thua Thien",
+ "75" => "Tra Vinh",
+ "76" => "Tuyen Quang",
+ "77" => "Vinh Long",
+ "78" => "Da Nang",
+ "79" => "Hai Duong",
+ "80" => "Ha Nam",
+ "81" => "Hung Yen",
+ "82" => "Nam Dinh",
+ "83" => "Phu Tho",
+ "84" => "Quang Nam",
+ "85" => "Thai Nguyen",
+ "86" => "Vinh Puc Province",
+ "87" => "Can Tho",
+ "88" => "Dak Lak",
+ "89" => "Lai Chau",
+ "90" => "Lao Cai",
+ "91" => "Dak Nong",
+ "92" => "Dien Bien",
+ "93" => "Hau Giang"),
+"VU" => array(
+ "05" => "Ambrym",
+ "06" => "Aoba",
+ "07" => "Torba",
+ "08" => "Efate",
+ "09" => "Epi",
+ "10" => "Malakula",
+ "11" => "Paama",
+ "12" => "Pentecote",
+ "13" => "Sanma",
+ "14" => "Shepherd",
+ "15" => "Tafea",
+ "16" => "Malampa",
+ "17" => "Penama",
+ "18" => "Shefa"),
+"WS" => array(
+ "02" => "Aiga-i-le-Tai",
+ "03" => "Atua",
+ "04" => "Fa",
+ "05" => "Gaga",
+ "06" => "Va",
+ "07" => "Gagaifomauga",
+ "08" => "Palauli",
+ "09" => "Satupa",
+ "10" => "Tuamasaga",
+ "11" => "Vaisigano"),
+"YE" => array(
+ "01" => "Abyan",
+ "02" => "Adan",
+ "03" => "Al Mahrah",
+ "04" => "Hadramawt",
+ "05" => "Shabwah",
+ "06" => "Lahij",
+ "07" => "Al Bayda'",
+ "08" => "Al Hudaydah",
+ "09" => "Al Jawf",
+ "10" => "Al Mahwit",
+ "11" => "Dhamar",
+ "12" => "Hajjah",
+ "13" => "Ibb",
+ "14" => "Ma'rib",
+ "15" => "Sa'dah",
+ "16" => "San'a'",
+ "17" => "Taizz",
+ "18" => "Ad Dali",
+ "19" => "Amran",
+ "20" => "Al Bayda'",
+ "21" => "Al Jawf",
+ "22" => "Hajjah",
+ "23" => "Ibb",
+ "24" => "Lahij",
+ "25" => "Taizz"),
+"ZA" => array(
+ "01" => "North-Western Province",
+ "02" => "KwaZulu-Natal",
+ "03" => "Free State",
+ "05" => "Eastern Cape",
+ "06" => "Gauteng",
+ "07" => "Mpumalanga",
+ "08" => "Northern Cape",
+ "09" => "Limpopo",
+ "10" => "North-West",
+ "11" => "Western Cape"),
+"ZM" => array(
+ "01" => "Western",
+ "02" => "Central",
+ "03" => "Eastern",
+ "04" => "Luapula",
+ "05" => "Northern",
+ "06" => "North-Western",
+ "07" => "Southern",
+ "08" => "Copperbelt",
+ "09" => "Lusaka"),
+"ZW" => array(
+ "01" => "Manicaland",
+ "02" => "Midlands",
+ "03" => "Mashonaland Central",
+ "04" => "Mashonaland East",
+ "05" => "Mashonaland West",
+ "06" => "Matabeleland North",
+ "07" => "Matabeleland South",
+ "08" => "Masvingo",
+ "09" => "Bulawayo",
+ "10" => "Harare")
);
+?>
diff --git a/libs/PiwikTracker/PiwikTracker.php b/libs/PiwikTracker/PiwikTracker.php
index 39eb82b6bd..c998e1913d 100644
--- a/libs/PiwikTracker/PiwikTracker.php
+++ b/libs/PiwikTracker/PiwikTracker.php
@@ -219,6 +219,8 @@ class PiwikTracker
$this->doBulkRequests = false;
$this->storedTrackingActions = array();
+ $this->sendImageResponse = true;
+
$this->visitorCustomVar = $this->getCustomVariablesFromCookie();
}
@@ -501,6 +503,14 @@ class PiwikTracker
}
/**
+ * If image response is disabled Piwik will respond with a HTTP 204 header instead of responding with a gif.
+ */
+ public function disableSendImageResponse()
+ {
+ $this->sendImageResponse = false;
+ }
+
+ /**
* Fix-up domain
*/
static protected function domainFixup($domain)
@@ -1524,6 +1534,7 @@ class PiwikTracker
(!empty($this->city) ? '&city=' . urlencode($this->city) : '') .
(!empty($this->lat) ? '&lat=' . urlencode($this->lat) : '') .
(!empty($this->long) ? '&long=' . urlencode($this->long) : '') .
+ (!$this->sendImageResponse ? '&send_image=0' : '') .
// DEBUG
$this->DEBUG_APPEND_URL;
diff --git a/misc/log-analytics/import_logs.py b/misc/log-analytics/import_logs.py
index 90a7f4f709..6674e2f2fa 100755
--- a/misc/log-analytics/import_logs.py
+++ b/misc/log-analytics/import_logs.py
@@ -1162,7 +1162,7 @@ class Recorder(object):
# We have to do this so visits from the same IP will be added in the right order.
hits_by_client = [[] for r in cls.recorders]
for hit in all_hits:
- hits_by_client[abs(hash(hit.ip)) % len(cls.recorders)].append(hit)
+ hits_by_client[hit.get_visitor_id_hash() % len(cls.recorders)].append(hit)
for i, recorder in enumerate(cls.recorders):
recorder.queue.put(hits_by_client[i])
@@ -1351,6 +1351,17 @@ class Hit(object):
if config.options.force_lowercase_path:
self.full_path = self.full_path.lower()
+ def get_visitor_id_hash(self):
+ visitor_id = self.ip
+
+ if config.options.replay_tracking:
+ for param_name_to_use in ['uid', 'cid', '_id', 'cip']:
+ if param_name_to_use in self.args:
+ visitor_id = self.args[param_name_to_use]
+ break
+
+ return abs(hash(visitor_id))
+
class Parser(object):
"""
The Parser parses the lines in a specified file and inserts them into
diff --git a/piwik.js b/piwik.js
index c593488d33..0eb59e8cc6 100644
--- a/piwik.js
+++ b/piwik.js
@@ -32,7 +32,7 @@ function bF(cf,cc,cb,ce,ca,cd){if(ao){return}var b9;if(cb){b9=new Date();b9.setT
}};ca.src=aa+(aa.indexOf("?")<0?"?":"&")+b9}function bG(ca,cd,b9){if(!w(b9)||null===b9){b9=true}try{var cc=G.XMLHttpRequest?new G.XMLHttpRequest():G.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):null;cc.open("POST",aa,true);cc.onreadystatechange=function(){if(this.readyState===4&&!(this.status>=200&&this.status<300)&&b9){b8(ca,cd)}else{if(typeof cd==="function"){cd()}}};cc.setRequestHeader("Content-Type",aK);cc.send(ca)}catch(cb){if(b9){b8(ca,cd)}}}function bY(ca){var b9=new Date();var cb=b9.getTime()+ca;if(!j||cb>j){j=cb}}function aD(cd){var ca=new Date();var b9=ca.getTime();if(a8&&b9<a8){var cb=a8-b9;setTimeout(cd,cb);bY(cb+50);a8+=50;return}if(a8===false){var cc=800;a8=b9+cc}cd()}function aZ(ca,b9,cb){if(!bV&&ca){aD(function(){if(br==="POST"){bG(ca,cb)}else{b8(ca,cb)}bY(b9)})}}function ba(b9){if(bV){return false}return(b9&&b9.length)}function ap(cb,b9){if(!ba(cb)){return}var ca='{"requests":["?'+cb.join('","?')+'"]}';aD(function(){bG(ca,null,false);bY(b9)})}function bE(b9){return b1+b9+"."+bR+"."+bx
}function ae(){if(ao){return"0"}if(!w(e.cookieEnabled)){var b9=bE("testcookie");bF(b9,"1");return av(b9)==="1"?"1":"0"}return e.cookieEnabled?"1":"0"}function bj(){bx=aX((aq||bL)+(b2||"/")).slice(0,4)}function ar(){var ca=bE("cvar"),b9=av(ca);if(b9.length){b9=JSON2.parse(b9);if(J(b9)){return b9}}return{}}function Z(){if(ag===false){ag=ar()}}function bQ(){var b9=new Date();bs=b9.getTime()}function Y(){var ca=new Date(),b9=Math.round(ca.getTime()/1000),cc=av(bE("id")),cb;if(cc){cb=cc.split(".");cb.unshift("0")}else{if(!a2){a2=aX((e.userAgent||"")+(e.platform||"")+JSON2.stringify(bS)+ca.getTime()+Math.random()).slice(0,16)}cb=["1",a2,b9,0,b9,"",""]}return cb}function aL(){var cd=new Date(),ca=cd.getTime(),cc=Y();var b9=parseInt(cc[2],10);var cb=(b9*1000)+aw-ca;return cb}function am(cd,ca,b9,cc,cb,cf){var ce=aL();bF(bE("id"),cd+"."+ca+"."+b9+"."+cc+"."+cb+"."+cf,ce,b2,aq)}function X(){var b9=av(bE("ref"));if(b9.length){try{b9=JSON2.parse(b9);if(J(b9)){return b9}}catch(ca){}}return["","",0,""]
}function W(){var b9=ao;ao=false;bF(bE("id"),"",-86400,b2,aq);bF(bE("ses"),"",-86400,b2,aq);bF(bE("cvar"),"",-86400,b2,aq);bF(bE("ref"),"",-86400,b2,aq);ao=b9}function bP(cd){if(!cd||!J(cd)){return}var cc=[];var cb;for(cb in cd){if(Object.prototype.hasOwnProperty.call(cd,cb)){cc.push(cb)}}var ce={};cc.sort();var b9=cc.length;var ca;for(ca=0;ca<b9;ca++){ce[cc[ca]]=cd[cc[ca]]}return ce}function aT(cb,cz,cA,cc){var cx,ca=new Date(),cj=Math.round(ca.getTime()/1000),cD,cy,ce,cp,cu,ci,cs,cf,cw,cd=1024,cF,cm,ct=ag,ck=bE("ses"),cl=bE("ref"),cG=bE("cvar"),cq=Y(),co=av(ck),cv=X(),cC=a6||b3,cg,b9;if(ao){W()}if(bV){return""}cD=cq[0];cy=cq[1];cp=cq[2];ce=cq[3];cu=cq[4];ci=cq[5];if(!w(cq[6])){cq[6]=""}cs=cq[6];if(!w(cc)){cc=""}var cn=u.characterSet||u.charset;if(!cn||cn.toLowerCase()==="utf-8"){cn=null}cg=cv[0];b9=cv[1];cf=cv[2];cw=cv[3];if(!co){var cB=az/1000;if(!ci||(cj-ci)>cB){ce++;ci=cu}if(!a4||!cg.length){for(cx in aY){if(Object.prototype.hasOwnProperty.call(aY,cx)){cg=I(cC,aY[cx]);if(cg.length){break
-}}}for(cx in aP){if(Object.prototype.hasOwnProperty.call(aP,cx)){b9=I(cC,aP[cx]);if(b9.length){break}}}}cF=b(bt);cm=cw.length?b(cw):"";if(cF.length&&!bq(cF)&&(!a4||!cm.length||bq(cm))){cw=bt}if(cw.length||cg.length){cf=cj;cv=[cg,b9,cf,bX(cw.slice(0,cd))];bF(cl,JSON2.stringify(cv),a9,b2,aq)}}cb+="&idsite="+bR+"&rec=1&r="+String(Math.random()).slice(2,8)+"&h="+ca.getHours()+"&m="+ca.getMinutes()+"&s="+ca.getSeconds()+"&url="+l(bX(cC))+(bt.length?"&urlref="+l(bX(bt)):"")+(aJ.length?"&uid="+l(aJ):"")+"&_id="+cy+"&_idts="+cp+"&_idvc="+ce+"&_idn="+cD+(cg.length?"&_rcn="+l(cg):"")+(b9.length?"&_rck="+l(b9):"")+"&_refts="+cf+"&_viewts="+ci+(String(cs).length?"&_ects="+cs:"")+(String(cw).length?"&_ref="+l(bX(cw.slice(0,cd))):"")+(cn?"&cs="+l(cn):"");for(cx in bS){if(Object.prototype.hasOwnProperty.call(bS,cx)){cb+="&"+cx+"="+bS[cx]}}if(cz){cb+="&data="+l(JSON2.stringify(cz))}else{if(an){cb+="&data="+l(JSON2.stringify(an))}}function ch(cH,cI){var cJ=JSON2.stringify(cH);if(cJ.length>2){return"&"+cI+"="+l(cJ)
+}}}for(cx in aP){if(Object.prototype.hasOwnProperty.call(aP,cx)){b9=I(cC,aP[cx]);if(b9.length){break}}}}cF=b(bt);cm=cw.length?b(cw):"";if(cF.length&&!bq(cF)&&(!a4||!cm.length||bq(cm))){cw=bt}if(cw.length||cg.length){cf=cj;cv=[cg,b9,cf,bX(cw.slice(0,cd))];bF(cl,JSON2.stringify(cv),a9,b2,aq)}}cb+="&idsite="+bR+"&rec=1&r="+String(Math.random()).slice(2,8)+"&h="+ca.getHours()+"&m="+ca.getMinutes()+"&s="+ca.getSeconds()+"&url="+l(bX(cC))+(bt.length?"&urlref="+l(bX(bt)):"")+(aJ.length?"&uid="+l(aJ):"")+"&_id="+cy+"&_idts="+cp+"&_idvc="+ce+"&_idn="+cD+(cg.length?"&_rcn="+l(cg):"")+(b9.length?"&_rck="+l(b9):"")+"&_refts="+cf+"&_viewts="+ci+(String(cs).length?"&_ects="+cs:"")+(String(cw).length?"&_ref="+l(bX(cw.slice(0,cd))):"")+(cn?"&cs="+l(cn):"")+"&send_image=0";for(cx in bS){if(Object.prototype.hasOwnProperty.call(bS,cx)){cb+="&"+cx+"="+bS[cx]}}if(cz){cb+="&data="+l(JSON2.stringify(cz))}else{if(an){cb+="&data="+l(JSON2.stringify(an))}}function ch(cH,cI){var cJ=JSON2.stringify(cH);if(cJ.length>2){return"&"+cI+"="+l(cJ)
}return""}var cE=bP(bf);var cr=bP(ab);cb+=ch(cE,"cvar");cb+=ch(cr,"e_cvar");if(ag){cb+=ch(ag,"_cvar");for(cx in ct){if(Object.prototype.hasOwnProperty.call(ct,cx)){if(ag[cx][0]===""||ag[cx][1]===""){delete ag[cx]}}}if(a5){bF(cG,JSON2.stringify(ag),az,b2,aq)}}if(a1){if(aI){cb+="&gt_ms="+aI}else{if(f&&f.timing&&f.timing.requestStart&&f.timing.responseEnd){cb+="&gt_ms="+(f.timing.responseEnd-f.timing.requestStart)}}}am(cy,cp,ce,cj,ci,w(cc)&&String(cc).length?cc:cs);bF(ck,"*",az,b2,aq);cb+=O(cA);if(bn.length){cb+="&"+bn}if(q(au)){cb=au(cb)}return cb}function bI(cc,cb,cg,cd,b9,cj){var ce="idgoal=0",cf,ca=new Date(),ch=[],ci;if(String(cc).length){ce+="&ec_id="+l(cc);cf=Math.round(ca.getTime()/1000)}ce+="&revenue="+cb;if(String(cg).length){ce+="&ec_st="+cg}if(String(cd).length){ce+="&ec_tx="+cd}if(String(b9).length){ce+="&ec_sh="+b9}if(String(cj).length){ce+="&ec_dt="+cj}if(bD){for(ci in bD){if(Object.prototype.hasOwnProperty.call(bD,ci)){if(!w(bD[ci][1])){bD[ci][1]=""}if(!w(bD[ci][2])){bD[ci][2]=""
}if(!w(bD[ci][3])||String(bD[ci][3]).length===0){bD[ci][3]=0}if(!w(bD[ci][4])||String(bD[ci][4]).length===0){bD[ci][4]=1}ch.push(bD[ci])}}ce+="&ec_items="+l(JSON2.stringify(ch))}ce=aT(ce,an,"ecommerce",cf);aZ(ce,bm)}function bH(b9,cd,cc,cb,ca,ce){if(String(b9).length&&w(cd)){bI(b9,cd,cc,cb,ca,ce)}}function b0(b9){if(w(b9)){bI("",b9,"","","","")}}function bd(cc,cd){var b9=new Date(),cb=aT("action_name="+l(V(cc||aS)),cd,"log");aZ(cb,bm);if(aj&&aG&&!bv){bv=true;U(u,"click",bQ);U(u,"mouseup",bQ);U(u,"mousedown",bQ);U(u,"mousemove",bQ);U(u,"mousewheel",bQ);U(G,"DOMMouseScroll",bQ);U(G,"scroll",bQ);U(u,"keypress",bQ);U(u,"keydown",bQ);U(u,"keyup",bQ);U(G,"resize",bQ);U(G,"focus",bQ);U(G,"blur",bQ);bs=b9.getTime();setTimeout(function ca(){var ce;b9=new Date();if((bs+aG)>b9.getTime()){if(aj<b9.getTime()){ce=aT("ping=1",cd,"ping");aZ(ce,bm)}setTimeout(ca,aG)}},aG)}}function aH(cb,ca){var cc,b9="(^| )(piwik[_-]"+ca;if(cb){for(cc=0;cc<cb.length;cc++){b9+="|"+cb[cc]}}b9+=")( |$)";return new RegExp(b9)
}function bB(b9){return(aa&&b9&&0===String(b9).indexOf(aa))}function bO(cc,b9,cd){if(bB(b9)){return 0}var cb=aH(be,"download"),ca=aH(aC,"link"),ce=new RegExp("\\.("+aU+")([?&#]|$)","i");if(ca.test(cc)){return"link"}if(cb.test(cc)||ce.test(b9)){return"download"}if(cd){return 0}return"link"}function a7(ca){var b9;b9=ca.parentNode;while(b9!==null&&w(b9)){if(Q.isLinkElement(ca)){break}ca=b9;b9=ca.parentNode}return ca}function bh(cd){cd=a7(cd);if(!Q.hasNodeAttribute(cd,"href")){return}if(!w(cd.href)){return}var cc=Q.getAttributeValueFromNode(cd,"href");if(bB(cc)){return}var ce=cd.hostname||b(cd.href);var cf=ce.toLowerCase();var ca=cd.href.replace(ce,cf);var cb=new RegExp("^(javascript|vbscript|jscript|mocha|livescript|ecmascript|mailto):","i");if(!cb.test(ca)){var b9=bO(cd.className,ca,bq(cf));if(b9){return{type:b9,href:ca}}}}function b5(b9,ca,cb,cc){var cd=m.buildInteractionRequestParams(b9,ca,cb,cc);if(!cd){return}return aT(cd,null,"contentInteraction")}function b4(cb,cc,cg,b9,ca){if(!w(cb)){return
diff --git a/plugins/API/lang/fr.json b/plugins/API/lang/fr.json
index 4f256dacf0..7156d81f16 100644
--- a/plugins/API/lang/fr.json
+++ b/plugins/API/lang/fr.json
@@ -1,7 +1,7 @@
{
"API": {
- "GenerateVisits": "Si vous n'avez pas de données pour aujourd'hui vous pouvez en générer en utilisant le plugin %s. Vous pouvez activer le plugin %s, ensuite cliquez sur le menu 'Générateur de visites' dans la zone d'administration de Piwik.",
- "KeepTokenSecret": "Cette clef partagée (tocken_auth) est aussi secrète que votre login et mot de passe, %s ne la partagez pas%s!",
+ "GenerateVisits": "Si vous n'avez pas de données pour aujourd'hui vous pouvez en générer en utilisant le plugin %s. Vous pouvez activer le plugin %s puis cliquer sur le menu 'Générateur de visites' dans la zone d'administration de Piwik.",
+ "KeepTokenSecret": "Cette clef partagée (tocken_auth) est aussi secrète que votre login et mot de passe, %s ne la partagez pas%s !",
"LoadedAPIs": "%s API chargées avec succès",
"MoreInformation": "Pour plus d'informations à propos de l'API de Piwik, merci de visiter %s l'introduction à Piwik %s et %s la référence de l'API Piwik %s.",
"PluginDescription": "Toutes les données de Piwik sont disponibles au travers de simples APIs. Ce plugin est le point d'entrée du web service, ainsi vous pouvez obtenir vos données Statistiques Web en xml, json, php, csv, etc.",
diff --git a/plugins/Actions/lang/el.json b/plugins/Actions/lang/el.json
index 5e4df9e31a..e5fa5762bf 100644
--- a/plugins/Actions/lang/el.json
+++ b/plugins/Actions/lang/el.json
@@ -1,5 +1,6 @@
{
"Actions": {
+ "AvgGenerationTimeTooltip": "Μέσος όρος βάσει των %s επισκέψεων %s μεταξύ %s και %s",
"ColumnClickedURL": "URL επιλογής",
"ColumnClicks": "Κλικ",
"ColumnClicksDocumentation": "Οι φορές που πατήθηκε αυτός ο σύνδεσμος.",
diff --git a/plugins/Actions/lang/fr.json b/plugins/Actions/lang/fr.json
index 5bad45c4e3..5413f52feb 100644
--- a/plugins/Actions/lang/fr.json
+++ b/plugins/Actions/lang/fr.json
@@ -10,15 +10,15 @@
"ColumnExitPageTitle": "Titre de la page de sortie",
"ColumnExitPageURL": "URL de la page de sortie",
"ColumnNoResultKeyword": "Mots-clés sans résultats de recherche",
- "ColumnPageName": "Nom de la page",
+ "ColumnPageName": "Titre de la page",
"ColumnPagesPerSearch": "Pages des résultats de la recherche",
- "ColumnPagesPerSearchDocumentation": "Les visiteurs vont effectuer des recherches sur votre site web et parfois cliquer sur \"suivant\" pour afficher plus de résultats. Ceci est le nombre moyen de pages de résultats de recherche vues pour ce mot-clef.",
+ "ColumnPagesPerSearchDocumentation": "Les visiteurs vont effectuer des recherches sur votre site web et parfois cliquer sur \"suivant\" pour afficher plus de résultats. Ceci est le nombre moyen de pages de résultats vues pour ce mot-clé.",
"ColumnPageURL": "URL de la page",
"ColumnSearchCategory": "Catégorie de recherche",
"ColumnSearches": "Recherches",
"ColumnSearchesDocumentation": "Le nombre de visites pour lesquelles une recherche pour ce mot-clé a été effectuée avec le moteur de recherche de votre site web",
"ColumnSearchExits": "% Taux de rebond après recherche",
- "ColumnSearchExitsDocumentation": "Le taux de visites après lesquelles les utilisateurs on quitté le site après avoir effectué une recherche pour ce mot clef avec le moteur de recherche de votre site.",
+ "ColumnSearchExitsDocumentation": "Le pourcentage de visites où les utilisateurs on quitté le site après avoir effectué une recherche pour ce mot-clé avec le moteur de recherche de votre site.",
"ColumnSearchResultsCount": "Nombre de résultats de la recherche",
"ColumnSiteSearchKeywords": "Mot-clés uniques",
"ColumnUniqueClicks": "Clics uniques",
@@ -44,9 +44,9 @@
"SiteSearchCategories2": "Par exemple, les sites d'e-commerce ont généralement une sélection de la catégorie afin que les visiteurs puissent affiner leurs recherches aux produits d'une catégories définie.",
"SiteSearchFollowingPagesDoc": "Quand les visiteurs recherchent sur votre site web, ils sont à la recherche d'une page, d'un produit, d'un contenu ou service en particulier. Ce rapport liste les pages qui ont été le plus cliquées après une recherche interne. En d'autres termes, la liste des pages les plus recherchées par des visiteurs déjà sur votre site.",
"SiteSearchIntro": "Effectuer un suivi des recherches que les visiteurs font sur votre site web est une manière très efficace d'en apprendre plus sur ce que votre audience recherche, cela peut aider à trouver des idées pour du nouveau contenu, un nouveau produit e-commerce dont des clients potentiels pourraient être à la recherche, et de manière générale pour améliorer l'expérience utilisateurs de votre site web.",
- "SiteSearchKeyword": "Mot clef (recherche du site)",
- "SiteSearchKeywordsDocumentation": "Ce rapport est une liste des mots clefs de recherche que les visiteurs ont entré dans votre moteur de recherche interne.",
- "SiteSearchKeywordsNoResultDocumentation": "Ce rapport liste les mots clefs de recherche qui n'ont retourné aucun résultat de recherche: peut-être est-il possible d'améliorer l'algorithme, ou peut être que vos visiteurs cherchent du contenu qui n'est pas (encore) sur votre site web?",
+ "SiteSearchKeyword": "Mot-clé (recherche du site)",
+ "SiteSearchKeywordsDocumentation": "Ce rapport liste les mots-clés recherchés dans votre moteur de recherche interne.",
+ "SiteSearchKeywordsNoResultDocumentation": "Ce rapport liste les mots-clés de recherche qui n'ont retourné aucun résultat: peut-être est-il possible d'améliorer l'algorithme de recherche, ou peut-être que vos visiteurs cherchent du contenu qui n'est pas (encore) sur votre site web ?",
"SubmenuPagesEntry": "Pages d'entrée",
"SubmenuPagesExit": "Pages de sortie",
"SubmenuPageTitles": "Titres des pages",
@@ -59,7 +59,7 @@
"WidgetPageTitlesFollowingSearch": "Titre des pages après une recherche",
"WidgetPageUrlsFollowingSearch": "Pages après une recherche",
"WidgetSearchCategories": "Catégories de recherche",
- "WidgetSearchKeywords": "Mot clés de recherche sur le site",
- "WidgetSearchNoResultKeywords": "Mots-clés sans résultat"
+ "WidgetSearchKeywords": "Mot-clés recherchés sur le site",
+ "WidgetSearchNoResultKeywords": "Mots-clés sans résultats"
}
} \ No newline at end of file
diff --git a/plugins/Annotations/lang/fr.json b/plugins/Annotations/lang/fr.json
index 608b8fe3ea..2c8af3bb3a 100644
--- a/plugins/Annotations/lang/fr.json
+++ b/plugins/Annotations/lang/fr.json
@@ -1,22 +1,22 @@
{
"Annotations": {
- "AddAnnotationsFor": "Ajouter une note pour %s...",
- "AnnotationOnDate": "Note sur %1$s : %2$s",
+ "AddAnnotationsFor": "Ajouter une annotation pour %s...",
+ "AnnotationOnDate": "Annotation sur %1$s : %2$s",
"Annotations": "Annotations",
"ClickToDelete": "Cliquez ici pour supprimer une annotation",
"ClickToEdit": "Cliquez ici pour supprimer une annotation",
- "ClickToEditOrAdd": "Cliquer pour éditer ou ajouter une nouvelle note.",
+ "ClickToEditOrAdd": "Cliquer pour éditer ou ajouter une nouvelle annotation.",
"ClickToStarOrUnstar": "Cliquez pour marquer ou enlever le marquage de cette annotation.",
"CreateNewAnnotation": "Cliquez-ici pour créer une annotation",
"EnterAnnotationText": "Description...",
- "HideAnnotationsFor": "Masquer les notes pour %s...",
- "IconDesc": "Voir les notes pour cette plage de temps",
- "IconDescHideNotes": "Cacher les notes pour cet plage de temps",
+ "HideAnnotationsFor": "Masquer les annotations pour %s...",
+ "IconDesc": "Voir les annotations pour cette période",
+ "IconDescHideNotes": "Masquer les annotations pour cette période",
"InlineQuickHelp": "Vous pouvez créer des annotations pour marquer des évènements spéciaux (comme un nouveau billet de blog ou une refonte du site web), pour garder une trace de vos analyses de données ou de ce que vous jugez important.",
"LoginToAnnotate": "Identifiez vous pour créer une annotation",
- "NoAnnotations": "Il n'y a aucune note pour cette période",
- "PluginDescription": "Vous permet d'attacher des notes à différents jours pour indiquer les modifications effectuées à votre site, enregistre les analyses que vous faites en considérant vos données et les partages envoyés à vos collègues. En annotant vos données, vous vous assurerez de vous rappeler pourquoi vos données ressemblent à ce à quoi elles ressemblent.",
+ "NoAnnotations": "Il n'y a aucune annotation pour cette période",
+ "PluginDescription": "Vous permet d'annoter des dates pour marquer des changement sur votre site, noter des analyses que vous faites de vos données et partager vos notes avec vos collègues. En annotant vos données, vous pourrez vous rappeler pourquoi vos données sont ainsi.",
"ViewAndAddAnnotations": "Voir et ajouter une annotation pour %s ...",
- "YouCannotModifyThisNote": "Vous ne pouvez pas modifier cette annotation parce que, ou vous ne l'avez pas créée ou vous n'avez pas les accès d'administrateur pour ce site."
+ "YouCannotModifyThisNote": "Vous ne pouvez pas modifier cette annotation parce que vous ne l'avez pas créée ou vous n'avez pas les accès d'administrateur pour ce site."
}
} \ No newline at end of file
diff --git a/plugins/Contents/lang/fr.json b/plugins/Contents/lang/fr.json
new file mode 100644
index 0000000000..3d03a8af80
--- /dev/null
+++ b/plugins/Contents/lang/fr.json
@@ -0,0 +1,5 @@
+{
+ "Contents": {
+ "Contents": "Contenus"
+ }
+} \ No newline at end of file
diff --git a/plugins/CoreAdminHome/lang/fr.json b/plugins/CoreAdminHome/lang/fr.json
index e559e4e209..47ffb0e1a6 100644
--- a/plugins/CoreAdminHome/lang/fr.json
+++ b/plugins/CoreAdminHome/lang/fr.json
@@ -3,47 +3,47 @@
"Administration": "Administration",
"ArchivingSettings": "Paramètres d'archivage",
"BrandingSettings": "Paramètres de l'image de marque",
- "CheckReleaseGetVersion": "Quand vous vérifiez la présence d'une nouvelle version de Piwik, obtenez toujours",
+ "CheckReleaseGetVersion": "Lors de la vérification des nouvelles versions de Piwik, télécharger la",
"ClickHereToOptIn": "Cliquez ici pour inclure votre ordinateur.",
"ClickHereToOptOut": "Cliquez ici pour exclure votre ordinateur.",
- "CustomLogoFeedbackInfo": "Si vous personnalisez le logo Piwi, vous pouvez être aussi intéressé de cacher le lien %s du menu du haut. Pour ce faire, vous pouvez désactiver le plugin de Feedback dans la page de %sGestionnaire de Plugins%s",
- "CustomLogoHelpText": "Vous pouvez personnaliser le logo Piwik qui sera affichée dans l'interface utilisateur et les rapports par courriel.",
- "DevelopmentProcess": "Bien que notre %sprocessus de développement%s inclue des milliers de tests automatisés, les béta testeurs jouent un rôle clef dans la réalisation de la \"politique zéro bug\" de Piwik.",
+ "CustomLogoFeedbackInfo": "Si vous personnalisez le logo Piwi, vous pouvez être aussi vouloir cacher le lien %s du menu du haut. Pour ce faire, vous pouvez désactiver le plugin de Feedback dans la page de %sGestionnaire de Plugins%s.",
+ "CustomLogoHelpText": "Vous pouvez personnaliser le logo Piwik qui sera affiché dans l'interface utilisateur et les rapports par courriel.",
+ "DevelopmentProcess": "Bien que notre %sprocessus de développement%s inclue des milliers de tests automatisés, les béta testeurs jouent un rôle clef dans la réalisation de la \"politique zéro bugs\" de Piwik.",
"EmailServerSettings": "Paramètres du serveur mail",
"FaviconUpload": "Sélectionnez un favicon à télécharger",
"FileUploadDisabled": "Le téléversement de fichiers n'est pas activé dans votre configuration PHP. Pour téléverser un logo personnalisé veuillez définir %s dans php.ini et redémarrer votre serveur web.",
"ForBetaTestersOnly": "Pour les bêta testeurs uniquement",
- "ImageTracking": "Suivi par Image",
+ "ImageTracking": "Suivi par image",
"ImageTrackingIntro1": "Quand un visiteur désactive JavaScript, ou quand JavaScript ne peut être utilisé, vous pouvez utiliser le lien de suivi par image pour suivre les visiteurs.",
- "ImageTrackingIntro2": "Générez le lien ci-dessous et copiez-collez le HTML généré dans la page. Si vous utilisez cela comme méthode de secours au suivi JavaScript, vous pouvez l'insérer entre des tags %1$s.",
+ "ImageTrackingIntro2": "Générez le lien ci-dessous et copiez-collez le code HTML généré dans vos pages web. Si vous utilisez cela comme méthode de secours au suivi JavaScript, vous pouvez l'insérer entre des tags %1$s.",
"ImageTrackingIntro3": "Pour la liste complète des options que vous pouvez utiliser avec un lien de suivi par image, consultez la %1$sDocumentation de l'API de suivi%2$s.",
- "ImageTrackingLink": "Lien de suivi par Image",
- "ImportingServerLogs": "Importation des logs du server",
- "ImportingServerLogsDesc": "Un alternative au suivi des visiteurs via leur navigateur (par JavaScript ou par Image) est d'importer de manière continue les logs du serveur. Apprenez-en plus à propos des %1$sstatistiques via les logs serveur%2$s.",
- "InvalidPluginsWarning": "Les plugins suivants ne sont pas compatibles avec %1$s et ne peuvent pas être chargés: %2$s.",
+ "ImageTrackingLink": "Lien de suivi par image",
+ "ImportingServerLogs": "Importation des logs du serveur",
+ "ImportingServerLogsDesc": "Un alternative au suivi des visiteurs via leur navigateur (par JavaScript ou par image) est d'importer de manière continue les logs du serveur. Apprenez-en plus à propos des %1$sstatistiques via les logs serveur%2$s.",
+ "InvalidPluginsWarning": "Les plugins suivants ne sont pas compatibles avec %1$s et ne peuvent pas être chargés : %2$s.",
"InvalidPluginsYouCanUninstall": "Vous pouvez mettre à jour ou désinstaller ces plugins sur la page %1$sManagePlugins%2$s.",
"JavaScriptTracking": "Suivi par JavaScript",
- "JSTracking_CampaignKwdParam": "Paramètre de la campagne de mot clef",
+ "JSTracking_CampaignKwdParam": "Paramètre de la campagne de mot-clé",
"JSTracking_CampaignNameParam": "Paramètre nom de la campagne",
"JSTracking_CodeNote": "Assurez-vous que ce code est sur toutes les pages de votre site web avant la balise %1$s.",
- "JSTracking_CustomCampaignQueryParam": "Utilisez des paramètres de requête personnalisés pour le nom et le mot clef de la campagne",
- "JSTracking_CustomCampaignQueryParamDesc": "Note: %1$sPiwik détectera automatiquement les paramètres de Google Analytics.%2$s",
+ "JSTracking_CustomCampaignQueryParam": "Utilisez des paramètres de requête personnalisés pour le nom et le mot-clé de la campagne",
+ "JSTracking_CustomCampaignQueryParamDesc": "Note : %1$sPiwik détectera automatiquement les paramètres de Google Analytics.%2$s",
"JSTracking_EnableDoNotTrack": "Activer la détection côté client de \"ne pas suivre\"",
- "JSTracking_EnableDoNotTrack_AlreadyEnabled": "Note: Le support de la détection côté serveur de \"ne pas suivre\" est activé, cette option n'aura donc aucun effet.",
+ "JSTracking_EnableDoNotTrack_AlreadyEnabled": "Note : Le support de la détection côté serveur de \"ne pas suivre\" est activé, cette option n'aura donc aucun effet.",
"JSTracking_EnableDoNotTrackDesc": "Donc les requêtes de suivi ne seront pas envoyées si les visiteurs ne souhaitent pas être suivis.",
"JSTracking_GroupPageTitlesByDomain": "Préfixer le domaine du site au titre de la page lors du suivi",
- "JSTracking_GroupPageTitlesByDomainDesc1": "Donc si quelqu'un visite la page \"à propos de\" sur le site \"blog\". %1$s ce sera enregistré en tant que \"blog \/ à propos de\". C'est la manière la plus facile d'avoir un aperçu de votre trafic par sous-domaine.",
+ "JSTracking_GroupPageTitlesByDomainDesc1": "Si un internaute visite la page \"À propos\" sur blog.%1$s, la visite sera enregistrée en tant que \"blog \/ À propos\". C'est la manière la plus facile d'avoir un aperçu du trafic par sous-domaine.",
"JSTracking_MergeAliases": "Dans le rapport des liens sortants, cacher les clics vers des alias d'adresses connues telles que",
"JSTracking_MergeAliasesDesc": "Ainsi un clic sur les adresses d'alias (ex %s) ne sera pas compté comme un lien sortant.",
"JSTracking_MergeSubdomains": "Suivre les visiteurs sur tous les sous-domaines de",
"JSTracking_MergeSubdomainsDesc": "Ainsi si un visiteur visite %1$s et %2$s, cela sera comptabilisé comme une visite unique.",
"JSTracking_PageCustomVars": "Suivre une variable personnalisée pour chaque affichage de page",
- "JSTracking_PageCustomVarsDesc": "Par exemple, avec une variable nommée \"categorie\" et une valeur de \"livre blancs\".",
+ "JSTracking_PageCustomVarsDesc": "Par exemple, avec une variable nommée \"categorie\" et la valeur \"livre blancs\".",
"JSTracking_VisitorCustomVars": "Effectuer le suivi des variables personnalisées pour ce visiteur",
- "JSTracking_VisitorCustomVarsDesc": "Par exemple, avec la variable nommée \"type\" et la valeur \"client\".",
+ "JSTracking_VisitorCustomVarsDesc": "Par exemple, avec une variable nommée \"type\" et la valeur \"client\".",
"JSTrackingIntro1": "Vous pouvez suivre les visiteurs de votre site web de manières variées. La manière recommandée est celle via JavaScript. Pour utiliser cette méthode assurez vous simplement que chaque page web du site a un certain code JavaScript que vous pouvez générer ici.",
- "JSTrackingIntro2": "une fois que vous avez le code de suivi JavaScript pour votre site web, copiez-collez le sur toutes les pages dont vous voulez effectuer le suivi avec Piwik.",
- "JSTrackingIntro3": "Dans la plupart des sites web, blogs, CMS, etc. Vous pouvez utiliser un module additionnel préconçu pour effectuer le travail technique à votre place. (Consultez la %1$s liste des modules utilisés pour intégrer Piwik%2$s.) Si aucun module n'existe vous pouvez modifier les modèles de pages de votre site web et ajouter ce code dans le fichier de pied de page.",
+ "JSTrackingIntro2": "Une fois que vous avez le code de suivi JavaScript pour votre site web, copiez-collez le sur toutes les pages dont vous voulez effectuer le suivi avec Piwik.",
+ "JSTrackingIntro3": "Dans la plupart des sites web, blogs, CMS, etc, vous pouvez utiliser un module additionnel préconçu pour effectuer le travail technique à votre place. (Consultez la %1$s liste des modules utilisés pour intégrer Piwik%2$s.) Si aucun module n'existe vous pouvez modifier les modèles de pages de votre site web et ajouter ce code dans le fichier de pied de page.",
"JSTrackingIntro4": "Si vous ne souhaitez pas utiliser JavaScript pour effectuer le suivi des visiteurs, %1$sgénérez un lien de suivi par image ci-dessous%2$s.",
"JSTrackingIntro5": "Si vous voulez faire plus qu'effectuer le suivi des visites de pages, veuillez consulter %1$sla documentation de suivi par JavaScript%2$s pour connaitre la liste des fonctions disponibles. En utilisant ces fonctions vous pouvez effectuer le suivi des objectifs, variables personnalisées, commandes de e-commerce, chariots\/paniers abandonnés et plus encore.",
"LatestBetaRelease": "Dernière version beta",
@@ -56,9 +56,9 @@
"MenuGeneralSettings": "Paramètres généraux",
"MenuManage": "Gérer",
"OptOutComplete": "Cookie d'exclusion installé. Vos visites sur ce site web ne seront PAS enregistrées par notre outil d'analyse web.",
- "OptOutCompleteBis": "Note - Si vous nettoyez vos cookies et supprimez le cookie d'exclusion, ou bien si vous changez d'ordinateur et\/ou de navigateur, il vous faudra de nouveau activer la procédure d'exclusion.",
+ "OptOutCompleteBis": "Note: si vous nettoyez vos cookies et supprimez le cookie d'exclusion, ou bien si vous changez d'ordinateur et\/ou de navigateur, il vous faudra de nouveau effectuer la procédure d'exclusion.",
"OptOutExplanation": "Piwik met un point d'honneur à respecter la vie privée sur Internet. Pour fournir à vos visiteurs le choix de ne pas apparaître dans les analyses de Piwik, vous pouvez ajouter le code HTML suivant sur une des pages de votre site web, par exemple dans la page \"Politique de confidentialité\".",
- "OptOutExplanationBis": "Ce code va afficher un Iframe contenant un lien pour vos visiteurs pour ne pas être suivi dans Piwik en installant un cookie de neutralisation dans leur navigateur. %s Cliquez ici %s pour visualiser le contenu qui sera affiché par l'iFrame.",
+ "OptOutExplanationBis": "Ce code va afficher un iFrame contenant un lien permettant à vos visiteurs de ne pas être suivi par Piwik en installant un cookie de neutralisation dans leur navigateur. %s Cliquez ici %s pour visualiser le contenu qui sera affiché par l'iFrame.",
"OptOutForYourVisitors": "Exclusion de Piwik pour vos visiteurs",
"PiwikIsInstalledAt": "Piwik est installé à l'adresse",
"PluginDescription": "Zone d'administration de Piwik.",
diff --git a/plugins/CoreConsole/Commands/ManagePlugin.php b/plugins/CoreConsole/Commands/ManagePlugin.php
index 0ceacbef3b..00dcd29c0a 100644
--- a/plugins/CoreConsole/Commands/ManagePlugin.php
+++ b/plugins/CoreConsole/Commands/ManagePlugin.php
@@ -26,12 +26,13 @@ class ManagePlugin extends ConsoleCommand
{
$this->setName('core:plugin');
$this->setDescription("Perform various actions regarding one or more plugins.");
- $this->addArgument("operation", InputArgument::REQUIRED, "Operation to apply (can be 'activate' or 'deactivate').");
- $this->addArgument("plugins", InputArgument::REQUIRED | InputArgument::IS_ARRAY, 'Plugin name(s) to activate.');
+ $this->addArgument("operation", InputArgument::REQUIRED, "Operation to apply (can be 'activate' or 'deactivate' or 'list').");
+ $this->addArgument("plugins", InputArgument::OPTIONAL | InputArgument::IS_ARRAY, 'Plugin name(s) to activate.');
$this->addOption('domain', null, InputOption::VALUE_REQUIRED, "The domain to activate the plugin for.");
$this->operations['activate'] = 'activatePlugin';
$this->operations['deactivate'] = 'deactivatePlugin';
+ $this->operations['list'] = 'listPlugins';
}
/**
@@ -47,6 +48,23 @@ class ManagePlugin extends ConsoleCommand
}
$fn = $this->operations[$operation];
+
+
+ if($fn == 'listPlugins') {
+ call_user_func(array($this, $fn), $input, $output);
+ } else {
+ $this->applyOperationToEachPlugin($input, $output, $plugins, $fn);
+ }
+ }
+
+ /**
+ * @param InputInterface $input
+ * @param OutputInterface $output
+ * @param $plugins
+ * @param $fn
+ */
+ protected function applyOperationToEachPlugin(InputInterface $input, OutputInterface $output, $plugins, $fn)
+ {
foreach ($plugins as $plugin) {
call_user_func(array($this, $fn), $input, $output, $plugin);
}
@@ -65,4 +83,16 @@ class ManagePlugin extends ConsoleCommand
$output->writeln("Deactivated plugin <info>$plugin</info>");
}
+
+ private function listPlugins(InputInterface $input, OutputInterface $output, $plugin)
+ {
+ $plugins = Manager::getInstance()->getPluginsLoadedAndActivated();
+
+ $count = count($plugins);
+ $output->writeln("Listing $count activated plugins:");
+ foreach($plugins as $plugin) {
+ $pluginName = $plugin->getPluginName();
+ $output->writeln("<info>$pluginName</info>");
+ };
+ }
} \ No newline at end of file
diff --git a/plugins/CoreHome/lang/fr.json b/plugins/CoreHome/lang/fr.json
index 7fbc771adf..78b14e3f9a 100644
--- a/plugins/CoreHome/lang/fr.json
+++ b/plugins/CoreHome/lang/fr.json
@@ -16,7 +16,7 @@
"ExcludeRowsWithLowPopulation": "Toutes les lignes sont affichées %s Exclure celles peu signifiantes",
"ExternalHelp": "Aide (nouvel onglet)",
"FlattenDataTable": "Le rapport est hiérarchique %s L'aplatir",
- "HowMuchIsPiwikWorth": "Combien vaut Piwik pour vous?",
+ "HowMuchIsPiwikWorth": "Combien vaut Piwik pour vous ?",
"IncludeRowsWithLowPopulation": "Les lignes peu signifiantes sont cachées %s Afficher toutes les lignes",
"InjectedHostEmailBody": "Bonjour, j'ai essayé d'accéder à Piwik aujourd'hui et j'ai rencontré l'avertissement de nom d'hôte inconnu.",
"InjectedHostEmailSubject": "On a accédé à Piwik avec un nom d'hôte inconnu : %s",
@@ -29,7 +29,7 @@
"MakeADifference": "Faites une différence : %1$sDonnez Maintenant%2$s pour financer Piwik 2.0!",
"MakeOneTimeDonation": "Faire un don unique à la place.",
"NoPrivilegesAskPiwikAdmin": "Vous êtes connecté en tant que '%s' mais il semble que nous n'ayez aucune permission définie dans Piwik. %s Demandez à votre administrateur (cliquez pour envoyer un e-mail)%s de vous donner l'accès 'Consultation' à un site web.",
- "OnlyForSuperUserAccess": "Ce Gadget est uniquement affiché aux utilisateurs possédant un accès de type super utilisateur.",
+ "OnlyForSuperUserAccess": "Ce widget est uniquement affiché aux utilisateurs possédant un accès de type super utilisateur.",
"PageOf": "%1$s de %2$s",
"PeriodDay": "Jour",
"PeriodDays": "jours",
@@ -43,7 +43,7 @@
"PluginDescription": "Structure des rapports statistiques web.",
"ReportGeneratedOn": "Rapport généré le %s",
"ReportGeneratedXAgo": "Rapport généré il y a %s",
- "SharePiwikLong": "Salut! Je viens juste de trouver un bon logiciel libre: Piwik!\nPiwik va te permettre de suivre els visiteurs de ton site web gratuitement. Tu devrais vraiment aller voir!",
+ "SharePiwikLong": "Salut ! Je viens juste de trouver un bon logiciel libre : Piwik !\nPiwik va te permettre de suivre les visiteurs de ton site web gratuitement. Tu devrais vraiment aller voir !",
"SharePiwikShort": "Piwik! Analyse web gratuite et libre. Maîtrisez vos données.",
"ShareThis": "Partager ceci",
"ShortDateFormat": "%shortDay% %day% %shortMonth%",
@@ -54,7 +54,7 @@
"SubscribeAndBecomePiwikSupporter": "Procéder à un paiement par carte de crédit sécurisé (Paypal) pour devenir un bienfaiteur de Piwik!",
"SupportPiwik": "Supporter Piwik!",
"TableNoData": "Aucune donnée pour cette table.",
- "ThereIsNoDataForThisReport": "Il n'y a pas de donnée pour ce rapport.",
+ "ThereIsNoDataForThisReport": "Il n'y a pas de données pour ce rapport.",
"UnFlattenDataTable": "Le rapport est plat %s Le rendre hiérarchique",
"ViewAllPiwikVideoTutorials": "Visualiser tous les tutoriaux vidéo de Piwik",
"WebAnalyticsReports": "Rapports des statistiques web.",
diff --git a/plugins/CorePluginsAdmin/Controller.php b/plugins/CorePluginsAdmin/Controller.php
index b87fc91579..02020c710d 100644
--- a/plugins/CorePluginsAdmin/Controller.php
+++ b/plugins/CorePluginsAdmin/Controller.php
@@ -11,7 +11,7 @@ namespace Piwik\Plugins\CorePluginsAdmin;
use Exception;
use Piwik\API\Request;
use Piwik\Common;
-use Piwik\Exceptions\HtmlMessageException;
+use Piwik\Exception\MissingFilePermissionException;
use Piwik\Filechecks;
use Piwik\Filesystem;
use Piwik\Nonce;
@@ -444,10 +444,13 @@ class Controller extends Plugin\ControllerAdmin
$messageIntro = Piwik::translate("Warning: \"%s\" could not be uninstalled. Piwik did not have enough permission to delete the files in $path. ",
$pluginName);
- $exitMessage = $messageIntro . "<br/><br/>" . $messagePermissions;
+ $exitMessage = $messageIntro . "<br/><br/>" . $messagePermissions;
$exitMessage .= "<br> Or manually delete this directory (using FTP or SSH access)";
- throw new HtmlMessageException($exitMessage);
+ $ex = new MissingFilePermissionException($exitMessage);
+ $ex->setIsHtmlMessage();
+
+ throw $ex;
}
$this->redirectAfterModification($redirectAfter);
diff --git a/plugins/CorePluginsAdmin/lang/fr.json b/plugins/CorePluginsAdmin/lang/fr.json
index 465054c613..17310355b0 100644
--- a/plugins/CorePluginsAdmin/lang/fr.json
+++ b/plugins/CorePluginsAdmin/lang/fr.json
@@ -61,7 +61,7 @@
"OriginThirdParty": "Tierce-Partie",
"PluginDescription": "Interface d'administration des plugins.",
"PluginHomepage": "Page d'accueil du plugin",
- "PluginKeywords": "Mots-Clefs",
+ "PluginKeywords": "Mots-clés",
"PluginNotCompatibleWith": "Le composant %1$s n'est pas compatible avec %2$s.",
"PluginNotWorkingAlternative": "Si vous avez utilisé ce composant additionnel, peut être pourriez vous trouver une version plus récente sur le Marché. Le cas échéant vous devriez le désinstaller.",
"PluginRequirement": "%1$s requiert %2$s.",
diff --git a/plugins/CoreUpdater/lang/fr.json b/plugins/CoreUpdater/lang/fr.json
index 13d8cee023..b616864f19 100644
--- a/plugins/CoreUpdater/lang/fr.json
+++ b/plugins/CoreUpdater/lang/fr.json
@@ -16,8 +16,8 @@
"ErrorDuringPluginsUpdates": "Erreurs pendant les mises à jour de plugins :",
"ExceptionAlreadyLatestVersion": "Votre version de Piwik %s est à jour.",
"ExceptionArchiveEmpty": "Archive vide.",
- "ExceptionArchiveIncompatible": "Archive incompatible: %s",
- "ExceptionArchiveIncomplete": "L'archive est incomplète: des fichiers sont manquants (ex. %s).",
+ "ExceptionArchiveIncompatible": "Archive incompatible : %s",
+ "ExceptionArchiveIncomplete": "L'archive est incomplète : des fichiers sont manquants (ex. %s).",
"FeedbackRequest": "N'hésitez pas à partager vos idées et suggestions avec l'équipe Piwik :",
"HelpMessageContent": "Allez voir la %1$s FAQ Piwik %2$s qui explique les erreurs courantes lors de la mise à jour. %3$s Demandez à votre administrateur système - il pourra être à même avec cette erreur qui est très probablement liée à la configuration de votre serveur MySQL.",
"HelpMessageIntroductionWhenError": "Ci-dessus est le message d'erreur du noyau. Cela devrait expliquer la cause, mais si vous nécessitez davantage d'aide merci de :",
@@ -28,7 +28,7 @@
"MajorUpdateWarning1": "C'est une mise à jour importante! Elle va prendre plus de temps que d'habitude.",
"MajorUpdateWarning2": "Le conseil suivant est particulièrement important pour des installations conséquentes.",
"NoteForLargePiwikInstances": "Note importante pour les installations Piwik de taille importante",
- "NoteItIsExpectedThatQueriesFail": "Note: si vous exécutez manuellement ces requêtes, il se peut que certaines d'entre elles échouent. Dans ce cas, ignorez simplement les erreurs, et exécutez les suivantes dans la liste.",
+ "NoteItIsExpectedThatQueriesFail": "Note : si vous exécutez manuellement ces requêtes, il se peut que certaines d'entre elles échouent. Dans ce cas, ignorez simplement les erreurs, et exécutez les suivantes dans la liste.",
"NotificationClickToUpdatePlugins": "Cliquez ici pour mettre à jour vos plugins maintenant :",
"NotificationClickToUpdateThemes": "Cliquez ici pour mettre à jour vos plugins maintenant :",
"NotificationSubjectAvailableCoreUpdate": "Piwik %s est maintenant disponible",
diff --git a/plugins/CustomVariables/Archiver.php b/plugins/CustomVariables/Archiver.php
index 47e1363dc4..704038b0a1 100644
--- a/plugins/CustomVariables/Archiver.php
+++ b/plugins/CustomVariables/Archiver.php
@@ -154,7 +154,7 @@ class Archiver extends \Piwik\Plugin\Archiver
if (substr($value, -2) != '"]') {
$value .= '"]';
}
- $decoded = @Common::json_decode($value);
+ $decoded = json_decode($value);
if (is_array($decoded)) {
$count = 0;
foreach ($decoded as $category) {
diff --git a/plugins/Dashboard/Controller.php b/plugins/Dashboard/Controller.php
index c7a89a75a5..4c7d0c53f4 100644
--- a/plugins/Dashboard/Controller.php
+++ b/plugins/Dashboard/Controller.php
@@ -39,7 +39,7 @@ class Controller extends \Piwik\Plugin\Controller
$view = new View($template);
$this->setGeneralVariablesView($view);
- $view->availableWidgets = Common::json_encode(WidgetsList::get());
+ $view->availableWidgets = json_encode(WidgetsList::get());
$view->availableLayouts = $this->getAvailableLayouts();
$view->dashboardId = Common::getRequestVar('idDashboard', 1, 'int');
@@ -75,7 +75,7 @@ class Controller extends \Piwik\Plugin\Controller
$this->checkTokenInUrl();
Json::sendHeaderJSON();
- return Common::json_encode(WidgetsList::get());
+ return json_encode(WidgetsList::get());
}
public function getDashboardLayout($checkToken = true)
@@ -148,7 +148,7 @@ class Controller extends \Piwik\Plugin\Controller
$dashboards = $this->dashboard->getAllDashboards($login);
Json::sendHeaderJSON();
- return Common::json_encode($dashboards);
+ return json_encode($dashboards);
}
/**
@@ -175,7 +175,7 @@ class Controller extends \Piwik\Plugin\Controller
$nextId = $this->getModel()->createNewDashboardForUser($login, $name, $layout);
Json::sendHeaderJSON();
- return Common::json_encode($nextId);
+ return json_encode($nextId);
}
public function copyDashboardToUser()
@@ -197,7 +197,7 @@ class Controller extends \Piwik\Plugin\Controller
$nextId = $this->getModel()->createNewDashboardForUser($user, $name, $layout);
Json::sendHeaderJSON();
- return Common::json_encode($nextId);
+ return json_encode($nextId);
}
}
diff --git a/plugins/Dashboard/Dashboard.php b/plugins/Dashboard/Dashboard.php
index 1ff5a98182..a0a12985c3 100644
--- a/plugins/Dashboard/Dashboard.php
+++ b/plugins/Dashboard/Dashboard.php
@@ -193,12 +193,12 @@ class Dashboard extends \Piwik\Plugin
$layout = str_replace("\\\"", "\"", $layout);
$layout = str_replace("\n", "", $layout);
- return Common::json_decode($layout, $assoc = false);
+ return json_decode($layout, $assoc = false);
}
public function encodeLayout($layout)
{
- return Common::json_encode($layout);
+ return json_encode($layout);
}
public function getJsFiles(&$jsFiles)
diff --git a/plugins/DevicesDetection/lang/cs.json b/plugins/DevicesDetection/lang/cs.json
index fee44471c1..9214d12406 100644
--- a/plugins/DevicesDetection/lang/cs.json
+++ b/plugins/DevicesDetection/lang/cs.json
@@ -1,6 +1,8 @@
{
"DevicesDetection": {
+ "BrowserEngine": "Vykreslovací jádro",
"BrowserEngineDocumentation": "Tento graf zobrazuje prohlížeče vašich návštěvníků odle prodin prohlížečů. %s Nejdůležitější informací pro webové vývojáře je to, jaká vykreslovací jádra návštěvníci používají. Název vykreslovacího jádra je v popisku následován v závorkách nejčastějším prohlížečem, který ho používá.",
+ "BrowserEngines": "Vykreslovací jádra",
"BrowserVersions": "Verze prohlížečů",
"Camera": "Fotoaparát",
"CarBrowser": "Prohlížeč v autě",
diff --git a/plugins/DevicesDetection/lang/da.json b/plugins/DevicesDetection/lang/da.json
index cca1370299..31ec5a967b 100644
--- a/plugins/DevicesDetection/lang/da.json
+++ b/plugins/DevicesDetection/lang/da.json
@@ -1,5 +1,6 @@
{
"DevicesDetection": {
+ "BrowserEngine": "Browser",
"BrowserEngineDocumentation": "Diagrammet viser de besøgendes browsere opdelt i grupper. %s De vigtigste oplysninger for web-udviklere er, hvilken slags rendering motor de besøgende bruger. Etiketterne indeholder navnene på motorerne, efterfulgt af de mest almindelige browsere, der benytter motoren i parentes.",
"BrowserVersions": "Browser-versioner",
"Camera": "Kamera",
diff --git a/plugins/DevicesDetection/lang/de.json b/plugins/DevicesDetection/lang/de.json
index f81ca19286..9dfc5b547b 100644
--- a/plugins/DevicesDetection/lang/de.json
+++ b/plugins/DevicesDetection/lang/de.json
@@ -1,6 +1,8 @@
{
"DevicesDetection": {
+ "BrowserEngine": "Browser",
"BrowserEngineDocumentation": "Dieser Graph zeit Ihnen die Browser Ihrer Besucher aufgeteilt nach Browserfamilien. %s Die wichtigste Information für Webentwickler ist, welche Rendering Engine Besucher verwenden. Die Beschriftungen enthalten den Namen der Engine und in Klammern den Namen des bekanntesten Browsers, der diese verwendet.",
+ "BrowserEngines": "Browser",
"BrowserVersions": "Browser Versionen",
"Camera": "Digitalcamera",
"CarBrowser": "PKW-Browser",
diff --git a/plugins/DevicesDetection/lang/el.json b/plugins/DevicesDetection/lang/el.json
index c375261ca6..14ab980463 100644
--- a/plugins/DevicesDetection/lang/el.json
+++ b/plugins/DevicesDetection/lang/el.json
@@ -1,6 +1,8 @@
{
"DevicesDetection": {
+ "BrowserEngine": "Μηχανή προγράμματος πλοήγησης",
"BrowserEngineDocumentation": "Αυτό το διάγραμμα δείχνει τους φυλλομετρητές των επισκεπτών σε οικογένειες φυλλομετρητών. %s Η πιο σημαντική πληροφορία για τους δημιουργούς ιστοσελίδων είναι οι μηχανές μετάφρασης που χρησιμοποιούν οι επισκέπτες. Οι ετικέτες περιέχουν τα ονόματα των μηχανών και σε εισαγωγικά τον πιο κοινό φυλλομετρητή που τη χρησιμοποιεί.",
+ "BrowserEngines": "Μηχανές προγράμματος πλοήγησης",
"BrowserVersions": "Εκδόσεις προγραμμάτων περιήγησης",
"Camera": "Κάμερα",
"CarBrowser": "Πρόγραμμα περιήγησης αυτοκινήτου",
diff --git a/plugins/DevicesDetection/lang/fr.json b/plugins/DevicesDetection/lang/fr.json
index 761510d9d4..b3cafa684c 100644
--- a/plugins/DevicesDetection/lang/fr.json
+++ b/plugins/DevicesDetection/lang/fr.json
@@ -1,6 +1,8 @@
{
"DevicesDetection": {
+ "BrowserEngine": "Moteur de rendu HTML",
"BrowserEngineDocumentation": "Ce tableau affiche les navigateurs de vos visiteurs regroupés par famille. %s L'information la plus importante pour les développeurs est quel type de moteur de rendu utilisent leurs visiteurs. Les labels contiennent les noms des moteurs suivis par les principaux navigateurs les utilisant entre parenthèses.",
+ "BrowserEngines": "Moteurs de rendu HTML",
"BrowserVersions": "Versions du navigateur",
"Camera": "Caméra",
"CarBrowser": "Navigateur de voiture",
@@ -17,7 +19,7 @@
"DevicesDetection": "Périphériques du visiteur",
"DeviceType": "Type du périphérique",
"FeaturePhone": "Fonctionnalité téléphone",
- "OperatingSystemFamilies": "Familles de système d'exploitation",
+ "OperatingSystemFamilies": "Familles de systèmes d'exploitations",
"OperatingSystemVersions": "Versions de système d'exploitation",
"PluginDescription": "Ce composant additionnel fournit des informations détaillées à propos des périphériques mobiles, telles que la marque (constructeur), le modèle (version du périphérique), une meilleure détection du type de périphérique (tv, consoles, smart phones, pc, etc) et autres. Ce composant additionnel ajoute un nouveau rapport dans Visiteur > Périphériques.",
"SmartDisplay": "Affichage intelligent",
diff --git a/plugins/DevicesDetection/lang/it.json b/plugins/DevicesDetection/lang/it.json
index 66d9d0aebc..59c1660d8b 100644
--- a/plugins/DevicesDetection/lang/it.json
+++ b/plugins/DevicesDetection/lang/it.json
@@ -1,6 +1,8 @@
{
"DevicesDetection": {
+ "BrowserEngine": "Motore browser",
"BrowserEngineDocumentation": "Questo grafico mostra i browser dei vostri visitatori suddivisi in famiglie di browser. %s Le informazioni più importanti per gli sviluppatori web sono che tipo di motore di rendering i loro visitatori stanno usando. Le etichette contengono i nomi dei motori seguiti dal browser più comune che utilizza quel motore tra parentesi.",
+ "BrowserEngines": "Motori browser",
"BrowserVersions": "Versioni browser",
"Camera": "Fotocamera",
"CarBrowser": "Browser in auto",
diff --git a/plugins/Events/lang/el.json b/plugins/Events/lang/el.json
index 0e50dd6745..2df155d36f 100644
--- a/plugins/Events/lang/el.json
+++ b/plugins/Events/lang/el.json
@@ -14,6 +14,7 @@
"EventsWithValue": "Γεγονότα με τιμή",
"EventsWithValueDocumentation": "Αριθμός γεγονότων στα οποία έχει οριστεί μια τιμή",
"EventValue": "Τιμή Συμβάντος",
+ "EventValueTooltip": "Η συνολική αξία συμβάντος είναι το άθροισμα %s τιμών συμβάντων %s μεταξύ ελάχιστου %s και μέγιστου %s.",
"MaxValue": "Μέγιστη τιμή",
"MaxValueDocumentation": "Μέγιστη τιμή για το συμβάν",
"MinValue": "Ελάχιστη τιμή",
diff --git a/plugins/ExamplePlugin/tests/Integration/SimpleTest.php b/plugins/ExamplePlugin/tests/Integration/SimpleTest.php
index 3d8ac904f8..5aa9d4c617 100644
--- a/plugins/ExamplePlugin/tests/Integration/SimpleTest.php
+++ b/plugins/ExamplePlugin/tests/Integration/SimpleTest.php
@@ -18,6 +18,23 @@ use Piwik\Tests\Framework\TestCase\IntegrationTestCase;
class SimpleTest extends IntegrationTestCase
{
+ public function setUp()
+ {
+ parent::setUp();
+
+ // set up your test here if needed
+ }
+
+ public function tearDown()
+ {
+ // clean up your test here if needed
+
+ parent::tearDown();
+ }
+
+ /**
+ * All your actual test methods should start with the name "test"
+ */
public function testSimpleAddition()
{
$this->assertEquals(2, 1+1);
diff --git a/plugins/ExamplePlugin/tests/Unit/SimpleTest.php b/plugins/ExamplePlugin/tests/Unit/SimpleTest.php
index 396ee20785..4b5341096f 100644
--- a/plugins/ExamplePlugin/tests/Unit/SimpleTest.php
+++ b/plugins/ExamplePlugin/tests/Unit/SimpleTest.php
@@ -16,6 +16,9 @@ namespace Piwik\Plugins\ExamplePlugin\tests\Unit;
class SimpleTest extends \PHPUnit_Framework_TestCase
{
+ /**
+ * All your actual test methods should start with the name "test"
+ */
public function testSimpleAddition()
{
$this->assertEquals(2, 1+1);
diff --git a/plugins/Goals/Controller.php b/plugins/Goals/Controller.php
index e7af6d6243..3e61eb06e3 100644
--- a/plugins/Goals/Controller.php
+++ b/plugins/Goals/Controller.php
@@ -168,7 +168,7 @@ class Controller extends \Piwik\Plugin\Controller
$goal['pattern'] = Common::unsanitizeInputValue($goal['pattern']);
}
}
- $view->goalsJSON = Common::json_encode($goals);
+ $view->goalsJSON = json_encode($goals);
$view->userCanEditGoals = Piwik::isUserHasAdminAccess($this->idSite);
$view->ecommerceEnabled = $this->site->isEcommerceEnabled();
diff --git a/plugins/Goals/lang/fr.json b/plugins/Goals/lang/fr.json
index 787c6ae1d2..28e8430bea 100644
--- a/plugins/Goals/lang/fr.json
+++ b/plugins/Goals/lang/fr.json
@@ -6,11 +6,12 @@
"AddNewGoalOrEditExistingGoal": "%sAjouter un nouvel objectif%s or %sEditer%s des objectifs existants",
"AllowGoalConvertedMoreThanOncePerVisit": "Autoriser un objectif à être converti plus d'une fois par visite.",
"AllowMultipleConversionsPerVisit": "Autoriser les conversions multiples par visite",
- "BestCountries": "Vos meilleurs pays de conversion sont:",
- "BestKeywords": "Vos meilleurs mots clefs sont:",
- "BestReferrers": "Vos meilleurs sites web de conversion sont:",
+ "BestCountries": "Vos meilleurs pays de conversion sont :",
+ "BestKeywords": "Vos meilleurs mots-clés sont :",
+ "BestReferrers": "Vos meilleurs sites web de conversion sont :",
"CaseSensitive": "Correspondance sensible à la case",
- "ClickOutlink": "Cliquent sur un Lien vers un site externe",
+ "ChooseGoal": "Choisir un objectif",
+ "ClickOutlink": "Cliquent sur un lien vers un site externe",
"ColumnAverageOrderRevenueDocumentation": "Les recettes moyennes par commande représentent les recettes totales des commandes E-commerce divisées par le nombre de commandes.",
"ColumnAveragePriceDocumentation": "Revenu moyen pour %s.",
"ColumnAverageQuantityDocumentation": "Quantité moyenne vendue de %s dans les commandes E-commerce.",
@@ -34,7 +35,7 @@
"CreateNewGOal": "Créer un nouvel Objectif",
"DaysToConv": "Jours par conversion",
"DefaultGoalConvertedOncePerVisit": "(par défaut) Un objectif peut-être converti une seule fois par visite",
- "DefaultRevenue": "Le revenue par défaut de l'objectif est",
+ "DefaultRevenue": "Le revenu par défaut de l'objectif est",
"DefaultRevenueHelp": "Par exemple, un formulaire de contact soumis par un visiteur peut avoir une valeur de 10 € en moyenne. Piwik vous aidera à comprendre comment se comportent vos visiteurs.",
"DeleteGoalConfirm": "Êtes vous sûr de vouloir supprimer l'objectif %s?",
"DocumentationRevenueGeneratedByProductSales": "Ventes de produits. Hors taxes, expéditions et remises.",
@@ -66,24 +67,24 @@
"Manually": "manuellement",
"ManuallyTriggeredUsingJavascriptFunction": "Les objectifs sont déclenchés manuellement en utilisant l'API Javascript trackGoal()",
"MatchesExpression": "correspond à l'expression %s",
- "NewGoalDescription": "Un Objectif dans Piwik représente votre stratégie, votre priorité, et peut comporter plusieurs choses: \"les broches téléchargées\", \"Enregistré à la newsletter\", \"Page services.html visitée\", etc.",
+ "NewGoalDescription": "Dans Piwik, un objectif représente votre stratégie, votre priorité, et peut comporter plusieurs choses: \"Télécharger la brochure\", \"S'enregistrer à la newsletter\", \"Visiter la page services.html\", etc.",
"NewGoalIntro": "Le suivi de la conversion des objectifs et une des manières les plus efficaces de mesurer et améliorer vos objectifs d'affaires.",
- "NewGoalYouWillBeAbleTo": "Vous serez en capacité de visualiser et d'analyser votre performance, pour chaque Objectif, et d'apprendre comment augmenter vos conversions, taux de conversion et revenu par visite.",
+ "NewGoalYouWillBeAbleTo": "Vous serez en capacité de visualiser et d'analyser vos performances pour chaque objectif, et d'apprendre comment augmenter vos conversions, taux de conversion et revenu par visite.",
"NewVisitorsConversionRateIs": "Le taux de conversion des nouveaux visiteurs est %s",
- "NewWhatDoYouWantUsersToDo": "Que voulez vous que vos visiteurs accomplissent sur votre site web?",
+ "NewWhatDoYouWantUsersToDo": "Que voulez-vous que vos visiteurs accomplissent sur votre site web ?",
"NoGoalsNeedAccess": "Uniquement un Administrateur ou un utilisateur avec un accès Super Utilisateur peut ajouter des Objectifs à un site donné. Veuillez demander à votre administrateur Piwik de mettre en place un Objectif pour votre site web. <br \/>Le suivit d'Objectifs est une bonne manière de mieux comprendre et de maximiser les performances de votre site web!",
"Optional": "(optionnel)",
"OverallConversionRate": "%s taux de conversion global (visites avec un objectif rempli)",
"OverallRevenue": "%s revenu global",
"PageTitle": "Titre de la page",
"Pattern": "Modèle",
- "PluginDescription": "Créer des objectifs et consulter les rapports sur vos conversions d'objectifs: évolution au cours du temps, revenu par visite, conversion par référant, par mot clef, etc.",
+ "PluginDescription": "Créer des objectifs et consulter les rapports sur vos conversions d'objectifs : évolution au cours du temps, revenu par visite, conversion par référent, par mot-clé, etc.",
"ProductCategory": "Catégorie du produit",
"ProductName": "Nom du produit",
"Products": "Produits",
"ProductSKU": "Code Produit",
"ReturningVisitorsConversionRateIs": "Le taux de conversion des visiteurs déjà venus est %s",
- "SendEvent": "Envoyer un évènement",
+ "SendEvent": "Envoient un évènement",
"SingleGoalOverviewDocumentation": "Ceci est un aperçu des conversions pour un seul Objectif. %s les lignes de tendance sous le graphique peuvent être agrandies en cliquant dessus.",
"UpdateGoal": "Mettre à jour un objectif",
"URL": "URL",
diff --git a/plugins/Installation/Exception/DatabaseConnectionFailedException.php b/plugins/Installation/Exception/DatabaseConnectionFailedException.php
new file mode 100644
index 0000000000..b5883f0f6d
--- /dev/null
+++ b/plugins/Installation/Exception/DatabaseConnectionFailedException.php
@@ -0,0 +1,15 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\Installation\Exception;
+
+use Piwik\Exception\Exception;
+
+class DatabaseConnectionFailedException extends Exception
+{
+} \ No newline at end of file
diff --git a/plugins/Installation/Installation.php b/plugins/Installation/Installation.php
index 8bd1a00fab..427d3d502e 100644
--- a/plugins/Installation/Installation.php
+++ b/plugins/Installation/Installation.php
@@ -10,9 +10,9 @@ namespace Piwik\Plugins\Installation;
use Piwik\Common;
use Piwik\Config;
-use Piwik\Exceptions\HtmlMessageException;
use Piwik\FrontController;
use Piwik\Piwik;
+use Piwik\Plugins\Installation\Exception\DatabaseConnectionFailedException;
use Piwik\Translate;
use Piwik\View as PiwikView;
@@ -43,7 +43,10 @@ class Installation extends \Piwik\Plugin
$view = new PiwikView("@Installation/cannotConnectToDb");
$view->exceptionMessage = $exception->getMessage();
- throw new HtmlMessageException($view->render());
+ $ex = new DatabaseConnectionFailedException($view->render());
+ $ex->setIsHtmlMessage();
+
+ throw $ex;
}
public function dispatchIfNotInstalledYet(&$module, &$action, &$parameters)
diff --git a/plugins/Installation/lang/cs.json b/plugins/Installation/lang/cs.json
index 5c4dedf41e..83ee327088 100644
--- a/plugins/Installation/lang/cs.json
+++ b/plugins/Installation/lang/cs.json
@@ -17,6 +17,8 @@
"DatabaseSetupLogin": "uživatelské jméno",
"DatabaseSetupServer": "server s databází",
"DatabaseSetupTablePrefix": "prefix tabulek",
+ "DefaultSettings": "Výchozí nastavení Piwiku",
+ "DefaultSettingsHelp": "Piwik má výchozí nastavení. Můžete je změnit teď, nebo později z administračního rozhraní.",
"Email": "e-mail",
"Extension": "přípona",
"Filesystem": "Souborový systém",
diff --git a/plugins/Installation/lang/da.json b/plugins/Installation/lang/da.json
index b079ba92c5..deab4591d3 100644
--- a/plugins/Installation/lang/da.json
+++ b/plugins/Installation/lang/da.json
@@ -17,6 +17,8 @@
"DatabaseSetupLogin": "Brugernavn",
"DatabaseSetupServer": "Databaseserver",
"DatabaseSetupTablePrefix": "Tabel præfiks",
+ "DefaultSettings": "Piwik standardindstillinger",
+ "DefaultSettingsHelp": "Piwik leveres med standardindstillinger. Tilpas dem nu, eller gør det senere på adminskærmen.",
"Email": "E-mail",
"Extension": "udvidelse",
"Filesystem": "Filsystem",
diff --git a/plugins/Installation/lang/de.json b/plugins/Installation/lang/de.json
index 3a5d09ef89..37f845d3cd 100644
--- a/plugins/Installation/lang/de.json
+++ b/plugins/Installation/lang/de.json
@@ -17,6 +17,8 @@
"DatabaseSetupLogin": "Benutzer",
"DatabaseSetupServer": "Datenbank-Server",
"DatabaseSetupTablePrefix": "Tabellen-Prefix",
+ "DefaultSettings": "Standard Piwik Einstellungen",
+ "DefaultSettingsHelp": "Piwik ist mit Standardeinstellungen vorkonfiguriert. Sie können diese nun personalisieren oder dies später im Adminbereich nachholen.",
"Email": "E-Mail",
"Extension": "Erweiterung",
"Filesystem": "Dateisystem",
diff --git a/plugins/Installation/lang/el.json b/plugins/Installation/lang/el.json
index 69dc01c108..315055f768 100644
--- a/plugins/Installation/lang/el.json
+++ b/plugins/Installation/lang/el.json
@@ -17,6 +17,8 @@
"DatabaseSetupLogin": "Όνομα χρήστη",
"DatabaseSetupServer": "Διακομιστής βάσης δεδομένων",
"DatabaseSetupTablePrefix": "Πρόθεμα πινάκων",
+ "DefaultSettings": "Προκαθορισμένες ρυθμίσεις του Piwik",
+ "DefaultSettingsHelp": "Το Piwik έρχεται με προκαθορισμένες ρυθμίσεις. Μπορείτε να τις αλλάξετε τώρα ή αργότερα στην οθόνη διαχείρισης.",
"Email": "Ηλεκτρονική διεύθυνση",
"Extension": "επέκταση",
"Filesystem": "Σύστημα αρχείων",
diff --git a/plugins/Installation/lang/fr.json b/plugins/Installation/lang/fr.json
index e792a442e2..fcf10917c5 100644
--- a/plugins/Installation/lang/fr.json
+++ b/plugins/Installation/lang/fr.json
@@ -4,7 +4,7 @@
"CannotConnectToDbResolvingExplanation": "Cela peut être un problème temporaire, essayer de %1$srafraichir la page%2$s. Si le problème persiste veuillez contacter votre administrateur Piwik.",
"CollaborativeProject": "Piwik est un projet collaboratif, construit avec amour par des personnes du monde entier.",
"ConfigurationHelp": "Votre configuration de Piwik semble être erronée. Vous pouvez ou bien supprimer config\/config.inc.php et reprendre l'installation ou corriger les paramètres de connexion.",
- "ConfirmDeleteExistingTables": "Êtes vous sûr de vouloir supprimer les tables : %s de votre base de données? ATTENTION: LES DONNÉES SERONT DÉFINITIVEMENT PERDUES!",
+ "ConfirmDeleteExistingTables": "Êtes vous sûr de vouloir supprimer les tables %s de votre base de données ? ATTENTION : LES DONNÉES SERONT DÉFINITIVEMENT PERDUES !",
"Congratulations": "Félicitations",
"CongratulationsHelp": "<p>Félicitations! Votre installation de Piwik est terminée.<\/p><p>Assurez-vous que le code JavaScript est présent sur toutes vos pages et attendez vos premiers visiteurs!<\/p>",
"DatabaseAbilities": "Capacités de la base de données",
@@ -17,6 +17,8 @@
"DatabaseSetupLogin": "compte",
"DatabaseSetupServer": "serveur de la base de données",
"DatabaseSetupTablePrefix": "préfixe des tables",
+ "DefaultSettings": "Paramétrage par défaut",
+ "DefaultSettingsHelp": "Piwik est installé avec un paramétrage par défaut. Vous pouvez personnaliser ces réglages maintenant ou le faire plus tard dans l'espace d'administration.",
"Email": "courriel",
"Extension": "extension",
"Filesystem": "Système de fichiers",
@@ -28,7 +30,7 @@
"InsufficientPrivilegesHelp": "Vous pouvez donner ces droits en utilisant un outils tel que phpMyAdmin ou en exécutant les requêtes SQL appropriées. Si vous ne savez pas comment effectuer cela veuillez demander à votre administrateur système de donner ces droits pour vous.",
"InsufficientPrivilegesMain": "La base de données n'existe pas (et n'a pas pu être créée), ou l'utilisateur spécifié a des privilèges insuffisants. Les utilisateurs de la base de données doivent avoir les privilèges suivants : %s",
"JsTagArchivingHelp1": "Pour les sites à moyen et fort trafic il existe des optimisations qui pourraient être mises en place pour aider Piwik à s'exécuter plus rapidement (comme %1$smettre en place l'auto-archivage%2$s).",
- "JSTracking_EndNote": "Note: après le processus d'installation, vous pouvez générer un code de suivi personnalisé depuis la section d'administration \"%1$sCode de Suivi%2$s.",
+ "JSTracking_EndNote": "Note : après le processus d'installation, vous pouvez générer un code de suivi personnalisé depuis la section d'administration \"%1$sCode de Suivi%2$s.",
"JSTracking_Intro": "Pour effectuer le suivi du trafic web avec Piwik vous devez vous assurer que du code supplémentaire est ajouté sur toutes vos pages.",
"LargePiwikInstances": "Aide pour les instances de Piwik volumineuses",
"Legend": "Légendes",
@@ -64,7 +66,7 @@
"SuperUserSetupError": "Erreur lors de l'ajout du super utilisateur.",
"SuperUserSetupSuccess": "Super Utilisateur créé avec succès!",
"SystemCheck": "Vérification du système",
- "SystemCheckAutoUpdateHelp": "Note: La mise à jour de Piwik en un clic requiert une permission en écriture sur le dossier de Piwik et son contenu.",
+ "SystemCheckAutoUpdateHelp": "Note : La mise à jour de Piwik en un clic requiert une permission en écriture sur le dossier de Piwik et son contenu.",
"SystemCheckCreateFunctionHelp": "Piwik utilise des fonctions anonymes pour les callbacks.",
"SystemCheckCronArchiveProcess": "Tâche Cron d'archivage",
"SystemCheckCronArchiveProcessCLI": "Gestion des processus via ligne de commande",
@@ -96,7 +98,7 @@
"SystemCheckPdoAndMysqliHelp": "Sur un serveur linux vous pouvez compiler PHP avec les options suivantes : %1$s Dans votre php.ini, ajoutez les lignes suivantes: %2$s",
"SystemCheckPhp": "Version PHP",
"SystemCheckPhpPdoAndMysqli": "Plus d'informations sur: %1$sPHP PDO%2$s et %3$sMYSQLI%4$s.",
- "SystemCheckSessionAutostart": "Pour éviter certains problèmes veuillez définir le paramètre suivant dans votre fichier php.ini: session.auto_start=0",
+ "SystemCheckSessionAutostart": "Pour éviter certains problèmes veuillez définir le paramètre suivant dans votre fichier php.ini : session.auto_start=0",
"SystemCheckSplHelp": "Vous devez configurer et recompiler PHP avec la librairie standard (par défaut).",
"SystemCheckSummaryNoProblems": "Génial! Il n'y a aucun problème avec votre installation de Piwik. Donnez vous une tape dans le dos.",
"SystemCheckSummaryThereWereErrors": "Oh-oh! Piwik a détecté des %1$sproblèmes critiques%2$s avec votre installation de Piwik. %3$sCes problèmes critiques doivent être fixés immédiatement.%4$s",
diff --git a/plugins/Installation/lang/it.json b/plugins/Installation/lang/it.json
index 9da55d46dd..17ade74780 100644
--- a/plugins/Installation/lang/it.json
+++ b/plugins/Installation/lang/it.json
@@ -17,6 +17,8 @@
"DatabaseSetupLogin": "login",
"DatabaseSetupServer": "database server",
"DatabaseSetupTablePrefix": "Prefisso tabelle",
+ "DefaultSettings": "Impostazioni predefinite di Piwik",
+ "DefaultSettingsHelp": "Piwik ha delle impostazioni predefinite. Puoi personalizzarle ora o farlo in seguito dalla schermata di amministrazione.",
"Email": "E-mail",
"Extension": "estensione",
"Filesystem": "Filesystem",
diff --git a/plugins/Live/lang/fr.json b/plugins/Live/lang/fr.json
index d947dae7fc..80e9d2c65a 100644
--- a/plugins/Live/lang/fr.json
+++ b/plugins/Live/lang/fr.json
@@ -4,12 +4,12 @@
"AveragePageGenerationTime": "Chaque page a pris une moyenne de %1$s à charger pour ce visiteur.",
"CalculatedOverNPageViews": "Calculé sur la base des %1$s dernières pages vues par ce visiteur.",
"ClickToViewMoreAboutVisit": "Cliquez pour afficher plus d'informations à propos de cette visite",
- "ConvertedNGoals": "Conversion de %s Objectifs",
+ "ConvertedNGoals": "Conversion de %s objectifs",
"EcommerceSummaryConversions": "%1$s%2$s commandes sur un total de %3$s%4$s, comptaient %5$s articles.",
"FirstVisit": "Première visite",
"GoalType": "Type",
"HideMap": "Cacher la carte",
- "KeywordRankedOnSearchResultForThisVisitor": "Le mot clef %1$s a été a été noté %2$s dans la page de résultats de recherche %3$s pour ce visiteur",
+ "KeywordRankedOnSearchResultForThisVisitor": "Le mot-clé %1$s a été a été noté %2$s dans la page de résultats de recherche %3$s pour ce visiteur",
"LastHours": "Dernières %s heures",
"LastMinutes": "Dernières %s minutes",
"LastVisit": "Dernière visite",
@@ -24,7 +24,7 @@
"PluginDescription": "Espionnez vos visiteurs, en temps réel!",
"PreviousVisitor": "Visiteur précédent",
"RealTimeVisitorCount": "Décompte des visiteurs en temps réel",
- "Referrer_URL": "URL du référant",
+ "Referrer_URL": "URL du référent",
"ShowMap": "Montrer la carte",
"SimpleRealTimeWidget_Message": "%s et %s dans le(s)\/la dernier(s)\/ière(s) %s.",
"ViewVisitorProfile": "Afficher le profil du visiteur",
diff --git a/plugins/Live/tests/Integration/APITest.php b/plugins/Live/tests/Integration/APITest.php
index fc56b0d16e..2c85088a19 100644
--- a/plugins/Live/tests/Integration/APITest.php
+++ b/plugins/Live/tests/Integration/APITest.php
@@ -12,9 +12,9 @@ use Piwik\Date;
use Piwik\Db;
use Piwik\Plugins\Goals\API as GoalsApi;
use Piwik\Plugins\Live\API;
-use FakeAccess;
use Piwik\Access;
use Piwik\Tests\Framework\Fixture;
+use Piwik\Tests\Framework\Mock\FakeAccess;
use Piwik\Tests\Framework\TestCase\SystemTestCase;
/**
diff --git a/plugins/Login/lang/cs.json b/plugins/Login/lang/cs.json
index d0323c4d85..8bf4831d94 100644
--- a/plugins/Login/lang/cs.json
+++ b/plugins/Login/lang/cs.json
@@ -11,6 +11,7 @@
"LoginOrEmail": "Uživatelské jméno nebo E-mail",
"LoginPasswordNotCorrect": "Uživatelské jméno & heslo nejsou správné",
"LostYourPassword": "Zapomněli jste vaše heslo?",
+ "MailPasswordChangeBody": "Ahoj %1$s,\n\nZ %2$s byl zaslán požadavek o změnu hesla. Pro potvrzení nových přihlašovacích údajů navštivte následující odkaz:\n\n%3$s\n\nPoznámka: Tento token je platný 24 hodin.\n\nA díky za používání Piwiku!",
"MailTopicPasswordChange": "Potvrďte změnu hesla",
"PasswordChanged": "Vaše heslo bylo změněno.",
"PasswordRepeat": "Heslo (pro kontrolu)",
diff --git a/plugins/Login/lang/fr.json b/plugins/Login/lang/fr.json
index 6d0e93c6a6..ac12cab079 100644
--- a/plugins/Login/lang/fr.json
+++ b/plugins/Login/lang/fr.json
@@ -4,14 +4,14 @@
"ContactAdmin": "Raison possible : Votre hébergeur peut avoir désactivé la fonction mail(). <br \/> Veuillez contacter votre administrateur Piwik.",
"ExceptionInvalidSuperUserAccessAuthenticationMethod": "Un utilisateur avec un accès super utilisateur ne peut être authentifié en utilisant le mécanisme '%s'.",
"ExceptionPasswordMD5HashExpected": "Le paramètre mot de passe doit être le hash MD5 du mot de passe.",
- "InvalidNonceOrHeadersOrReferrer": "La sécurité du formulaire a échoué. Veuillez recharger le formulaire et vérifier que vos cookies sont activés. Si vous utilisez un serveur proxy, vous devez %s configurer Piwik pour accepter les en-têtes du proxy %s qui relaient les en-têtes de l'hôte. Vérifiez aussi que l'en-tête de votre référant est correctement transmis.",
+ "InvalidNonceOrHeadersOrReferrer": "La sécurité du formulaire a échoué. Veuillez recharger le formulaire et vérifier que vos cookies sont activés. Si vous utilisez un serveur proxy, vous devez %s configurer Piwik pour accepter les en-têtes du proxy %s qui relaient les en-têtes de l'hôte. Vérifiez aussi que l'en-tête de votre référent est correctement transmis.",
"InvalidOrExpiredToken": "La clef est invalide ou a expiré",
"InvalidUsernameEmail": "Nom d'utilisateur et\/ou courriel invalide.",
"LogIn": "Connexion",
"LoginOrEmail": "Nom d'utilisateur ou courriel",
"LoginPasswordNotCorrect": "Mot de passe et nom d'utilisateur incorrects.",
"LostYourPassword": "Mot de passe perdu ?",
- "MailPasswordChangeBody": "Bonjour %1$s,\n\nUne demande de réinitialisation de mot de passe a été reçue depuis %2$s. Pour confirmer le changement de mot de passe afin de pouvoir vous authentifier avec vos nouveaux identifiants, cliquez sur le lien suivant :\n\n%3$s\n\nNote : ce jeton expirera dans 24 heures.\n\nMerci d'utiliser Piwik!",
+ "MailPasswordChangeBody": "Bonjour %1$s,\n\nUne demande de réinitialisation de mot de passe a été reçue depuis %2$s. Pour confirmer le changement de mot de passe afin de pouvoir vous authentifier avec vos nouveaux identifiants, cliquez sur le lien suivant :\n\n%3$s\n\nNote : ce jeton expirera dans 24 heures.\n\nMerci d'utiliser Piwik !",
"MailTopicPasswordChange": "Confirmer le changement de mot de passe",
"PasswordChanged": "Votre mot de passe a été modifié",
"PasswordRepeat": "Mot de passe (répétez)",
diff --git a/plugins/Login/tests/Integration/LoginTest.php b/plugins/Login/tests/Integration/LoginTest.php
index b250bcf8e0..67d1d34d97 100644
--- a/plugins/Login/tests/Integration/LoginTest.php
+++ b/plugins/Login/tests/Integration/LoginTest.php
@@ -13,8 +13,8 @@ use Piwik\AuthResult;
use Piwik\DbHelper;
use Piwik\Plugins\Login\Auth;
use Piwik\Plugins\UsersManager\API;
+use Piwik\Tests\Framework\Mock\FakeAccess;
use Piwik\Tests\Framework\TestCase\IntegrationTestCase;
-use FakeAccess;
require_once PIWIK_INCLUDE_PATH . '/plugins/Login/Auth.php';
diff --git a/plugins/MobileMessaging/API.php b/plugins/MobileMessaging/API.php
index c8268c76a7..aaf30e6a64 100644
--- a/plugins/MobileMessaging/API.php
+++ b/plugins/MobileMessaging/API.php
@@ -365,7 +365,7 @@ class API extends \Piwik\Plugin\API
{
Option::set(
$user . MobileMessaging::USER_SETTINGS_POSTFIX_OPTION,
- Common::json_encode($settings)
+ json_encode($settings)
);
}
@@ -392,7 +392,7 @@ class API extends \Piwik\Plugin\API
if (empty($userSettings)) {
$userSettings = array();
} else {
- $userSettings = Common::json_decode($userSettings, true);
+ $userSettings = json_decode($userSettings, true);
}
return $userSettings;
diff --git a/plugins/MobileMessaging/lang/fr.json b/plugins/MobileMessaging/lang/fr.json
index ca090ebd99..d3be3b6938 100644
--- a/plugins/MobileMessaging/lang/fr.json
+++ b/plugins/MobileMessaging/lang/fr.json
@@ -1,6 +1,6 @@
{
"MobileMessaging": {
- "Exception_UnknownProvider": "Le fournisseur avec le nom '%s' est inconnu. Essayez un de ceux-ci à la place: %s.",
+ "Exception_UnknownProvider": "Le fournisseur avec le nom '%s' est inconnu. Essayez un de ceux-ci à la place : %s.",
"MobileReport_AdditionalPhoneNumbers": "Vous pouvez ajouter plus de numéro de téléphone en accédant à",
"MobileReport_MobileMessagingSettingsLink": "la page des paramètres mobiles",
"MobileReport_NoPhoneNumbers": "Veuillez activer au moins un des numéros de téléphone en accédant à",
@@ -25,7 +25,7 @@
"Settings_PhoneNumbers_Help": "Avant de recevoir des rapports par SMS sur un téléphone, le numéro de téléphone doit être entré ci-dessous.",
"Settings_PhoneNumbers_HelpAdd": "Quand vous cliquez sur \"Ajouter\", un SMS contenant un code sera envoyé au téléphone. L'utilisateur qui recevra le code devra ensuite se connecter à Piwik, Cliquer sur Paramètres, puis sur Messagerie Mobile. Après avoir entré le code, l'utilisateur sera capable de recevoir des rapports sur son téléphone.",
"Settings_PleaseSignUp": "Pour créer un rapport SMS et en recevoir avec les statistiques de vos sites web sur votre téléphone mobile, veuillez vous enregistrer auprès d'une API SMS et entrer vos informations ci-dessous.",
- "Settings_SMSAPIAccount": "Gérer le compte d'API SMS",
+ "Settings_SMSAPIAccount": "Paramètres de compte d'API SMS",
"Settings_SMSProvider": "Fournisseur SMS",
"Settings_SuperAdmin": "Paramètres Super Utilisateur",
"Settings_SuspiciousPhoneNumber": "Si vous ne recevez pas de SMS, vous devriez essayer sans le zéro initial. ie. %s",
diff --git a/plugins/MobileMessaging/tests/Integration/MobileMessagingTest.php b/plugins/MobileMessaging/tests/Integration/MobileMessagingTest.php
index 022dfda9ba..037bfb6e45 100644
--- a/plugins/MobileMessaging/tests/Integration/MobileMessagingTest.php
+++ b/plugins/MobileMessaging/tests/Integration/MobileMessagingTest.php
@@ -14,8 +14,8 @@ use Piwik\Plugins\MobileMessaging\MobileMessaging;
use Piwik\Plugins\MobileMessaging\SMSProvider;
use Piwik\Plugins\ScheduledReports\API as APIScheduledReports;
use Piwik\Plugins\SitesManager\API as APISitesManager;
+use Piwik\Tests\Framework\Mock\FakeAccess;
use Piwik\Tests\Framework\TestCase\IntegrationTestCase;
-use FakeAccess;
/**
* Class Plugins_MobileMessagingTest
diff --git a/plugins/Overlay/Controller.php b/plugins/Overlay/Controller.php
index ea540c6e14..7ddfde1e41 100644
--- a/plugins/Overlay/Controller.php
+++ b/plugins/Overlay/Controller.php
@@ -160,7 +160,7 @@ class Controller extends \Piwik\Plugin\Controller
var urlToRedirect = window.location.hash.substr(1);
var urlToRedirectWithoutPrefix = removeUrlPrefix(urlToRedirect);
- var knownUrls = ' . Common::json_encode($urls) . ';
+ var knownUrls = ' . json_encode($urls) . ';
for (var i = 0; i < knownUrls.length; i++) {
var testUrl = removeUrlPrefix(knownUrls[i]);
if (urlToRedirectWithoutPrefix.substr(0, testUrl.length) == testUrl) {
diff --git a/plugins/Overlay/lang/fr.json b/plugins/Overlay/lang/fr.json
index 89e9b4bb95..89b4321b77 100644
--- a/plugins/Overlay/lang/fr.json
+++ b/plugins/Overlay/lang/fr.json
@@ -3,7 +3,7 @@
"Clicks": "%s clics",
"ClicksFromXLinks": "%1$s clics depuis un des %2$s liens",
"Domain": "Domaine",
- "ErrorNotLoading": "La session de page superposée n'a pas encore pu être lancée.",
+ "ErrorNotLoading": "L'analyse des pages web n'a pas pu être lancée pour le moment.",
"ErrorNotLoadingDetails": "Peut être que la page chargée sur la droite n'a pas de code de suivi Piwik. Dans ce cas, essayez de lancer la navigation superposée depuis une autre page que le rapport de pages.",
"ErrorNotLoadingDetailsSSL": "Etant donné que vous utilisez Piwik en https, la cause la plus probable est que votre site web ne supporte pas le SSL. Essayez d'utiliser Piwik en http.",
"ErrorNotLoadingLink": "Cliquez ici pour obtenir plus d'informations de dépannage.",
@@ -12,9 +12,9 @@
"NoData": "Il n'y a aucune données durant cette période",
"OneClick": "1 clic",
"OpenFullScreen": "Ouvrir en plein écran",
- "Overlay": "FOnd de page",
+ "Overlay": "Analyse des pages web",
"PluginDescription": "Visualisez les données d'analyse superposées sur votre site web.",
- "RedirectUrlError": "Vous tentez à présent d'ouvrir une page superposée pour l'URL \"%s\". %s Aucun des domaines des paramètres de Piwik ne correspond au lien.",
+ "RedirectUrlError": "Vous tentez d'ouvrir l'analyse des pages web pour l'URL \"%s\". %s Aucun des domaines configurés dans Piwik ne correspond à cette URL.",
"RedirectUrlErrorAdmin": "Vous pouvez ajouter le domaine en tant qu'URL additionnelle %sdans les paramètres%s.",
"RedirectUrlErrorUser": "Demandez à votre administrateur d'ajouter le domaine en tant qu'URL additionnelle."
}
diff --git a/plugins/PrivacyManager/lang/da.json b/plugins/PrivacyManager/lang/da.json
index 0d0403e120..a103f53f55 100644
--- a/plugins/PrivacyManager/lang/da.json
+++ b/plugins/PrivacyManager/lang/da.json
@@ -1,6 +1,7 @@
{
"PrivacyManager": {
"AnonymizeIpDescription": "Vælg \"Ja\", hvis Piwik ikke skal spore fuldt kvalificerede IP-adresser.",
+ "AnonymizeIpExtendedHelp": "Når brugerne besøger hjemmesiden, vil Piwik ikke bruge den fulde IP-adresse (f.eks %s), men i stedet vil Piwik anonymisere det først (til %s). IP-adresse anonymisering er et af de krav, som lovgivningen om privatlivets fred i visse lande som fx. Tyskland.",
"AnonymizeIpInlineHelp": "Anonymiser besøgendes IP-adresser for at efterkomme den lokale lovgivning om privatlivets fred\/retningslinjer.",
"AnonymizeIpMaskLengtDescription": "Vælg hvor mange bytes af de besøgendes IP-adresser der skal maskeres.",
"AnonymizeIpMaskLength": "%s bytes - f.eks %s",
diff --git a/plugins/PrivacyManager/lang/de.json b/plugins/PrivacyManager/lang/de.json
index b29e11e8b2..5545b1be91 100644
--- a/plugins/PrivacyManager/lang/de.json
+++ b/plugins/PrivacyManager/lang/de.json
@@ -1,6 +1,7 @@
{
"PrivacyManager": {
"AnonymizeIpDescription": "Wählen Sie \"Ja\", wenn Piwik nicht die komplette IP-Adresse speichern soll.",
+ "AnonymizeIpExtendedHelp": "Wenn Benutzer Ihre Webseite besuchen, wird Piwik nicht die komplette IP Adresse (so wie %s) benützen, sondern sie stattdessen zuerst anonymisieren (zu %s). Die Anonymisierung der IP Adresse ist in einigen Ländern eine gesetzliche Pflicht, zum Beispiel in Deutschland vorgegeben durch das Datenschutzrecht.",
"AnonymizeIpInlineHelp": "Um den Datenschutzbestimmungen Ihres Landes gerecht zu werden, können Sie mit diesem Plugin die letzten Bytes der IP-Adresse Ihrer Besucher anonymisieren.",
"AnonymizeIpMaskLengtDescription": "Wählen Sie aus, wieviele Bytes der Besucher-IP maskiert werden sollen.",
"AnonymizeIpMaskLength": "%s byte(s) - z.B. %s",
diff --git a/plugins/PrivacyManager/lang/el.json b/plugins/PrivacyManager/lang/el.json
index f6b65c8e64..cf5c00c670 100644
--- a/plugins/PrivacyManager/lang/el.json
+++ b/plugins/PrivacyManager/lang/el.json
@@ -1,6 +1,7 @@
{
"PrivacyManager": {
"AnonymizeIpDescription": "Επιλέξτε «Ναι» αν θέλετε το Piwik να μην ανιχνεύει πλήρως ταυτοποιημένες διευθύνσεις IP.",
+ "AnonymizeIpExtendedHelp": "Όταν οι χρήστες επισκέπτονται τον ιστοτόπο σας, το Piwik δε θα χρησιμοποιεί την πλήρη διεύθυνση IP (όπως το %s), αλλά αντίθετα θα το κάνει πρώτα ανώνυμο (σε %s). Η μετατροπή των διευθύνσεων IP σε ανώνυμες είναι μία από τις απαιτήσεις που ορίζει η νομοθεσία γύρω από την ιδιωτικότητα σε ορισμένες χώρες όπως η Γερμανία.",
"AnonymizeIpInlineHelp": "Αποκρύπτει το τελευταίο byte των διευθύνσεων IP των επισκεπτών σας για συμμόρφωση με την τοπική νομοθεσία περί Ιδιωτικού Απορρήτου.",
"AnonymizeIpMaskLengtDescription": "Επιλέξτε πόσα bytes από τις διευθύνσεις IPs των επισκεπτών πρέπει να κρύβονται.",
"AnonymizeIpMaskLength": "%s byte(s) - π.χ.. %s",
diff --git a/plugins/PrivacyManager/lang/fr.json b/plugins/PrivacyManager/lang/fr.json
index cea8005c4d..4a9665d04f 100644
--- a/plugins/PrivacyManager/lang/fr.json
+++ b/plugins/PrivacyManager/lang/fr.json
@@ -1,6 +1,7 @@
{
"PrivacyManager": {
"AnonymizeIpDescription": "Sélectionnez \"Oui\" si vous voulez que Piwik ne trace pas les adresses IP complètes.",
+ "AnonymizeIpExtendedHelp": "Quand les utilisateurs visitent votre site, Piwik n'utilisera pas l'adresse IP complète (par exemple %s) mais l'anonymisera (par exemple %s). L'anonymisation des adresses IP est requise par certaines lois adressant la protection de la vie privée dans certains pays comme l'Allemagne.",
"AnonymizeIpInlineHelp": "Masque les adresses IP des visiteurs pour remplir les conditions légales et politiques locales.",
"AnonymizeIpMaskLengtDescription": "Sélectionnez combien de bytes de l'adresse IP du visiteur doivent être masqués.",
"AnonymizeIpMaskLength": "%s byte(s) - ex %s",
@@ -32,8 +33,8 @@
"DoNotTrack_DisabledMoreInfo": "Nous vous recommandons de respecter la vie privée de vos visiteurs et d'activer la prise en charge de \"Ne pas Suivre\"",
"DoNotTrack_Enable": "Activer la prise en charge de \"Ne pas Suivre\"",
"DoNotTrack_Enabled": "Vous respectez actuellement actuellement la vie privée de vos utilisateurs, Bravo!",
- "DoNotTrack_EnabledMoreInfo": "Quand les utilisateurs ont définit au sein de leurs navigateurs \"Je ne veux plus être suivi\" (DoNoTrack est activé) Piwik ne suit plus leurs visites.",
- "DoNotTrack_SupportDNTPreference": "Prendre en charge la préférence \"Ne pas Suivre\"",
+ "DoNotTrack_EnabledMoreInfo": "Quand les utilisateurs ont activé dans leurs navigateurs \"Je ne veux pas être suivi\" (Do No Track en anglais) Piwik ne suit plus leurs visites.",
+ "DoNotTrack_SupportDNTPreference": "Prendre en charge la préférence \"Ne Pas Suivre\"",
"EstimatedDBSizeAfterPurge": "Taille estimée de la base de données après la purge",
"EstimatedSpaceSaved": "Espace libéré estimé",
"GeolocationAnonymizeIpNote": "Note : La géolocalisation aura à peu près les mêmes résultats avec 1 octet rendu anonyme. Avec 2 octets ou plus, elle sera inexacte.",
@@ -53,8 +54,8 @@
"RecommendedForPrivacy": "(recommandé pour le respect de la vie privée)",
"ReportsDataSavedEstimate": "Taille de la base de données",
"SaveSettingsBeforePurge": "Vous avez modifié les paramètres de suppression des données. Veuillez les sauvegarder avant de démmarrer une purge.",
- "SeeAlsoOurOfficialGuidePrivacy": "Consultez aussi notre guide officiel: %sConfidentialité de l'analyse web%s",
- "Teaser": "Sur cette page, vous pouvez personnaliser Piwik pour que sa gestion de la vie privée respecte la législation en vigueur, en : %s rendant anonyme l'adresse IP du visiteur%s, %s supprime automatiquement les anciens logs de visiteurs de la base de données%s, et %s fournit un mécanisme d'exclusion pour votre site web%s.",
+ "SeeAlsoOurOfficialGuidePrivacy": "Consultez aussi notre guide officiel : %sConfidentialité de l'analyse web%s",
+ "Teaser": "Sur cette page, vous pouvez personnaliser Piwik pour que sa gestion de la vie privée respecte la législation en vigueur, en : %s rendant anonyme l'adresse IP du visiteur%s, %s supprimant automatiquement les anciens logs de visiteurs de la base de données%s, et %s en fournissant un mécanisme d'exclusion pour votre site web%s.",
"TeaserHeadline": "Paramètres de vie privée",
"UseAnonymizedIpForVisitEnrichment": "Utiliser les adresses IP anonymisées pour enrichir les visites",
"UseAnonymizedIpForVisitEnrichmentNote": "Les composants tels que Geo Location (localisation) par IP et Fournisseur améliorent les métadonnées des visiteurs. Par défaut ces composants utilisent des adresses IP anonymisées. Si vous sélectionnez \"Non\", l'adresse IP réelle et complète sera utilisée à la place. Ceci améliorera la précision des données mais diminuera le respect de la vie privée.",
diff --git a/plugins/PrivacyManager/lang/it.json b/plugins/PrivacyManager/lang/it.json
index c3741c2847..af4ebd0d4a 100644
--- a/plugins/PrivacyManager/lang/it.json
+++ b/plugins/PrivacyManager/lang/it.json
@@ -1,6 +1,7 @@
{
"PrivacyManager": {
"AnonymizeIpDescription": "Seleziona \"Si\" se vuoi che Piwik non mostri gli indirizzi IP completi dei visitatori.",
+ "AnonymizeIpExtendedHelp": "Quando gli utenti visitano il tuo sito web, Piwik non userà l'indirizzo IP completo (come %s) ma lo renderà prima anonimo (in %s). Questo è uno dei requisiti definiti dalle leggi sulla privacy in alcuni paesi come la Germania.",
"AnonymizeIpInlineHelp": "Rende anonimi gli ip dei tuoi visitatori per conformarsi alle leggi o alle linee guida locali.",
"AnonymizeIpMaskLengtDescription": "Seleziona quanti byte degli indirizzi IP dei visitatori devono essere nascosti.",
"AnonymizeIpMaskLength": "%s byte - e.s. %s",
diff --git a/plugins/Referrers/lang/fr.json b/plugins/Referrers/lang/fr.json
index 10b46809a0..d161f47b80 100644
--- a/plugins/Referrers/lang/fr.json
+++ b/plugins/Referrers/lang/fr.json
@@ -1,43 +1,43 @@
{
"Referrers": {
- "AllReferrersReportDocumentation": "Ce rapport affiche tous les référents en un rapport consolidé, listant tous les sites web, mots clefs de recherche et campagnes utilisés par vos visiteurs pour trouver votre site web.",
+ "AllReferrersReportDocumentation": "Ce rapport affiche tous les référents en un rapport consolidé, listant tous les sites web, mots-clés de recherche et campagnes utilisés par vos visiteurs pour trouver votre site web.",
"Campaigns": "Campagnes",
"CampaignsDocumentation": "Visiteurs venus sur votre site web grâce à une campagne. %s Affichez le rapport %s pour plus de détails.",
"CampaignsReportDocumentation": "Ce rapport montre quelles campagnes ont conduit des visiteurs à votre site web. %s Pour plus d'informations à propos des campagnes lisez %s la documentation des campagnes sur piwik.org%s",
"ColumnCampaign": "Campagne",
"ColumnSearchEngine": "Moteur de recherche",
- "ColumnSocial": "Réseau sociaux",
+ "ColumnSocial": "Réseaux sociaux",
"ColumnWebsite": "Site Web",
"ColumnWebsitePage": "Page du site",
- "DetailsByReferrerType": "Détails de types d'affluents",
+ "DetailsByReferrerType": "Détails de types d'acquisitions",
"DirectEntry": "Entrées directes",
"DirectEntryDocumentation": "Un visiteur a entré directement l'URL du site web dans son navigateur et a commencé à parcourir votre site web - il est entré directement sur le site web.",
"Distinct": "Provenances distinctes par type de Provenance",
"DistinctCampaigns": "campagnes distinctes",
- "DistinctKeywords": "mots clef distincts",
+ "DistinctKeywords": "mots-clés distincts",
"DistinctSearchEngines": "Moteurs de recherche distincts",
"DistinctWebsites": "sites web distincts",
- "EvolutionDocumentation": "Ceci est un aperçu des référants qui ont conduit des visiteurs sur votre site web.",
- "EvolutionDocumentationMoreInfo": "Pour plus d'informations sur les différents types de référants, consultez la documentation du tableau %s.",
+ "EvolutionDocumentation": "Ceci est un aperçu des référents qui ont conduit des visiteurs sur votre site web.",
+ "EvolutionDocumentationMoreInfo": "Pour plus d'informations sur les différents types de référents, consultez la documentation du tableau %s.",
"Keywords": "Mots-clés",
- "KeywordsReportDocumentation": "Ce rapport affiche quels mots clefs les utilisateurs recherchaient avant d'être conduit sur votre site web. %s En cliquant sur une ligne vous pouvez visualiser la distribution des moteurs de recherche qui ont été requêtés pour le mot clef.",
- "PluginDescription": "Effectue des rapports sur les données des référents: moteurs de recherche, mots clefs, sites web, suivi de campagne, entrée directe.",
+ "KeywordsReportDocumentation": "Ce rapport affiche quels mots-clés les utilisateurs recherchaient avant d'être conduit sur votre site web. %s En cliquant sur une ligne vous pouvez visualiser la distribution des moteurs de recherche qui ont été utilisés pour le mot-clé.",
+ "PluginDescription": "Effectue des rapports sur les données des référents : moteurs de recherche, mots-clés, sites web, suivi de campagne, entrée directe.",
"Referrer": "Réfèrent",
- "ReferrerName": "Nom du référant",
+ "ReferrerName": "Nom du référent",
"Referrers": "Référents",
"ReferrersOverview": "Vue d'ensemble des référents",
"SearchEngines": "Moteurs de recherche",
"SearchEnginesDocumentation": "Un visiteur a été conduit sur votre site web par un moteur de recherche. %s Affichez le rapport %s pour plus de détails.",
"SearchEnginesReportDocumentation": "Ce rapport vous montre quels moteurs de recherche ont envoyé vos utilisateurs vers votre site. %s en cliquant sur une ligne sur la table, vous pouvez voir ce que vos utilisateurs étaient en train de chercher avec les moteurs de recherches spécifiques.",
"SocialFooterMessage": "Ceci est un sous-ensemble du rapport de sites web à gauche. Les autres sites web sont filtrés vous permettant ainsi de comparer les réseaux sociaux référents directement.",
- "Socials": "Réseau sociaux",
+ "Socials": "Réseaux sociaux",
"SocialsReportDocumentation": "Ce rapport affiche quels réseaux sociaux ont amené des visiteurs sur votre site web.<br \/>En cliquant sur une ligne du tableau, vous pouvez voir depuis quelles pages du réseau social les visiteur sont venus sur votre site web.",
"SubmenuSearchEngines": "Moteurs de recherche et mots-clés",
"SubmenuWebsites": "Sites Internet",
- "Type": "Types d'affluents",
+ "Type": "Types d'acquisitions",
"TypeCampaigns": "%s depuis des campagnes",
"TypeDirectEntries": "%s entrées directes",
- "TypeReportDocumentation": "Ce tableau contient des informations à propos de la distribution des types de référants.",
+ "TypeReportDocumentation": "Ce tableau contient des informations à propos de la distribution des types de référents.",
"TypeSearchEngines": "%s depuis des moteurs de recherche",
"TypeWebsites": "%s depuis d'autres sites Internet",
"UsingNDistinctUrls": "(utilisant %s urls distinctes)",
@@ -46,11 +46,11 @@
"Websites": "Sites Internet",
"WebsitesDocumentation": "Le visiteur a suivi un lien sur un autre site qui l'a conduit sur votre site. %s Affichez le rapport %s pour plus de détails.",
"WebsitesReportDocumentation": "Dans ce tableau vous pouvez voir quels sites web ont conduit des visiteurs sur votre site.. %s En cliquant sur une ligne du tableau, vous pouvez voir les URL des sites sur lesquels sont les liens.",
- "WidgetExternalWebsites": "Liste des sites Internet externes",
+ "WidgetExternalWebsites": "Sites Internet référents",
"WidgetGetAll": "Tous les référents",
"WidgetKeywords": "Liste des mots-clés",
"WidgetSocials": "Liste des réseaux sociaux",
- "WidgetTopKeywordsForPages": "Meilleurs mots clefs pour l'URL",
+ "WidgetTopKeywordsForPages": "Meilleurs mots-clés pour l'URL",
"XPercentOfVisits": "%s%% des visites"
}
} \ No newline at end of file
diff --git a/plugins/SEO/MajesticClient.php b/plugins/SEO/MajesticClient.php
index 5031958209..b7a7eeddc8 100644
--- a/plugins/SEO/MajesticClient.php
+++ b/plugins/SEO/MajesticClient.php
@@ -65,7 +65,7 @@ class MajesticClient
'referrer_domains_count' => false
);
- $apiResponse = Common::json_decode($apiResponse, $assoc = true);
+ $apiResponse = json_decode($apiResponse, $assoc = true);
if (!empty($apiResponse)
&& !empty($apiResponse['Data'])
) {
diff --git a/plugins/SEO/tests/Integration/SEOTest.php b/plugins/SEO/tests/Integration/SEOTest.php
index 14f8666d61..7ece856ed5 100644
--- a/plugins/SEO/tests/Integration/SEOTest.php
+++ b/plugins/SEO/tests/Integration/SEOTest.php
@@ -11,8 +11,8 @@ namespace Piwik\Plugins\SEO\tests\Integration;
use Piwik\Access;
use Piwik\DataTable\Renderer;
use Piwik\Plugins\SEO\API;
-use FakeAccess;
use Exception;
+use Piwik\Tests\Framework\Mock\FakeAccess;
/**
* @group SEO
diff --git a/plugins/ScheduledReports/API.php b/plugins/ScheduledReports/API.php
index 66eb55a235..e8a105114b 100644
--- a/plugins/ScheduledReports/API.php
+++ b/plugins/ScheduledReports/API.php
@@ -236,10 +236,10 @@ class API extends \Piwik\Plugin\API
foreach ($reports as &$report) {
// decode report parameters
- $report['parameters'] = Common::json_decode($report['parameters'], true);
+ $report['parameters'] = json_decode($report['parameters'], true);
// decode report list
- $report['reports'] = Common::json_decode($report['reports'], true);
+ $report['reports'] = json_decode($report['reports'], true);
}
// static cache
@@ -294,7 +294,7 @@ class API extends \Piwik\Plugin\API
}
// override and/or validate report parameters
- $report['parameters'] = Common::json_decode(
+ $report['parameters'] = json_decode(
self::validateReportParameters($reportType, empty($parameters) ? $report['parameters'] : $parameters),
true
);
@@ -624,7 +624,7 @@ class API extends \Piwik\Plugin\API
*/
Piwik::postEvent(self::VALIDATE_PARAMETERS_EVENT, array(&$parameters, $reportType));
- return Common::json_encode($parameters);
+ return json_encode($parameters);
}
private static function validateAndTruncateDescription(&$description)
@@ -653,7 +653,7 @@ class API extends \Piwik\Plugin\API
}
}
- return Common::json_encode($requestedReports);
+ return json_encode($requestedReports);
}
private static function validateCommonReportAttributes($period, $hour, &$description, &$idSegment, $reportType, $reportFormat)
diff --git a/plugins/ScheduledReports/Controller.php b/plugins/ScheduledReports/Controller.php
index 2bb64b8faf..2ae16cc410 100644
--- a/plugins/ScheduledReports/Controller.php
+++ b/plugins/ScheduledReports/Controller.php
@@ -66,7 +66,7 @@ class Controller extends \Piwik\Plugin\Controller
}
}
$view->reports = $reports;
- $view->reportsJSON = Common::json_encode($reportsById);
+ $view->reportsJSON = json_encode($reportsById);
$view->downloadOutputType = API::OUTPUT_INLINE;
diff --git a/plugins/ScheduledReports/lang/fr.json b/plugins/ScheduledReports/lang/fr.json
index b4e64d69f2..4f02025ed8 100644
--- a/plugins/ScheduledReports/lang/fr.json
+++ b/plugins/ScheduledReports/lang/fr.json
@@ -9,7 +9,7 @@
"CancelAndReturnToReports": "Annuler et %s retourner à la liste des rapports%s",
"CreateAndScheduleReport": "Créer et planifier un rapport",
"CreateReport": "Créer le rapport",
- "CustomVisitorSegment": "Segment de visiteur personnalisé:",
+ "CustomVisitorSegment": "Segment de visiteur personnalisé :",
"DescriptionOnFirstPage": "La description du rapport sera affichée sur la première page du rapport.",
"DisplayFormat_TablesOnly": "Afficher uniquement les tableaux (pas de graphiques)",
"EmailHello": "Bonjour,",
diff --git a/plugins/ScheduledReports/tests/Integration/ApiTest.php b/plugins/ScheduledReports/tests/Integration/ApiTest.php
index e1efb7fdcb..50610684d6 100644
--- a/plugins/ScheduledReports/tests/Integration/ApiTest.php
+++ b/plugins/ScheduledReports/tests/Integration/ApiTest.php
@@ -19,8 +19,8 @@ use Piwik\ScheduledTask;
use Piwik\ScheduledTime\Monthly;
use Piwik\ScheduledTime;
use Piwik\Site;
+use Piwik\Tests\Framework\Mock\FakeAccess;
use Piwik\Tests\Framework\TestCase\IntegrationTestCase;
-use FakeAccess;
use Exception;
use ReflectionMethod;
diff --git a/plugins/SegmentEditor/lang/fr.json b/plugins/SegmentEditor/lang/fr.json
index 9d5d5992a7..76c2ea7435 100644
--- a/plugins/SegmentEditor/lang/fr.json
+++ b/plugins/SegmentEditor/lang/fr.json
@@ -1,6 +1,7 @@
{
"SegmentEditor": {
"AddANDorORCondition": "Ajouter la condition %s",
+ "AddingSegmentForAllWebsitesDisabled": "Ajouter des segments pour tous les sites a été désactivé.",
"AddNewSegment": "Ajouter un nouveau segment",
"AreYouSureDeleteSegment": "Êtes vous sûr(e) de vouloir supprimer ce segment?",
"AutoArchivePreProcessed": "les rapports segmentés sont pré-traités (plus rapide, requiert un cron sur archive.php)",
diff --git a/plugins/SegmentEditor/tests/Integration/SegmentEditorTest.php b/plugins/SegmentEditor/tests/Integration/SegmentEditorTest.php
index ca90f3b43c..adbdbdd395 100644
--- a/plugins/SegmentEditor/tests/Integration/SegmentEditorTest.php
+++ b/plugins/SegmentEditor/tests/Integration/SegmentEditorTest.php
@@ -14,8 +14,8 @@ use Piwik\Piwik;
use Piwik\Plugins\SegmentEditor\API;
use Piwik\Plugins\SegmentEditor\Model;
use Piwik\Plugins\SitesManager\API as APISitesManager;
+use Piwik\Tests\Framework\Mock\FakeAccess;
use Piwik\Tests\Framework\TestCase\IntegrationTestCase;
-use FakeAccess;
use Exception;
/**
diff --git a/plugins/SitesManager/SitesManager.php b/plugins/SitesManager/SitesManager.php
index 5b26868c35..b16b5add39 100644
--- a/plugins/SitesManager/SitesManager.php
+++ b/plugins/SitesManager/SitesManager.php
@@ -206,6 +206,7 @@ class SitesManager extends \Piwik\Plugin
{
$translationKeys[] = "General_Save";
$translationKeys[] = "General_OrCancel";
+ $translationKeys[] = "Actions_SubmenuSitesearch";
$translationKeys[] = "SitesManager_OnlyOneSiteAtTime";
$translationKeys[] = "SitesManager_DeleteConfirm";
$translationKeys[] = "SitesManager_Urls";
@@ -264,6 +265,7 @@ class SitesManager extends \Piwik\Plugin
$translationKeys[] = "SitesManager_SelectDefaultTimezone";
$translationKeys[] = "SitesManager_DefaultCurrencyForNewWebsites";
$translationKeys[] = "SitesManager_SelectDefaultCurrency";
+ $translationKeys[] = "SitesManager_AddSite";
$translationKeys[] = "Goals_Ecommerce";
}
}
diff --git a/plugins/SitesManager/lang/fr.json b/plugins/SitesManager/lang/fr.json
index 080f216eb4..31a8192778 100644
--- a/plugins/SitesManager/lang/fr.json
+++ b/plugins/SitesManager/lang/fr.json
@@ -50,11 +50,11 @@
"PiwikOffersEcommerceAnalytics": "Piwik permet un suivi et un rapport avancé des statistiques E-commerce. Apprenez-en plus à propos %s des statistiques E-commerce%s.",
"PiwikWillAutomaticallyExcludeCommonSessionParameters": "Piwik exclura automatiquement les paramètres de session communs (%s).",
"PluginDescription": "Gestion des sites web dans Piwik: Ajoute un nouveau site web, modifie un existant, affiche le code JavaScript à inclure dans vos pages. Toutes les actions sont disponibles au travers de l'API.",
- "SearchCategoryDesc": "Piwik peut aussi effectuer le suivi de la catégorie de recherche pour chaque mot clef de recherche interne.",
- "SearchCategoryLabel": "Paramètres de categoriees",
+ "SearchCategoryDesc": "Piwik peut aussi effectuer le suivi de la catégorie de recherche pour chaque mot-clé de recherche interne.",
+ "SearchCategoryLabel": "Paramètres de catégories",
"SearchCategoryParametersDesc": "Vous pouvez entrer une liste de paramètres de requête servant à spécifier la catégorie de recherche séparés par des virgules.",
"SearchKeywordLabel": "Paramètres de requêtes",
- "SearchKeywordParametersDesc": "Entrez une liste séparée par des virgules de tous les noms de paramètres de requête de recherche contenant les mots clefs.",
+ "SearchKeywordParametersDesc": "Entrez une liste séparée par des virgules de tous les paramètres de requête contenant des mots-clés de recherche.",
"SearchParametersNote": "Note : les paramètres de requête et de catégorie seront utilisés uniquement pour les sites web qui ont la recherche activée et ces paramètres laissés vides.",
"SearchParametersNote2": "Pour désactiver la recherche sur les nouveaux sites web, laissez ces deux champs vides.",
"SearchUseDefault": "Utiliser les paramètres de recherche par %sdéfaut%s",
@@ -66,10 +66,10 @@
"SiteSearchUse": "Vous pouvez utiliser Piwik pour suivre et effectuer un rapport sur ce que vos visiteurs cherchent sur le moteur de recherche interne de votre site web.",
"SuperUserAccessCan": "Un utilisateur avec un accès super utilisateur peut aussi %sconfigurer les paramètres globaux%s pour les nouveaux sites web.",
"Timezone": "Fuseau horaire",
- "TrackingSiteSearch": "Suivi de la recherche interne du site",
+ "TrackingSiteSearch": "Suivi de la recherche interne sur le site",
"TrackingTags": "Tags de suivi pour %s",
"Urls": "URLs",
- "UTCTimeIs": "l'heure UTC est %s.",
+ "UTCTimeIs": "L'heure UTC est %s.",
"WebsitesManagement": "Gestion des sites",
"YouCurrentlyHaveAccessToNWebsites": "Vous avez actuellement accès à %s sites web.",
"YourCurrentIpAddressIs": "Votre adresse IP actuelle est %s"
diff --git a/plugins/SitesManager/tests/Integration/SitesManagerTest.php b/plugins/SitesManager/tests/Integration/SitesManagerTest.php
index c49ff6b5e4..3f82a95574 100644
--- a/plugins/SitesManager/tests/Integration/SitesManagerTest.php
+++ b/plugins/SitesManager/tests/Integration/SitesManagerTest.php
@@ -12,8 +12,8 @@ use Piwik\Access;
use Piwik\Plugins\SitesManager\API;
use Piwik\Plugins\UsersManager\API as APIUsersManager;
use Piwik\Site;
+use Piwik\Tests\Framework\Mock\FakeAccess;
use Piwik\Tests\Framework\TestCase\IntegrationTestCase;
-use FakeAccess;
use Exception;
use PHPUnit_Framework_Constraint_IsType;
diff --git a/plugins/TestRunner/Aws/Instance.php b/plugins/TestRunner/Aws/Instance.php
index 769b35b337..77f21253c8 100644
--- a/plugins/TestRunner/Aws/Instance.php
+++ b/plugins/TestRunner/Aws/Instance.php
@@ -126,12 +126,17 @@ class Instance
public function verifySetup($instanceIds)
{
$awsCloudWatch = new CloudWatch($this->config);
- $hasAlarms = $awsCloudWatch->hasAssignedAlarms($instanceIds);
+ $hasAlarms = $awsCloudWatch->hasAssignedAlarms($instanceIds);
if (!$hasAlarms) {
- return $this->setup($instanceIds);
- }
+ $this->setup($instanceIds); // try setup again
+
+ $hasAlarms = $awsCloudWatch->hasAssignedAlarms($instanceIds);
+ if (!$hasAlarms) { // declare it as failed if it still does not work
+ throw new \Exception('Failed to assign alarms for InstanceIds: ' . implode(', ' , $instanceIds));
+ }
+ }
}
/**
diff --git a/plugins/TestRunner/Runner/InstanceLauncher.php b/plugins/TestRunner/Runner/InstanceLauncher.php
index 4f9faf97c7..a041cd0471 100644
--- a/plugins/TestRunner/Runner/InstanceLauncher.php
+++ b/plugins/TestRunner/Runner/InstanceLauncher.php
@@ -40,6 +40,7 @@ class InstanceLauncher {
try {
$host = $this->instance->setup($instanceIds);
+ $this->instance->verifySetup($instanceIds);
} catch (\Exception $e) {
$this->instance->terminate($instanceIds);
diff --git a/plugins/UserCountry/Controller.php b/plugins/UserCountry/Controller.php
index a6ed712dbe..145f981cc3 100644
--- a/plugins/UserCountry/Controller.php
+++ b/plugins/UserCountry/Controller.php
@@ -135,9 +135,9 @@ class Controller extends \Piwik\Plugin\ControllerAdmin
$result['next_screen'] = $this->getGeoIpUpdaterManageScreen();
}
- return Common::json_encode($result);
+ return json_encode($result);
} catch (Exception $ex) {
- return Common::json_encode(array('error' => $ex->getMessage()));
+ return json_encode(array('error' => $ex->getMessage()));
}
}
}
@@ -207,15 +207,15 @@ class Controller extends \Piwik\Plugin\ControllerAdmin
// the browser so it can download it next
$info = $this->getNextMissingDbUrlInfo();
if ($info !== false) {
- return Common::json_encode($info);
+ return json_encode($info);
} else {
$view = new View("@UserCountry/_updaterNextRunTime");
$view->nextRunTime = GeoIPAutoUpdater::getNextRunTime();
$nextRunTimeHtml = $view->render();
- return Common::json_encode(array('nextRunTime' => $nextRunTimeHtml));
+ return json_encode(array('nextRunTime' => $nextRunTimeHtml));
}
} catch (Exception $ex) {
- return Common::json_encode(array('error' => $ex->getMessage()));
+ return json_encode(array('error' => $ex->getMessage()));
}
}
}
@@ -270,13 +270,13 @@ class Controller extends \Piwik\Plugin\ControllerAdmin
$info = $this->getNextMissingDbUrlInfo();
if ($info !== false) {
- return Common::json_encode($info);
+ return json_encode($info);
}
}
- return Common::json_encode($result);
+ return json_encode($result);
} catch (Exception $ex) {
- return Common::json_encode(array('error' => $ex->getMessage()));
+ return json_encode(array('error' => $ex->getMessage()));
}
}
}
diff --git a/plugins/UserCountry/LocationProvider.php b/plugins/UserCountry/LocationProvider.php
index 2c431565e5..a5a656c42f 100755
--- a/plugins/UserCountry/LocationProvider.php
+++ b/plugins/UserCountry/LocationProvider.php
@@ -444,7 +444,8 @@ abstract class LocationProvider
/**
* Returns an IP address from an array that was passed into getLocation. This
- * will return an IPv4 address or IPv6 address.
+ * will return an IPv4 address or null if the address is IPv6 (IPv6 is not
+ * supported yet).
*
* @param array $info Must have 'ip' key.
* @return string|null
@@ -453,11 +454,7 @@ abstract class LocationProvider
{
$ip = \Piwik\Network\IP::fromStringIP($info['ip']);
- if ($ip instanceof \Piwik\Network\IPv6 && $ip->isMappedIPv4()) {
- return $ip->toIPv4String();
- } else {
- return $ip->toString();
- }
+ return $ip->toIPv4String();
}
}
diff --git a/plugins/UserCountry/LocationProvider/GeoIp/Php.php b/plugins/UserCountry/LocationProvider/GeoIp/Php.php
index 33b763e502..2a3fda9dee 100755
--- a/plugins/UserCountry/LocationProvider/GeoIp/Php.php
+++ b/plugins/UserCountry/LocationProvider/GeoIp/Php.php
@@ -95,7 +95,6 @@ class Php extends GeoIp
public function getLocation($info)
{
$ip = $this->getIpFromInfo($info);
- $isIPv6 = filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6);
$result = array();
@@ -105,11 +104,7 @@ class Php extends GeoIp
case GEOIP_CITY_EDITION_REV0: // city database type
case GEOIP_CITY_EDITION_REV1:
case GEOIP_CITYCOMBINED_EDITION:
- if ($isIPv6) {
- $location = geoip_record_by_addr_v6($locationGeoIp, $ip);
- } else {
- $location = geoip_record_by_addr($locationGeoIp, $ip);
- }
+ $location = geoip_record_by_addr($locationGeoIp, $ip);
if (!empty($location)) {
$result[self::COUNTRY_CODE_KEY] = $location->country_code;
$result[self::REGION_CODE_KEY] = $location->region;
@@ -122,46 +117,28 @@ class Php extends GeoIp
break;
case GEOIP_REGION_EDITION_REV0: // region database type
case GEOIP_REGION_EDITION_REV1:
- if ($isIPv6) {
- // NOTE: geoip_region_by_addr_v6 does not exist (yet?), so we
- // return the country code and an empty region code
- $location = array(geoip_country_code_by_addr_v6($locationGeoIp, $ip), '');
- } else {
- $location = geoip_region_by_addr($locationGeoIp, $ip);
- }
+ $location = geoip_region_by_addr($locationGeoIp, $ip);
if (!empty($location)) {
$result[self::COUNTRY_CODE_KEY] = $location[0];
$result[self::REGION_CODE_KEY] = $location[1];
}
break;
case GEOIP_COUNTRY_EDITION: // country database type
- if ($isIPv6) {
- $result[self::COUNTRY_CODE_KEY] = geoip_country_code_by_addr_v6($locationGeoIp, $ip);
- } else {
- $result[self::COUNTRY_CODE_KEY] = geoip_country_code_by_addr($locationGeoIp, $ip);
- }
+ $result[self::COUNTRY_CODE_KEY] = geoip_country_code_by_addr($locationGeoIp, $ip);
break;
default: // unknown database type, log warning and fallback to country edition
Log::warning("Found unrecognized database type: %s", $locationGeoIp->databaseType);
- if ($isIPv6) {
- $result[self::COUNTRY_CODE_KEY] = geoip_country_code_by_addr_v6($locationGeoIp, $ip);
- } else {
- $result[self::COUNTRY_CODE_KEY] = geoip_country_code_by_addr($locationGeoIp, $ip);
- }
+ $result[self::COUNTRY_CODE_KEY] = geoip_country_code_by_addr($locationGeoIp, $ip);
break;
}
}
- // NOTE: ISP & ORG require commercial dbs to test. The code has been tested manually,
+ // NOTE: ISP & ORG require commercial dbs to test. this code has been tested manually,
// but not by system tests.
$ispGeoIp = $this->getGeoIpInstance($key = 'isp');
if ($ispGeoIp) {
- if ($isIPv6) {
- $isp = geoip_name_by_addr_v6($ispGeoIp, $ip);
- } else {
- $isp = geoip_org_by_addr($ispGeoIp, $ip);
- }
+ $isp = geoip_org_by_addr($ispGeoIp, $ip);
if (!empty($isp)) {
$result[self::ISP_KEY] = utf8_encode($isp);
}
@@ -169,11 +146,7 @@ class Php extends GeoIp
$orgGeoIp = $this->getGeoIpInstance($key = 'org');
if ($orgGeoIp) {
- if ($isIPv6) {
- $org = geoip_name_by_addr_v6($orgGeoIp, $ip);
- } else {
- $org = geoip_org_by_addr($orgGeoIp, $ip);
- }
+ $org = geoip_org_by_addr($orgGeoIp, $ip);
if (!empty($org)) {
$result[self::ORG_KEY] = utf8_encode($org);
}
diff --git a/plugins/UserCountry/lang/fr.json b/plugins/UserCountry/lang/fr.json
index 325961a0c1..08b7ae2d3a 100644
--- a/plugins/UserCountry/lang/fr.json
+++ b/plugins/UserCountry/lang/fr.json
@@ -314,7 +314,7 @@
"GeoIpLocationProviderDesc_Php2": "Si votre site web a beaucoup de trafic, vous pourriez trouver que ce fournisseur de localisation est trop lent. Dans ce cas, vous devriez installer %1$sl'extension PECL%2$s ou un %3$smodule serveur%4$s.",
"GeoIpLocationProviderDesc_ServerBased1": "Ce fournisseur de localisation utilise le module GeoIP qui a été installé sur votre serveur HTTP. Ce fournisseur est rapide et précis, mais peut être %1$suniquement utilisé avec le suivi de navigateur classique.%2$s",
"GeoIpLocationProviderDesc_ServerBased2": "Si vous devez importer des fichiers de logs ou bien autre chose qui requiert de définir des adresses IP, utilisez %1$sl'implémentation PECL GeoIP(recommandé)%2$s ou %3$sl'implémentation GeoIP PHP%4$s.",
- "GeoIpLocationProviderDesc_ServerBasedAnonWarn": "Note: L'anonymisation de l'adresse IP n'a aucun effet sur les localisations communiquées par ce fournisseur. Avant de l'utiliser avec l'anonymisation d'IP, assurez vous que cela ne transgresse aucune loi sur la vie privées à laquelle vous pourriez être assujetti.",
+ "GeoIpLocationProviderDesc_ServerBasedAnonWarn": "Note : L'anonymisation de l'adresse IP n'a aucun effet sur les localisations communiquées par ce fournisseur. Avant de l'utiliser avec l'anonymisation d'IP, assurez vous que cela ne transgresse aucune loi sur la vie privées à laquelle vous pourriez être assujetti.",
"GeoIpLocationProviderNotRecomnended": "La géolocalisation fonctionne, mais vous n'utilisez pas un des fournisseurs recommandés.",
"GeoIPNoServerVars": "Piwik ne parvient à trouver aucune variable GeoIP %s.",
"GeoIPPeclCustomDirNotSet": "L'option %s du PHP ini n'est pas définie.",
@@ -336,7 +336,7 @@
"HowToSetupGeoIP_Step1": "%1$sTélécharger%2$s la base de données GeoLite City depuis %3$sMaxMind%4$s.",
"HowToSetupGeoIP_Step2": "Extrayez ce fichier et copiez le résultat %1$s dans le %2$ssous-répertoire misc%3$s de Piwik (vous pouvez effectuer cela par FTP ou SSH).",
"HowToSetupGeoIP_Step3": "Recharger cet affichage. Le fournisseur %1$sGeoIP (PHP)%2$s va maintenant être %3$sInstallé%4$s. Sélectionnez le.",
- "HowToSetupGeoIP_Step4": "Vous avez terminé! Vous venez juste de configurer Piwik pour utiliser GeoIP ce qui veut dire que vous allez être capable de voir de quelles régions et villes sont vos visiteurs avec une information sur le pays très précise.",
+ "HowToSetupGeoIP_Step4": "Vous avez terminé ! Vous venez juste de configurer Piwik pour utiliser GeoIP ce qui veut dire que vous allez être capable de voir de quelles régions et villes sont vos visiteurs avec une information sur le pays très précise.",
"HowToSetupGeoIPIntro": "Il ne semble pas que vous ayez une configuration de géolocalisation très précise. C'est une fonctionnalité utile et sans elle vous ne verrez pas de manière précise et complète les informations de localisation de vos visiteurs. Voici comment vous pouvez rapidement commencer à l'utiliser :",
"HttpServerModule": "Module du serveur HTTP",
"InvalidGeoIPUpdatePeriod": "Période invalide pour la mise à jour de GeoIP: %1$s. Les valeurs valides sont %2$s.",
@@ -357,7 +357,7 @@
"PeclGeoLiteError": "Votre base de données GeoIP dans %1$s est nommée %2$s. Malheureusement, le module PECL ne la reconnaitra pas avec ce nom. Veuillez la renommer %3$s.",
"PiwikNotManagingGeoIPDBs": "Piwik ne gère actuellement aucune base de données GeoIP.",
"PluginDescription": "Effectue des rapports sur les pays des visiteurs.",
- "Region": "Region",
+ "Region": "Région",
"SetupAutomaticUpdatesOfGeoIP": "Configurer les mises à jour automatiques des bases de données GeoIP",
"SubmenuLocations": "Provenances géographiques",
"TestIPLocatorFailed": "Piwik a essayé de vérifier la localisation d'une adresse IP connue (%1$s), mais le serveur a renvoyé %2$s. Si ce fournisseur était configuré correctement il aurait renvoyé %3$s.",
diff --git a/plugins/UserCountryMap/Controller.php b/plugins/UserCountryMap/Controller.php
index e5f845d80a..914835439e 100644
--- a/plugins/UserCountryMap/Controller.php
+++ b/plugins/UserCountryMap/Controller.php
@@ -63,7 +63,7 @@ class Controller extends \Piwik\Plugin\Controller
$view->defaultMetric = 'nb_visits';
// some translations
- $view->localeJSON = Common::json_encode(array(
+ $view->localeJSON = json_encode(array(
'nb_visits' => Piwik::translate('General_NVisits'),
'one_visit' => Piwik::translate('General_OneVisit'),
'no_visit' => Piwik::translate('UserCountryMap_NoVisit'),
@@ -90,7 +90,7 @@ class Controller extends \Piwik\Plugin\Controller
$view->metrics = $config['metrics'] = $this->getMetrics($idSite, $period, $date, $token_auth);
$config['svgBasePath'] = 'plugins/UserCountryMap/svg/';
$config['mapCssPath'] = 'plugins/UserCountryMap/stylesheets/map.css';
- $view->config = Common::json_encode($config);
+ $view->config = json_encode($config);
$view->noData = empty($config['visitsSummary']['nb_visits']);
return $view->render();
@@ -198,7 +198,7 @@ class Controller extends \Piwik\Plugin\Controller
}
if ($encode) {
- $params = Common::json_encode($params);
+ $params = json_encode($params);
}
return $params;
}
diff --git a/plugins/UserCountryMap/lang/fr.json b/plugins/UserCountryMap/lang/fr.json
index 1b1852f081..961f86fad3 100644
--- a/plugins/UserCountryMap/lang/fr.json
+++ b/plugins/UserCountryMap/lang/fr.json
@@ -19,7 +19,7 @@
"SecondsAgo": "%s secondes",
"ShowingVisits": "Visites géo-localisées des derniers",
"Unlocated": "<b>%s<\/b> %p des dernières visites de %c n'ont pas pu être géo-localisées.",
- "VisitorMap": "Carte du visiteur",
+ "VisitorMap": "Carte des visiteurs",
"WithUnknownCity": "%s avec une ville inconnue",
"WithUnknownRegion": "%s avec une région inconnue",
"WorldWide": "Mondialement"
diff --git a/plugins/UserSettings/Archiver.php b/plugins/UserSettings/Archiver.php
index 1cc16b01c9..63b6ca5028 100644
--- a/plugins/UserSettings/Archiver.php
+++ b/plugins/UserSettings/Archiver.php
@@ -115,12 +115,11 @@ class Archiver extends \Piwik\Plugin\Archiver
protected function aggregateByLanguage()
{
$query = $this->getLogAggregator()->queryVisitsByDimension(array("label" => self::LANGUAGE_DIMENSION));
- $languageCodes = array_keys(Common::getLanguagesList());
$countryCodes = Common::getCountriesList($includeInternalCodes = true);
$metricsByLanguage = new DataArray();
while ($row = $query->fetch()) {
- $langCode = Common::extractLanguageCodeFromBrowserLanguage($row['label'], $languageCodes);
+ $langCode = Common::extractLanguageCodeFromBrowserLanguage($row['label']);
$countryCode = Common::extractCountryCodeFromBrowserLanguage($row['label'], $countryCodes, $enableLanguageToCountryGuess = true);
if ($countryCode == 'xx' || $countryCode == $langCode) {
diff --git a/plugins/UserSettings/Columns/Language.php b/plugins/UserSettings/Columns/Language.php
index f61154c7c4..4f31778e2d 100644
--- a/plugins/UserSettings/Columns/Language.php
+++ b/plugins/UserSettings/Columns/Language.php
@@ -8,6 +8,7 @@
*/
namespace Piwik\Plugins\UserSettings\Columns;
+use Piwik\Common;
use Piwik\Piwik;
use Piwik\Plugin\Dimension\VisitDimension;
use Piwik\Tracker\Action;
@@ -32,12 +33,22 @@ class Language extends VisitDimension
*/
public function onNewVisit(Request $request, Visitor $visitor, $action)
{
- $language = $request->getBrowserLanguage();
+ return $this->getSingleLanguageFromAcceptedLanguages($request->getBrowserLanguage());
+ }
- if (empty($language)) {
+ /**
+ * For better privacy we store only the main language code, instead of the whole browser language string.
+ *
+ * @param $acceptLanguagesString
+ * @return string
+ */
+ protected function getSingleLanguageFromAcceptedLanguages($acceptLanguagesString)
+ {
+ if (empty($acceptLanguagesString)) {
return '';
}
- return substr($language, 0, 20);
+ $languageCode = Common::extractLanguageAndRegionCodeFromBrowserLanguage($acceptLanguagesString);
+ return $languageCode;
}
-} \ No newline at end of file
+}
diff --git a/plugins/UserSettings/lang/fr.json b/plugins/UserSettings/lang/fr.json
index bb48117989..8bd67eb6b0 100644
--- a/plugins/UserSettings/lang/fr.json
+++ b/plugins/UserSettings/lang/fr.json
@@ -6,7 +6,7 @@
"BrowserWithNoPluginsEnabled": "%1$s avec aucun plugin activé",
"BrowserWithPluginsEnabled": "%1$s avec les plugins %2$s activés",
"ColumnBrowser": "Navigateur",
- "ColumnBrowserFamily": "Famille de navigateur",
+ "ColumnBrowserFamily": "Famille de navigateurs",
"ColumnBrowserVersion": "Version du navigateur",
"ColumnConfiguration": "Configuration",
"ColumnOperatingSystem": "Système d'exploitation",
@@ -200,10 +200,10 @@
"Language_zu": "Zoulou",
"LanguageCode": "Code langue",
"MobileVsDesktop": "Mobile vs Fixe",
- "OperatingSystemFamily": "Famille de systèmes d'exploitation",
+ "OperatingSystemFamily": "Famille de systèmes d'exploitations",
"OperatingSystems": "Système d'exploitation",
"PluginDescription": "Effectue des rapports variés sur les paramètres utilisateurs: navigateur, famille du navigateur, système d'exploitation, plugins, résolution, paramètres généraux.",
- "PluginDetectionDoesNotWorkInIE": "Note : La détection des plugins ne fonctionne pas avec Internet Explorer. Ce rapport est basé sur les navigateurs non-IE.",
+ "PluginDetectionDoesNotWorkInIE": "Note : La détection des plugins ne fonctionne pas avec Internet Explorer. Ce rapport est basé sur les autres navigateurs.",
"Resolutions": "Résolutions",
"VisitorSettings": "Paramètres visiteur",
"WideScreen": "Largeur d'écran",
diff --git a/plugins/UserSettings/tests/System/expected/test___UserSettings.getLanguageCode_day.xml b/plugins/UserSettings/tests/System/expected/test___UserSettings.getLanguageCode_day.xml
index 689e3d7d37..02c15ad520 100644
--- a/plugins/UserSettings/tests/System/expected/test___UserSettings.getLanguageCode_day.xml
+++ b/plugins/UserSettings/tests/System/expected/test___UserSettings.getLanguageCode_day.xml
@@ -2,7 +2,7 @@
<result>
<row>
<label>Polish (pl)</label>
- <nb_uniq_visitors>2</nb_uniq_visitors>
+ <nb_uniq_visitors>1</nb_uniq_visitors>
<nb_visits>3</nb_visits>
<nb_actions>3</nb_actions>
<nb_users>0</nb_users>
@@ -12,7 +12,7 @@
<nb_visits_converted>0</nb_visits_converted>
</row>
<row>
- <label>English - United States (en-us)</label>
+ <label>English (en)</label>
<nb_uniq_visitors>1</nb_uniq_visitors>
<nb_visits>2</nb_visits>
<nb_actions>2</nb_actions>
@@ -133,7 +133,7 @@
<nb_visits_converted>0</nb_visits_converted>
</row>
<row>
- <label>Unknown - Liberia (xx-lr)</label>
+ <label>Unknown (xx)</label>
<nb_uniq_visitors>1</nb_uniq_visitors>
<nb_visits>1</nb_visits>
<nb_actions>1</nb_actions>
diff --git a/plugins/UserSettings/tests/System/expected/test___UserSettings.getLanguage_day.xml b/plugins/UserSettings/tests/System/expected/test___UserSettings.getLanguage_day.xml
index 6bb328c660..18d4468a2e 100644
--- a/plugins/UserSettings/tests/System/expected/test___UserSettings.getLanguage_day.xml
+++ b/plugins/UserSettings/tests/System/expected/test___UserSettings.getLanguage_day.xml
@@ -2,7 +2,7 @@
<result>
<row>
<label>Polish</label>
- <nb_uniq_visitors>2</nb_uniq_visitors>
+ <nb_uniq_visitors>1</nb_uniq_visitors>
<nb_visits>3</nb_visits>
<nb_actions>3</nb_actions>
<nb_users>0</nb_users>
diff --git a/plugins/UsersManager/tests/Integration/APITest.php b/plugins/UsersManager/tests/Integration/APITest.php
index 038fee2934..1cf2cf71bb 100644
--- a/plugins/UsersManager/tests/Integration/APITest.php
+++ b/plugins/UsersManager/tests/Integration/APITest.php
@@ -8,10 +8,10 @@
namespace Piwik\Plugins\UsersManager\tests;
use Piwik\Access;
-use FakeAccess;
use Piwik\Piwik;
use Piwik\Plugins\UsersManager\API;
use Piwik\Tests\Framework\Fixture;
+use Piwik\Tests\Framework\Mock\FakeAccess;
use Piwik\Tests\Framework\TestCase\IntegrationTestCase;
/**
diff --git a/plugins/UsersManager/tests/Integration/UserPreferencesTest.php b/plugins/UsersManager/tests/Integration/UserPreferencesTest.php
index 34a5907c0a..34a8aeabbc 100644
--- a/plugins/UsersManager/tests/Integration/UserPreferencesTest.php
+++ b/plugins/UsersManager/tests/Integration/UserPreferencesTest.php
@@ -11,9 +11,9 @@ namespace Piwik\Plugins\UsersManager\tests;
use Piwik\Piwik;
use Piwik\Plugins\UsersManager\UserPreferences;
use Piwik\Plugins\UsersManager\API as APIUsersManager;
-use FakeAccess;
use Piwik\Access;
use Piwik\Tests\Framework\Fixture;
+use Piwik\Tests\Framework\Mock\FakeAccess;
use Piwik\Tests\Framework\TestCase\IntegrationTestCase;
/**
diff --git a/plugins/UsersManager/tests/Integration/UsersManagerTest.php b/plugins/UsersManager/tests/Integration/UsersManagerTest.php
index ddf6f69e48..74f7fe3369 100644
--- a/plugins/UsersManager/tests/Integration/UsersManagerTest.php
+++ b/plugins/UsersManager/tests/Integration/UsersManagerTest.php
@@ -12,9 +12,9 @@ use Piwik\Access;
use Piwik\Plugins\SitesManager\API as APISitesManager;
use Piwik\Plugins\UsersManager\API;
use Piwik\Plugins\UsersManager\Model;
+use Piwik\Tests\Framework\Mock\FakeAccess;
use Piwik\Translate;
use Piwik\Tests\Framework\TestCase\IntegrationTestCase;
-use FakeAccess;
use Exception;
diff --git a/plugins/VisitFrequency/lang/de.json b/plugins/VisitFrequency/lang/de.json
index bca281919d..b778119c69 100644
--- a/plugins/VisitFrequency/lang/de.json
+++ b/plugins/VisitFrequency/lang/de.json
@@ -7,6 +7,7 @@
"ColumnBounceRateForReturningVisits": "Absprungsrate bei wiederkehrenden Besuchen",
"ColumnMaxActionsInReturningVisit": "Maximale Aktionen eines wiederkehrenden Besuchs",
"ColumnNbReturningVisitsConverted": "Anzahl wiederkehrende Besuche mit Konversion",
+ "ColumnReturningUsers": "Wiederkehrende Benutzer",
"ColumnReturningVisits": "Wiederkehrende Besuche",
"ColumnSumVisitLengthReturning": "Gesamte Aufenthaltszeit bei wiederkehrenden Besuchen (in Sekunden)",
"ColumnUniqueReturningVisitors": "Eindeutige wiederkehrende Besucher",
diff --git a/plugins/VisitFrequency/lang/el.json b/plugins/VisitFrequency/lang/el.json
index f2521a71b3..bf5e4980ff 100644
--- a/plugins/VisitFrequency/lang/el.json
+++ b/plugins/VisitFrequency/lang/el.json
@@ -7,6 +7,7 @@
"ColumnBounceRateForReturningVisits": "Βαθμός Απομάκρυνσης για Επιστρεφόμενες Επισκέψεις",
"ColumnMaxActionsInReturningVisit": "Μέγιστος αριθμός Δραστηριοτήτων σε μια επιστρεφόμενη επίσκεψη",
"ColumnNbReturningVisitsConverted": "Αριθμός μετατρεπόμενων επιστρεφόμενων επισκέψεων",
+ "ColumnReturningUsers": "Επιστρέφοντες Χρήστες",
"ColumnReturningVisits": "Επιστρεφόμενες επισκέψεις",
"ColumnSumVisitLengthReturning": "Συνολικός δαπανηθής χρόνος από επιστρεφόμενους επισκέπτες (σε δευτερόλεπτα)",
"ColumnUniqueReturningVisitors": "Μοναδικοί επιστρεφόμενοι επισκέπτες",
diff --git a/plugins/VisitFrequency/lang/fr.json b/plugins/VisitFrequency/lang/fr.json
index 039c0740e2..1246849d48 100644
--- a/plugins/VisitFrequency/lang/fr.json
+++ b/plugins/VisitFrequency/lang/fr.json
@@ -4,7 +4,7 @@
"ColumnAverageVisitDurationForReturningVisitors": "Durée moyenne des visites pour les visiteurs connus (en secondes)",
"ColumnAvgActionsPerReturningVisit": "Nombre d'actions moyen par visiteur connu.",
"ColumnBounceCountForReturningVisits": "Compteur rebond pour visites de retour",
- "ColumnBounceRateForReturningVisits": "Pourcentage de rebond par les visites retour",
+ "ColumnBounceRateForReturningVisits": "Pourcentage de rebond pour les visites retour",
"ColumnMaxActionsInReturningVisit": "Actions maximum dans une visite de retour",
"ColumnNbReturningVisitsConverted": "Nombre de visites converties de retour",
"ColumnReturningVisits": "Visites retour",
diff --git a/plugins/VisitFrequency/lang/it.json b/plugins/VisitFrequency/lang/it.json
index 16a963ec1f..e8a5decf92 100644
--- a/plugins/VisitFrequency/lang/it.json
+++ b/plugins/VisitFrequency/lang/it.json
@@ -7,6 +7,7 @@
"ColumnBounceRateForReturningVisits": "Percentuale dei rimbalzi per le visite ricorrenti",
"ColumnMaxActionsInReturningVisit": "Numero massimo di azioni in una visita di ritorno",
"ColumnNbReturningVisitsConverted": "Numero di visite di ritorno convertite",
+ "ColumnReturningUsers": "Utenti di ritorno",
"ColumnReturningVisits": "Visite ricorrenti",
"ColumnSumVisitLengthReturning": "Tempo complessivo speso dai visitatori di ritorno (in secondi)",
"ColumnUniqueReturningVisitors": "Visitatori unici di ritorno",
diff --git a/plugins/VisitTime/lang/fr.json b/plugins/VisitTime/lang/fr.json
index 30ae4ac2c3..9d2455d80c 100644
--- a/plugins/VisitTime/lang/fr.json
+++ b/plugins/VisitTime/lang/fr.json
@@ -11,8 +11,8 @@
"VisitsByDayOfWeek": "Visites par Jour de la Semaine",
"WidgetByDayOfWeekDocumentation": "Ce graphique affiche le nombre de visites que votre site web a reçu durant chaque jour de la semaine.",
"WidgetLocalTime": "Visites par fuseau horaire local",
- "WidgetLocalTimeDocumentation": "Ce graphique affiche quelle heure il était dans le %s fuseau horaire du visiteur %s pendant sa visite.",
+ "WidgetLocalTimeDocumentation": "Ce graphique affiche la répartition horaire basée sur le %s fuseau horaire du visiteur %s.",
"WidgetServerTime": "Visites par fuseau horaire du serveur",
- "WidgetServerTimeDocumentation": "Ce graphique affiche quelle heure il était dans le %s fuseau horaire du serveur %s pendant les visites."
+ "WidgetServerTimeDocumentation": "Ce graphique affiche la répartition horaire basée sur le %s fuseau horaire du serveur %s."
}
} \ No newline at end of file
diff --git a/plugins/VisitorInterest/lang/fr.json b/plugins/VisitorInterest/lang/fr.json
index 372d18396e..47339eadab 100644
--- a/plugins/VisitorInterest/lang/fr.json
+++ b/plugins/VisitorInterest/lang/fr.json
@@ -12,7 +12,7 @@
"PlusXMin": "%s min",
"VisitNum": "Numéro de la visite",
"VisitsByDaysSinceLast": "Visites par jours depuis la dernière visite",
- "visitsByVisitCount": "Visites par numéro de visite",
+ "visitsByVisitCount": "Visites par nombre de visites",
"VisitsPerDuration": "Visites par durée de la visite",
"VisitsPerNbOfPages": "Visites par nombre de pages",
"WidgetLengths": "Durée des visites",
@@ -20,7 +20,7 @@
"WidgetPages": "Pages par visite",
"WidgetPagesDocumentation": "Dans ce rapport, vous pouvez voir combien de visites impliquaient l'affichage d'un certain nombre de pages. Initialement ce rapport est affiché comme un nuage de tags, les nombres de pages les plus fréquents sont affichés dans des polices plus grandes.",
"WidgetVisitsByDaysSinceLast": "Visites par jour depuis la dernière visite",
- "WidgetVisitsByDaysSinceLastDocumentation": "Dans ce rapport, vous pouvez voir le nombre de visites il y a eu de ce visiteur dont la dernière visite date depuis un certain nombre de jours.",
- "WidgetVisitsByNumDocumentation": "Dans ce rapport, vous pouvez voir le nombre de visites qui était la nième visite, par exemple: visiteurs qui ont visité votre site web au moins n fois."
+ "WidgetVisitsByDaysSinceLastDocumentation": "Dans ce rapport, vous pouvez voir le nombre de visites par visiteur dont la dernière visite date de X jours.",
+ "WidgetVisitsByNumDocumentation": "Dans ce rapport, vous pouvez voir la répartition par nombre de visites. Par exemple quel proportion de visiteurs ont visité votre site au moins n fois."
}
} \ No newline at end of file
diff --git a/plugins/Widgetize/Controller.php b/plugins/Widgetize/Controller.php
index 043ff8134d..5b1d31b586 100644
--- a/plugins/Widgetize/Controller.php
+++ b/plugins/Widgetize/Controller.php
@@ -22,7 +22,7 @@ class Controller extends \Piwik\Plugin\Controller
public function index()
{
$view = new View('@Widgetize/index');
- $view->availableWidgets = Common::json_encode(WidgetsList::get());
+ $view->availableWidgets = json_encode(WidgetsList::get());
$this->setGeneralVariablesView($view);
return $view->render();
}
diff --git a/plugins/ZenMode/lang/nl.json b/plugins/ZenMode/lang/nl.json
new file mode 100644
index 0000000000..115eea6320
--- /dev/null
+++ b/plugins/ZenMode/lang/nl.json
@@ -0,0 +1,9 @@
+{
+ "ZenMode": {
+ "Activated": "Zen-modus geactiveerd",
+ "HowToSearch": "Om te zoeken op menu-items, rapporten of websites gebruik het zoekvak rechtsboven of druk op 'alt+f'.",
+ "HowToToggleZenMode": "Om de zen-modus te betreden of verlaten klik op pijl rechtsboven of druk 'alt+z'.",
+ "QuickAccessTitle": "Zoeken op menu-items, rapporten en websites",
+ "SearchForAnything": "Zoeken op alles"
+ }
+} \ No newline at end of file
diff --git a/tests/PHPUnit/BenchmarkTestCase.php b/tests/PHPUnit/BenchmarkTestCase.php
index d3775bb15d..a067a3286a 100755
--- a/tests/PHPUnit/BenchmarkTestCase.php
+++ b/tests/PHPUnit/BenchmarkTestCase.php
@@ -8,6 +8,8 @@
/**
* Base class for benchmarks.
+ *
+ * @deprecated since 2.10.0 use Piwik\Tests\Framework\TestCase\BenchmarkTestCase instead
*/
abstract class BenchmarkTestCase extends \Piwik\Tests\Framework\TestCase\BenchmarkTestCase
{
diff --git a/tests/PHPUnit/ConsoleCommandTestCase.php b/tests/PHPUnit/ConsoleCommandTestCase.php
index f32533077c..138e6e77eb 100644
--- a/tests/PHPUnit/ConsoleCommandTestCase.php
+++ b/tests/PHPUnit/ConsoleCommandTestCase.php
@@ -8,6 +8,9 @@
namespace Piwik\Tests;
+/**
+ * @deprecated since 2.10.0 use \Piwik\Tests\Framework\TestCase\ConsoleCommandTestCase instead
+ */
class ConsoleCommandTestCase extends Framework\TestCase\ConsoleCommandTestCase
{
} \ No newline at end of file
diff --git a/tests/PHPUnit/FakeAccess.php b/tests/PHPUnit/FakeAccess.php
index 2cac223994..66f58c795b 100644
--- a/tests/PHPUnit/FakeAccess.php
+++ b/tests/PHPUnit/FakeAccess.php
@@ -10,6 +10,8 @@ use \Piwik\Tests\Framework\Mock\FakeAccess as MockFakeAccess;
/**
* FakeAccess for UnitTests
+ *
+ * @deprecated since 2.10.0 use \Piwik\Tests\Framework\Mock\FakeAccess instead
*/
class FakeAccess extends MockFakeAccess
{
diff --git a/tests/PHPUnit/Fixtures/ManyVisitsWithGeoIP.php b/tests/PHPUnit/Fixtures/ManyVisitsWithGeoIP.php
index 3abb1ee414..b499959f78 100644
--- a/tests/PHPUnit/Fixtures/ManyVisitsWithGeoIP.php
+++ b/tests/PHPUnit/Fixtures/ManyVisitsWithGeoIP.php
@@ -33,7 +33,7 @@ class ManyVisitsWithGeoIP extends Fixture
'::ffff:137.82.130.49', // in British Columbia (mapped ipv4)
'137.82.130.0', // anonymization tests
'137.82.0.0',
- '2001:db8:85a3:0:0:8a2e:370:7334', // ipv6
+ '2001:db8:85a3:0:0:8a2e:370:7334', // ipv6 (geoip lookup not supported)
'113.62.1.1', // in Lhasa, Tibet
'151.100.101.92', // in Rome, Italy (using country DB, so only Italy will show)
'103.29.196.229', // in Indonesia (Bali), (only Indonesia will show up)
@@ -257,4 +257,4 @@ class ManyVisitsWithGeoIP extends Fixture
// ignore error
}
}
-}
+} \ No newline at end of file
diff --git a/tests/PHPUnit/Fixtures/TwoSitesWithAnnotations.php b/tests/PHPUnit/Fixtures/TwoSitesWithAnnotations.php
index b549bb6c8e..e0cfca3dd5 100644
--- a/tests/PHPUnit/Fixtures/TwoSitesWithAnnotations.php
+++ b/tests/PHPUnit/Fixtures/TwoSitesWithAnnotations.php
@@ -11,7 +11,7 @@ use Piwik\Access;
use Piwik\Date;
use Piwik\Plugins\Annotations\API;
use Piwik\Tests\Framework\Fixture;
-use FakeAccess;
+use Piwik\Tests\Framework\Mock\FakeAccess;
/**
* A fixture that adds two websites and annotations for each website.
diff --git a/tests/PHPUnit/Fixtures/UITestFixture.php b/tests/PHPUnit/Fixtures/UITestFixture.php
index 8ff2282402..5eb6cf2610 100644
--- a/tests/PHPUnit/Fixtures/UITestFixture.php
+++ b/tests/PHPUnit/Fixtures/UITestFixture.php
@@ -249,7 +249,7 @@ class UITestFixture extends SqlDump
} else {
$_GET['name'] = 'dashboard name' . $id;
}
- $_GET['layout'] = Common::json_encode($layout);
+ $_GET['layout'] = json_encode($layout);
$_GET['idDashboard'] = $id + 1;
FrontController::getInstance()->fetchDispatch('Dashboard', 'saveLayout');
}
@@ -271,7 +271,7 @@ class UITestFixture extends SqlDump
);
$_GET['name'] = 'D4';
- $_GET['layout'] = Common::json_encode($dashboard);
+ $_GET['layout'] = json_encode($dashboard);
$_GET['idDashboard'] = 5;
$_GET['idSite'] = 2;
FrontController::getInstance()->fetchDispatch('Dashboard', 'saveLayout');
diff --git a/tests/PHPUnit/Framework/Constraint/ResponseCode.php b/tests/PHPUnit/Framework/Constraint/ResponseCode.php
new file mode 100644
index 0000000000..b934ea008f
--- /dev/null
+++ b/tests/PHPUnit/Framework/Constraint/ResponseCode.php
@@ -0,0 +1,56 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+namespace Piwik\Tests\Framework\Constraint;
+
+class ResponseCode extends \PHPUnit_Framework_Constraint
+{
+
+ /**
+ * @param integer $value Expected response code
+ */
+ public function __construct($value)
+ {
+ parent::__construct();
+ $this->value = $value;
+ }
+
+ /**
+ * Evaluates the constraint for parameter $other. Returns TRUE if the
+ * constraint is met, FALSE otherwise.
+ *
+ * @param mixed $other Value or object to evaluate.
+ * @return bool
+ */
+ public function matches($other)
+ {
+ $options = array(
+ CURLOPT_URL => $other,
+ CURLOPT_HEADER => true,
+ CURLOPT_TIMEOUT => 1,
+ CURLOPT_RETURNTRANSFER => true
+ );
+
+ $ch = curl_init();
+ curl_setopt_array($ch, $options);
+ @curl_exec($ch);
+ $responseCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
+ curl_close($ch);
+
+ return $this->value === (int) $responseCode;
+ }
+
+ /**
+ * Returns a string representation of the constraint.
+ *
+ * @return string
+ */
+ public function toString()
+ {
+ return 'does not return response code ' . $this->exporter->export($this->value);
+ }
+}?> \ No newline at end of file
diff --git a/tests/PHPUnit/Framework/Fixture.php b/tests/PHPUnit/Framework/Fixture.php
index f61beffbb1..ff5d6cc97a 100644
--- a/tests/PHPUnit/Framework/Fixture.php
+++ b/tests/PHPUnit/Framework/Fixture.php
@@ -8,6 +8,7 @@
namespace Piwik\Tests\Framework;
use Piwik\Access;
+use Piwik\CacheFile;
use Piwik\Common;
use Piwik\Config;
use Piwik\DataAccess\ArchiveTableCreator;
@@ -15,27 +16,34 @@ use Piwik\DataTable\Manager as DataTableManager;
use Piwik\Date;
use Piwik\Db;
use Piwik\DbHelper;
+use Piwik\EventDispatcher;
use Piwik\Log;
use Piwik\Option;
use Piwik\Piwik;
use Piwik\Plugin;
+use Piwik\Plugin\Manager;
use Piwik\Plugins\LanguagesManager\API as APILanguageManager;
use Piwik\Plugins\MobileMessaging\MobileMessaging;
+use Piwik\Plugins\PrivacyManager\DoNotTrackHeaderChecker;
+use Piwik\Plugins\PrivacyManager\IPAnonymizer;
use Piwik\Plugins\ScheduledReports\API as APIScheduledReports;
use Piwik\Plugins\ScheduledReports\ScheduledReports;
use Piwik\Plugins\SitesManager\API as APISitesManager;
use Piwik\Plugins\UserCountry\LocationProvider;
use Piwik\Plugins\UsersManager\API as APIUsersManager;
use Piwik\Plugins\UsersManager\UsersManager;
+use Piwik\Registry;
use Piwik\ReportRenderer;
+use Piwik\SettingsPiwik;
+use Piwik\SettingsServer;
use Piwik\Site;
+use Piwik\Tests\Framework\Mock\FakeAccess;
use Piwik\Tests\Framework\TestCase\SystemTestCase;
use Piwik\Tracker\Cache;
use Piwik\Translate;
use Piwik\Url;
use PHPUnit_Framework_Assert;
use Piwik_TestingEnvironment;
-use FakeAccess;
use PiwikTracker;
use Piwik_LocalTracker;
use Piwik\Updater;
@@ -91,7 +99,7 @@ class Fixture extends \PHPUnit_Framework_Assert
*/
protected static function getPythonBinary()
{
- if (\Piwik\SettingsServer::isWindows()) {
+ if (SettingsServer::isWindows()) {
return "C:\Python27\python.exe";
}
@@ -172,7 +180,7 @@ class Fixture extends \PHPUnit_Framework_Assert
DbHelper::createTables();
- \Piwik\Plugin\Manager::getInstance()->unloadPlugins();
+ Manager::getInstance()->unloadPlugins();
} catch (Exception $e) {
static::fail("TEST INITIALIZATION FAILED: " . $e->getMessage() . "\n" . $e->getTraceAsString());
@@ -214,12 +222,12 @@ class Fixture extends \PHPUnit_Framework_Assert
FakeAccess::$superUserLogin = 'superUserLogin';
- \Piwik\SettingsPiwik::$cachedKnownSegmentsToArchive = null;
- \Piwik\CacheFile::$invalidateOpCacheBeforeRead = true;
+ SettingsPiwik::$cachedKnownSegmentsToArchive = null;
+ CacheFile::$invalidateOpCacheBeforeRead = true;
if ($this->configureComponents) {
- \Piwik\Plugins\PrivacyManager\IPAnonymizer::deactivate();
- \Piwik\Plugins\PrivacyManager\DoNotTrackHeaderChecker::deactivate();
+ IPAnonymizer::deactivate();
+ DoNotTrackHeaderChecker::deactivate();
}
if ($this->createSuperUser) {
@@ -295,15 +303,15 @@ class Fixture extends \PHPUnit_Framework_Assert
Config::getInstance()->clear();
ArchiveTableCreator::clear();
\Piwik\Plugins\ScheduledReports\API::$cache = array();
- \Piwik\Registry::unsetInstance();
- \Piwik\EventDispatcher::getInstance()->clearAllObservers();
+ Registry::unsetInstance();
+ EventDispatcher::getInstance()->clearAllObservers();
$_GET = $_REQUEST = array();
Translate::unloadEnglishTranslation();
Config::unsetInstance();
- \Piwik\Config::getInstance()->Plugins; // make sure Plugins exists in a config object for next tests that use Plugin\Manager
+ Config::getInstance()->Plugins; // make sure Plugins exists in a config object for next tests that use Plugin\Manager
// since Plugin\Manager uses getFromGlobalConfig which doesn't init the config object
}
@@ -314,15 +322,15 @@ class Fixture extends \PHPUnit_Framework_Assert
}
DbHelper::createTables();
- $pluginsManager = \Piwik\Plugin\Manager::getInstance();
+ $pluginsManager = Manager::getInstance();
$plugins = $testEnvironment->getCoreAndSupportedPlugins();
// make sure the plugin that executed this method is included in the plugins to load
$extraPlugins = array_merge($extraPluginsToLoad, array(
- \Piwik\Plugin::getPluginNameFromBacktrace(debug_backtrace()),
- \Piwik\Plugin::getPluginNameFromNamespace($testCaseClass),
- \Piwik\Plugin::getPluginNameFromNamespace(get_called_class())
+ Plugin::getPluginNameFromBacktrace(debug_backtrace()),
+ Plugin::getPluginNameFromNamespace($testCaseClass),
+ Plugin::getPluginNameFromNamespace(get_called_class())
));
foreach ($extraPlugins as $pluginName) {
if (empty($pluginName)) {
@@ -346,7 +354,7 @@ class Fixture extends \PHPUnit_Framework_Assert
public static function installAndActivatePlugins()
{
- $pluginsManager = \Piwik\Plugin\Manager::getInstance();
+ $pluginsManager = Manager::getInstance();
// Install plugins
$messages = $pluginsManager->installLoadedPlugins();
@@ -366,12 +374,12 @@ class Fixture extends \PHPUnit_Framework_Assert
public static function unloadAllPlugins()
{
try {
- $manager = \Piwik\Plugin\Manager::getInstance();
+ $manager = Manager::getInstance();
$plugins = $manager->getLoadedPlugins();
foreach ($plugins as $plugin) {
$plugin->uninstall();
}
- \Piwik\Plugin\Manager::getInstance()->unloadPlugins();
+ Manager::getInstance()->unloadPlugins();
} catch (Exception $e) {
}
}
diff --git a/tests/PHPUnit/Framework/TestCase/SystemTestCase.php b/tests/PHPUnit/Framework/TestCase/SystemTestCase.php
index e153dc5f2f..96b60cab0a 100755
--- a/tests/PHPUnit/Framework/TestCase/SystemTestCase.php
+++ b/tests/PHPUnit/Framework/TestCase/SystemTestCase.php
@@ -16,6 +16,7 @@ use Piwik\DataAccess\ArchiveTableCreator;
use Piwik\Db;
use Piwik\DbHelper;
use Piwik\ReportRenderer;
+use Piwik\Tests\Framework\Constraint\ResponseCode;
use Piwik\Tests\Framework\TestRequest\ApiTestConfig;
use Piwik\Tests\Framework\TestRequest\Collection;
use Piwik\Tests\Framework\TestRequest\Response;
@@ -578,4 +579,9 @@ abstract class SystemTestCase extends PHPUnit_Framework_TestCase
$this->markTestSkipped('Sometimes fail on php 5.3');
}
}
+
+ public function assertResponseCode($expectedResponseCode, $url, $message = '')
+ {
+ self::assertThat($url, new ResponseCode($expectedResponseCode), $message);
+ }
}
diff --git a/tests/PHPUnit/Integration/AccessTest.php b/tests/PHPUnit/Integration/AccessTest.php
index 94143fff5e..cb2d201c84 100644
--- a/tests/PHPUnit/Integration/AccessTest.php
+++ b/tests/PHPUnit/Integration/AccessTest.php
@@ -5,16 +5,18 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+
+namespace Piwik\Tests\Integration;
+
+use Exception;
use Piwik\Access;
use Piwik\AuthResult;
use Piwik\Tests\Framework\TestCase\IntegrationTestCase;
/**
- * Class Core_AccessTest
- *
* @group Core
*/
-class Core_AccessTest extends IntegrationTestCase
+class AccessTest extends IntegrationTestCase
{
public function setUp()
{
@@ -88,7 +90,7 @@ class Core_AccessTest extends IntegrationTestCase
}
/**
- * @expectedException Piwik\NoAccessException
+ * @expectedException \Piwik\NoAccessException
*/
public function testCheckUserHasSuperUserAccessWithEmptyAccess()
{
@@ -104,7 +106,7 @@ class Core_AccessTest extends IntegrationTestCase
}
/**
- * @expectedException Piwik\NoAccessException
+ * @expectedException \Piwik\NoAccessException
*/
public function testCheckUserHasSomeAdminAccessWithEmptyAccess()
{
@@ -134,7 +136,7 @@ class Core_AccessTest extends IntegrationTestCase
}
/**
- * @expectedException Piwik\NoAccessException
+ * @expectedException \Piwik\NoAccessException
*/
public function testCheckUserHasSomeViewAccessWithEmptyAccess()
{
@@ -164,7 +166,7 @@ class Core_AccessTest extends IntegrationTestCase
}
/**
- * @expectedException Piwik\NoAccessException
+ * @expectedException \Piwik\NoAccessException
*/
public function testCheckUserHasViewAccessWithEmptyAccessNoSiteIdsGiven()
{
@@ -208,7 +210,7 @@ class Core_AccessTest extends IntegrationTestCase
}
/**
- * @expectedException Piwik\NoAccessException
+ * @expectedException \Piwik\NoAccessException
*/
public function testCheckUserHasViewAccessWithSomeAccessFailure()
{
@@ -232,7 +234,7 @@ class Core_AccessTest extends IntegrationTestCase
}
/**
- * @expectedException Piwik\NoAccessException
+ * @expectedException \Piwik\NoAccessException
*/
public function testCheckUserHasAdminAccessWithEmptyAccessNoSiteIdsGiven()
{
@@ -273,7 +275,7 @@ class Core_AccessTest extends IntegrationTestCase
}
/**
- * @expectedException Piwik\NoAccessException
+ * @expectedException \Piwik\NoAccessException
*/
public function testCheckUserHasAdminAccessWithSomeAccessFailure()
{
@@ -304,8 +306,8 @@ class Core_AccessTest extends IntegrationTestCase
public function testReloadAccessWithMockedAuthValid()
{
- $mock = $this->getMock('\\Piwik\\Auth', array('authenticate', 'getName', 'getTokenAuthSecret', 'getLogin', 'setTokenAuth', 'setLogin',
- 'setPassword', 'setPasswordHash'));
+ $mock = $this->getMock('Piwik\\Auth', array('authenticate', 'getName', 'getTokenAuthSecret', 'getLogin', 'setTokenAuth', 'setLogin',
+ 'setPassword', 'setPasswordHash'));
$mock->expects($this->once())
->method('authenticate')
->will($this->returnValue(new AuthResult(AuthResult::SUCCESS, 'login', 'token')));
@@ -324,7 +326,7 @@ class Core_AccessTest extends IntegrationTestCase
$this->assertFalse(Access::getInstance()->hasSuperUserAccess());
Access::doAsSuperUser(function () {
- Core_AccessTest::assertTrue(Access::getInstance()->hasSuperUserAccess());
+ AccessTest::assertTrue(Access::getInstance()->hasSuperUserAccess());
});
$this->assertFalse(Access::getInstance()->hasSuperUserAccess());
@@ -365,9 +367,9 @@ class Core_AccessTest extends IntegrationTestCase
Access::doAsSuperUser(function () {
$access = Access::getInstance();
- Core_AccessTest::assertTrue($access->hasSuperUserAccess());
+ AccessTest::assertTrue($access->hasSuperUserAccess());
$access->reloadAccess();
- Core_AccessTest::assertTrue($access->hasSuperUserAccess());
+ AccessTest::assertTrue($access->hasSuperUserAccess());
});
}
-} \ No newline at end of file
+}
diff --git a/tests/PHPUnit/Integration/ArchiveProcessingTest.php b/tests/PHPUnit/Integration/ArchiveProcessingTest.php
index 6514a10134..7c9f24e096 100644
--- a/tests/PHPUnit/Integration/ArchiveProcessingTest.php
+++ b/tests/PHPUnit/Integration/ArchiveProcessingTest.php
@@ -6,6 +6,9 @@
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+namespace Piwik\Tests\Integration;
+
+use Exception;
use Piwik\Access;
use Piwik\ArchiveProcessor;
use Piwik\ArchiveProcessor\Rules;
@@ -20,18 +23,21 @@ use Piwik\Plugins\SitesManager\API;
use Piwik\Segment;
use Piwik\SettingsServer;
use Piwik\Site;
+use Piwik\Tests\Framework\Mock\FakeAccess;
use Piwik\Tests\Framework\TestCase\IntegrationTestCase;
-class Core_ArchiveProcessorTest extends ArchiveProcessor\Loader {
-
+class ArchiveProcessorTest extends ArchiveProcessor\Loader
+{
public function getParams()
{
return $this->params;
}
+
public function public_getMinTimeArchiveProcessed()
{
return $this->getMinTimeArchiveProcessed();
}
+
public function public_isArchiveTemporary()
{
return $this->isArchiveTemporary();
@@ -39,11 +45,9 @@ class Core_ArchiveProcessorTest extends ArchiveProcessor\Loader {
}
/**
- * Class Core_ArchiveProcessorTest
- *
* @group Core
*/
-class Core_ArchiveProcessingTest extends IntegrationTestCase
+class ArchiveProcessingTest extends IntegrationTestCase
{
public function setUp()
{
@@ -90,7 +94,7 @@ class Core_ArchiveProcessingTest extends IntegrationTestCase
* @param string $periodLabel
* @param string $dateLabel
* @param string $siteTimezone
- * @return \Core_ArchiveProcessorTest
+ * @return ArchiveProcessorTest
*/
private function _createArchiveProcessor($periodLabel, $dateLabel, $siteTimezone)
{
@@ -100,12 +104,11 @@ class Core_ArchiveProcessingTest extends IntegrationTestCase
$segment = new Segment('', $site->getId());
$params = new ArchiveProcessor\Parameters($site, $period, $segment);
- return new \Core_ArchiveProcessorTest($params);
+ return new ArchiveProcessorTest($params);
}
/**
* test of validity of an archive, for a month not finished
- * @group Core
*/
public function testInitCurrentMonth()
{
@@ -138,7 +141,6 @@ class Core_ArchiveProcessingTest extends IntegrationTestCase
/**
* test of validity of an archive, for a month in the past
- * @group Core
*/
public function testInitDayInPast()
{
@@ -155,7 +157,6 @@ class Core_ArchiveProcessingTest extends IntegrationTestCase
/**
* test of validity of an archive, for a non UTC date in the past
- * @group Core
*/
public function testInitDayInPastNonUTCWebsite()
{
@@ -172,7 +173,6 @@ class Core_ArchiveProcessingTest extends IntegrationTestCase
/**
* test of validity of an archive, for a non UTC month in the past
- * @group Core
*/
public function testInitMonthInPastNonUTCWebsite()
{
@@ -189,7 +189,6 @@ class Core_ArchiveProcessingTest extends IntegrationTestCase
/**
* test of validity of an archive, for today's archive
- * @group Core
*/
public function testInitToday()
{
@@ -222,7 +221,6 @@ class Core_ArchiveProcessingTest extends IntegrationTestCase
/**
* test of validity of an archive, for today's archive with european timezone
- * @group Core
*/
public function testInitTodayEurope()
{
@@ -263,7 +261,6 @@ class Core_ArchiveProcessingTest extends IntegrationTestCase
/**
* test of validity of an archive, for today's archive with toronto's timezone
- * @group Core
*/
public function testInitTodayToronto()
{
@@ -303,7 +300,6 @@ class Core_ArchiveProcessingTest extends IntegrationTestCase
/**
* Testing batch insert
- * @group Core
*/
public function testTableInsertBatch()
{
@@ -351,7 +347,6 @@ class Core_ArchiveProcessingTest extends IntegrationTestCase
/**
* Testing plain inserts
- * @group Core
*/
public function testTableInsertBatchIterate()
{
@@ -374,7 +369,6 @@ class Core_ArchiveProcessingTest extends IntegrationTestCase
/**
* Testing batch insert (BLOB)
- * @group Core
*/
public function testTableInsertBatchBlob()
{
@@ -405,7 +399,6 @@ class Core_ArchiveProcessingTest extends IntegrationTestCase
/**
* Testing plain inserts (BLOB)
- * @group Core
*/
public function testTableInsertBatchIterateBlob()
{
diff --git a/tests/PHPUnit/Integration/AssetManager/UIAssetMinifierTest.php b/tests/PHPUnit/Integration/AssetManager/UIAssetMinifierTest.php
index 968c68c35f..e1dc6c4a3c 100644
--- a/tests/PHPUnit/Integration/AssetManager/UIAssetMinifierTest.php
+++ b/tests/PHPUnit/Integration/AssetManager/UIAssetMinifierTest.php
@@ -1,5 +1,4 @@
<?php
-
/**
* Piwik - free/libre analytics platform
*
@@ -7,12 +6,13 @@
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+namespace Piwik\Tests\Integration\AssetManager;
+
use Piwik\AssetManager\UIAsset\OnDiskUIAsset;
use Piwik\AssetManager\UIAssetMinifier;
-class Piwik_Test_UIAssetMinifierTest extends PHPUnit_Framework_TestCase
+class UIAssetMinifierTest extends \PHPUnit_Framework_TestCase
{
-
/**
* @var UIAssetMinifier
*/
diff --git a/tests/PHPUnit/Integration/CronArchive/FixedSiteIdsTest.php b/tests/PHPUnit/Integration/CronArchive/FixedSiteIdsTest.php
index 259df6fc9e..3f74af2bec 100644
--- a/tests/PHPUnit/Integration/CronArchive/FixedSiteIdsTest.php
+++ b/tests/PHPUnit/Integration/CronArchive/FixedSiteIdsTest.php
@@ -6,12 +6,14 @@
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+namespace Piwik\Tests\Integration\CronArchive;
+
use Piwik\CronArchive\FixedSiteIds;
/**
* @group Core
*/
-class FixedSiteIdsTest extends PHPUnit_Framework_TestCase
+class FixedSiteIdsTest extends \PHPUnit_Framework_TestCase
{
/**
* @var FixedSiteIds
@@ -50,5 +52,4 @@ class FixedSiteIdsTest extends PHPUnit_Framework_TestCase
$this->assertNull($this->fixedSiteIds->getNextSiteId());
$this->assertEquals(4, $this->fixedSiteIds->getNumProcessedWebsites());
}
-
-} \ No newline at end of file
+}
diff --git a/tests/PHPUnit/Integration/CronArchive/SharedSiteIdsTest.php b/tests/PHPUnit/Integration/CronArchive/SharedSiteIdsTest.php
index 43962ff17b..6e3959ceda 100644
--- a/tests/PHPUnit/Integration/CronArchive/SharedSiteIdsTest.php
+++ b/tests/PHPUnit/Integration/CronArchive/SharedSiteIdsTest.php
@@ -6,6 +6,8 @@
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+namespace Piwik\Tests\Integration;
+
use Piwik\CronArchive\SharedSiteIds;
use Piwik\Tests\Framework\TestCase\IntegrationTestCase;
@@ -111,5 +113,4 @@ class SharedSiteIdsTest extends IntegrationTestCase
$this->assertEquals(4, $this->sharedSiteIds->getNumProcessedWebsites());
$this->assertEquals(array(), $this->sharedSiteIds->getAllSiteIdsToArchive());
}
-
-} \ No newline at end of file
+}
diff --git a/tests/PHPUnit/Integration/DataAccess/ModelTest.php b/tests/PHPUnit/Integration/DataAccess/ModelTest.php
index 270253b82a..1ec10bdebf 100644
--- a/tests/PHPUnit/Integration/DataAccess/ModelTest.php
+++ b/tests/PHPUnit/Integration/DataAccess/ModelTest.php
@@ -6,6 +6,8 @@
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+namespace Piwik\Tests\Integration\DataAccess;
+
use Piwik\Tests\Framework\TestCase\IntegrationTestCase;
use Piwik\DataAccess\Model;
@@ -13,7 +15,7 @@ use Piwik\DataAccess\Model;
* @group Core
* @group DataAccess
*/
-class Core_DataAccess_ModelTest extends IntegrationTestCase
+class ModelTest extends IntegrationTestCase
{
/**
* @var Model
@@ -45,5 +47,4 @@ class Core_DataAccess_ModelTest extends IntegrationTestCase
$this->assertEquals($expectedId, $id);
}
-
-} \ No newline at end of file
+}
diff --git a/tests/PHPUnit/Integration/DbTest.php b/tests/PHPUnit/Integration/DbTest.php
index c7a8e465eb..e450ec7bae 100644
--- a/tests/PHPUnit/Integration/DbTest.php
+++ b/tests/PHPUnit/Integration/DbTest.php
@@ -5,18 +5,18 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+
+namespace Piwik\Tests\Integration;
+
use Piwik\Common;
use Piwik\Db;
use Piwik\Tests\Framework\TestCase\IntegrationTestCase;
/**
- * Class Core_DbTest
- *
* @group Core
*/
-class Core_DbTest extends IntegrationTestCase
+class DbTest extends IntegrationTestCase
{
-
public function test_getColumnNamesFromTable()
{
$this->assertColumnNames('access', array('login', 'idsite', 'access'));
@@ -29,5 +29,4 @@ class Core_DbTest extends IntegrationTestCase
$this->assertEquals($expectedColumnNames, $colmuns);
}
-
-} \ No newline at end of file
+}
diff --git a/tests/PHPUnit/Core/API/DocumentationGeneratorTest.php b/tests/PHPUnit/Integration/DocumentationGeneratorTest.php
index 5fb119f6a0..253844cd18 100644
--- a/tests/PHPUnit/Core/API/DocumentationGeneratorTest.php
+++ b/tests/PHPUnit/Integration/DocumentationGeneratorTest.php
@@ -1,16 +1,17 @@
<?php
/**
- * Copyright (C) Piwik PRO - All rights reserved.
+ * Piwik - free/libre analytics platform
*
- * Using this code requires that you first get a license from Piwik PRO.
- * Unauthorized copying of this file, via any medium is strictly prohibited.
- *
- * @link http://piwik.pro
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+
+namespace Piwik\Tests\Integration;
+
+use PHPUnit_Framework_TestCase;
use Piwik\API\DocumentationGenerator;
use Piwik\API\Proxy;
use Piwik\EventDispatcher;
-use Piwik\Plugin\Manager as PluginManager;
/**
* @group Core
diff --git a/tests/PHPUnit/Integration/HttpTest.php b/tests/PHPUnit/Integration/HttpTest.php
index 68988d78a9..a5d62b3060 100644
--- a/tests/PHPUnit/Integration/HttpTest.php
+++ b/tests/PHPUnit/Integration/HttpTest.php
@@ -5,13 +5,17 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+
+namespace Piwik\Tests\Integration;
+
use Piwik\Http;
use Piwik\Tests\Framework\Fixture;
/**
+ * @group Core
* @group HttpTest
*/
-class Piwik_Test_HttpTest extends PHPUnit_Framework_TestCase
+class HttpTest extends \PHPUnit_Framework_TestCase
{
/**
* Dataprovider for testFetchRemoteFile
@@ -26,8 +30,6 @@ class Piwik_Test_HttpTest extends PHPUnit_Framework_TestCase
}
/**
- * @group Core
- *
* @dataProvider getMethodsToTest
*/
public function testFetchRemoteFile($method)
@@ -37,9 +39,6 @@ class Piwik_Test_HttpTest extends PHPUnit_Framework_TestCase
$this->assertTrue(strpos($result, 'Piwik') !== false);
}
- /**
- * @group Core
- */
public function testFetchApiLatestVersion()
{
$destinationPath = PIWIK_USER_PATH . '/tmp/latest/LATEST';
@@ -48,9 +47,6 @@ class Piwik_Test_HttpTest extends PHPUnit_Framework_TestCase
$this->assertGreaterThan(0, filesize($destinationPath));
}
- /**
- * @group Core
- */
public function testFetchLatestZip()
{
$destinationPath = PIWIK_USER_PATH . '/tmp/latest/latest.zip';
@@ -60,7 +56,6 @@ class Piwik_Test_HttpTest extends PHPUnit_Framework_TestCase
}
/**
- * @group Core
* @dataProvider getMethodsToTest
*/
public function testCustomByteRange($method)
@@ -88,8 +83,6 @@ class Piwik_Test_HttpTest extends PHPUnit_Framework_TestCase
}
/**
- * @group Core
- *
* @dataProvider getMethodsToTest
*/
public function testHEADOperation($method)
diff --git a/tests/PHPUnit/Integration/JsProxyTest.php b/tests/PHPUnit/Integration/JsProxyTest.php
index 92a6461acc..e968fec50e 100644
--- a/tests/PHPUnit/Integration/JsProxyTest.php
+++ b/tests/PHPUnit/Integration/JsProxyTest.php
@@ -6,14 +6,16 @@
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+namespace Piwik\Tests\Integration;
+
use Piwik\Tests\Framework\Fixture;
-class Test_Piwik_JsProxy extends PHPUnit_Framework_TestCase
+/**
+ * @group Core
+ */
+class JsProxyTest extends \PHPUnit_Framework_TestCase
{
- /**
- * @group Core
- */
- function testPiwikJs()
+ public function testPiwikJs()
{
$curlHandle = curl_init();
curl_setopt($curlHandle, CURLOPT_URL, $this->getStaticSrvUrl() . '/js/');
@@ -28,10 +30,7 @@ class Test_Piwik_JsProxy extends PHPUnit_Framework_TestCase
$this->assertEquals($piwik_js, $fullResponse, 'script content');
}
- /**
- * @group Core
- */
- function testPiwikJsNoComment()
+ public function testPiwikJsNoComment()
{
$curlHandle = curl_init();
curl_setopt($curlHandle, CURLOPT_URL, $this->getStaticSrvUrl() . '/js/tracker.php');
@@ -47,10 +46,7 @@ class Test_Piwik_JsProxy extends PHPUnit_Framework_TestCase
$this->assertEquals($piwikNoCommentJs, $fullResponse, 'script content (if comment shows, $byteStart value in /js/tracker.php)');
}
- /**
- * @group Core
- */
- function testPiwikPhp()
+ public function testPiwikPhp()
{
$curlHandle = curl_init();
$url = $this->getStaticSrvUrl() . '/js/?idsite=1';
diff --git a/tests/PHPUnit/Integration/LogTest.php b/tests/PHPUnit/Integration/LogTest.php
index 8934e31e85..386b348fda 100644
--- a/tests/PHPUnit/Integration/LogTest.php
+++ b/tests/PHPUnit/Integration/LogTest.php
@@ -5,6 +5,10 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+
+namespace Piwik\Tests\Integration;
+
+use Exception;
use Piwik\Common;
use Piwik\Config;
use Piwik\Db;
@@ -17,12 +21,10 @@ use Piwik\Tests\Framework\TestCase\IntegrationTestCase;
require_once PIWIK_INCLUDE_PATH . '/tests/resources/TestPluginLogClass.php';
/**
- * Class Core_LogTest
- *
* @group Core
* @group Core_LogTest
*/
-class Core_LogTest extends IntegrationTestCase
+class LogTest extends IntegrationTestCase
{
const TESTMESSAGE = 'test%smessage';
const STRING_MESSAGE_FORMAT = '[%tag%] %message%';
@@ -32,9 +34,9 @@ class Core_LogTest extends IntegrationTestCase
'screen' => 'dummy error message<br />
<br />
--&gt; To temporarily debug this error further, set const PIWIK_PRINT_ERROR_BACKTRACE=true; in index.php',
- 'file' => '[Core_LogTest] LogTest.php(166): dummy error message
+ 'file' => '[Piwik\Tests\Integration\LogTest] LogTest.php(160): dummy error message
dummy backtrace',
- 'database' => '[Core_LogTest] LogTest.php(166): dummy error message
+ 'database' => '[Piwik\Tests\Integration\LogTest] LogTest.php(160): dummy error message
dummy backtrace'
);
@@ -46,9 +48,9 @@ dummy backtrace'
<br /><br />Backtrace --&gt;<div style="font-family:Courier;font-size:10pt"><br />
dummy backtrace</div><br />
</pre></div><br />',
- 'file' => '[Core_LogTest] dummyerrorfile.php(145): Unknown error (102) - dummy error string
+ 'file' => '[Piwik\Tests\Integration\LogTest] dummyerrorfile.php(145): Unknown error (102) - dummy error string
dummy backtrace',
- 'database' => '[Core_LogTest] dummyerrorfile.php(145): Unknown error (102) - dummy error string
+ 'database' => '[Piwik\Tests\Integration\LogTest] dummyerrorfile.php(145): Unknown error (102) - dummy error string
dummy backtrace'
);
@@ -101,8 +103,6 @@ dummy backtrace'
}
/**
- * @group Core
- *
* @dataProvider getBackendsToTest
*/
public function testLoggingWorksWhenMessageIsString($backend)
@@ -114,12 +114,10 @@ dummy backtrace'
$this->screenOutput = ob_get_contents();
ob_end_clean();
- $this->checkBackend($backend, self::TESTMESSAGE, $formatMessage = true, $tag = 'Core_LogTest');
+ $this->checkBackend($backend, self::TESTMESSAGE, $formatMessage = true, $tag = __CLASS__);
}
/**
- * @group Core
- *
* @dataProvider getBackendsToTest
*/
public function testLoggingWorksWhenMessageIsSprintfString($backend)
@@ -131,12 +129,10 @@ dummy backtrace'
$this->screenOutput = ob_get_contents();
ob_end_clean();
- $this->checkBackend($backend, sprintf(self::TESTMESSAGE, " subst "), $formatMessage = true, $tag = 'Core_LogTest');
+ $this->checkBackend($backend, sprintf(self::TESTMESSAGE, " subst "), $formatMessage = true, $tag = __CLASS__);
}
/**
- * @group Core
- *
* @dataProvider getBackendsToTest
*/
public function testLoggingWorksWhenMessageIsError($backend)
@@ -149,13 +145,11 @@ dummy backtrace'
$this->screenOutput = ob_get_contents();
ob_end_clean();
- $this->checkBackend($backend, self::$expectedErrorOutput[$backend], $formatMessage = false, $tag = 'Core_LogTest');
+ $this->checkBackend($backend, self::$expectedErrorOutput[$backend], $formatMessage = false, $tag = __CLASS__);
$this->checkBackend('screen', self::$expectedErrorOutput['screen']); // errors should always written to the screen
}
/**
- * @group Core
- *
* @dataProvider getBackendsToTest
*/
public function testLoggingWorksWhenMessageIsException($backend)
@@ -168,13 +162,11 @@ dummy backtrace'
$this->screenOutput = ob_get_contents();
ob_end_clean();
- $this->checkBackend($backend, self::$expectedExceptionOutput[$backend], $formatMessage = false, $tag = 'Core_LogTest');
+ $this->checkBackend($backend, self::$expectedExceptionOutput[$backend], $formatMessage = false, $tag = __CLASS__);
$this->checkBackend('screen', self::$expectedExceptionOutput['screen']); // errors should always written to the screen
}
/**
- * @group Core
- *
* @dataProvider getBackendsToTest
*/
public function testLoggingCorrectlyIdentifiesPlugin($backend)
@@ -190,8 +182,6 @@ dummy backtrace'
}
/**
- * @group Core
- *
* @dataProvider getBackendsToTest
*/
public function testLogMessagesIgnoredWhenNotWithinLevel($backend)
@@ -208,7 +198,6 @@ dummy backtrace'
}
/**
- * @group Core
* @dataProvider getBackendsToTest
*/
public function testLogMessagesAreTrimmed($backend)
@@ -300,5 +289,4 @@ dummy backtrace'
$path = PIWIK_INCLUDE_PATH . '/tmp/logs/piwik.test.log';
return $path;
}
-
-} \ No newline at end of file
+}
diff --git a/tests/PHPUnit/Integration/OptionTest.php b/tests/PHPUnit/Integration/OptionTest.php
index 0e6b8cba7d..616202f05f 100644
--- a/tests/PHPUnit/Integration/OptionTest.php
+++ b/tests/PHPUnit/Integration/OptionTest.php
@@ -5,22 +5,20 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+
+namespace Piwik\Tests\Integration;
+
use Piwik\Common;
use Piwik\Db;
use Piwik\Option;
use Piwik\Tests\Framework\TestCase\IntegrationTestCase;
/**
- * Class Core_OptionTest
- *
* @group Core
* @group Core_OptionTest
*/
-class Core_OptionTest extends IntegrationTestCase
+class OptionTest extends IntegrationTestCase
{
- /**
- * @group Core
- */
public function testGet()
{
// empty table, expect false (i.e., not found)
@@ -39,9 +37,6 @@ class Core_OptionTest extends IntegrationTestCase
$this->assertFalse(Option::get('anonymous_defaultReport'));
}
- /**
- * @group Core
- */
public function testGetOption()
{
// empty table, expect false (i.e., not found)
@@ -60,9 +55,6 @@ class Core_OptionTest extends IntegrationTestCase
$this->assertFalse(Option::get('anonymous_defaultReport'));
}
- /**
- * @group Core
- */
public function testSet()
{
// empty table, expect false (i.e., not found)
@@ -73,9 +65,6 @@ class Core_OptionTest extends IntegrationTestCase
$this->assertSame('1', Option::get('anonymous_defaultReport'));
}
- /**
- * @group Core
- */
public function testSetOption()
{
// empty table, expect false (i.e., not found)
@@ -86,9 +75,6 @@ class Core_OptionTest extends IntegrationTestCase
$this->assertSame('1', Option::get('anonymous_defaultReport'));
}
- /**
- * @group Core
- */
public function testDelete()
{
// empty table, expect false (i.e., not found)
@@ -121,9 +107,6 @@ class Core_OptionTest extends IntegrationTestCase
$this->assertFalse(Option::get('admin_defaultReport'));
}
- /**
- * @group Core
- */
public function testDeleteLike()
{
// empty table, expect false (i.e., not found)
diff --git a/tests/PHPUnit/Integration/PiwikTest.php b/tests/PHPUnit/Integration/PiwikTest.php
index 46cc79f0d2..252c08cd78 100644
--- a/tests/PHPUnit/Integration/PiwikTest.php
+++ b/tests/PHPUnit/Integration/PiwikTest.php
@@ -5,6 +5,9 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+
+namespace Piwik\Tests\Integration;
+
use Piwik\Access;
use Piwik\Filesystem;
use Piwik\MetricsFormatter;
@@ -14,11 +17,9 @@ use Piwik\Translate;
use Piwik\Tests\Framework\TestCase\IntegrationTestCase;
/**
- * Class Core_PiwikTest
- *
* @group Core
*/
-class Core_PiwikTest extends IntegrationTestCase
+class PiwikTest extends IntegrationTestCase
{
/**
* Dataprovider for testIsNumericValid
diff --git a/tests/PHPUnit/Integration/Plugin/SettingsTest.php b/tests/PHPUnit/Integration/Plugin/SettingsTest.php
index ffec54ce58..763ce4f09a 100644
--- a/tests/PHPUnit/Integration/Plugin/SettingsTest.php
+++ b/tests/PHPUnit/Integration/Plugin/SettingsTest.php
@@ -6,9 +6,12 @@
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+namespace Piwik\Tests\Integration\Plugin;
+
use Piwik\Access;
use Piwik\Plugin\Settings as PluginSettings;
use Piwik\Settings\Setting;
+use Piwik\Tests\Framework\Mock\FakeAccess;
use Piwik\Tests\Framework\TestCase\IntegrationTestCase;
class CorePluginSettingsTest extends \Piwik\Plugins\ExampleSettingsPlugin\Settings {
@@ -25,11 +28,10 @@ class CorePluginSettingsTest extends \Piwik\Plugins\ExampleSettingsPlugin\Settin
}
/**
- * Class Core_Plugin_SettingsTest
* @group Core
* @group PluginSettings
*/
-class Core_Plugin_SettingsTest extends IntegrationTestCase
+class SettingsTest extends IntegrationTestCase
{
/**
* @var CorePluginSettingsTest
@@ -604,7 +606,7 @@ class Core_Plugin_SettingsTest extends IntegrationTestCase
public function test_construct_shouldDetectTheNameOfThePluginAutomatically_IfPluginNameNotGiven()
{
- $setting = new Piwik\Plugins\ExampleSettingsPlugin\Settings();
+ $setting = new \Piwik\Plugins\ExampleSettingsPlugin\Settings();
$this->assertEquals('ExampleSettingsPlugin', $setting->getPluginName());
}
@@ -671,4 +673,4 @@ class Core_Plugin_SettingsTest extends IntegrationTestCase
{
return new CorePluginSettingsTest('ExampleSettingsPlugin');
}
-} \ No newline at end of file
+}
diff --git a/tests/PHPUnit/Integration/ReleaseCheckListTest.php b/tests/PHPUnit/Integration/ReleaseCheckListTest.php
index 4362dacca1..2c4ab2a00d 100644
--- a/tests/PHPUnit/Integration/ReleaseCheckListTest.php
+++ b/tests/PHPUnit/Integration/ReleaseCheckListTest.php
@@ -5,13 +5,24 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+
+namespace Piwik\Tests\Integration;
+
+use Exception;
+use Piwik\Config;
use Piwik\Filesystem;
+use Piwik\Plugin\Manager;
+use RecursiveDirectoryIterator;
+use RecursiveIteratorIterator;
/**
+ * @group Core
* @group ReleaseCheckListTest
*/
-class Test_Piwik_ReleaseCheckListTest extends PHPUnit_Framework_TestCase
+class ReleaseCheckListTest extends \PHPUnit_Framework_TestCase
{
+ private $globalConfig;
+
public function setUp()
{
$this->globalConfig = _parse_ini_file(PIWIK_PATH_TEST_TO_ROOT . '/config/global.ini.php', true);
@@ -19,9 +30,6 @@ class Test_Piwik_ReleaseCheckListTest extends PHPUnit_Framework_TestCase
parent::setUp();
}
- /**
- * @group Core
- */
public function test_icoFilesIconsShouldBeInPngFormat()
{
$files = Filesystem::globr(PIWIK_INCLUDE_PATH . '/plugins', '*.ico');
@@ -30,9 +38,6 @@ class Test_Piwik_ReleaseCheckListTest extends PHPUnit_Framework_TestCase
$this->checkFilesAreInPngFormat($files);
}
- /**
- * @group Core
- */
public function test_pngFilesIconsShouldBeInPngFormat()
{
$files = Filesystem::globr(PIWIK_INCLUDE_PATH . '/plugins', '*.png');
@@ -41,9 +46,6 @@ class Test_Piwik_ReleaseCheckListTest extends PHPUnit_Framework_TestCase
$this->checkFilesAreInPngFormat($files);
}
- /**
- * @group Core
- */
public function test_gifFilesIconsShouldBeInGifFormat()
{
$files = Filesystem::globr(PIWIK_INCLUDE_PATH . '/plugins', '*.gif');
@@ -52,9 +54,6 @@ class Test_Piwik_ReleaseCheckListTest extends PHPUnit_Framework_TestCase
$this->checkFilesAreInGifFormat($files);
}
- /**
- * @group Core
- */
public function test_jpgImagesShouldBeInJpgFormat()
{
$files = Filesystem::globr(PIWIK_INCLUDE_PATH . '/plugins', '*.jpg');
@@ -67,9 +66,6 @@ class Test_Piwik_ReleaseCheckListTest extends PHPUnit_Framework_TestCase
$this->checkFilesAreInJpgFormat($files);
}
- /**
- * @group Core
- */
public function testCheckThatConfigurationValuesAreProductionValues()
{
$this->_checkEqual(array('Debug' => 'always_archive_data_day'), '0');
@@ -106,9 +102,6 @@ class Test_Piwik_ReleaseCheckListTest extends PHPUnit_Framework_TestCase
$this->assertEquals($valueExpected, $value, "$section -> $optionName was '" . var_export($value, true) . "', expected '" . var_export($valueExpected, true) . "'");
}
- /**
- * @group Core
- */
public function testTemplatesDontContainDebug()
{
$patternFailIfFound = 'dump(';
@@ -123,9 +116,6 @@ class Test_Piwik_ReleaseCheckListTest extends PHPUnit_Framework_TestCase
}
}
- /**
- * @group Core
- */
public function testCheckThatGivenPluginsAreDisabledByDefault()
{
$pluginsShouldBeDisabled = array(
@@ -141,7 +131,6 @@ class Test_Piwik_ReleaseCheckListTest extends PHPUnit_Framework_TestCase
/**
* test that the profiler is disabled (mandatory on a production server)
- * @group Core
*/
public function testProfilingDisabledInProduction()
{
@@ -149,9 +138,6 @@ class Test_Piwik_ReleaseCheckListTest extends PHPUnit_Framework_TestCase
$this->assertTrue(\Piwik\Tracker\Db::isProfilingEnabled() === false, 'SQL profiler should be disabled in production! See Db::$profiling');
}
- /**
- * @group Core
- */
public function testPiwikTrackerDebugIsOff()
{
$this->assertTrue(!isset($GLOBALS['PIWIK_TRACKER_DEBUG']));
@@ -161,7 +147,6 @@ class Test_Piwik_ReleaseCheckListTest extends PHPUnit_Framework_TestCase
/**
* This tests that all PHP files start with <?php
* This would help detect errors such as a php file starting with spaces
- * @group Core
*/
public function test_phpFilesStartWithRightCharacter()
{
@@ -187,9 +172,6 @@ class Test_Piwik_ReleaseCheckListTest extends PHPUnit_Framework_TestCase
}
}
- /**
- * @group Core
- */
public function test_directoriesShouldBeChmod755()
{
$pluginsPath = realpath(PIWIK_INCLUDE_PATH . '/plugins/');
@@ -222,17 +204,15 @@ class Test_Piwik_ReleaseCheckListTest extends PHPUnit_Framework_TestCase
* Check that directories in plugins/ folder are specifically either enabled or disabled.
*
* This fails when a new folder is added to plugins/* and forgot to enable or mark as disabled in Manager.php.
- *
- * @group Core
*/
public function test_DirectoriesInPluginsFolder_areKnown()
{
- $pluginsBundledWithPiwik = \Piwik\Config::getInstance()->getFromGlobalConfig('Plugins');
+ $pluginsBundledWithPiwik = Config::getInstance()->getFromGlobalConfig('Plugins');
$pluginsBundledWithPiwik = $pluginsBundledWithPiwik['Plugins'];
$magicPlugins = 42;
$this->assertTrue(count($pluginsBundledWithPiwik) > $magicPlugins);
- $plugins = _glob(\Piwik\Plugin\Manager::getPluginsDirectory() . '*', GLOB_ONLYDIR);
+ $plugins = _glob(Manager::getPluginsDirectory() . '*', GLOB_ONLYDIR);
$count = 1;
foreach($plugins as $pluginPath) {
$pluginName = basename($pluginPath);
@@ -243,7 +223,7 @@ class Test_Piwik_ReleaseCheckListTest extends PHPUnit_Framework_TestCase
// if not added to git, then it is not part of the release checklist.
continue;
}
- $manager = \Piwik\Plugin\Manager::getInstance();
+ $manager = Manager::getInstance();
$isGitSubmodule = $manager->isPluginOfficialAndNotBundledWithCore($pluginName);
$disabled = in_array($pluginName, $manager->getCorePluginsDisabledByDefault()) || $isGitSubmodule;
@@ -258,9 +238,6 @@ class Test_Piwik_ReleaseCheckListTest extends PHPUnit_Framework_TestCase
$this->assertTrue($count > $magicPlugins);
}
- /**
- * @group Core
- */
public function testEndOfLines()
{
foreach (Filesystem::globr(PIWIK_DOCUMENT_ROOT, '*') as $file) {
@@ -300,9 +277,6 @@ class Test_Piwik_ReleaseCheckListTest extends PHPUnit_Framework_TestCase
}
}
- /**
- * @group Core
- */
public function testPiwikJavaScript()
{
// check source against Snort rule 8443
@@ -316,9 +290,6 @@ class Test_Piwik_ReleaseCheckListTest extends PHPUnit_Framework_TestCase
$this->assertTrue(preg_match($pattern, $contents) == 0);
}
- /**
- * @param $files
- */
private function checkFilesAreInPngFormat($files)
{
$this->checkFilesAreInFormat($files, "png");
@@ -333,10 +304,6 @@ class Test_Piwik_ReleaseCheckListTest extends PHPUnit_Framework_TestCase
$this->checkFilesAreInFormat($files, "gif");
}
- /**
- * @param $files
- * @param $format
- */
private function checkFilesAreInFormat($files, $format)
{
$errors = array();
@@ -353,15 +320,12 @@ class Test_Piwik_ReleaseCheckListTest extends PHPUnit_Framework_TestCase
}
if (!empty($errors)) {
- $icons = var_export($errors, true);
$icons = "gimp " . implode(" ", $errors);
$this->fail("$format format failed for following icons $icons \n");
}
}
/**
- * @param $file
- * @param $isIniFile
* @return bool
*/
protected function isSkipPhpFileStartWithPhpBlock($file, $isIniFile)
@@ -378,7 +342,6 @@ class Test_Piwik_ReleaseCheckListTest extends PHPUnit_Framework_TestCase
}
/**
- * @param $pluginPath
* @return bool
*/
protected function isPathAddedToGit($pluginPath)
@@ -387,5 +350,4 @@ class Test_Piwik_ReleaseCheckListTest extends PHPUnit_Framework_TestCase
$addedToGit = (strlen($gitOutput) > 0) && strpos($gitOutput, 'error: pathspec') === false;
return $addedToGit;
}
-
}
diff --git a/tests/PHPUnit/Integration/ReportTest.php b/tests/PHPUnit/Integration/ReportTest.php
index a9a3ef74be..13c404375c 100644
--- a/tests/PHPUnit/Integration/ReportTest.php
+++ b/tests/PHPUnit/Integration/ReportTest.php
@@ -6,6 +6,8 @@
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+namespace Piwik\Tests\Integration;
+
use Piwik\API\Proxy;
use Piwik\Plugin\Report;
use Piwik\Plugins\ExampleReport\Reports\GetExampleReport;
@@ -72,7 +74,7 @@ class GetDisabledReport extends GetBasicReport
/**
* @group Core
*/
-class Plugin_ReportTest extends IntegrationTestCase
+class ReportTest extends IntegrationTestCase
{
/**
* @var Report
@@ -540,4 +542,4 @@ class Plugin_ReportTest extends IntegrationTestCase
{
Translate::reloadLanguage('en');
}
-} \ No newline at end of file
+}
diff --git a/tests/PHPUnit/Integration/SegmentTest.php b/tests/PHPUnit/Integration/SegmentTest.php
index c4721b2339..889f4a8e04 100644
--- a/tests/PHPUnit/Integration/SegmentTest.php
+++ b/tests/PHPUnit/Integration/SegmentTest.php
@@ -5,12 +5,18 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+
+namespace Piwik\Tests\Integration;
+
+use Exception;
use Piwik\Access;
use Piwik\Common;
use Piwik\Segment;
+use Piwik\Tests\Framework\Mock\FakeAccess;
use Piwik\Tests\Framework\TestCase\IntegrationTestCase;
/**
+ * @group Core
* @group SegmentTest
*/
class SegmentTest extends IntegrationTestCase
@@ -91,7 +97,6 @@ class SegmentTest extends IntegrationTestCase
/**
* @dataProvider getCommonTestData
- * @group Core
*/
public function testCommon($segment, $expected)
{
@@ -121,9 +126,6 @@ class SegmentTest extends IntegrationTestCase
$this->assertEquals(32, strlen($segment->getHash()));
}
- /**
- * @group Core
- */
public function testGetSelectQueryNoJoin()
{
$select = '*';
@@ -151,9 +153,6 @@ class SegmentTest extends IntegrationTestCase
$this->assertEquals($this->_filterWhitsSpaces($expected), $this->_filterWhitsSpaces($query));
}
- /**
- * @group Core
- */
public function testGetSelectQueryJoinVisitOnAction()
{
$select = '*';
@@ -182,9 +181,6 @@ class SegmentTest extends IntegrationTestCase
$this->assertEquals($this->_filterWhitsSpaces($expected), $this->_filterWhitsSpaces($query));
}
- /**
- * @group Core
- */
public function testGetSelectQueryJoinActionOnVisit()
{
$select = 'sum(log_visit.visit_total_actions) as nb_actions, max(log_visit.visit_total_actions) as max_actions, sum(log_visit.visit_total_time) as sum_visit_length';
@@ -220,9 +216,6 @@ class SegmentTest extends IntegrationTestCase
$this->assertEquals($this->_filterWhitsSpaces($expected), $this->_filterWhitsSpaces($query));
}
- /**
- * @group Core
- */
public function testGetSelectQueryJoinConversionOnAction()
{
$select = '*';
@@ -251,9 +244,6 @@ class SegmentTest extends IntegrationTestCase
$this->assertEquals($this->_filterWhitsSpaces($expected), $this->_filterWhitsSpaces($query));
}
- /**
- * @group Core
- */
public function testGetSelectQueryJoinActionOnConversion()
{
$select = '*';
@@ -282,9 +272,6 @@ class SegmentTest extends IntegrationTestCase
$this->assertEquals($this->_filterWhitsSpaces($expected), $this->_filterWhitsSpaces($query));
}
- /**
- * @group Core
- */
public function testGetSelectQueryJoinConversionOnVisit()
{
$select = 'log_visit.*';
@@ -319,9 +306,6 @@ class SegmentTest extends IntegrationTestCase
$this->assertEquals($this->_filterWhitsSpaces($expected), $this->_filterWhitsSpaces($query));
}
- /**
- * @group Core
- */
public function testGetSelectQueryConversionOnly()
{
$select = 'log_conversion.*';
@@ -349,9 +333,6 @@ class SegmentTest extends IntegrationTestCase
$this->assertEquals($this->_filterWhitsSpaces($expected), $this->_filterWhitsSpaces($query));
}
- /**
- * @group Core
- */
public function testGetSelectQueryJoinVisitOnConversion()
{
$select = '*';
@@ -383,8 +364,6 @@ class SegmentTest extends IntegrationTestCase
/**
* visit is joined on action, then conversion is joined
* make sure that conversion is joined on action not visit
- *
- * @group Core
*/
public function testGetSelectQueryJoinVisitAndConversionOnAction()
{
@@ -416,8 +395,6 @@ class SegmentTest extends IntegrationTestCase
/**
* join conversion on visit, then actions
* make sure actions are joined before conversions
- *
- * @group Core
*/
public function testGetSelectQueryJoinConversionAndActionOnVisit()
{
@@ -465,14 +442,12 @@ class SegmentTest extends IntegrationTestCase
}
/**
- * @group Core
- *
* @dataProvider getBogusSegments
*/
public function testBogusSegmentThrowsException($segment)
{
try {
- $segment = new Segment($segment, $idSites = array());
+ new Segment($segment, $idSites = array());
} catch (Exception $e) {
return;
}
diff --git a/tests/PHPUnit/Integration/ServeStaticFileTest.php b/tests/PHPUnit/Integration/ServeStaticFileTest.php
index 236bc748c3..d7f19a30e5 100644
--- a/tests/PHPUnit/Integration/ServeStaticFileTest.php
+++ b/tests/PHPUnit/Integration/ServeStaticFileTest.php
@@ -11,10 +11,11 @@
* serverStaticFile.test.php has been created to avoid making too many modifications to /tests/core/Piwik.test.php
*/
-// This is Piwik logo, the static file used in this test suit
+namespace Piwik\Tests\Integration;
-// TODO this is an integration or system test! not a unit test
+// This is Piwik logo, the static file used in this test suit
+use Exception;
use Piwik\ProxyHttp;
use Piwik\SettingsServer;
use Piwik\Tests\Framework\Fixture;
@@ -46,7 +47,7 @@ define("PARTIAL_BYTE_START", 1204);
define("PARTIAL_BYTE_END", 14724);
// If the static file server has not been requested, the standard unit test case class is defined
-class Test_Piwik_ServeStaticFile extends PHPUnit_Framework_TestCase
+class ServeStaticFileTest extends \PHPUnit_Framework_TestCase
{
public function tearDown()
{
diff --git a/tests/PHPUnit/Integration/SqlTest.php b/tests/PHPUnit/Integration/SqlTest.php
index aed82013c9..c5f673f17e 100755
--- a/tests/PHPUnit/Integration/SqlTest.php
+++ b/tests/PHPUnit/Integration/SqlTest.php
@@ -1,16 +1,20 @@
<?php
-use Piwik\Db;
-use Piwik\Tests\Framework\TestCase\IntegrationTestCase;
-
/**
* Piwik - free/libre analytics platform
*
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- *
+ */
+
+namespace Piwik\Tests\Integration;
+
+use Piwik\Db;
+use Piwik\Tests\Framework\TestCase\IntegrationTestCase;
+
+/**
* @group Core
*/
-class Core_SqlTest extends IntegrationTestCase
+class SqlTest extends IntegrationTestCase
{
public function setUp()
{
@@ -30,9 +34,6 @@ class Core_SqlTest extends IntegrationTestCase
parent::tearDown();
}
- /**
- * @group Core
- */
public function testOptimize()
{
// make sure optimizing myisam tables works
diff --git a/tests/PHPUnit/Integration/Tracker/ActionTest.php b/tests/PHPUnit/Integration/Tracker/ActionTest.php
index dd3388a56c..1ca87f9678 100644
--- a/tests/PHPUnit/Integration/Tracker/ActionTest.php
+++ b/tests/PHPUnit/Integration/Tracker/ActionTest.php
@@ -5,9 +5,13 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+
+namespace Piwik\Tests\Integration\Tracker;
+
use Piwik\Access;
use Piwik\Config;
use Piwik\Plugins\SitesManager\API;
+use Piwik\Tests\Framework\Mock\FakeAccess;
use Piwik\Tracker\Action;
use Piwik\Tracker\PageUrl;
use Piwik\Tracker\Request;
@@ -16,15 +20,10 @@ use Piwik\Plugin\Manager as PluginManager;
use Piwik\Tests\Framework\TestCase\IntegrationTestCase;
/**
- * Piwik - free/libre analytics platform
- *
- * @link http://piwik.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- *
* @group Core
* @group ActionTest
*/
-class Core_Tracker_ActionTest extends IntegrationTestCase
+class ActionTest extends IntegrationTestCase
{
public function setUp()
{
@@ -123,7 +122,6 @@ class Core_Tracker_ActionTest extends IntegrationTestCase
/**
* No excluded query parameters specified, apart from the standard "session" parameters, always excluded
*
- * @group Core
* @dataProvider getTestUrls
*/
public function testExcludeQueryParametersNone($url, $filteredUrl)
@@ -151,7 +149,6 @@ class Core_Tracker_ActionTest extends IntegrationTestCase
/**
* Test removing hash tag
- * @group Core
* @dataProvider getTestUrlsHashtag
*/
public function testRemoveTrailingHashtag($url, $expectedUrl)
@@ -161,7 +158,6 @@ class Core_Tracker_ActionTest extends IntegrationTestCase
/**
* Testing with some website specific parameters excluded
- * @group Core
* @dataProvider getTestUrls
*/
public function testExcludeQueryParametersSiteExcluded($url, $filteredUrl)
@@ -177,7 +173,6 @@ class Core_Tracker_ActionTest extends IntegrationTestCase
/**
* Testing with some website specific and some global excluded query parameters
- * @group Core
* @dataProvider getTestUrls
*/
public function testExcludeQueryParametersSiteAndGlobalExcluded($url, $filteredUrl)
@@ -367,7 +362,6 @@ class Core_Tracker_ActionTest extends IntegrationTestCase
/**
* @dataProvider getExtractUrlData
- * @group Core
*/
public function testExtractUrlAndActionNameFromRequest($request, $expected)
{
diff --git a/tests/PHPUnit/Integration/Tracker/DbTest.php b/tests/PHPUnit/Integration/Tracker/DbTest.php
index 8bfdd5232f..e55d87d2ef 100644
--- a/tests/PHPUnit/Integration/Tracker/DbTest.php
+++ b/tests/PHPUnit/Integration/Tracker/DbTest.php
@@ -5,9 +5,13 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+
+namespace Piwik\Tests\Integration\Tracker;
+
use Piwik\Common;
use Piwik\Db;
use Piwik\Tests\Framework\TestCase\IntegrationTestCase;
+use Piwik\Tracker;
/**
* Tracker DB test
@@ -15,11 +19,11 @@ use Piwik\Tests\Framework\TestCase\IntegrationTestCase;
* @group Core
* @group TrackerDbTest
*/
-class Core_Tracker_DbTest extends IntegrationTestCase
+class DbTest extends IntegrationTestCase
{
public function test_rowCount_whenUpdating_returnsAllMatchedRowsNotOnlyUpdatedRows()
{
- $db = \Piwik\Tracker::getDatabase();
+ $db = Tracker::getDatabase();
// insert one record
$db->query("INSERT INTO `" . Common::prefixTable('option') . "` VALUES ('rowid', '1', false)");
@@ -39,5 +43,4 @@ class Core_Tracker_DbTest extends IntegrationTestCase
$result = $db->query($sqlUpdate . " WHERE option_name = 'rowid'");
$this->assertSame(1, $db->rowCount($result));
}
-
-} \ No newline at end of file
+}
diff --git a/tests/PHPUnit/Integration/Tracker/Visit2Test.php b/tests/PHPUnit/Integration/Tracker/Visit2Test.php
index 5c191d90ee..3a64c6e54b 100644
--- a/tests/PHPUnit/Integration/Tracker/Visit2Test.php
+++ b/tests/PHPUnit/Integration/Tracker/Visit2Test.php
@@ -6,11 +6,13 @@
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+namespace Piwik\Tests\Integration\Tracker;
// Tests Visits and Dimensions behavior which is a lot of logic so not in VisitTest
use Piwik\Plugin\Dimension\VisitDimension;
use Piwik\Tracker\Request;
+use Piwik\Tracker\Visit;
use Piwik\Tracker\Visitor;
use Piwik\Piwik;
use Piwik\EventDispatcher;
@@ -88,7 +90,7 @@ class FakeTrackerVisitDimension4 extends VisitDimension
}
-class FakeTrackerVisit extends \Piwik\Tracker\Visit
+class FakeTrackerVisit extends Visit
{
public function __construct($request)
{
@@ -124,12 +126,10 @@ class FakeTrackerVisit extends \Piwik\Tracker\Visit
protected function insertNewVisit($visit)
{
-
}
protected function updateExistingVisit($valuesToUpdate)
{
-
}
}
@@ -137,9 +137,8 @@ class FakeTrackerVisit extends \Piwik\Tracker\Visit
* @group Core
* @group VisitTest
*/
-class VisitTest extends IntegrationTestCase
+class Visit2Test extends IntegrationTestCase
{
-
public function setUp()
{
parent::setUp();
@@ -157,8 +156,8 @@ class VisitTest extends IntegrationTestCase
public function test_handleNewVisitWithoutConversion_shouldTriggerDimensions()
{
- $request = new \Piwik\Tracker\Request(array());
- $visitor = new \Piwik\Tracker\Visitor($request, '');
+ $request = new Request(array());
+ $visitor = new Visitor($request, '');
$visit = new FakeTrackerVisit($request);
$visit->handleNewVisit($visitor, null, false);
@@ -179,8 +178,8 @@ class VisitTest extends IntegrationTestCase
public function test_handleNewVisitWithConversion_shouldTriggerDimensions()
{
- $request = new \Piwik\Tracker\Request(array());
- $visitor = new \Piwik\Tracker\Visitor($request, '');
+ $request = new Request(array());
+ $visitor = new Visitor($request, '');
$visit = new FakeTrackerVisit($request);
$visit->handleNewVisit($visitor, null, true);
@@ -197,8 +196,8 @@ class VisitTest extends IntegrationTestCase
public function test_handleExistingVisitWithoutConversion_shouldTriggerDimensions()
{
- $request = new \Piwik\Tracker\Request(array());
- $visitor = new \Piwik\Tracker\Visitor($request, '');
+ $request = new Request(array());
+ $visitor = new Visitor($request, '');
$visit = new FakeTrackerVisit($request);
$visit->handleNewVisit($visitor, null, false);
@@ -220,8 +219,8 @@ class VisitTest extends IntegrationTestCase
public function test_handleExistingVisitWithConversion_shouldTriggerDimensions()
{
- $request = new \Piwik\Tracker\Request(array());
- $visitor = new \Piwik\Tracker\Visitor($request, '');
+ $request = new Request(array());
+ $visitor = new Visitor($request, '');
$visit = new FakeTrackerVisit($request);
$visit->handleNewVisit($visitor, null, false);
@@ -236,4 +235,4 @@ class VisitTest extends IntegrationTestCase
$this->assertEquals('converted3', $visitor->getVisitorColumn('custom_dimension_3'));
}
-} \ No newline at end of file
+}
diff --git a/tests/PHPUnit/Integration/Tracker/VisitTest.php b/tests/PHPUnit/Integration/Tracker/VisitTest.php
index 292b98737d..3a516d1c53 100644
--- a/tests/PHPUnit/Integration/Tracker/VisitTest.php
+++ b/tests/PHPUnit/Integration/Tracker/VisitTest.php
@@ -6,19 +6,21 @@
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+namespace Piwik\Tests\Integration\Tracker;
+
use Piwik\Access;
use Piwik\Network\IPUtils;
+use Piwik\Plugin\Manager;
use Piwik\Plugins\SitesManager\API;
+use Piwik\Tests\Framework\Mock\FakeAccess;
use Piwik\Tracker\Request;
use Piwik\Tracker\VisitExcluded;
use Piwik\Tests\Framework\TestCase\IntegrationTestCase;
/**
- * Class Core_Tracker_VisitTest
- *
* @group Core
*/
-class Core_Tracker_VisitTest extends IntegrationTestCase
+class VisitTest extends IntegrationTestCase
{
public function setUp()
{
@@ -29,7 +31,7 @@ class Core_Tracker_VisitTest extends IntegrationTestCase
FakeAccess::$superUser = true;
Access::setSingletonInstance($pseudoMockAccess);
- \Piwik\Plugin\Manager::getInstance()->loadPlugins(array('SitesManager'));
+ Manager::getInstance()->loadPlugins(array('SitesManager'));
}
/**
@@ -75,7 +77,6 @@ class Core_Tracker_VisitTest extends IntegrationTestCase
}
/**
- * @group Core
* @dataProvider getExcludedIpTestData
*/
public function testIsVisitorIpExcluded($excludedIp, $tests)
@@ -120,7 +121,6 @@ class Core_Tracker_VisitTest extends IntegrationTestCase
}
/**
- * @group Core
* @dataProvider getExcludedUserAgentTestData
*/
public function testIsVisitorUserAgentExcluded($excludedUserAgent, $tests)
@@ -143,7 +143,6 @@ class Core_Tracker_VisitTest extends IntegrationTestCase
}
/**
- * @group Core
* @group referrerIsKnownSpam
*/
public function testIsVisitor_referrerIsKnownSpam()
@@ -173,7 +172,6 @@ class Core_Tracker_VisitTest extends IntegrationTestCase
}
/**
- * @group Core
* @group IpIsKnownBot
*/
public function testIsVisitor_ipIsKnownBot()
@@ -203,7 +201,6 @@ class Core_Tracker_VisitTest extends IntegrationTestCase
}
/**
- * @group Core
* @group UserAgentIsKnownBot
*/
public function testIsVisitor_userAgentIsKnownBot()
diff --git a/tests/PHPUnit/Integration/TrackerTest.php b/tests/PHPUnit/Integration/TrackerTest.php
index 0da7445964..bc4c99090c 100644
--- a/tests/PHPUnit/Integration/TrackerTest.php
+++ b/tests/PHPUnit/Integration/TrackerTest.php
@@ -5,11 +5,11 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+
namespace Piwik\Tests\Integration;
use Piwik\Common;
use Piwik\Db;
-use Piwik\Option;
use Piwik\Tests\Framework\Fixture;
use Piwik\Tests\Framework\TestCase\IntegrationTestCase;
use Piwik\Tracker;
diff --git a/tests/PHPUnit/Integration/TravisEnvironmentTest.php b/tests/PHPUnit/Integration/TravisEnvironmentTest.php
index 5faf9cbe10..60a3664bc2 100644
--- a/tests/PHPUnit/Integration/TravisEnvironmentTest.php
+++ b/tests/PHPUnit/Integration/TravisEnvironmentTest.php
@@ -1,14 +1,21 @@
<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+namespace Piwik\Tests\Integration;
+
+use Piwik\Db;
use Piwik\Translate;
use Piwik\Tests\Framework\TestCase\IntegrationTestCase;
/**
- * Class TravisEnvironmentTest
- *
* @group Core
*/
-class Core_TravisEnvironmentTest extends IntegrationTestCase
+class TravisEnvironmentTest extends IntegrationTestCase
{
public function testUsageOfCorrectMysqlAdapter()
{
@@ -20,17 +27,16 @@ class Core_TravisEnvironmentTest extends IntegrationTestCase
$this->assertTrue(in_array($mysqlAdapter, array('PDO_MYSQL', 'PDO\MYSQL', 'MYSQLI')));
- $db = Piwik\Db::get();
+ $db = Db::get();
switch ($mysqlAdapter) {
case 'PDO_MYSQL':
case 'PDO\MYSQL':
- $this->assertInstanceOf('\Piwik\Db\Adapter\Pdo\Mysql', $db);
+ $this->assertInstanceOf('Piwik\Db\Adapter\Pdo\Mysql', $db);
break;
case 'MYSQLI':
- $this->assertInstanceOf('\Piwik\Db\Adapter\Mysqli', $db);
+ $this->assertInstanceOf('Piwik\Db\Adapter\Mysqli', $db);
break;
}
-
}
-} \ No newline at end of file
+}
diff --git a/tests/PHPUnit/Integration/UpdaterTest.php b/tests/PHPUnit/Integration/UpdaterTest.php
index 563de9abfe..c15d6b0a88 100644
--- a/tests/PHPUnit/Integration/UpdaterTest.php
+++ b/tests/PHPUnit/Integration/UpdaterTest.php
@@ -5,15 +5,14 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
-namespace Piwik\Tests\Integration\Core;
+
+namespace Piwik\Tests\Integration;
use Piwik\Tests\Framework\TestCase\IntegrationTestCase;
use Piwik\Updater;
use Piwik\Tests\Framework\Fixture;
/**
- * Class Core_UpdaterTest
- *
* @group Core
* @group Core_UpdaterTest
*/
@@ -74,4 +73,4 @@ class UpdaterTest extends IntegrationTestCase
throw new \Exception("Failed to force update (nothing to update).");
}
}
-} \ No newline at end of file
+}
diff --git a/tests/PHPUnit/Integration/ViewDataTable/ManagerTest.php b/tests/PHPUnit/Integration/ViewDataTable/ManagerTest.php
index b6ef41d9f6..cc2d6b97aa 100644
--- a/tests/PHPUnit/Integration/ViewDataTable/ManagerTest.php
+++ b/tests/PHPUnit/Integration/ViewDataTable/ManagerTest.php
@@ -6,18 +6,18 @@
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+namespace Piwik\Tests\Integration\ViewDataTable;
+
use Piwik\Access;
use Piwik\ViewDataTable\Manager as ViewDataTableManager;
use Piwik\Tests\Framework\TestCase\IntegrationTestCase;
/**
- * Class Core_Plugin_SettingsTest
* @group Core
* @group ViewDataTable
*/
-class Core_Plugin_ViewDataTable_ManagerTest extends IntegrationTestCase
+class ManagerTest extends IntegrationTestCase
{
-
public function setUp()
{
parent::setUp();
@@ -103,4 +103,4 @@ class Core_Plugin_ViewDataTable_ManagerTest extends IntegrationTestCase
return array('login' => $login, 'method' => $method, 'params' => $params);
}
-} \ No newline at end of file
+}
diff --git a/tests/PHPUnit/Integration/WidgetsListTest.php b/tests/PHPUnit/Integration/WidgetsListTest.php
index a75723e6c3..cf1c778e84 100644
--- a/tests/PHPUnit/Integration/WidgetsListTest.php
+++ b/tests/PHPUnit/Integration/WidgetsListTest.php
@@ -6,22 +6,21 @@
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+namespace Piwik\Tests\Integration;
+
use Piwik\Access;
use Piwik\Plugins\Goals\API;
+use Piwik\Tests\Framework\Mock\FakeAccess;
+use Piwik\Translate;
use Piwik\WidgetsList;
use Piwik\Tests\Framework\Fixture;
use Piwik\Tests\Framework\TestCase\IntegrationTestCase;
/**
- * Class Core_WidgetsListTest
- *
* @group Core
*/
class Core_WidgetsListTest extends IntegrationTestCase
{
- /**
- * @group Core
- */
public function testGet()
{
// setup the access layer
@@ -62,9 +61,6 @@ class Core_WidgetsListTest extends IntegrationTestCase
}
}
- /**
- * @group Core
- */
public function testGetWithGoals()
{
// setup the access layer
@@ -94,9 +90,6 @@ class Core_WidgetsListTest extends IntegrationTestCase
}
}
- /**
- * @group Core
- */
public function testGetWithGoalsAndEcommerce()
{
// setup the access layer
@@ -127,9 +120,6 @@ class Core_WidgetsListTest extends IntegrationTestCase
}
}
- /**
- * @group Core
- */
public function testRemove()
{
// setup the access layer
@@ -167,9 +157,6 @@ class Core_WidgetsListTest extends IntegrationTestCase
WidgetsList::_reset();
}
- /**
- * @group Core
- */
public function testIsDefined()
{
// setup the access layer
@@ -177,7 +164,7 @@ class Core_WidgetsListTest extends IntegrationTestCase
FakeAccess::$superUser = true;
Access::setSingletonInstance($pseudoMockAccess);
- \Piwik\Translate::loadEnglishTranslation();
+ Translate::loadEnglishTranslation();
Fixture::createWebsite('2009-01-04 00:11:42', true);
diff --git a/tests/PHPUnit/System/AnnotationsTest.php b/tests/PHPUnit/System/AnnotationsTest.php
index 722b104978..49a41e2c2e 100755
--- a/tests/PHPUnit/System/AnnotationsTest.php
+++ b/tests/PHPUnit/System/AnnotationsTest.php
@@ -10,9 +10,9 @@ namespace Piwik\Tests\System;
use Piwik\Access;
use Piwik\API\Request;
use Piwik\Plugins\Annotations\API;
+use Piwik\Tests\Framework\Mock\FakeAccess;
use Piwik\Tests\Framework\TestCase\SystemTestCase;
use Piwik\Tests\Fixtures\TwoSitesWithAnnotations;
-use FakeAccess;
use Exception;
/**
diff --git a/tests/PHPUnit/System/FrontControllerTest.php b/tests/PHPUnit/System/FrontControllerTest.php
index 13ced79f6f..e0eb62df7d 100644
--- a/tests/PHPUnit/System/FrontControllerTest.php
+++ b/tests/PHPUnit/System/FrontControllerTest.php
@@ -8,7 +8,7 @@
namespace Piwik\Tests\System;
-use Piwik\Tests\Fixture;
+use Piwik\Tests\Framework\Fixture;
use Piwik\Tests\Framework\TestCase\SystemTestCase;
/**
diff --git a/tests/PHPUnit/System/ManyVisitorsOneWebsiteTest.php b/tests/PHPUnit/System/ManyVisitorsOneWebsiteTest.php
index 22897c17a4..8910c8568e 100755
--- a/tests/PHPUnit/System/ManyVisitorsOneWebsiteTest.php
+++ b/tests/PHPUnit/System/ManyVisitorsOneWebsiteTest.php
@@ -102,18 +102,6 @@ class ManyVisitorsOneWebsiteTest extends SystemTestCase
'periods' => array('month'),
'otherRequestParameters' => array('ip' => '194.57.91.215')
)),
-
- array(array('UserCountry.getLocationFromIP'), array(
- 'otherRequestParameters' => array('ip' => '194.57.91.215')
- )),
-
- array(array('UserCountry.getLocationFromIP'), array(
- 'format' => 'json',
- 'otherRequestParameters' => array(
- 'ip' => '2001:db8:85a3:0:0:8a2e:370:7334',
- 'format' => 'json'
- )
- )),
);
// Randomly fails on 5.3
@@ -172,4 +160,4 @@ class ManyVisitorsOneWebsiteTest extends SystemTestCase
}
}
-ManyVisitorsOneWebsiteTest::$fixture = new ManyVisitsWithGeoIP();
+ManyVisitorsOneWebsiteTest::$fixture = new ManyVisitsWithGeoIP(); \ No newline at end of file
diff --git a/tests/PHPUnit/System/TrackerTest.php b/tests/PHPUnit/System/TrackerTest.php
new file mode 100755
index 0000000000..c3b7125eed
--- /dev/null
+++ b/tests/PHPUnit/System/TrackerTest.php
@@ -0,0 +1,72 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+namespace Piwik\Tests\System;
+
+use Piwik\Tests\Framework\Fixture;
+use Piwik\Tests\Framework\TestCase\SystemTestCase;
+
+/**
+ * @group TrackerTest
+ * @group Plugins
+ */
+class TrackerTest extends SystemTestCase
+{
+ public static $fixture = null;
+
+ /**
+ * @var \PiwikTracker
+ */
+ private $tracker;
+
+ public function setUp()
+ {
+ parent::setUp();
+
+ $idSite = 1;
+ $dateTime = '2014-01-01 00:00:01';
+
+ if (!Fixture::siteCreated($idSite)) {
+ Fixture::createWebsite($dateTime);
+ }
+
+ $this->tracker = Fixture::getTracker($idSite, $dateTime, $defaultInit = true);
+ }
+
+ public function test_response_ShouldContainAnImage()
+ {
+ $response = $this->tracker->doTrackPageView('Test');
+
+ Fixture::checkResponse($response);
+ $this->assertNotEmpty($response);
+ }
+
+ public function test_response_ShouldBeEmpty_IfImageIsDisabled()
+ {
+ $this->tracker->disableSendImageResponse();
+
+ $response = $this->tracker->doTrackPageView('Test');
+
+ $this->assertSame('', $response);
+ }
+
+ public function test_response_ShouldSend200ResponseCode_IfImageIsEnabled()
+ {
+ $url = $this->tracker->getUrlTrackPageView('Test');
+
+ $this->assertResponseCode(200, $url);
+ }
+
+ public function test_response_ShouldSend204ResponseCode_IfImageIsDisabled()
+ {
+ $url = $this->tracker->getUrlTrackPageView('Test');
+ $url .= '&send_image=0';
+
+ $this->assertResponseCode(204, $url);
+ }
+
+}
diff --git a/tests/PHPUnit/System/expected/test_AutoSuggestAPITest__Live.getLastVisitsDetails_range.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest__Live.getLastVisitsDetails_range.xml
index f05ac2bcea..13e226509c 100644
--- a/tests/PHPUnit/System/expected/test_AutoSuggestAPITest__Live.getLastVisitsDetails_range.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest__Live.getLastVisitsDetails_range.xml
@@ -2277,17 +2277,17 @@
<browserCode>UNK</browserCode>
<browserVersion />
<events>1</events>
- <continent>North America</continent>
- <continentCode>amn</continentCode>
- <country>United States</country>
- <countryCode>us</countryCode>
- <countryFlag>plugins/UserCountry/images/flags/us.png</countryFlag>
+ <continent>Unknown</continent>
+ <continentCode>unk</continentCode>
+ <country>Unknown</country>
+ <countryCode>xx</countryCode>
+ <countryFlag>plugins/UserCountry/images/flags/xx.png</countryFlag>
<region />
<regionCode />
<city />
- <location>United States</location>
- <latitude>38</latitude>
- <longitude>-97</longitude>
+ <location>Unknown</location>
+ <latitude />
+ <longitude />
<visitLocalTime>12:34:06</visitLocalTime>
<visitLocalHour>12</visitLocalHour>
<daysSinceLastVisit>10</daysSinceLastVisit>
@@ -2519,17 +2519,17 @@
<browserCode>UNK</browserCode>
<browserVersion />
<events>0</events>
- <continent>North America</continent>
- <continentCode>amn</continentCode>
- <country>United States</country>
- <countryCode>us</countryCode>
- <countryFlag>plugins/UserCountry/images/flags/us.png</countryFlag>
+ <continent>Unknown</continent>
+ <continentCode>unk</continentCode>
+ <country>Unknown</country>
+ <countryCode>xx</countryCode>
+ <countryFlag>plugins/UserCountry/images/flags/xx.png</countryFlag>
<region />
<regionCode />
<city />
- <location>United States</location>
- <latitude>38</latitude>
- <longitude>-97</longitude>
+ <location>Unknown</location>
+ <latitude />
+ <longitude />
<visitLocalTime>12:34:06</visitLocalTime>
<visitLocalHour>12</visitLocalHour>
<daysSinceLastVisit>11</daysSinceLastVisit>
diff --git a/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_countryCode__API.getSuggestedValuesForSegment.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_countryCode__API.getSuggestedValuesForSegment.xml
index 84baa921c6..949a6486de 100644
--- a/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_countryCode__API.getSuggestedValuesForSegment.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_countryCode__API.getSuggestedValuesForSegment.xml
@@ -2,12 +2,12 @@
<result>
<row>gb</row>
<row>ca</row>
+ <row>xx</row>
<row>ru</row>
- <row>us</row>
<row>it</row>
- <row>fr</row>
<row>id</row>
+ <row>fr</row>
<row>ti</row>
<row>mk</row>
- <row>xx</row>
+ <row>us</row>
</result> \ No newline at end of file
diff --git a/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_latitude__API.getSuggestedValuesForSegment.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_latitude__API.getSuggestedValuesForSegment.xml
index 8cc367528e..d48ae32332 100644
--- a/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_latitude__API.getSuggestedValuesForSegment.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_latitude__API.getSuggestedValuesForSegment.xml
@@ -3,8 +3,7 @@
<row>49.25</row>
<row>123.456</row>
<row>47.249</row>
- <row>38</row>
- <row>29.65</row>
<row>124.456</row>
+ <row>29.65</row>
<row>1</row>
</result> \ No newline at end of file
diff --git a/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_longitude__API.getSuggestedValuesForSegment.xml b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_longitude__API.getSuggestedValuesForSegment.xml
index 43e5a510a3..34b2e9333d 100644
--- a/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_longitude__API.getSuggestedValuesForSegment.xml
+++ b/tests/PHPUnit/System/expected/test_AutoSuggestAPITest_longitude__API.getSuggestedValuesForSegment.xml
@@ -3,8 +3,7 @@
<row>-123.133</row>
<row>21.321</row>
<row>6.018</row>
- <row>-97</row>
- <row>91.1</row>
<row>22.231</row>
+ <row>91.1</row>
<row>2</row>
</result> \ No newline at end of file
diff --git a/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest__UserCountry.getContinent_month.xml b/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest__UserCountry.getContinent_month.xml
index a608b58f48..9572d1df13 100644
--- a/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest__UserCountry.getContinent_month.xml
+++ b/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest__UserCountry.getContinent_month.xml
@@ -27,34 +27,34 @@
</row>
<row>
<label>North America</label>
- <nb_visits>9</nb_visits>
- <nb_actions>15</nb_actions>
+ <nb_visits>7</nb_visits>
+ <nb_actions>11</nb_actions>
<max_actions>3</max_actions>
- <sum_visit_length>5044</sum_visit_length>
- <bounce_count>5</bounce_count>
+ <sum_visit_length>3783</sum_visit_length>
+ <bounce_count>4</bounce_count>
<goals>
<row idgoal='1'>
- <nb_conversions>9</nb_conversions>
- <nb_visits_converted>9</nb_visits_converted>
- <revenue>45</revenue>
+ <nb_conversions>7</nb_conversions>
+ <nb_visits_converted>7</nb_visits_converted>
+ <revenue>35</revenue>
</row>
<row idgoal='2'>
- <nb_conversions>4</nb_conversions>
- <nb_visits_converted>4</nb_visits_converted>
- <revenue>20</revenue>
+ <nb_conversions>3</nb_conversions>
+ <nb_visits_converted>3</nb_visits_converted>
+ <revenue>15</revenue>
</row>
</goals>
- <nb_conversions>13</nb_conversions>
- <revenue>65</revenue>
- <sum_daily_nb_uniq_visitors>5</sum_daily_nb_uniq_visitors>
+ <nb_conversions>10</nb_conversions>
+ <revenue>50</revenue>
+ <sum_daily_nb_uniq_visitors>4</sum_daily_nb_uniq_visitors>
<sum_daily_nb_users>1</sum_daily_nb_users>
<code>North America</code>
</row>
<row>
- <label>Asia</label>
+ <label>Unknown</label>
<nb_visits>4</nb_visits>
- <nb_actions>6</nb_actions>
- <max_actions>2</max_actions>
+ <nb_actions>8</nb_actions>
+ <max_actions>3</max_actions>
<sum_visit_length>2522</sum_visit_length>
<bounce_count>2</bounce_count>
<goals>
@@ -73,31 +73,31 @@
<revenue>30</revenue>
<sum_daily_nb_uniq_visitors>2</sum_daily_nb_uniq_visitors>
<sum_daily_nb_users>0</sum_daily_nb_users>
- <code>Asia</code>
+ <code>Unknown</code>
</row>
<row>
- <label>Unknown</label>
- <nb_visits>2</nb_visits>
- <nb_actions>4</nb_actions>
- <max_actions>3</max_actions>
- <sum_visit_length>1261</sum_visit_length>
- <bounce_count>1</bounce_count>
+ <label>Asia</label>
+ <nb_visits>4</nb_visits>
+ <nb_actions>6</nb_actions>
+ <max_actions>2</max_actions>
+ <sum_visit_length>2522</sum_visit_length>
+ <bounce_count>2</bounce_count>
<goals>
<row idgoal='1'>
+ <nb_conversions>4</nb_conversions>
+ <nb_visits_converted>4</nb_visits_converted>
+ <revenue>20</revenue>
+ </row>
+ <row idgoal='2'>
<nb_conversions>2</nb_conversions>
<nb_visits_converted>2</nb_visits_converted>
<revenue>10</revenue>
</row>
- <row idgoal='2'>
- <nb_conversions>1</nb_conversions>
- <nb_visits_converted>1</nb_visits_converted>
- <revenue>5</revenue>
- </row>
</goals>
- <nb_conversions>3</nb_conversions>
- <revenue>15</revenue>
- <sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
+ <nb_conversions>6</nb_conversions>
+ <revenue>30</revenue>
+ <sum_daily_nb_uniq_visitors>2</sum_daily_nb_uniq_visitors>
<sum_daily_nb_users>0</sum_daily_nb_users>
- <code>Unknown</code>
+ <code>Asia</code>
</row>
</result> \ No newline at end of file
diff --git a/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest__UserCountry.getCountry_month.xml b/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest__UserCountry.getCountry_month.xml
index c56807d771..c37c6d773b 100644
--- a/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest__UserCountry.getCountry_month.xml
+++ b/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest__UserCountry.getCountry_month.xml
@@ -85,30 +85,30 @@
<logoHeight>11</logoHeight>
</row>
<row>
- <label>United States</label>
- <nb_visits>3</nb_visits>
- <nb_actions>5</nb_actions>
+ <label>Unknown</label>
+ <nb_visits>4</nb_visits>
+ <nb_actions>8</nb_actions>
<max_actions>3</max_actions>
- <sum_visit_length>1261</sum_visit_length>
+ <sum_visit_length>2522</sum_visit_length>
<bounce_count>2</bounce_count>
<goals>
<row idgoal='1'>
- <nb_conversions>3</nb_conversions>
- <nb_visits_converted>3</nb_visits_converted>
- <revenue>15</revenue>
+ <nb_conversions>4</nb_conversions>
+ <nb_visits_converted>4</nb_visits_converted>
+ <revenue>20</revenue>
</row>
<row idgoal='2'>
- <nb_conversions>1</nb_conversions>
- <nb_visits_converted>1</nb_visits_converted>
- <revenue>5</revenue>
+ <nb_conversions>2</nb_conversions>
+ <nb_visits_converted>2</nb_visits_converted>
+ <revenue>10</revenue>
</row>
</goals>
- <nb_conversions>4</nb_conversions>
- <revenue>20</revenue>
+ <nb_conversions>6</nb_conversions>
+ <revenue>30</revenue>
<sum_daily_nb_uniq_visitors>2</sum_daily_nb_uniq_visitors>
- <sum_daily_nb_users>1</sum_daily_nb_users>
- <code>us</code>
- <logo>plugins/UserCountry/images/flags/us.png</logo>
+ <sum_daily_nb_users>0</sum_daily_nb_users>
+ <code>xx</code>
+ <logo>plugins/UserCountry/images/flags/xx.png</logo>
<logoWidth>16</logoWidth>
<logoHeight>11</logoHeight>
</row>
@@ -253,30 +253,25 @@
<logoHeight>11</logoHeight>
</row>
<row>
- <label>Unknown</label>
- <nb_visits>2</nb_visits>
- <nb_actions>4</nb_actions>
- <max_actions>3</max_actions>
- <sum_visit_length>1261</sum_visit_length>
+ <label>United States</label>
+ <nb_visits>1</nb_visits>
+ <nb_actions>1</nb_actions>
+ <max_actions>1</max_actions>
+ <sum_visit_length>0</sum_visit_length>
<bounce_count>1</bounce_count>
<goals>
<row idgoal='1'>
- <nb_conversions>2</nb_conversions>
- <nb_visits_converted>2</nb_visits_converted>
- <revenue>10</revenue>
- </row>
- <row idgoal='2'>
<nb_conversions>1</nb_conversions>
<nb_visits_converted>1</nb_visits_converted>
<revenue>5</revenue>
</row>
</goals>
- <nb_conversions>3</nb_conversions>
- <revenue>15</revenue>
+ <nb_conversions>1</nb_conversions>
+ <revenue>5</revenue>
<sum_daily_nb_uniq_visitors>1</sum_daily_nb_uniq_visitors>
- <sum_daily_nb_users>0</sum_daily_nb_users>
- <code>xx</code>
- <logo>plugins/UserCountry/images/flags/xx.png</logo>
+ <sum_daily_nb_users>1</sum_daily_nb_users>
+ <code>us</code>
+ <logo>plugins/UserCountry/images/flags/us.png</logo>
<logoWidth>16</logoWidth>
<logoHeight>11</logoHeight>
</row>
diff --git a/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest__UserCountry.getLocationFromIP.json b/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest__UserCountry.getLocationFromIP.json
deleted file mode 100644
index cc4c5534d2..0000000000
--- a/tests/PHPUnit/System/expected/test_ManyVisitorsOneWebsiteTest__UserCountry.getLocationFromIP.json
+++ /dev/null
@@ -1 +0,0 @@
-[{"country_code":"US","region_code":null,"city_name":"","area_code":0,"lat":38,"long":-97,"postal_code":null,"continent_code":"amn","continent_name":"North America","country_name":"United States","ip":"2001:db8:85a3:0:0:8a2e:370:7334"}] \ No newline at end of file
diff --git a/tests/PHPUnit/System/expected/test_OneVisitor_NoKeywordSpecified__Referrers.getKeywords_day.xml b/tests/PHPUnit/System/expected/test_OneVisitor_NoKeywordSpecified__Referrers.getKeywords_day.xml
index 9b2a6b9b0e..8555f09801 100644
--- a/tests/PHPUnit/System/expected/test_OneVisitor_NoKeywordSpecified__Referrers.getKeywords_day.xml
+++ b/tests/PHPUnit/System/expected/test_OneVisitor_NoKeywordSpecified__Referrers.getKeywords_day.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>
<result>
<row>
- <label>Mot clef indéfini</label>
+ <label>Mot-clé indéfini</label>
<nb_uniq_visitors>1</nb_uniq_visitors>
<nb_visits>1</nb_visits>
<nb_actions>1</nb_actions>
diff --git a/tests/PHPUnit/TestingEnvironment.php b/tests/PHPUnit/TestingEnvironment.php
index c52556fa7d..98e1566c5d 100644
--- a/tests/PHPUnit/TestingEnvironment.php
+++ b/tests/PHPUnit/TestingEnvironment.php
@@ -249,7 +249,7 @@ class Piwik_TestingEnvironment
'contents' => $outputContent
);
- file_put_contents($outputFile, Common::json_encode($outputContents));
+ file_put_contents($outputFile, json_encode($outputContents));
});
}
diff --git a/tests/PHPUnit/Unit/CommonTest.php b/tests/PHPUnit/Unit/CommonTest.php
index 5e820a25fd..22ee2c52da 100644
--- a/tests/PHPUnit/Unit/CommonTest.php
+++ b/tests/PHPUnit/Unit/CommonTest.php
@@ -395,23 +395,29 @@ class Core_CommonTest extends PHPUnit_Framework_TestCase
}
/**
- * Dataprovider for testExtractLanguageCodeFromBrowserLanguage
+ * Dataprovider for testExtractLanguageAndRegionCodeFromBrowserLanguage
*/
- public function getLanguageDataToExtract()
+ public function getLanguageDataToExtractLanguageRegionCode()
{
- return array( // browser language, valid languages, expected result
- array("fr-ca", array("fr"), "fr"),
+ return array(
+ // browser language, valid languages (with optional region), expected result
+ array("fr-ca", array("fr"), "fr-ca"),
+ array("fr-ca", array("ca"), "xx"),
array("", array(), "xx"),
array("", array("en"), "xx"),
array("fr", array("en"), "xx"),
array("en", array("en"), "en"),
+ array("en", array("en-ca"), "xx"),
array("en-ca", array("en-ca"), "en-ca"),
- array("en-ca", array("en"), "en"),
+ array("en-ca", array("en"), "en-ca"),
array("fr,en-us", array("fr", "en"), "fr"),
array("fr,en-us", array("en", "fr"), "fr"),
- array("fr-fr,fr-ca", array("fr"), "fr"),
+ array("fr-fr,fr-ca", array("fr"), "fr-fr"),
array("fr-fr,fr-ca", array("fr-ca"), "fr-ca"),
+ array("-ca", array("fr","ca"), "xx"),
array("fr-fr;q=1.0,fr-ca;q=0.9", array("fr-ca"), "fr-ca"),
+ array("es,en,fr;q=0.7,de;q=0.3", array("fr", "es", "de", "en"), "es"),
+ array("zh-sg,de;q=0.3", array("zh", "es", "de"), "zh-sg"),
array("fr-ca,fr;q=0.1", array("fr-ca"), "fr-ca"),
array("r5,fr;q=1,de", array("fr", "de"), "fr"),
array("Zen§gq1", array("en"), "xx"),
@@ -419,7 +425,42 @@ class Core_CommonTest extends PHPUnit_Framework_TestCase
}
/**
- * @dataProvider getLanguageDataToExtract
+ * @dataProvider getLanguageDataToExtractLanguageRegionCode
+ * @group Core
+ */
+ public function testExtractLanguageAndRegionCodeFromBrowserLanguage($browserLanguage, $validLanguages, $expected)
+ {
+ $this->assertEquals($expected, Common::extractLanguageAndRegionCodeFromBrowserLanguage($browserLanguage, $validLanguages), "test with {$browserLanguage} failed, expected {$expected}");
+ }
+
+
+ /**
+ * Dataprovider for testExtractLanguageCodeFromBrowserLanguage
+ */
+ public function getLanguageDataToExtractLanguageCode()
+ {
+ return array(
+ // browser language, valid languages, expected result
+ array("fr-ca", array("fr"), "fr"),
+ array("fr-ca", array("ca"), "xx"),
+ array("", array("en"), "xx"),
+ array("fr", array("en"), "xx"),
+ array("en", array("en"), "en"),
+ array("en", array("en-ca"), "xx"),
+ array("en-ca", array("en"), "en"),
+ array("fr,en-us", array("fr", "en"), "fr"),
+ array("fr,en-us", array("en", "fr"), "fr"),
+ array("fr-fr,fr-ca", array("fr"), "fr"),
+ array("-ca", array("fr","ca"), "xx"),
+ array("es,en,fr;q=0.7,de;q=0.3", array("fr", "es", "de", "en"), "es"),
+ array("zh-sg,de;q=0.3", array("zh", "es", "de"), "zh"),
+ array("r5,fr;q=1,de", array("fr", "de"), "fr"),
+ array("Zen§gq1", array("en"), "xx"),
+ );
+ }
+
+ /**
+ * @dataProvider getLanguageDataToExtractLanguageCode
* @group Core
*/
public function testExtractLanguageCodeFromBrowserLanguage($browserLanguage, $validLanguages, $expected)
diff --git a/tests/javascript/index.php b/tests/javascript/index.php
index 802cf492d9..b4e737792d 100644
--- a/tests/javascript/index.php
+++ b/tests/javascript/index.php
@@ -2368,12 +2368,14 @@ function PiwikTest() {
});
test("getRequest()", function() {
- expect(1);
+ expect(2);
var tracker = Piwik.getTracker();
tracker.setCustomData("key is X", "value is Y");
equal( tracker.getRequest('hello=world').indexOf('hello=world&idsite=&rec=1&r='), 0);
+
+ ok( -1 !== tracker.getRequest('hello=world').indexOf('send_image=0'), 'should disable sending image response');
});
// support for setCustomRequestProcessing( customRequestContentProcessingLogic )
diff --git a/tests/resources/TestPluginLogClass.php b/tests/resources/TestPluginLogClass.php
index 75f28928c4..3a95fe0cfb 100644
--- a/tests/resources/TestPluginLogClass.php
+++ b/tests/resources/TestPluginLogClass.php
@@ -5,6 +5,7 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+
namespace Piwik\Plugins\TestPlugin;
use Piwik\Log;
@@ -15,4 +16,4 @@ class TestLoggingUtility
{
Log::warning($message);
}
-} \ No newline at end of file
+}