]> granicus.if.org Git - php/commitdiff
Add Intl resource bundle files for big-endian architecture.
authorGeorge Peter Banyard <girgias@php.net>
Tue, 14 Apr 2020 11:56:48 +0000 (13:56 +0200)
committerGeorge Peter Banyard <girgias@php.net>
Tue, 14 Apr 2020 13:30:01 +0000 (15:30 +0200)
Little and Big endian files have their own designated folder.
Both use the ASCII charset family.
We may want to add a big-endian/EBCDIC charset family resource bundle in the future.

The build script is currently left untouched as it seems to mostly be for Windows.

ext/intl/tests/_files/resourcebundle_be/es.res [new file with mode: 0644]
ext/intl/tests/_files/resourcebundle_be/res_index.res [new file with mode: 0644]
ext/intl/tests/_files/resourcebundle_be/root.res [new file with mode: 0644]
ext/intl/tests/_files/resourcebundle_le/es.res [moved from ext/intl/tests/_files/resourcebundle/es.res with 100% similarity]
ext/intl/tests/_files/resourcebundle_le/res_index.res [moved from ext/intl/tests/_files/resourcebundle/res_index.res with 100% similarity]
ext/intl/tests/_files/resourcebundle_le/root.res [moved from ext/intl/tests/_files/resourcebundle/root.res with 92% similarity]
ext/intl/tests/resourcebundle.build
ext/intl/tests/resourcebundle.inc

diff --git a/ext/intl/tests/_files/resourcebundle_be/es.res b/ext/intl/tests/_files/resourcebundle_be/es.res
new file mode 100644 (file)
index 0000000..5564e19
Binary files /dev/null and b/ext/intl/tests/_files/resourcebundle_be/es.res differ
diff --git a/ext/intl/tests/_files/resourcebundle_be/res_index.res b/ext/intl/tests/_files/resourcebundle_be/res_index.res
new file mode 100644 (file)
index 0000000..03892a6
Binary files /dev/null and b/ext/intl/tests/_files/resourcebundle_be/res_index.res differ
diff --git a/ext/intl/tests/_files/resourcebundle_be/root.res b/ext/intl/tests/_files/resourcebundle_be/root.res
new file mode 100644 (file)
index 0000000..7df81bc
Binary files /dev/null and b/ext/intl/tests/_files/resourcebundle_be/root.res differ
similarity index 92%
rename from ext/intl/tests/_files/resourcebundle/root.res
rename to ext/intl/tests/_files/resourcebundle_le/root.res
index 62cb48c45718392516578b864c11a8c34678cf3f..52cd79e002c2060cf68c1823663889af9a36d266 100644 (file)
Binary files a/ext/intl/tests/_files/resourcebundle/root.res and b/ext/intl/tests/_files/resourcebundle_le/root.res differ
index 273e4407b7aea3a979ec7c9e7a62544507ff2c9d..ee645a0c55401d7ad53f734b893aafbe1d044cd6 100644 (file)
@@ -1,4 +1,5 @@
 <?php
+// FIXME Add handling for big endian archs
 // THIS SCRIPT WILL REBUILD ResourceBundle bundles from source files
 
 // DEFINE YOUR ICU TOOLS PATH HERE
index 9eea8aaffbafe7ffc21a0e968c608937316525dc..614a7403331a05e656f70365a062e29169d3332f 100644 (file)
@@ -1,5 +1,13 @@
 <?php
-define('BUNDLE', dirname(__FILE__)."/_files/resourcebundle");
+// FIXME Improve Endian check when endian const gets added
+// Check if platform is Big or Little endian
+if (pack('S', 0xABCD) !== pack('v', 0xABCD)) {
+    $endian = 'be';
+} else {
+    $endian = 'le';
+}
+
+define('BUNDLE', __DIR__ . '/_files/resourcebundle_' . $endian);
 
 function debug( $res ) {
     if (is_null( $res )) {