Adds missing phone prefix.
authorStéphane Jacob <sj@m4x.org>
Fri, 2 Jul 2010 15:04:26 +0000 (17:04 +0200)
committerStéphane Jacob <sj@m4x.org>
Fri, 2 Jul 2010 15:04:26 +0000 (17:04 +0200)
Signed-off-by: Stéphane Jacob <sj@m4x.org>
upgrade/1.0.1/connect.db.inc.php [new symlink]
upgrade/1.0.1/phone.php [new file with mode: 0755]

diff --git a/upgrade/1.0.1/connect.db.inc.php b/upgrade/1.0.1/connect.db.inc.php
new file mode 120000 (symlink)
index 0000000..442fab7
--- /dev/null
@@ -0,0 +1 @@
+../../bin/connect.db.inc.php
\ No newline at end of file
diff --git a/upgrade/1.0.1/phone.php b/upgrade/1.0.1/phone.php
new file mode 100755 (executable)
index 0000000..4239ece
--- /dev/null
@@ -0,0 +1,58 @@
+#!/usr/bin/php5
+<?php
+require_once 'connect.db.inc.php';
+
+$globals->debug = 0; //do not store backtraces
+
+$phones = array(
+    'AF' => '93',
+    'AN' => '599',
+    'BY' => '375',
+    'FM' => '691',
+    'GE' => '995',
+    'GL' => '299',
+    'ID' => '62',
+    'IL' => '972',
+    'IN' => '91',
+    'IQ' => '964',
+    'IR' => '98',
+    'JO' => '962',
+    'JP' => '81',
+    'KG' => '996',
+    'KW' => '965',
+    'KZ' => '7',
+    'LA' => '856',
+    'LB' => '961',
+    'LK' => '94',
+    'MM' => '95',
+    'MN' => '976',
+    'MV' => '960',
+    'MY' => '60',
+    'NP' => '977',
+    'OM' => '968',
+    'PH' => '63',
+    'PK' => '92',
+    'QA' => '974',
+    'SA' => '966',
+    'SG' => '65',
+    'SY' => '963',
+    'TH' => '66',
+    'TJ' => '992',
+    'TM' => '993',
+    'TR' => '90',
+    'TW' => '886',
+    'UZ' => '998',
+    'VG' => '1284',
+    'VN' => '84',
+    'YE' => '967',
+);
+
+foreach ($phones as $country => $phone) {
+    XDB::execute('UPDATE  geoloc_countries
+                     SET  phonePrefix = {?}
+                   WHERE  iso_3166_1_a2 = {?}',
+                 $phone, $country);
+}
+
+/* vim:set et sw=4 sts=4 ts=4: */
+?>