mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-15 13:06:38 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6daaf1103b | ||
|
|
073d24bb50 | ||
|
|
bdb901b64a | ||
|
|
5cd8ff9885 | ||
|
|
63f3ff7b5f | ||
|
|
0fc90b100d | ||
|
|
de65817136 | ||
|
|
2381b817aa | ||
|
|
9a6b72a05a | ||
|
|
5a3886f15c | ||
|
|
0aadab0e2e | ||
|
|
40dc242904 | ||
|
|
74ba88e186 | ||
|
|
d79dd9cc1c | ||
|
|
ff20a9019d | ||
|
|
27524b52b5 | ||
|
|
d85ac7fb3f | ||
|
|
f28ac55b6d | ||
|
|
a8c7e50f4d | ||
|
|
29ee38bf0d | ||
|
|
1b0e6067d5 | ||
|
|
b7b6c35eea | ||
|
|
27dc82d0ec | ||
|
|
ad5a63e8bc | ||
|
|
345032946c | ||
|
|
763f4aef8b | ||
|
|
ce09822269 | ||
|
|
c2b2afacc0 | ||
|
|
4a1c9be857 | ||
|
|
18b2b2a0bc | ||
|
|
b902a25cc3 | ||
|
|
b8b92bd790 | ||
|
|
0d558afc05 | ||
|
|
050dd59c63 | ||
|
|
72a8489a12 | ||
|
|
101c780500 | ||
|
|
87cabc04ac | ||
|
|
25c08a839a | ||
|
|
e3528f086a | ||
|
|
9937e2fda5 | ||
|
|
5e9268f469 | ||
|
|
de79c51555 | ||
|
|
823e330c75 | ||
|
|
d0cd112702 | ||
|
|
cd6eda5e5f | ||
|
|
b8d88bf2c5 | ||
|
|
d7441f6695 | ||
|
|
7d2609b0f5 | ||
|
|
018b9445da | ||
|
|
a3f5b9f62d | ||
|
|
aee271ec0d | ||
|
|
1984919ddc | ||
|
|
304bff90f4 | ||
|
|
c9cfd98bcd | ||
|
|
288e9c6423 | ||
|
|
df7321359e | ||
|
|
064ba179b1 | ||
|
|
915c428ba1 | ||
|
|
49fbe2579e | ||
|
|
717268cb1e | ||
|
|
5f17c4d08e | ||
|
|
cf2626f10c | ||
|
|
f345152037 | ||
|
|
41eb3c959d | ||
|
|
fd3fa9b53c | ||
|
|
caab95155d | ||
|
|
224dc52ea9 | ||
|
|
b3d522d215 | ||
|
|
890ea8411f | ||
|
|
8cb128159d | ||
|
|
54fe719953 | ||
|
|
91108818e1 | ||
|
|
8b6b39fdcf | ||
|
|
290becb1f1 | ||
|
|
9c1e1bbc05 | ||
|
|
c439ac6c35 | ||
|
|
9d75b9fb27 | ||
|
|
63dba7ec9d | ||
|
|
906d3ae0ed | ||
|
|
d4f5ca467f | ||
|
|
e3d9e18e7b | ||
|
|
2b7e89e20a | ||
|
|
a07ae67a21 | ||
|
|
3d4ef50dd7 | ||
|
|
bb42643ae0 | ||
|
|
d3fd163d27 | ||
|
|
55ee543e2f | ||
|
|
7cd5ae6fab | ||
|
|
812dfbc431 | ||
|
|
b4bed6fde0 | ||
|
|
4ded6ee971 | ||
|
|
5f1cbfacf9 | ||
|
|
0d89265a69 | ||
|
|
4c45e95cfe | ||
|
|
d04bcb8969 | ||
|
|
16a9fec889 | ||
|
|
49b3fef86a | ||
|
|
4dc4302a30 | ||
|
|
a7fc8eecb0 | ||
|
|
e2c9f3983a | ||
|
|
69808d698c | ||
|
|
ad7793d94c | ||
|
|
ab6481993e | ||
|
|
824bac9f23 | ||
|
|
7a526f01b5 | ||
|
|
2d14cc2a49 | ||
|
|
eb22041ffe | ||
|
|
1dcca1fdb9 | ||
|
|
a9c288ed3c | ||
|
|
0db6adda48 | ||
|
|
5c0890ba8a | ||
|
|
91b8a6752e | ||
|
|
f8f643b4f7 | ||
|
|
9765763413 | ||
|
|
a3bd4fda09 | ||
|
|
9b399be778 | ||
|
|
e18e7a5983 | ||
|
|
66fe7fabad | ||
|
|
bd1d2d8fb0 | ||
|
|
a209cf7a5a | ||
|
|
e50eb1ce34 | ||
|
|
bb73d18c85 | ||
|
|
9cb3a759a7 | ||
|
|
70c3a722e2 | ||
|
|
0adba0abb9 | ||
|
|
6af3683a4c | ||
|
|
6410f6ff68 | ||
|
|
1f5b1cfb2b | ||
|
|
2cf5614f5f | ||
|
|
b6ceea4a25 | ||
|
|
ee7cfa022d | ||
|
|
5cc797d119 | ||
|
|
757f4a952c | ||
|
|
2fa5f39e4c | ||
|
|
1b43f95040 | ||
|
|
b636c03426 | ||
|
|
e78c53680f | ||
|
|
fb610b4e80 | ||
|
|
825174e480 | ||
|
|
60ce3811ae | ||
|
|
2ecf94e07e | ||
|
|
098855433d | ||
|
|
cb47396d46 | ||
|
|
f860486de5 | ||
|
|
00697927d8 | ||
|
|
297324146e | ||
|
|
27ebcb8d0e | ||
|
|
8f19a8da65 | ||
|
|
8bef8e66cf | ||
|
|
ef9069b4ef | ||
|
|
910d4751e3 | ||
|
|
2186e1583d | ||
|
|
42cb9ac7a6 | ||
|
|
dab1d76e9d | ||
|
|
646813a37a | ||
|
|
9aad9114e3 | ||
|
|
9e4651f6f1 | ||
|
|
18cc5386de | ||
|
|
2129de4569 | ||
|
|
288a4ec3bd | ||
|
|
8f4a6d6e1b | ||
|
|
c5e5a6c2ac | ||
|
|
1494298231 | ||
|
|
8aa19c9fd8 | ||
|
|
9976b5cd7f | ||
|
|
5b0560efc3 | ||
|
|
52555a7894 | ||
|
|
b6feabc8c6 | ||
|
|
df31eb8fdc | ||
|
|
33d377e701 | ||
|
|
683a7d719b | ||
|
|
fb38fdc7fd | ||
|
|
0d6247f968 | ||
|
|
a1daebefda | ||
|
|
8d22c23161 | ||
|
|
420068c6e1 | ||
|
|
0b5c2887cd | ||
|
|
85a622e42f | ||
|
|
c1f22176f3 | ||
|
|
aa4f9b322b | ||
|
|
1ce00048fd | ||
|
|
2be67ca457 | ||
|
|
4a205092f7 | ||
|
|
26b27767a6 | ||
|
|
813e867652 | ||
|
|
a55d3b9295 | ||
|
|
df501fd464 | ||
|
|
d42fa2a059 | ||
|
|
4d7d85640d | ||
|
|
55b16f40a2 | ||
|
|
6919d15a2e | ||
|
|
30d64b0efb | ||
|
|
1fe1f7305b | ||
|
|
db61685edf | ||
|
|
4417421ab6 | ||
|
|
a4b4477466 | ||
|
|
d89d46d940 | ||
|
|
8aaecef524 | ||
|
|
62be976abe | ||
|
|
2aaa3d538a | ||
|
|
4628c9b375 | ||
|
|
51b809e3ad | ||
|
|
06994a419d | ||
|
|
865f221627 | ||
|
|
4c0bb6d76e | ||
|
|
872ef919ca | ||
|
|
29e755ac66 | ||
|
|
8495d63034 | ||
|
|
aa76f779ef | ||
|
|
7e4a42c278 | ||
|
|
b0a36007ab | ||
|
|
78cbe9aed5 | ||
|
|
9ccde8a415 | ||
|
|
2c9fc139fe | ||
|
|
7a038ccbe6 | ||
|
|
62a8305007 | ||
|
|
960b4e81f3 | ||
|
|
5c6dbc35e7 | ||
|
|
ef7fd7f4b5 | ||
|
|
ef8cf76815 | ||
|
|
f859b8d2cf | ||
|
|
9fbfdb3396 | ||
|
|
3b3c57e79e | ||
|
|
22700890d4 | ||
|
|
36fb4ed968 | ||
|
|
b026993a74 | ||
|
|
e3c7b48709 | ||
|
|
fe650a43ed | ||
|
|
f32d2ac3aa | ||
|
|
0117eb747e | ||
|
|
4840b0a749 | ||
|
|
b5a0f12871 | ||
|
|
fa40290fb7 | ||
|
|
63f242178d | ||
|
|
5ce23f39d5 | ||
|
|
d74b9cfee5 | ||
|
|
690bbe170d | ||
|
|
93f3ba66a7 | ||
|
|
3aaee86ee3 | ||
|
|
248afd1c3c | ||
|
|
5bc377457e | ||
|
|
fb6f5d2e2d | ||
|
|
6a823071f9 | ||
|
|
90f0a77cad | ||
|
|
96cc419924 | ||
|
|
d72a4d1634 | ||
|
|
8973390541 | ||
|
|
adfb5ab7ce | ||
|
|
e8ae795529 | ||
|
|
366491c1ce | ||
|
|
76d2d474be | ||
|
|
536260f2c5 | ||
|
|
2e2bda3508 | ||
|
|
f6ff3a28d6 | ||
|
|
2e2636dcc5 | ||
|
|
545363cce0 | ||
|
|
92fd085ebf | ||
|
|
dc3d360a0f | ||
|
|
86f2b33629 | ||
|
|
fc3f8a8f54 | ||
|
|
60d9175280 | ||
|
|
2ba3926815 | ||
|
|
9209c19f8f | ||
|
|
6cd0bd82dc | ||
|
|
dbe2d7745f | ||
|
|
b2f8f35a88 | ||
|
|
60e38b3243 | ||
|
|
ec5b87c50d | ||
|
|
33fd0e0b78 | ||
|
|
4b61203b01 | ||
|
|
cd1cab3f47 | ||
|
|
d56850aaff | ||
|
|
930946005e | ||
|
|
ad139d9a00 | ||
|
|
18b04b480e | ||
|
|
51fca2b4b3 | ||
|
|
aeb6e9c264 | ||
|
|
679bf479b6 | ||
|
|
d7baf0427f | ||
|
|
d4d6a95105 | ||
|
|
2b78edfba2 | ||
|
|
e9e63f9223 | ||
|
|
6b68f44e6b | ||
|
|
1d1fb69c8b | ||
|
|
f0c926564c | ||
|
|
f0c1ea1d2e | ||
|
|
c91a638ed7 | ||
|
|
d143c2b60f | ||
|
|
0eb414e2a5 | ||
|
|
7e35004e39 | ||
|
|
e98fc7de52 | ||
|
|
0ad0a2f56e | ||
|
|
80346690ba | ||
|
|
f904830012 | ||
|
|
ea0f832f10 | ||
|
|
7a1a1aec8c | ||
|
|
577b10b214 | ||
|
|
ac05cfb499 | ||
|
|
9aa904c375 | ||
|
|
9a655fcb18 | ||
|
|
b4b4372c88 | ||
|
|
69454d9f0f | ||
|
|
dc8705c256 | ||
|
|
f7eff9cd41 | ||
|
|
a92a350cce | ||
|
|
30e0442c54 | ||
|
|
9bf997c1db | ||
|
|
34fc79bd61 | ||
|
|
3f64d35559 | ||
|
|
cc66eaa04b | ||
|
|
8f146c2bb0 | ||
|
|
dfa43d55dd | ||
|
|
c2b8a72673 | ||
|
|
d5ba2d8a99 | ||
|
|
2524428504 | ||
|
|
e06a712c90 | ||
|
|
d52dbd569f | ||
|
|
7bb8cbcdee | ||
|
|
e5678c9b95 | ||
|
|
768c776d30 | ||
|
|
9789df7764 |
No files matched your search
+1
-1
@@ -151,7 +151,7 @@ Naming Conventions
|
||||
|
||||
7. Classes should be given descriptive names. Avoid using abbreviations where
|
||||
possible. Each word in the class name should start with a capital letter,
|
||||
without underscore delimiters (CampelCaps starting with a capital letter).
|
||||
without underscore delimiters (CamelCaps starting with a capital letter).
|
||||
The class name should be prefixed with the name of the 'parent set' (e.g.
|
||||
the name of the extension)::
|
||||
|
||||
|
||||
@@ -1,31 +1,152 @@
|
||||
PHP NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
?? ??? 2013, PHP 5.5.5
|
||||
12 Dec 2013, PHP 5.5.7
|
||||
|
||||
- CLI server:
|
||||
. Added some MIME types to the CLI web server (Chris Jones)
|
||||
. Implemented FR #65917 (getallheaders() is not supported by the built-in web
|
||||
server) - also implements apache_response_headers() (Andrea Faulds)
|
||||
|
||||
- Core:
|
||||
. Fixed bug #66094 (unregister_tick_function tries to cast a Closure to a
|
||||
string). (Laruence)
|
||||
|
||||
- OPCache
|
||||
. Fixed bug #66176 (Invalid constant substitution). (Dmitry)
|
||||
. Fixed bug #65915 (Inconsistent results with require return value). (Dmitry)
|
||||
. Fixed bug #65559 (Opcache: cache not cleared if changes occur while
|
||||
running). (Dmitry)
|
||||
|
||||
- OpenSSL:
|
||||
. Fixed memory corruption in openssl_x509_parse() (CVE-2013-6420).
|
||||
(Stefan Esser).
|
||||
|
||||
- readline
|
||||
. Fixed Bug #65714 (PHP cli forces the tty to cooked mode). (Remi)
|
||||
|
||||
14 Nov 2013, PHP 5.5.6
|
||||
|
||||
- Core:
|
||||
. Fixed bug #65947 (basename is no more working after fgetcsv in certain
|
||||
situation). (Laruence)
|
||||
. Improved performance of array_merge() and func_get_args() by eliminating
|
||||
useless copying. (Dmitry)
|
||||
. Fixed bug #65939 (Space before ";" breaks php.ini parsing).
|
||||
(brainstorm at nopcode dot org)
|
||||
. Fixed bug #65911 (scope resolution operator - strange behavior with $this).
|
||||
(Bob Weinand)
|
||||
. Fixed bug #65936 (dangling context pointer causes crash). (Tony)
|
||||
|
||||
- FPM:
|
||||
. Changed default listen() backlog to 65535. (Tony)
|
||||
|
||||
- JSON
|
||||
. Fixed whitespace part of bug #64874 ("json_decode handles whitespace and
|
||||
case-sensitivity incorrectly"). (Andrea Faulds)
|
||||
|
||||
- MySQLi:
|
||||
. Fixed bug #66043 (Segfault calling bind_param() on mysqli). (Laruence)
|
||||
|
||||
- OPcache
|
||||
. Increased limit for opcache.max_accelerated_files to 1,000,000. (Chris)
|
||||
. Fixed issue #115 (path issue when using phar). (Dmitry)
|
||||
. Fixed issue #149 (Phar mount points not working with OPcache enabled).
|
||||
(Dmitry)
|
||||
|
||||
- ODBC
|
||||
. Fixed bug #65950 (Field name truncation if the field name is bigger than
|
||||
32 characters). (patch submitted by: michael dot y at zend dot com, Yasuo)
|
||||
|
||||
- PDO:
|
||||
. Fixed bug #66033 (Segmentation Fault when constructor of PDO statement
|
||||
throws an exception). (Laruence)
|
||||
. Fixed bug 65946 (sql_parser permanently converts values bound to strings)
|
||||
|
||||
- Standard:
|
||||
. Fixed bug #64760 (var_export() does not use full precision for floating-point
|
||||
numbers) (Yasuo)
|
||||
|
||||
|
||||
17 Oct 2013, PHP 5.5.5
|
||||
|
||||
- Core:
|
||||
. Fixed bug #64979 (Wrong behavior of static variables in closure generators).
|
||||
(Nikita)
|
||||
. Fixed bug #65322 (compile time errors won't trigger auto loading). (Nikita)
|
||||
. Fixed bug #65821 (By-ref foreach on property access of string offset
|
||||
segfaults). (Nikita)
|
||||
|
||||
- CLI server:
|
||||
. Fixed bug #65633 (built-in server treat some http headers as
|
||||
case-sensitive). (Adam)
|
||||
. Fixed bug #65818 (Segfault with built-in webserver and chunked transfer
|
||||
encoding). (Felipe)
|
||||
. Added application/pdf to PHP CLI Web Server mime types (Chris Jones)
|
||||
|
||||
- Datetime:
|
||||
. Fixed bug #64157 (DateTime::createFromFormat() reports confusing error
|
||||
message). (Boro Sitnikovski)
|
||||
. Fixed bug #65502 (DateTimeImmutable::createFromFormat returns DateTime).
|
||||
(Boro Sitnikovski)
|
||||
. Fixed bug #65548 (Comparison for DateTimeImmutable doesn't work).
|
||||
(Boro Sitnikovski)
|
||||
|
||||
- DBA extension:
|
||||
. Fixed bug #65708 (dba functions cast $key param to string in-place,
|
||||
bypassing copy on write). (Adam)
|
||||
|
||||
- Filter:
|
||||
. Add RFC 6598 IPs to reserved addresses. (Sebastian Nohn)
|
||||
. Fixed bug #64441 (FILTER_VALIDATE_URL rejects fully qualified domain names).
|
||||
(Syra)
|
||||
|
||||
- FTP:
|
||||
. Fixed bug #65667 (ftp_nb_continue produces segfault). (Philip Hofstetter)
|
||||
|
||||
- GD
|
||||
. Ensure that the defined interpolation method is used with the generic
|
||||
scaling methods. (Pierre)
|
||||
|
||||
- IMAP:
|
||||
. Fixed bug #65721 (configure script broken in 5.5.4 and 5.4.20 when enabling
|
||||
imap). (ryotakatsuki at gmail dot com)
|
||||
|
||||
- OPcache:
|
||||
. Added support for GNU Hurd. (Svante Signell)
|
||||
. Added function opcache_compile_file() to load PHP scripts into cache
|
||||
without execution. (Julien)
|
||||
. Fixed bug #65845 (Error when Zend Opcache Optimizer is fully enabled).
|
||||
(Dmitry)
|
||||
. Fixed bug #65665 (Exception not properly caught when opcache enabled).
|
||||
(Laruence)
|
||||
. Fixed bug #65510 (5.5.2 crashes in _get_zval_ptr_ptr_var). (Dmitry)
|
||||
. Fixed issue #135 (segfault in interned strings if initial memory is too
|
||||
low). (Julien)
|
||||
|
||||
- Sockets:
|
||||
. Fixed bug #65808 (the socket_connect() won't work with IPv6 address).
|
||||
(Mike)
|
||||
|
||||
- SPL:
|
||||
. Fix bug #64782 (SplFileObject constructor make $context optional / give it
|
||||
a default value). (Nikita)
|
||||
|
||||
?? ??? 2013, PHP 5.5.4
|
||||
- Standard:
|
||||
. Fixed bug #61548 (content-type must appear at the end of headers for 201
|
||||
Location to work in http). (Mike)
|
||||
|
||||
- XMLReader:
|
||||
. Fixed bug #51936 (Crash with clone XMLReader). (Mike)
|
||||
. Fixed bug #64230 (XMLReader does not suppress errors). (Mike)
|
||||
|
||||
- Build system:
|
||||
. Fixed bug #51076 (race condition in shtool's mkdir -p implementation).
|
||||
(Mike, Raphael Geissert)
|
||||
. Fixed bug #62396 ('make test' crashes starting with 5.3.14 (missing
|
||||
gzencode())). (Mike)
|
||||
|
||||
|
||||
19 Sep 2013, PHP 5.5.4
|
||||
|
||||
- Core:
|
||||
. Fixed bug #60598 (cli/apache sapi segfault on objects manipulation).
|
||||
@@ -35,6 +156,7 @@ PHP NEWS
|
||||
DTRACE_FUNCTION_*). (Chris Jones)
|
||||
. Fixed bug #65483 (quoted-printable encode stream filter incorrectly encoding
|
||||
spaces). (Michael M Slusarz)
|
||||
. Fixed bug #65481 (shutdown segfault due to serialize) (Mike)
|
||||
. Fixed bug #65470 (Segmentation fault in zend_error() with
|
||||
--enable-dtrace). (Chris Jones, Kris Van Hees)
|
||||
. Fixed bug #65225 (PHP_BINARY incorrectly set). (Patrick Allaert)
|
||||
@@ -61,6 +183,10 @@ PHP NEWS
|
||||
. Fixed bug #64802 (openssl_x509_parse fails to parse subject properly in
|
||||
some cases). (Mark Jones)
|
||||
|
||||
- PDO:
|
||||
. Fixed bug #64953 (Postgres prepared statement positional parameter
|
||||
casting). (Mike)
|
||||
|
||||
- Session:
|
||||
. Fixed bug #65475 (Session ID is not initialized properly when strict session
|
||||
is enabled). (Yasuo)
|
||||
@@ -71,6 +197,10 @@ PHP NEWS
|
||||
. Fix issue with return types of password API helper functions. Found via
|
||||
static analysis by cjones. (Anthony Ferrara)
|
||||
|
||||
- Zlib:
|
||||
. Fixed bug #65391 (Unable to send vary header user-agent when
|
||||
ob_start('ob_gzhandler') is called) (Mike)
|
||||
|
||||
22 Aug 2013, PHP 5.5.3
|
||||
|
||||
- Openssl:
|
||||
|
||||
+1
-1
@@ -30,7 +30,7 @@ zend_module_entry foo_module_entry = {
|
||||
PHP_RSHUTDOWN(foo), /* per-request shutdown function */
|
||||
PHP_MINFO(foo), /* information function */
|
||||
#if ZEND_MODULE_API_NO >= 20010901
|
||||
FOO_VERSION, /* extension version number (string) */
|
||||
PHP_FOO_VERSION, /* extension version number (string) */
|
||||
#endif
|
||||
STANDARD_MODULE_PROPERTIES
|
||||
};
|
||||
|
||||
@@ -31,6 +31,11 @@ HOW TO USE IT
|
||||
|
||||
./buildconf; ./configure --enable-module_name; make
|
||||
|
||||
The definition of PHP_MODULE_NAME_VERSION will be present in the
|
||||
php_module_name.h and injected into the zend_module_entry definition. This
|
||||
is required by the PECL website for the version string conformity checks
|
||||
against package.xml
|
||||
|
||||
But if you already have planned the overall scheme of your module, what
|
||||
functions it will contain, their return types and the arguments they take
|
||||
(a very good idea) and don't want to bother yourself with creating function
|
||||
|
||||
@@ -153,3 +153,18 @@ ADDING SHARED MODULE SUPPORT TO A MODULE
|
||||
#ifdef COMPILE_DL_FOO
|
||||
ZEND_GET_MODULE(foo)
|
||||
#endif
|
||||
|
||||
PECL SITE CONFORMITY
|
||||
|
||||
If you plan to release an extension to the PECL website, there are several
|
||||
points to be regarded.
|
||||
|
||||
1. Add LICENSE or COPYING to the package.xml
|
||||
|
||||
2. The following should be defined in one of the extension header files
|
||||
|
||||
#define PHP_FOO_VERSION "1.2.3"
|
||||
|
||||
This macros has to be used within your foo_module_entry to indicate the
|
||||
extension version.
|
||||
|
||||
@@ -17,7 +17,7 @@ See https://wiki.php.net/rfc and https://wiki.php.net/rfc/voting for more
|
||||
information on the process.
|
||||
|
||||
Bug fixes **do not** require an RFC, but require a bugtracker ticket. Always
|
||||
open a ticket at http://bugs.php.net and reference the bug id using #NNNNNN.
|
||||
open a ticket at https://bugs.php.net and reference the bug id using #NNNNNN.
|
||||
|
||||
Fix #55371: get_magic_quotes_gpc() throws deprecation warning
|
||||
|
||||
@@ -28,3 +28,12 @@ open a ticket at http://bugs.php.net and reference the bug id using #NNNNNN.
|
||||
|
||||
We do not merge pull requests directly on github. All PRs will be
|
||||
pulled and pushed through http://git.php.net.
|
||||
|
||||
|
||||
Guidelines for contributors
|
||||
===========================
|
||||
- [CODING_STANDARDS](/CODING_STANDARDS)
|
||||
- [README.GIT-RULES](/README.GIT-RULES)
|
||||
- [README.MAILINGLIST_RULES](/README.MAILINGLIST_RULES)
|
||||
- [README.RELEASE_PROCESS](/README.RELEASE_PROCESS)
|
||||
|
||||
@@ -343,6 +343,8 @@ None
|
||||
|
||||
- Intl:
|
||||
- This extension now requires ICU 4.0+.
|
||||
- Phar:
|
||||
- Added ability of resolving alias created by Phar::map
|
||||
|
||||
========================================
|
||||
9. New Global Constants
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ AC_DEFUN([LIBZEND_BISON_CHECK],[
|
||||
bison_version=none
|
||||
if test "$YACC"; then
|
||||
AC_CACHE_CHECK([for bison version], php_cv_bison_version, [
|
||||
bison_version_vars=`bison --version 2> /dev/null | grep 'GNU Bison' | cut -d ' ' -f 4 | $SED -e 's/\./ /' | tr -d a-z`
|
||||
bison_version_vars=`$YACC --version 2> /dev/null | grep 'GNU Bison' | cut -d ' ' -f 4 | $SED -e 's/\./ /g' | tr -d a-z`
|
||||
php_cv_bison_version=invalid
|
||||
if test -n "$bison_version_vars"; then
|
||||
set $bison_version_vars
|
||||
|
||||
@@ -1,15 +1,13 @@
|
||||
--TEST--
|
||||
Bug #64578 (Closures with static variables can be generators)
|
||||
--XFAIL--
|
||||
Bug #64979 not fixed yet.
|
||||
Bug #64979 (Wrong behavior of static variables in closure generators)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
function new_closure_gen() {
|
||||
return function() {
|
||||
static $foo = 0;
|
||||
yield ++$foo;
|
||||
};
|
||||
return function() {
|
||||
static $foo = 0;
|
||||
yield ++$foo;
|
||||
};
|
||||
}
|
||||
|
||||
$closure1 = new_closure_gen();
|
||||
@@ -20,9 +18,9 @@ $gen2 = $closure1();
|
||||
$gen3 = $closure2();
|
||||
|
||||
foreach (array($gen1, $gen2, $gen3) as $gen) {
|
||||
foreach ($gen as $val) {
|
||||
print "$val\n";
|
||||
}
|
||||
foreach ($gen as $val) {
|
||||
var_dump($val);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
--TEST--
|
||||
Bug #65322: compile time errors won't trigger auto loading
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
spl_autoload_register(function($class) {
|
||||
var_dump($class);
|
||||
class B {}
|
||||
});
|
||||
|
||||
set_error_handler(function($_, $msg, $file) {
|
||||
var_dump($msg, $file);
|
||||
new B;
|
||||
});
|
||||
|
||||
eval('class A { function a() {} function __construct() {} }');
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
string(50) "Redefining already defined constructor for class A"
|
||||
string(%d) "%s(%d) : eval()'d code"
|
||||
string(1) "B"
|
||||
@@ -0,0 +1,20 @@
|
||||
--TEST--
|
||||
Bug #65911 (scope resolution operator - strange behavior with $this)
|
||||
--FILE--
|
||||
<?php
|
||||
class A {}
|
||||
|
||||
class B
|
||||
{
|
||||
public function go()
|
||||
{
|
||||
$this->foo = 'bar';
|
||||
echo A::$this->foo; // should not output 'bar'
|
||||
}
|
||||
}
|
||||
|
||||
$obj = new B();
|
||||
$obj->go();
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Access to undeclared static property: A::$this in %s on line %d
|
||||
@@ -0,0 +1,18 @@
|
||||
--TEST--
|
||||
Error message in error handler during compilation
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
set_error_handler(function($_, $msg, $file) {
|
||||
var_dump($msg, $file);
|
||||
echo $undefined;
|
||||
});
|
||||
|
||||
eval('class A { function a() {} function __construct() {} }');
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
string(50) "Redefining already defined constructor for class A"
|
||||
string(%d) "%s(%d) : eval()'d code"
|
||||
|
||||
Notice: Undefined variable: undefined in %s on line %d
|
||||
+3
-1
@@ -1184,7 +1184,7 @@ ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */
|
||||
* such scripts recursivly, but some CG() variables may be
|
||||
* inconsistent. */
|
||||
|
||||
in_compilation = zend_is_compiling(TSRMLS_C);
|
||||
in_compilation = CG(in_compilation);
|
||||
if (in_compilation) {
|
||||
saved_class_entry = CG(active_class_entry);
|
||||
CG(active_class_entry) = NULL;
|
||||
@@ -1196,6 +1196,7 @@ ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */
|
||||
SAVE_STACK(declare_stack);
|
||||
SAVE_STACK(list_stack);
|
||||
SAVE_STACK(context_stack);
|
||||
CG(in_compilation) = 0;
|
||||
}
|
||||
|
||||
if (call_user_function_ex(CG(function_table), NULL, orig_user_error_handler, &retval, 5, params, 1, NULL TSRMLS_CC) == SUCCESS) {
|
||||
@@ -1220,6 +1221,7 @@ ZEND_API void zend_error(int type, const char *format, ...) /* {{{ */
|
||||
RESTORE_STACK(declare_stack);
|
||||
RESTORE_STACK(list_stack);
|
||||
RESTORE_STACK(context_stack);
|
||||
CG(in_compilation) = 1;
|
||||
}
|
||||
|
||||
if (!EG(user_error_handler)) {
|
||||
|
||||
@@ -461,12 +461,17 @@ ZEND_FUNCTION(func_get_args)
|
||||
|
||||
array_init_size(return_value, arg_count);
|
||||
for (i=0; i<arg_count; i++) {
|
||||
zval *element;
|
||||
zval *element, *arg;
|
||||
|
||||
ALLOC_ZVAL(element);
|
||||
*element = **((zval **) (p-(arg_count-i)));
|
||||
zval_copy_ctor(element);
|
||||
INIT_PZVAL(element);
|
||||
arg = *((zval **) (p-(arg_count-i)));
|
||||
if (!Z_ISREF_P(arg)) {
|
||||
element = arg;
|
||||
Z_ADDREF_P(element);
|
||||
} else {
|
||||
ALLOC_ZVAL(element);
|
||||
INIT_PZVAL_COPY(element, arg);
|
||||
zval_copy_ctor(element);
|
||||
}
|
||||
zend_hash_next_index_insert(return_value->value.ht, &element, sizeof(zval *), NULL);
|
||||
}
|
||||
}
|
||||
|
||||
+3
-31
@@ -908,6 +908,7 @@ static zend_bool opline_is_fetch_this(const zend_op *opline TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
if ((opline->opcode == ZEND_FETCH_W) && (opline->op1_type == IS_CONST)
|
||||
&& (Z_TYPE(CONSTANT(opline->op1.constant)) == IS_STRING)
|
||||
&& ((opline->extended_value & ZEND_FETCH_STATIC_MEMBER) != ZEND_FETCH_STATIC_MEMBER)
|
||||
&& (Z_HASH_P(&CONSTANT(opline->op1.constant)) == THIS_HASHVAL)
|
||||
&& (Z_STRLEN(CONSTANT(opline->op1.constant)) == (sizeof("this")-1))
|
||||
&& !memcmp(Z_STRVAL(CONSTANT(opline->op1.constant)), "this", sizeof("this"))) {
|
||||
@@ -1749,7 +1750,6 @@ void zend_do_begin_function_declaration(znode *function_token, znode *function_n
|
||||
zend_op dummy_opline;
|
||||
|
||||
dummy_opline.result_type = IS_UNUSED;
|
||||
dummy_opline.op1_type = IS_UNUSED;
|
||||
|
||||
zend_stack_push(&CG(foreach_copy_stack), (void *) &dummy_opline, sizeof(zend_op));
|
||||
}
|
||||
@@ -2662,7 +2662,7 @@ static int generate_free_switch_expr(const zend_switch_entry *switch_entry TSRML
|
||||
opline->opcode = (switch_entry->cond.op_type == IS_TMP_VAR) ? ZEND_FREE : ZEND_SWITCH_FREE;
|
||||
SET_NODE(opline->op1, &switch_entry->cond);
|
||||
SET_UNUSED(opline->op2);
|
||||
opline->extended_value = 0;
|
||||
|
||||
return 0;
|
||||
}
|
||||
/* }}} */
|
||||
@@ -2672,7 +2672,7 @@ static int generate_free_foreach_copy(const zend_op *foreach_copy TSRMLS_DC) /*
|
||||
zend_op *opline;
|
||||
|
||||
/* If we reach the separator then stop applying the stack */
|
||||
if (foreach_copy->result_type == IS_UNUSED && foreach_copy->op1_type == IS_UNUSED) {
|
||||
if (foreach_copy->result_type == IS_UNUSED) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -2681,16 +2681,6 @@ static int generate_free_foreach_copy(const zend_op *foreach_copy TSRMLS_DC) /*
|
||||
opline->opcode = (foreach_copy->result_type == IS_TMP_VAR) ? ZEND_FREE : ZEND_SWITCH_FREE;
|
||||
COPY_NODE(opline->op1, foreach_copy->result);
|
||||
SET_UNUSED(opline->op2);
|
||||
opline->extended_value = 1;
|
||||
|
||||
if (foreach_copy->op1_type != IS_UNUSED) {
|
||||
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
|
||||
|
||||
opline->opcode = (foreach_copy->op1_type == IS_TMP_VAR) ? ZEND_FREE : ZEND_SWITCH_FREE;
|
||||
COPY_NODE(opline->op1, foreach_copy->op1);
|
||||
SET_UNUSED(opline->op2);
|
||||
opline->extended_value = 0;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -6227,7 +6217,6 @@ void zend_do_foreach_begin(znode *foreach_token, znode *open_brackets_token, zno
|
||||
{
|
||||
zend_op *opline;
|
||||
zend_bool is_variable;
|
||||
zend_bool push_container = 0;
|
||||
zend_op dummy_opline;
|
||||
|
||||
if (variable) {
|
||||
@@ -6239,14 +6228,6 @@ void zend_do_foreach_begin(znode *foreach_token, znode *open_brackets_token, zno
|
||||
/* save the location of FETCH_W instruction(s) */
|
||||
open_brackets_token->u.op.opline_num = get_next_op_number(CG(active_op_array));
|
||||
zend_do_end_variable_parse(array, BP_VAR_W, 0 TSRMLS_CC);
|
||||
if (CG(active_op_array)->last > 0 &&
|
||||
CG(active_op_array)->opcodes[CG(active_op_array)->last-1].opcode == ZEND_FETCH_OBJ_W) {
|
||||
/* Only lock the container if we are fetching from a real container and not $this */
|
||||
if (CG(active_op_array)->opcodes[CG(active_op_array)->last-1].op1_type == IS_VAR) {
|
||||
CG(active_op_array)->opcodes[CG(active_op_array)->last-1].extended_value |= ZEND_FETCH_ADD_LOCK;
|
||||
push_container = 1;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
is_variable = 0;
|
||||
open_brackets_token->u.op.opline_num = get_next_op_number(CG(active_op_array));
|
||||
@@ -6266,11 +6247,6 @@ void zend_do_foreach_begin(znode *foreach_token, znode *open_brackets_token, zno
|
||||
opline->extended_value = is_variable ? ZEND_FE_RESET_VARIABLE : 0;
|
||||
|
||||
COPY_NODE(dummy_opline.result, opline->result);
|
||||
if (push_container) {
|
||||
COPY_NODE(dummy_opline.op1, CG(active_op_array)->opcodes[CG(active_op_array)->last-2].op1);
|
||||
} else {
|
||||
dummy_opline.op1_type = IS_UNUSED;
|
||||
}
|
||||
zend_stack_push(&CG(foreach_copy_stack), (void *) &dummy_opline, sizeof(zend_op));
|
||||
|
||||
/* save the location of FE_FETCH */
|
||||
@@ -6327,7 +6303,6 @@ void zend_do_foreach_cont(znode *foreach_token, const znode *open_brackets_token
|
||||
opline->extended_value |= ZEND_FE_FETCH_BYREF;
|
||||
CG(active_op_array)->opcodes[foreach_token->u.op.opline_num].extended_value |= ZEND_FE_RESET_REFERENCE;
|
||||
} else {
|
||||
zend_op *foreach_copy;
|
||||
zend_op *fetch = &CG(active_op_array)->opcodes[foreach_token->u.op.opline_num];
|
||||
zend_op *end = &CG(active_op_array)->opcodes[open_brackets_token->u.op.opline_num];
|
||||
|
||||
@@ -6344,9 +6319,6 @@ void zend_do_foreach_cont(znode *foreach_token, const znode *open_brackets_token
|
||||
fetch->opcode -= 3; /* FETCH_W -> FETCH_R */
|
||||
}
|
||||
}
|
||||
/* prevent double SWITCH_FREE */
|
||||
zend_stack_top(&CG(foreach_copy_stack), (void **) &foreach_copy);
|
||||
foreach_copy->op1_type = IS_UNUSED;
|
||||
}
|
||||
|
||||
GET_NODE(&value_node, opline->result);
|
||||
|
||||
@@ -560,7 +560,7 @@ ZEND_METHOD(exception, getPrevious)
|
||||
RETURN_ZVAL(previous, 1, 0);
|
||||
}
|
||||
|
||||
int zend_spprintf(char **message, int max_len, char *format, ...) /* {{{ */
|
||||
int zend_spprintf(char **message, int max_len, const char *format, ...) /* {{{ */
|
||||
{
|
||||
va_list arg;
|
||||
int len;
|
||||
@@ -732,7 +732,7 @@ ZEND_API zend_class_entry *zend_get_error_exception(TSRMLS_D) /* {{{ */
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
ZEND_API zval * zend_throw_exception(zend_class_entry *exception_ce, char *message, long code TSRMLS_DC) /* {{{ */
|
||||
ZEND_API zval * zend_throw_exception(zend_class_entry *exception_ce, const char *message, long code TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
zval *ex;
|
||||
|
||||
@@ -760,7 +760,7 @@ ZEND_API zval * zend_throw_exception(zend_class_entry *exception_ce, char *messa
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
ZEND_API zval * zend_throw_exception_ex(zend_class_entry *exception_ce, long code TSRMLS_DC, char *format, ...) /* {{{ */
|
||||
ZEND_API zval * zend_throw_exception_ex(zend_class_entry *exception_ce, long code TSRMLS_DC, const char *format, ...) /* {{{ */
|
||||
{
|
||||
va_list arg;
|
||||
char *message;
|
||||
@@ -775,7 +775,7 @@ ZEND_API zval * zend_throw_exception_ex(zend_class_entry *exception_ce, long cod
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
ZEND_API zval * zend_throw_error_exception(zend_class_entry *exception_ce, char *message, long code, int severity TSRMLS_DC) /* {{{ */
|
||||
ZEND_API zval * zend_throw_error_exception(zend_class_entry *exception_ce, const char *message, long code, int severity TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
zval *ex = zend_throw_exception(exception_ce, message, code TSRMLS_CC);
|
||||
zend_update_property_long(default_exception_ce, ex, "severity", sizeof("severity")-1, severity TSRMLS_CC);
|
||||
|
||||
@@ -40,12 +40,12 @@ ZEND_API void zend_register_default_classes(TSRMLS_D);
|
||||
|
||||
/* exception_ce NULL or zend_exception_get_default() or a derived class
|
||||
* message NULL or the message of the exception */
|
||||
ZEND_API zval * zend_throw_exception(zend_class_entry *exception_ce, char *message, long code TSRMLS_DC);
|
||||
ZEND_API zval * zend_throw_exception_ex(zend_class_entry *exception_ce, long code TSRMLS_DC, char *format, ...);
|
||||
ZEND_API zval * zend_throw_exception(zend_class_entry *exception_ce, const char *message, long code TSRMLS_DC);
|
||||
ZEND_API zval * zend_throw_exception_ex(zend_class_entry *exception_ce, long code TSRMLS_DC, const char *format, ...);
|
||||
ZEND_API void zend_throw_exception_object(zval *exception TSRMLS_DC);
|
||||
ZEND_API void zend_clear_exception(TSRMLS_D);
|
||||
|
||||
ZEND_API zval * zend_throw_error_exception(zend_class_entry *exception_ce, char *message, long code, int severity TSRMLS_DC);
|
||||
ZEND_API zval * zend_throw_error_exception(zend_class_entry *exception_ce, const char *message, long code, int severity TSRMLS_DC);
|
||||
|
||||
extern ZEND_API void (*zend_throw_exception_hook)(zval *ex TSRMLS_DC);
|
||||
|
||||
@@ -53,7 +53,7 @@ extern ZEND_API void (*zend_throw_exception_hook)(zval *ex TSRMLS_DC);
|
||||
ZEND_API void zend_exception_error(zval *exception, int severity TSRMLS_DC);
|
||||
|
||||
/* do not export, in php it's available thru spprintf directly */
|
||||
int zend_spprintf(char **message, int max_len, char *format, ...);
|
||||
int zend_spprintf(char **message, int max_len, const char *format, ...);
|
||||
|
||||
END_EXTERN_C()
|
||||
|
||||
|
||||
+27
-1
@@ -226,6 +226,16 @@ static zend_object_value zend_generator_create(zend_class_entry *class_type TSRM
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static void copy_closure_static_var(zval **var TSRMLS_DC, int num_args, va_list args, zend_hash_key *key) /* {{{ */
|
||||
{
|
||||
HashTable *target = va_arg(args, HashTable *);
|
||||
|
||||
SEPARATE_ZVAL_TO_MAKE_IS_REF(var);
|
||||
Z_ADDREF_PP(var);
|
||||
zend_hash_quick_update(target, key->arKey, key->nKeyLength, key->h, var, sizeof(zval *), NULL);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
/* Requires globals EG(scope), EG(current_scope), EG(This),
|
||||
* EG(active_symbol_table) and EG(current_execute_data). */
|
||||
ZEND_API zval *zend_generator_create_zval(zend_op_array *op_array TSRMLS_DC) /* {{{ */
|
||||
@@ -242,7 +252,23 @@ ZEND_API zval *zend_generator_create_zval(zend_op_array *op_array TSRMLS_DC) /*
|
||||
if (op_array->fn_flags & ZEND_ACC_CLOSURE) {
|
||||
zend_op_array *op_array_copy = (zend_op_array*)emalloc(sizeof(zend_op_array));
|
||||
*op_array_copy = *op_array;
|
||||
function_add_ref((zend_function *) op_array_copy);
|
||||
|
||||
(*op_array->refcount)++;
|
||||
op_array->run_time_cache = NULL;
|
||||
if (op_array->static_variables) {
|
||||
ALLOC_HASHTABLE(op_array_copy->static_variables);
|
||||
zend_hash_init(
|
||||
op_array_copy->static_variables,
|
||||
zend_hash_num_elements(op_array->static_variables),
|
||||
NULL, ZVAL_PTR_DTOR, 0
|
||||
);
|
||||
zend_hash_apply_with_arguments(
|
||||
op_array->static_variables TSRMLS_CC,
|
||||
(apply_func_args_t) copy_closure_static_var,
|
||||
1, op_array_copy->static_variables
|
||||
);
|
||||
}
|
||||
|
||||
op_array = op_array_copy;
|
||||
}
|
||||
|
||||
|
||||
@@ -789,6 +789,7 @@ static zend_always_inline int fast_mul_function(zval *result, zval *op1, zval *o
|
||||
|
||||
static zend_always_inline int fast_div_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
|
||||
{
|
||||
#if 0
|
||||
if (EXPECTED(Z_TYPE_P(op1) == IS_LONG) && 0) {
|
||||
if (EXPECTED(Z_TYPE_P(op2) == IS_LONG)) {
|
||||
if (UNEXPECTED(Z_LVAL_P(op2) == 0)) {
|
||||
@@ -843,6 +844,7 @@ static zend_always_inline int fast_div_function(zval *result, zval *op1, zval *o
|
||||
return SUCCESS;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return div_function(result, op1, op2 TSRMLS_CC);
|
||||
}
|
||||
|
||||
|
||||
+13
-20
@@ -1392,11 +1392,6 @@ ZEND_VM_HANDLER(85, ZEND_FETCH_OBJ_W, VAR|UNUSED|CV, CONST|TMP|VAR|CV)
|
||||
SAVE_OPLINE();
|
||||
property = GET_OP2_ZVAL_PTR(BP_VAR_R);
|
||||
|
||||
if (OP1_TYPE == IS_VAR && (opline->extended_value & ZEND_FETCH_ADD_LOCK)) {
|
||||
PZVAL_LOCK(*EX_T(opline->op1.var).var.ptr_ptr);
|
||||
EX_T(opline->op1.var).var.ptr = *EX_T(opline->op1.var).var.ptr_ptr;
|
||||
}
|
||||
|
||||
if (IS_OP2_TMP_FREE()) {
|
||||
MAKE_REAL_ZVAL_PTR(property);
|
||||
}
|
||||
@@ -4458,22 +4453,22 @@ ZEND_VM_HELPER_EX(zend_isset_isempty_dim_prop_obj_handler, VAR|UNUSED|CV, CONST|
|
||||
{
|
||||
USE_OPLINE
|
||||
zend_free_op free_op1, free_op2;
|
||||
zval **container;
|
||||
zval *container;
|
||||
zval **value = NULL;
|
||||
int result = 0;
|
||||
ulong hval;
|
||||
zval *offset;
|
||||
|
||||
SAVE_OPLINE();
|
||||
container = GET_OP1_OBJ_ZVAL_PTR_PTR(BP_VAR_IS);
|
||||
container = GET_OP1_OBJ_ZVAL_PTR(BP_VAR_IS);
|
||||
|
||||
offset = GET_OP2_ZVAL_PTR(BP_VAR_R);
|
||||
|
||||
if (Z_TYPE_PP(container) == IS_ARRAY && !prop_dim) {
|
||||
if (Z_TYPE_P(container) == IS_ARRAY && !prop_dim) {
|
||||
HashTable *ht;
|
||||
int isset = 0;
|
||||
|
||||
ht = Z_ARRVAL_PP(container);
|
||||
ht = Z_ARRVAL_P(container);
|
||||
|
||||
switch (Z_TYPE_P(offset)) {
|
||||
case IS_DOUBLE:
|
||||
@@ -4492,9 +4487,7 @@ ZEND_VM_C_LABEL(num_index_prop):
|
||||
if (OP2_TYPE == IS_CONST) {
|
||||
hval = Z_HASH_P(offset);
|
||||
} else {
|
||||
if (!prop_dim) {
|
||||
ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, ZEND_VM_C_GOTO(num_index_prop));
|
||||
}
|
||||
ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, ZEND_VM_C_GOTO(num_index_prop));
|
||||
if (IS_INTERNED(Z_STRVAL_P(offset))) {
|
||||
hval = INTERNED_HASH(Z_STRVAL_P(offset));
|
||||
} else {
|
||||
@@ -4529,20 +4522,20 @@ ZEND_VM_C_LABEL(num_index_prop):
|
||||
}
|
||||
}
|
||||
FREE_OP2();
|
||||
} else if (Z_TYPE_PP(container) == IS_OBJECT) {
|
||||
} else if (Z_TYPE_P(container) == IS_OBJECT) {
|
||||
if (IS_OP2_TMP_FREE()) {
|
||||
MAKE_REAL_ZVAL_PTR(offset);
|
||||
}
|
||||
if (prop_dim) {
|
||||
if (Z_OBJ_HT_P(*container)->has_property) {
|
||||
result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value & ZEND_ISEMPTY) != 0, ((OP2_TYPE == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
if (Z_OBJ_HT_P(container)->has_property) {
|
||||
result = Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISEMPTY) != 0, ((OP2_TYPE == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
|
||||
} else {
|
||||
zend_error(E_NOTICE, "Trying to check property of non-object");
|
||||
result = 0;
|
||||
}
|
||||
} else {
|
||||
if (Z_OBJ_HT_P(*container)->has_dimension) {
|
||||
result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value & ZEND_ISEMPTY) != 0 TSRMLS_CC);
|
||||
if (Z_OBJ_HT_P(container)->has_dimension) {
|
||||
result = Z_OBJ_HT_P(container)->has_dimension(container, offset, (opline->extended_value & ZEND_ISEMPTY) != 0 TSRMLS_CC);
|
||||
} else {
|
||||
zend_error(E_NOTICE, "Trying to check element of non-array");
|
||||
result = 0;
|
||||
@@ -4553,7 +4546,7 @@ ZEND_VM_C_LABEL(num_index_prop):
|
||||
} else {
|
||||
FREE_OP2();
|
||||
}
|
||||
} else if ((*container)->type == IS_STRING && !prop_dim) { /* string offsets */
|
||||
} else if (Z_TYPE_P(container) == IS_STRING && !prop_dim) { /* string offsets */
|
||||
zval tmp;
|
||||
|
||||
if (Z_TYPE_P(offset) != IS_LONG) {
|
||||
@@ -4571,11 +4564,11 @@ ZEND_VM_C_LABEL(num_index_prop):
|
||||
}
|
||||
if (Z_TYPE_P(offset) == IS_LONG) {
|
||||
if (opline->extended_value & ZEND_ISSET) {
|
||||
if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container)) {
|
||||
if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_P(container)) {
|
||||
result = 1;
|
||||
}
|
||||
} else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
|
||||
if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_PP(container) && Z_STRVAL_PP(container)[offset->value.lval] != '0') {
|
||||
if (offset->value.lval >= 0 && offset->value.lval < Z_STRLEN_P(container) && Z_STRVAL_P(container)[offset->value.lval] != '0') {
|
||||
result = 1;
|
||||
}
|
||||
}
|
||||
|
||||
+156
-240
File diff suppressed because it is too large.
Load diff
+8
-1
@@ -1003,7 +1003,14 @@ mkdir )
|
||||
if [ ".$opt_t" = .yes ]; then
|
||||
echo "mkdir $pathcomp" 1>&2
|
||||
fi
|
||||
mkdir $pathcomp || errstatus=$?
|
||||
# See https://bugs.php.net/51076
|
||||
# The fix is from Debian who have sent it
|
||||
# upstream, too; but upstream seems dead.
|
||||
mkdir $pathcomp || {
|
||||
_errstatus=$?
|
||||
[ -d "$pathcomp" ] || errstatus=${_errstatus}
|
||||
unset _errstatus
|
||||
}
|
||||
if [ ".$opt_o" != . ]; then
|
||||
if [ ".$opt_t" = .yes ]; then
|
||||
echo "chown $opt_o $pathcomp" 1>&2
|
||||
|
||||
+2
-2
@@ -119,8 +119,8 @@ int zend_sprintf(char *buffer, const char *format, ...);
|
||||
|
||||
PHP_MAJOR_VERSION=5
|
||||
PHP_MINOR_VERSION=5
|
||||
PHP_RELEASE_VERSION=5
|
||||
PHP_EXTRA_VERSION="-dev"
|
||||
PHP_RELEASE_VERSION=7
|
||||
PHP_EXTRA_VERSION=""
|
||||
PHP_VERSION="$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION.$PHP_RELEASE_VERSION$PHP_EXTRA_VERSION"
|
||||
PHP_VERSION_ID=`expr [$]PHP_MAJOR_VERSION \* 10000 + [$]PHP_MINOR_VERSION \* 100 + [$]PHP_RELEASE_VERSION`
|
||||
|
||||
|
||||
@@ -183,7 +183,6 @@ _bc_rec_mul (bc_num u, int ulen, bc_num v, int vlen, bc_num *prod,
|
||||
int full_scale TSRMLS_DC)
|
||||
{
|
||||
bc_num u0, u1, v0, v1;
|
||||
int u0len, v0len;
|
||||
bc_num m1, m2, m3, d1, d2;
|
||||
int n, prodlen, m1zero;
|
||||
int d1len, d2len;
|
||||
@@ -216,10 +215,8 @@ _bc_rec_mul (bc_num u, int ulen, bc_num v, int vlen, bc_num *prod,
|
||||
}
|
||||
_bc_rm_leading_zeros (u1);
|
||||
_bc_rm_leading_zeros (u0);
|
||||
u0len = u0->n_len;
|
||||
_bc_rm_leading_zeros (v1);
|
||||
_bc_rm_leading_zeros (v0);
|
||||
v0len = v0->n_len;
|
||||
|
||||
m1zero = bc_is_zero(u1 TSRMLS_CC) || bc_is_zero(v1 TSRMLS_CC);
|
||||
|
||||
|
||||
@@ -97,6 +97,7 @@ static php_stream_filter_status_t php_bz2_decompress_filter(
|
||||
status = BZ2_bzDecompressInit(streamp, 0, data->small_footprint);
|
||||
|
||||
if (BZ_OK != status) {
|
||||
php_stream_bucket_delref(bucket TSRMLS_CC);
|
||||
return PSFS_ERR_FATAL;
|
||||
}
|
||||
|
||||
|
||||
+922
-930
File diff suppressed because it is too large.
Load diff
@@ -1406,6 +1406,7 @@ PHPAPI signed long php_parse_date(char *string, signed long *now)
|
||||
|
||||
parsed_time = timelib_strtotime(string, strlen(string), &error, DATE_TIMEZONEDB, php_date_parse_tzfile_wrapper);
|
||||
if (error->error_count) {
|
||||
timelib_time_dtor(parsed_time);
|
||||
timelib_error_container_dtor(error);
|
||||
return -1;
|
||||
}
|
||||
|
||||
+25
-9
@@ -226,12 +226,17 @@ static size_t php_dba_make_key(zval *key, char **key_str, char **key_free TSRMLS
|
||||
*key_free = *key_str;
|
||||
return len;
|
||||
} else {
|
||||
*key_free = NULL;
|
||||
zval tmp = *key;
|
||||
int len;
|
||||
|
||||
convert_to_string(key);
|
||||
*key_str = Z_STRVAL_P(key);
|
||||
zval_copy_ctor(&tmp);
|
||||
convert_to_string(&tmp);
|
||||
|
||||
return Z_STRLEN_P(key);
|
||||
*key_free = *key_str = estrndup(Z_STRVAL(tmp), Z_STRLEN(tmp));
|
||||
len = Z_STRLEN(tmp);
|
||||
|
||||
zval_dtor(&tmp);
|
||||
return len;
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
@@ -297,6 +302,14 @@ static size_t php_dba_make_key(zval *key, char **key_str, char **key_free TSRMLS
|
||||
RETURN_FALSE; \
|
||||
}
|
||||
|
||||
/* the same check, but with a call to DBA_ID_DONE before returning */
|
||||
#define DBA_WRITE_CHECK_WITH_ID \
|
||||
if(info->mode != DBA_WRITER && info->mode != DBA_TRUNC && info->mode != DBA_CREAT) { \
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "You cannot perform a modification to a database without proper access"); \
|
||||
DBA_ID_DONE; \
|
||||
RETURN_FALSE; \
|
||||
}
|
||||
|
||||
/* }}} */
|
||||
|
||||
/* {{{ globals */
|
||||
@@ -557,7 +570,7 @@ static void php_dba_update(INTERNAL_FUNCTION_PARAMETERS, int mode)
|
||||
|
||||
DBA_FETCH_RESOURCE(info, &id);
|
||||
|
||||
DBA_WRITE_CHECK;
|
||||
DBA_WRITE_CHECK_WITH_ID;
|
||||
|
||||
if (info->hnd->update(info, key_str, key_len, val, val_len, mode TSRMLS_CC) == SUCCESS) {
|
||||
DBA_ID_DONE;
|
||||
@@ -612,7 +625,8 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
|
||||
char *file_mode;
|
||||
char mode[4], *pmode, *lock_file_mode = NULL;
|
||||
int persistent_flag = persistent ? STREAM_OPEN_PERSISTENT : 0;
|
||||
char *opened_path, *lock_name;
|
||||
char *opened_path = NULL;
|
||||
char *lock_name;
|
||||
|
||||
if(ac < 2) {
|
||||
WRONG_PARAM_COUNT;
|
||||
@@ -835,8 +849,10 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent)
|
||||
if (!persistent) {
|
||||
info->lock.name = opened_path;
|
||||
} else {
|
||||
info->lock.name = pestrdup(opened_path, persistent);
|
||||
efree(opened_path);
|
||||
if (opened_path) {
|
||||
info->lock.name = pestrdup(opened_path, persistent);
|
||||
efree(opened_path);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1110,7 +1126,7 @@ PHP_FUNCTION(dba_delete)
|
||||
{
|
||||
DBA_ID_GET2;
|
||||
|
||||
DBA_WRITE_CHECK;
|
||||
DBA_WRITE_CHECK_WITH_ID;
|
||||
|
||||
if(info->hnd->delete(info, key_str, key_len TSRMLS_CC) == SUCCESS)
|
||||
{
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
--TEST--
|
||||
Bug #65708 (dba functions cast $key param to string in-place, bypassing copy on write)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once(dirname(__FILE__) .'/skipif.inc');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
error_reporting(E_ALL);
|
||||
|
||||
require_once(dirname(__FILE__) .'/test.inc');
|
||||
|
||||
$db = dba_popen($db_filename, 'c');
|
||||
|
||||
$key = 1;
|
||||
$copy = $key;
|
||||
|
||||
echo gettype($key)."\n";
|
||||
echo gettype($copy)."\n";
|
||||
|
||||
dba_exists($key, $db);
|
||||
|
||||
echo gettype($key)."\n";
|
||||
echo gettype($copy)."\n";
|
||||
|
||||
dba_close($db);
|
||||
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
require(dirname(__FILE__) .'/clean.inc');
|
||||
?>
|
||||
--EXPECT--
|
||||
integer
|
||||
integer
|
||||
integer
|
||||
integer
|
||||
+7
-5
@@ -2643,6 +2643,7 @@ static int exif_process_user_comment(image_info_type *ImageInfo, char **pszInfoP
|
||||
} else {
|
||||
decode = ImageInfo->decode_unicode_le;
|
||||
}
|
||||
/* XXX this will fail again if encoding_converter returns on error something different than SIZE_MAX */
|
||||
if (zend_multibyte_encoding_converter(
|
||||
(unsigned char**)pszInfoPtr,
|
||||
&len,
|
||||
@@ -2650,7 +2651,7 @@ static int exif_process_user_comment(image_info_type *ImageInfo, char **pszInfoP
|
||||
ByteCount,
|
||||
zend_multibyte_fetch_encoding(ImageInfo->encode_unicode TSRMLS_CC),
|
||||
zend_multibyte_fetch_encoding(decode TSRMLS_CC)
|
||||
TSRMLS_CC) < 0) {
|
||||
TSRMLS_CC) == (size_t)-1) {
|
||||
len = exif_process_string_raw(pszInfoPtr, szValuePtr, ByteCount);
|
||||
}
|
||||
return len;
|
||||
@@ -2663,6 +2664,7 @@ static int exif_process_user_comment(image_info_type *ImageInfo, char **pszInfoP
|
||||
*pszEncoding = estrdup((const char*)szValuePtr);
|
||||
szValuePtr = szValuePtr+8;
|
||||
ByteCount -= 8;
|
||||
/* XXX this will fail again if encoding_converter returns on error something different than SIZE_MAX */
|
||||
if (zend_multibyte_encoding_converter(
|
||||
(unsigned char**)pszInfoPtr,
|
||||
&len,
|
||||
@@ -2670,7 +2672,7 @@ static int exif_process_user_comment(image_info_type *ImageInfo, char **pszInfoP
|
||||
ByteCount,
|
||||
zend_multibyte_fetch_encoding(ImageInfo->encode_jis TSRMLS_CC),
|
||||
zend_multibyte_fetch_encoding(ImageInfo->motorola_intel ? ImageInfo->decode_jis_be : ImageInfo->decode_jis_le TSRMLS_CC)
|
||||
TSRMLS_CC) < 0) {
|
||||
TSRMLS_CC) == (size_t)-1) {
|
||||
len = exif_process_string_raw(pszInfoPtr, szValuePtr, ByteCount);
|
||||
}
|
||||
return len;
|
||||
@@ -2700,8 +2702,8 @@ static int exif_process_user_comment(image_info_type *ImageInfo, char **pszInfoP
|
||||
static int exif_process_unicode(image_info_type *ImageInfo, xp_field_type *xp_field, int tag, char *szValuePtr, int ByteCount TSRMLS_DC)
|
||||
{
|
||||
xp_field->tag = tag;
|
||||
|
||||
/* Copy the comment */
|
||||
|
||||
/* XXX this will fail again if encoding_converter returns on error something different than SIZE_MAX */
|
||||
if (zend_multibyte_encoding_converter(
|
||||
(unsigned char**)&xp_field->value,
|
||||
&xp_field->size,
|
||||
@@ -2709,7 +2711,7 @@ static int exif_process_unicode(image_info_type *ImageInfo, xp_field_type *xp_fi
|
||||
ByteCount,
|
||||
zend_multibyte_fetch_encoding(ImageInfo->encode_unicode TSRMLS_CC),
|
||||
zend_multibyte_fetch_encoding(ImageInfo->motorola_intel ? ImageInfo->decode_unicode_be : ImageInfo->decode_unicode_le TSRMLS_CC)
|
||||
TSRMLS_CC) < 0) {
|
||||
TSRMLS_CC) == (size_t)-1) {
|
||||
xp_field->size = exif_process_string_raw(&xp_field->value, szValuePtr, ByteCount);
|
||||
}
|
||||
return xp_field->size;
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
|
||||
<html><head>
|
||||
<title>301 Moved Permanently</title>
|
||||
</head><body>
|
||||
<h1>Moved Permanently</h1>
|
||||
<p>The document has moved <a href="http://www.getid3.org/temp/62523.jpg">here</a>.</p>
|
||||
<hr>
|
||||
<address>Apache Server at getid3.org Port 80</address>
|
||||
</body></html>
|
||||
@@ -0,0 +1,18 @@
|
||||
--TEST--
|
||||
Bug 62523 (php crashes with segfault when exif_read_data called)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
extension_loaded("exif") or die("skip need exif");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
echo "Test\n";
|
||||
var_dump(count(exif_read_data(__DIR__."/bug62523_1.jpg")));
|
||||
?>
|
||||
Done
|
||||
--EXPECTF--
|
||||
Test
|
||||
|
||||
Warning: exif_read_data(bug62523_1.jpg): File not supported in %sbug62523_1.php on line %d
|
||||
int(1)
|
||||
Done
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 504 KiB |
@@ -0,0 +1,16 @@
|
||||
--TEST--
|
||||
Bug 62523 (php crashes with segfault when exif_read_data called)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
extension_loaded("exif") or die("skip need exif");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
echo "Test\n";
|
||||
var_dump(count(exif_read_data(__DIR__."/bug62523_2.jpg")));
|
||||
?>
|
||||
Done
|
||||
--EXPECT--
|
||||
Test
|
||||
int(76)
|
||||
Done
|
||||
@@ -0,0 +1,12 @@
|
||||
<html>
|
||||
<head><title>Found</title></head>
|
||||
<body>
|
||||
<h1>Found</h1>
|
||||
<p>The resource was found at <a href="http://dl.dropboxusercontent.com/u/7562584/Bugs/Php/bad_exif.jpeg">http://dl.dropboxusercontent.com/u/7562584/Bugs/Php/bad_exif.jpeg</a>;
|
||||
you should be redirected automatically.
|
||||
|
||||
<!-- --></p>
|
||||
<hr noshade>
|
||||
<div align="right">WSGI Server</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,18 @@
|
||||
--TEST--
|
||||
Bug 62523 (php crashes with segfault when exif_read_data called)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
extension_loaded("exif") or die("skip need exif");
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
echo "Test\n";
|
||||
var_dump(count(exif_read_data(__DIR__."/bug62523_3.jpg")));
|
||||
?>
|
||||
Done
|
||||
--EXPECTF--
|
||||
Test
|
||||
|
||||
Warning: exif_read_data(bug62523_3.jpg): File not supported in %sbug62523_3.php on line %d
|
||||
int(1)
|
||||
Done
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 7.4 KiB |
@@ -0,0 +1,14 @@
|
||||
--TEST--
|
||||
PHP crash when zend_multibyte_encoding_converter returns (size_t)-1)
|
||||
--SKIPIF--
|
||||
<?php if (!extension_loaded('exif')) print 'skip exif extension not available';?>
|
||||
--FILE--
|
||||
<?php
|
||||
$infile = dirname(__FILE__).'/exif_encoding_crash.jpg';
|
||||
$exif_data = exif_read_data($infile);
|
||||
echo "*** no core dump ***\n";
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
*** no core dump ***
|
||||
===DONE===
|
||||
@@ -714,7 +714,7 @@ void php_filter_validate_ip(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
|
||||
if (flags & FILTER_FLAG_NO_RES_RANGE) {
|
||||
if (
|
||||
(ip[0] == 0) ||
|
||||
(ip[0] == 100 && (ip[1] >= 64 || ip[1] <= 127)) ||
|
||||
(ip[0] == 100 && (ip[1] >= 64 && ip[1] <= 127)) ||
|
||||
(ip[0] == 128 && ip[1] == 0) ||
|
||||
(ip[0] == 191 && ip[1] == 255) ||
|
||||
(ip[0] == 169 && ip[1] == 254) ||
|
||||
|
||||
@@ -15,7 +15,7 @@ var_dump(filter_var("192.168.0.1", FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE
|
||||
var_dump(filter_var("192.0.34.166", FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE));
|
||||
var_dump(filter_var("127.0.0.1", FILTER_VALIDATE_IP, FILTER_FLAG_NO_RES_RANGE));
|
||||
var_dump(filter_var("192.0.0.1", FILTER_VALIDATE_IP, FILTER_FLAG_NO_RES_RANGE));
|
||||
var_dump(filter_var("100.0.0.0", FILTER_VALIDATE_IP, FILTER_FLAG_NO_RES_RANGE));
|
||||
var_dump(filter_var("100.64.0.0", FILTER_VALIDATE_IP, FILTER_FLAG_NO_RES_RANGE));
|
||||
var_dump(filter_var("100.127.255.255", FILTER_VALIDATE_IP, FILTER_FLAG_NO_RES_RANGE));
|
||||
var_dump(filter_var("192.0.34.166", FILTER_VALIDATE_IP));
|
||||
var_dump(filter_var("256.1237.123.1", FILTER_VALIDATE_IP));
|
||||
|
||||
+4
-4
@@ -630,7 +630,7 @@ ftp_alloc(ftpbuf_t *ftp, const long size, char **response)
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (response && ftp->inbuf) {
|
||||
if (response) {
|
||||
*response = estrdup(ftp->inbuf);
|
||||
}
|
||||
|
||||
@@ -1638,7 +1638,7 @@ ftp_genlist(ftpbuf_t *ftp, const char *cmd, const char *path TSRMLS_DC)
|
||||
if (ftp->resp == 226) {
|
||||
ftp->data = data_close(ftp, data);
|
||||
php_stream_close(tmpstream);
|
||||
return ecalloc(1, sizeof(char**));
|
||||
return ecalloc(1, sizeof(char*));
|
||||
}
|
||||
|
||||
/* pull data buffer into tmpfile */
|
||||
@@ -1666,11 +1666,11 @@ ftp_genlist(ftpbuf_t *ftp, const char *cmd, const char *path TSRMLS_DC)
|
||||
}
|
||||
}
|
||||
|
||||
ftp->data = data = data_close(ftp, data);
|
||||
ftp->data = data_close(ftp, data);
|
||||
|
||||
php_stream_rewind(tmpstream);
|
||||
|
||||
ret = safe_emalloc((lines + 1), sizeof(char**), size * sizeof(char*));
|
||||
ret = safe_emalloc((lines + 1), sizeof(char*), size);
|
||||
|
||||
entry = ret;
|
||||
text = (char*) (ret + lines + 1);
|
||||
|
||||
+3
-1
@@ -968,7 +968,9 @@ PHP_FUNCTION(ftp_nb_get)
|
||||
RETURN_LONG(PHP_FTP_FAILED);
|
||||
}
|
||||
|
||||
php_stream_close(outstream);
|
||||
if (ret == PHP_FTP_FINISHED){
|
||||
php_stream_close(outstream);
|
||||
}
|
||||
|
||||
RETURN_LONG(ret);
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ ftp_login($ftp, 'user', 'pass');
|
||||
if (!$ftp) die("Couldn't connect to the server");
|
||||
ftp_set_option($ftp, FTP_AUTOSEEK, false);
|
||||
|
||||
$local_file = dirname(__FILE__) . DIRECTORY_SEPARATOR . "localfile.txt";
|
||||
$local_file = dirname(__FILE__) . DIRECTORY_SEPARATOR . "ftp_fget_basic1.txt";
|
||||
$handle = fopen($local_file, 'w');
|
||||
|
||||
var_dump(ftp_fget($ftp, $handle, 'fget.txt', FTP_ASCII, FTP_AUTORESUME));
|
||||
@@ -24,7 +24,7 @@ var_dump(file_get_contents($local_file));
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
@unlink(dirname(__FILE__) . DIRECTORY_SEPARATOR . "localfile.txt");
|
||||
@unlink(dirname(__FILE__) . DIRECTORY_SEPARATOR . "ftp_fget_basic1.txt");
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
|
||||
@@ -15,7 +15,7 @@ $ftp = ftp_connect('127.0.0.1', $port);
|
||||
ftp_login($ftp, 'user', 'pass');
|
||||
if (!$ftp) die("Couldn't connect to the server");
|
||||
|
||||
$local_file = dirname(__FILE__) . DIRECTORY_SEPARATOR . "localfile.txt";
|
||||
$local_file = dirname(__FILE__) . DIRECTORY_SEPARATOR . "ftp_fget_basic2.txt";
|
||||
file_put_contents($local_file, 'ASCIIFoo');
|
||||
$handle = fopen($local_file, 'a');
|
||||
|
||||
@@ -24,7 +24,7 @@ var_dump(file_get_contents($local_file));
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
@unlink(dirname(__FILE__) . DIRECTORY_SEPARATOR . "localfile.txt");
|
||||
@unlink(dirname(__FILE__) . DIRECTORY_SEPARATOR . "ftp_fget_basic2.txt");
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
|
||||
@@ -15,7 +15,7 @@ $ftp = ftp_connect('127.0.0.1', $port);
|
||||
ftp_login($ftp, 'user', 'pass');
|
||||
if (!$ftp) die("Couldn't connect to the server");
|
||||
|
||||
$local_file = dirname(__FILE__) . DIRECTORY_SEPARATOR . "localfile.txt";
|
||||
$local_file = dirname(__FILE__) . DIRECTORY_SEPARATOR . "ftp_fget_basic3.txt";
|
||||
file_put_contents($local_file, 'ASCIIFoo');
|
||||
$handle = fopen($local_file, 'a');
|
||||
|
||||
@@ -24,7 +24,7 @@ var_dump(file_get_contents($local_file));
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
@unlink(dirname(__FILE__) . DIRECTORY_SEPARATOR . "localfile.txt");
|
||||
@unlink(dirname(__FILE__) . DIRECTORY_SEPARATOR . "ftp_fget_basic3.txt");
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
|
||||
@@ -0,0 +1,182 @@
|
||||
--TEST--
|
||||
Testing whether ftp_nb_continue() fetches more data
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require 'skipif.inc';
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
require 'server.inc';
|
||||
|
||||
$file = "mediumfile.txt";
|
||||
|
||||
$ftp = ftp_connect('127.0.0.1', $port);
|
||||
ftp_login($ftp, 'user', 'pass');
|
||||
if (!$ftp) die("Couldn't connect to the server");
|
||||
|
||||
$local_file = dirname(__FILE__) . DIRECTORY_SEPARATOR . $file;
|
||||
touch($local_file);
|
||||
|
||||
$r = ftp_nb_get($ftp, $local_file, $file, FTP_BINARY);
|
||||
while ($r == FTP_MOREDATA) {
|
||||
$r = ftp_nb_continue($ftp);
|
||||
}
|
||||
ftp_close($ftp);
|
||||
|
||||
echo file_get_contents($local_file);
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
@unlink(dirname(__FILE__) . DIRECTORY_SEPARATOR . "mediumfile.txt");
|
||||
?>
|
||||
--EXPECT--
|
||||
This is line 0 of the test data.
|
||||
This is line 1 of the test data.
|
||||
This is line 2 of the test data.
|
||||
This is line 3 of the test data.
|
||||
This is line 4 of the test data.
|
||||
This is line 5 of the test data.
|
||||
This is line 6 of the test data.
|
||||
This is line 7 of the test data.
|
||||
This is line 8 of the test data.
|
||||
This is line 9 of the test data.
|
||||
This is line 10 of the test data.
|
||||
This is line 11 of the test data.
|
||||
This is line 12 of the test data.
|
||||
This is line 13 of the test data.
|
||||
This is line 14 of the test data.
|
||||
This is line 15 of the test data.
|
||||
This is line 16 of the test data.
|
||||
This is line 17 of the test data.
|
||||
This is line 18 of the test data.
|
||||
This is line 19 of the test data.
|
||||
This is line 20 of the test data.
|
||||
This is line 21 of the test data.
|
||||
This is line 22 of the test data.
|
||||
This is line 23 of the test data.
|
||||
This is line 24 of the test data.
|
||||
This is line 25 of the test data.
|
||||
This is line 26 of the test data.
|
||||
This is line 27 of the test data.
|
||||
This is line 28 of the test data.
|
||||
This is line 29 of the test data.
|
||||
This is line 30 of the test data.
|
||||
This is line 31 of the test data.
|
||||
This is line 32 of the test data.
|
||||
This is line 33 of the test data.
|
||||
This is line 34 of the test data.
|
||||
This is line 35 of the test data.
|
||||
This is line 36 of the test data.
|
||||
This is line 37 of the test data.
|
||||
This is line 38 of the test data.
|
||||
This is line 39 of the test data.
|
||||
This is line 40 of the test data.
|
||||
This is line 41 of the test data.
|
||||
This is line 42 of the test data.
|
||||
This is line 43 of the test data.
|
||||
This is line 44 of the test data.
|
||||
This is line 45 of the test data.
|
||||
This is line 46 of the test data.
|
||||
This is line 47 of the test data.
|
||||
This is line 48 of the test data.
|
||||
This is line 49 of the test data.
|
||||
This is line 50 of the test data.
|
||||
This is line 51 of the test data.
|
||||
This is line 52 of the test data.
|
||||
This is line 53 of the test data.
|
||||
This is line 54 of the test data.
|
||||
This is line 55 of the test data.
|
||||
This is line 56 of the test data.
|
||||
This is line 57 of the test data.
|
||||
This is line 58 of the test data.
|
||||
This is line 59 of the test data.
|
||||
This is line 60 of the test data.
|
||||
This is line 61 of the test data.
|
||||
This is line 62 of the test data.
|
||||
This is line 63 of the test data.
|
||||
This is line 64 of the test data.
|
||||
This is line 65 of the test data.
|
||||
This is line 66 of the test data.
|
||||
This is line 67 of the test data.
|
||||
This is line 68 of the test data.
|
||||
This is line 69 of the test data.
|
||||
This is line 70 of the test data.
|
||||
This is line 71 of the test data.
|
||||
This is line 72 of the test data.
|
||||
This is line 73 of the test data.
|
||||
This is line 74 of the test data.
|
||||
This is line 75 of the test data.
|
||||
This is line 76 of the test data.
|
||||
This is line 77 of the test data.
|
||||
This is line 78 of the test data.
|
||||
This is line 79 of the test data.
|
||||
This is line 80 of the test data.
|
||||
This is line 81 of the test data.
|
||||
This is line 82 of the test data.
|
||||
This is line 83 of the test data.
|
||||
This is line 84 of the test data.
|
||||
This is line 85 of the test data.
|
||||
This is line 86 of the test data.
|
||||
This is line 87 of the test data.
|
||||
This is line 88 of the test data.
|
||||
This is line 89 of the test data.
|
||||
This is line 90 of the test data.
|
||||
This is line 91 of the test data.
|
||||
This is line 92 of the test data.
|
||||
This is line 93 of the test data.
|
||||
This is line 94 of the test data.
|
||||
This is line 95 of the test data.
|
||||
This is line 96 of the test data.
|
||||
This is line 97 of the test data.
|
||||
This is line 98 of the test data.
|
||||
This is line 99 of the test data.
|
||||
This is line 100 of the test data.
|
||||
This is line 101 of the test data.
|
||||
This is line 102 of the test data.
|
||||
This is line 103 of the test data.
|
||||
This is line 104 of the test data.
|
||||
This is line 105 of the test data.
|
||||
This is line 106 of the test data.
|
||||
This is line 107 of the test data.
|
||||
This is line 108 of the test data.
|
||||
This is line 109 of the test data.
|
||||
This is line 110 of the test data.
|
||||
This is line 111 of the test data.
|
||||
This is line 112 of the test data.
|
||||
This is line 113 of the test data.
|
||||
This is line 114 of the test data.
|
||||
This is line 115 of the test data.
|
||||
This is line 116 of the test data.
|
||||
This is line 117 of the test data.
|
||||
This is line 118 of the test data.
|
||||
This is line 119 of the test data.
|
||||
This is line 120 of the test data.
|
||||
This is line 121 of the test data.
|
||||
This is line 122 of the test data.
|
||||
This is line 123 of the test data.
|
||||
This is line 124 of the test data.
|
||||
This is line 125 of the test data.
|
||||
This is line 126 of the test data.
|
||||
This is line 127 of the test data.
|
||||
This is line 128 of the test data.
|
||||
This is line 129 of the test data.
|
||||
This is line 130 of the test data.
|
||||
This is line 131 of the test data.
|
||||
This is line 132 of the test data.
|
||||
This is line 133 of the test data.
|
||||
This is line 134 of the test data.
|
||||
This is line 135 of the test data.
|
||||
This is line 136 of the test data.
|
||||
This is line 137 of the test data.
|
||||
This is line 138 of the test data.
|
||||
This is line 139 of the test data.
|
||||
This is line 140 of the test data.
|
||||
This is line 141 of the test data.
|
||||
This is line 142 of the test data.
|
||||
This is line 143 of the test data.
|
||||
This is line 144 of the test data.
|
||||
This is line 145 of the test data.
|
||||
This is line 146 of the test data.
|
||||
This is line 147 of the test data.
|
||||
This is line 148 of the test data.
|
||||
This is line 149 of the test data.
|
||||
@@ -16,7 +16,7 @@ ftp_login($ftp, 'user', 'pass');
|
||||
if (!$ftp) die("Couldn't connect to the server");
|
||||
ftp_set_option($ftp, FTP_AUTOSEEK, false);
|
||||
|
||||
$local_file = dirname(__FILE__) . DIRECTORY_SEPARATOR . "localfile.txt";
|
||||
$local_file = dirname(__FILE__) . DIRECTORY_SEPARATOR . "ftp_nb_fget_basic1.txt";
|
||||
$handle = fopen($local_file, 'w');
|
||||
|
||||
var_dump(ftp_nb_fget($ftp, $handle, 'fget.txt', FTP_ASCII, FTP_AUTORESUME));
|
||||
@@ -24,7 +24,7 @@ var_dump(file_get_contents($local_file));
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
@unlink(dirname(__FILE__) . DIRECTORY_SEPARATOR . "localfile.txt");
|
||||
@unlink(dirname(__FILE__) . DIRECTORY_SEPARATOR . "ftp_nb_fget_basic1.txt");
|
||||
?>
|
||||
--EXPECT--
|
||||
int(2)
|
||||
|
||||
@@ -15,7 +15,7 @@ $ftp = ftp_connect('127.0.0.1', $port);
|
||||
ftp_login($ftp, 'user', 'pass');
|
||||
if (!$ftp) die("Couldn't connect to the server");
|
||||
|
||||
$local_file = dirname(__FILE__) . DIRECTORY_SEPARATOR . "localfile.txt";
|
||||
$local_file = dirname(__FILE__) . DIRECTORY_SEPARATOR . "ftp_nb_fget_basic2.txt";
|
||||
file_put_contents($local_file, 'ASCIIFoo');
|
||||
$handle = fopen($local_file, 'a');
|
||||
|
||||
@@ -24,7 +24,7 @@ var_dump(file_get_contents($local_file));
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
@unlink(dirname(__FILE__) . DIRECTORY_SEPARATOR . "localfile.txt");
|
||||
@unlink(dirname(__FILE__) . DIRECTORY_SEPARATOR . "ftp_nb_fget_basic2.txt");
|
||||
?>
|
||||
--EXPECT--
|
||||
int(2)
|
||||
|
||||
@@ -15,7 +15,7 @@ $ftp = ftp_connect('127.0.0.1', $port);
|
||||
ftp_login($ftp, 'user', 'pass');
|
||||
if (!$ftp) die("Couldn't connect to the server");
|
||||
|
||||
$local_file = dirname(__FILE__) . DIRECTORY_SEPARATOR . "localfile.txt";
|
||||
$local_file = dirname(__FILE__) . DIRECTORY_SEPARATOR . "ftp_nb_fget_basic3.txt";
|
||||
file_put_contents($local_file, 'ASCIIFoo');
|
||||
$handle = fopen($local_file, 'a');
|
||||
|
||||
@@ -24,7 +24,7 @@ var_dump(file_get_contents($local_file));
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
@unlink(dirname(__FILE__) . DIRECTORY_SEPARATOR . "localfile.txt");
|
||||
@unlink(dirname(__FILE__) . DIRECTORY_SEPARATOR . "ftp_nb_fget_basic3.txt");
|
||||
?>
|
||||
--EXPECT--
|
||||
int(2)
|
||||
|
||||
@@ -18,7 +18,7 @@ $ftp = ftp_connect('127.0.0.1', $port);
|
||||
ftp_login($ftp, 'user', 'pass');
|
||||
if (!$ftp) die("Couldn't connect to the server");
|
||||
|
||||
$local_file = dirname(__FILE__) . DIRECTORY_SEPARATOR . "localfile.txt";
|
||||
$local_file = dirname(__FILE__) . DIRECTORY_SEPARATOR . "ftp_nb_get_large.txt";
|
||||
touch($local_file);
|
||||
ftp_nb_get($ftp, $local_file, 'fget_large.txt', FTP_BINARY, 5368709119);
|
||||
$fp = fopen($local_file, 'r');
|
||||
@@ -29,7 +29,7 @@ fclose($fp);
|
||||
?>
|
||||
--CLEAN--
|
||||
<?php
|
||||
@unlink(dirname(__FILE__) . DIRECTORY_SEPARATOR . "localfile.txt");
|
||||
@unlink(dirname(__FILE__) . DIRECTORY_SEPARATOR . "ftp_nb_get_large.txt");
|
||||
?>
|
||||
--EXPECT--
|
||||
string(1) "X"
|
||||
|
||||
@@ -368,6 +368,13 @@ if ($pid) {
|
||||
}
|
||||
fputs($s, "226 Closing data Connection.\r\n");
|
||||
break;
|
||||
case "mediumfile":
|
||||
fputs($s, "150 File status okay; about to open data connection.\r\n");
|
||||
for($i = 0; $i < 150; $i++){
|
||||
fputs($fs, "This is line $i of the test data.\n");
|
||||
}
|
||||
fputs($s, "226 Closing data Connection.\r\n");
|
||||
|
||||
default:
|
||||
fputs($s, "550 {$matches[1]}: No such file or directory \r\n");
|
||||
break;
|
||||
|
||||
+1
-1
@@ -59,7 +59,7 @@
|
||||
|
||||
PHPAPI extern const char php_sig_gif[3];
|
||||
PHPAPI extern const char php_sig_jpg[3];
|
||||
PHPAPI extern const char php_sig_png[3];
|
||||
PHPAPI extern const char php_sig_png[8];
|
||||
|
||||
extern zend_module_entry gd_module_entry;
|
||||
#define phpext_gd_ptr &gd_module_entry
|
||||
|
||||
+2
-2
@@ -198,9 +198,9 @@ if test "$PHP_IMAP" != "no"; then
|
||||
AC_MSG_ERROR(Cannot find rfc822.h. Please check your c-client installation.)
|
||||
fi
|
||||
|
||||
if test ! -r "$IMAP_DIR/c-client/libc-client.a" && -r "$IMAP_DIR/c-client/c-client.a" ; then
|
||||
if test ! -r "$IMAP_DIR/c-client/libc-client.a" && test -r "$IMAP_DIR/c-client/c-client.a" ; then
|
||||
ln -s "$IMAP_DIR/c-client/c-client.a" "$IMAP_DIR/c-client/libc-client.a" >/dev/null 2>&1
|
||||
elif test ! -r "$IMAP_DIR/$PHP_LIBDIR/libc-client.a" && -r "$IMAP_DIR/$PHP_LIBDIR/c-client.a"; then
|
||||
elif test ! -r "$IMAP_DIR/$PHP_LIBDIR/libc-client.a" && test -r "$IMAP_DIR/$PHP_LIBDIR/c-client.a"; then
|
||||
ln -s "$IMAP_DIR/$PHP_LIBDIR/c-client.a" "$IMAP_DIR/$PHP_LIBDIR/libc-client.a" >/dev/null 2>&1
|
||||
fi
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
/* {{{ */
|
||||
static void collator_ctor(INTERNAL_FUNCTION_PARAMETERS)
|
||||
{
|
||||
char* locale;
|
||||
const char* locale;
|
||||
int locale_len = 0;
|
||||
zval* object;
|
||||
Collator_object* co;
|
||||
|
||||
@@ -62,7 +62,7 @@ static void internal_parse_to_timestamp(IntlDateFormatter_object *dfo, char* tex
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
static void add_to_localtime_arr( IntlDateFormatter_object *dfo, zval* return_value, UCalendar parsed_calendar, long calendar_field, char* key_name TSRMLS_DC)
|
||||
static void add_to_localtime_arr( IntlDateFormatter_object *dfo, zval* return_value, const UCalendar *parsed_calendar, long calendar_field, char* key_name TSRMLS_DC)
|
||||
{
|
||||
long calendar_field_val = ucal_get( parsed_calendar, calendar_field, &INTL_DATA_ERROR_CODE(dfo));
|
||||
INTL_METHOD_CHECK_STATUS( dfo, "Date parsing - localtime failed : could not get a field from calendar" );
|
||||
@@ -83,7 +83,7 @@ static void add_to_localtime_arr( IntlDateFormatter_object *dfo, zval* return_va
|
||||
*/
|
||||
static void internal_parse_to_localtime(IntlDateFormatter_object *dfo, char* text_to_parse, int32_t text_len, int32_t *parse_pos, zval *return_value TSRMLS_DC)
|
||||
{
|
||||
UCalendar* parsed_calendar = NULL;
|
||||
UCalendar *parsed_calendar = NULL;
|
||||
UChar* text_utf16 = NULL;
|
||||
int32_t text_utf16_len = 0;
|
||||
long isInDST = 0;
|
||||
@@ -92,7 +92,7 @@ static void internal_parse_to_localtime(IntlDateFormatter_object *dfo, char* tex
|
||||
intl_convert_utf8_to_utf16(&text_utf16, &text_utf16_len, text_to_parse, text_len, &INTL_DATA_ERROR_CODE(dfo));
|
||||
INTL_METHOD_CHECK_STATUS(dfo, "Error converting timezone to UTF-16" );
|
||||
|
||||
parsed_calendar = udat_getCalendar(DATE_FORMAT_OBJECT(dfo));
|
||||
parsed_calendar = (UCalendar *)udat_getCalendar(DATE_FORMAT_OBJECT(dfo));
|
||||
udat_parseCalendar( DATE_FORMAT_OBJECT(dfo), parsed_calendar, text_utf16, text_utf16_len, parse_pos, &INTL_DATA_ERROR_CODE(dfo));
|
||||
|
||||
if (text_utf16) {
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
/* {{{ */
|
||||
static void numfmt_ctor(INTERNAL_FUNCTION_PARAMETERS)
|
||||
{
|
||||
char* locale;
|
||||
const char* locale;
|
||||
char* pattern = NULL;
|
||||
int locale_len = 0, pattern_len = 0;
|
||||
long style;
|
||||
|
||||
@@ -121,12 +121,15 @@ static int16_t findOffset(const char* const* list, const char* key)
|
||||
}
|
||||
/*}}}*/
|
||||
|
||||
static char* getPreferredTag(char* gf_tag)
|
||||
static char* getPreferredTag(const char* gf_tag)
|
||||
{
|
||||
char* result = NULL;
|
||||
int grOffset = 0;
|
||||
|
||||
grOffset = findOffset( LOC_GRANDFATHERED ,gf_tag);
|
||||
if(grOffset < 0) {
|
||||
return NULL;
|
||||
}
|
||||
if( grOffset < LOC_PREFERRED_GRANDFATHERED_LEN ){
|
||||
/* return preferred tag */
|
||||
result = estrdup( LOC_PREFERRED_GRANDFATHERED[grOffset] );
|
||||
@@ -172,7 +175,7 @@ static int getStrrtokenPos(char* str, int savedPos)
|
||||
* returns -1 if no singleton
|
||||
* strtok equivalent search for singleton
|
||||
*/
|
||||
static int getSingletonPos(char* str)
|
||||
static int getSingletonPos(const char* str)
|
||||
{
|
||||
int result =-1;
|
||||
int i=0;
|
||||
@@ -248,7 +251,7 @@ PHP_NAMED_FUNCTION(zif_locale_set_default)
|
||||
* common code shared by get_primary_language,get_script or get_region or get_variant
|
||||
* result = 0 if error, 1 if successful , -1 if no value
|
||||
*/
|
||||
static char* get_icu_value_internal( char* loc_name , char* tag_name, int* result , int fromParseLocale)
|
||||
static char* get_icu_value_internal( const char* loc_name , char* tag_name, int* result , int fromParseLocale)
|
||||
{
|
||||
char* tag_value = NULL;
|
||||
int32_t tag_value_len = 512;
|
||||
@@ -278,7 +281,7 @@ static char* get_icu_value_internal( char* loc_name , char* tag_name, int* resul
|
||||
/* Handle singletons */
|
||||
if( strcmp(tag_name , LOC_LANG_TAG)==0 ){
|
||||
if( strlen(loc_name)>1 && (isIDPrefix(loc_name) ==1 ) ){
|
||||
return loc_name;
|
||||
return (char *)loc_name;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -367,7 +370,7 @@ static char* get_icu_value_internal( char* loc_name , char* tag_name, int* resul
|
||||
static void get_icu_value_src_php( char* tag_name, INTERNAL_FUNCTION_PARAMETERS)
|
||||
{
|
||||
|
||||
char* loc_name = NULL;
|
||||
const char* loc_name = NULL;
|
||||
int loc_name_len = 0;
|
||||
|
||||
char* tag_value = NULL;
|
||||
@@ -462,10 +465,10 @@ PHP_FUNCTION(locale_get_primary_language )
|
||||
}}} */
|
||||
static void get_icu_disp_value_src_php( char* tag_name, INTERNAL_FUNCTION_PARAMETERS)
|
||||
{
|
||||
char* loc_name = NULL;
|
||||
const char* loc_name = NULL;
|
||||
int loc_name_len = 0;
|
||||
|
||||
char* disp_loc_name = NULL;
|
||||
const char* disp_loc_name = NULL;
|
||||
int disp_loc_name_len = 0;
|
||||
int free_loc_name = 0;
|
||||
|
||||
@@ -558,7 +561,7 @@ static void get_icu_disp_value_src_php( char* tag_name, INTERNAL_FUNCTION_PARAME
|
||||
efree( mod_loc_name );
|
||||
}
|
||||
if (free_loc_name) {
|
||||
efree(disp_loc_name);
|
||||
efree((void *)disp_loc_name);
|
||||
disp_loc_name = NULL;
|
||||
}
|
||||
RETURN_FALSE;
|
||||
@@ -569,7 +572,7 @@ static void get_icu_disp_value_src_php( char* tag_name, INTERNAL_FUNCTION_PARAME
|
||||
efree( mod_loc_name );
|
||||
}
|
||||
if (free_loc_name) {
|
||||
efree(disp_loc_name);
|
||||
efree((void *)disp_loc_name);
|
||||
disp_loc_name = NULL;
|
||||
}
|
||||
/* Convert display locale name from UTF-16 to UTF-8. */
|
||||
@@ -663,10 +666,10 @@ PHP_FUNCTION( locale_get_keywords )
|
||||
UEnumeration* e = NULL;
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
|
||||
const char* kw_key = NULL;
|
||||
const char* kw_key = NULL;
|
||||
int32_t kw_key_len = 0;
|
||||
|
||||
char* loc_name = NULL;
|
||||
const char* loc_name = NULL;
|
||||
int loc_name_len = 0;
|
||||
|
||||
/*
|
||||
@@ -713,7 +716,7 @@ PHP_FUNCTION( locale_get_keywords )
|
||||
kw_value = erealloc( kw_value , kw_value_len+1);
|
||||
}
|
||||
if (U_FAILURE(status)) {
|
||||
intl_error_set( NULL, FAILURE, "locale_get_keywords: Error encountered while getting the keyword value for the keyword", 0 TSRMLS_CC );
|
||||
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "locale_get_keywords: Error encountered while getting the keyword value for the keyword", 0 TSRMLS_CC );
|
||||
if( kw_value){
|
||||
efree( kw_value );
|
||||
}
|
||||
@@ -971,12 +974,12 @@ PHP_FUNCTION(locale_compose)
|
||||
* e.g. for locale='en_US-x-prv1-prv2-prv3'
|
||||
* returns a pointer to the string 'prv1-prv2-prv3'
|
||||
*/
|
||||
static char* get_private_subtags(char* loc_name)
|
||||
static char* get_private_subtags(const char* loc_name)
|
||||
{
|
||||
char* result =NULL;
|
||||
int singletonPos = 0;
|
||||
int len =0;
|
||||
char* mod_loc_name =NULL;
|
||||
const char* mod_loc_name =NULL;
|
||||
|
||||
if( loc_name && (len = strlen(loc_name)>0 ) ){
|
||||
mod_loc_name = loc_name ;
|
||||
@@ -1016,7 +1019,7 @@ static char* get_private_subtags(char* loc_name)
|
||||
|
||||
/* {{{ code used by locale_parse
|
||||
*/
|
||||
static int add_array_entry(char* loc_name, zval* hash_arr, char* key_name TSRMLS_DC)
|
||||
static int add_array_entry(const char* loc_name, zval* hash_arr, char* key_name TSRMLS_DC)
|
||||
{
|
||||
char* key_value = NULL;
|
||||
char* cur_key_name = NULL;
|
||||
@@ -1081,7 +1084,7 @@ static int add_array_entry(char* loc_name, zval* hash_arr, char* key_name TSRMLS
|
||||
*/
|
||||
PHP_FUNCTION(locale_parse)
|
||||
{
|
||||
char* loc_name = NULL;
|
||||
const char* loc_name = NULL;
|
||||
int loc_name_len = 0;
|
||||
int grOffset = 0;
|
||||
|
||||
@@ -1125,8 +1128,8 @@ PHP_FUNCTION(locale_parse)
|
||||
*/
|
||||
PHP_FUNCTION(locale_get_all_variants)
|
||||
{
|
||||
char* loc_name = NULL;
|
||||
int loc_name_len = 0;
|
||||
const char* loc_name = NULL;
|
||||
int loc_name_len = 0;
|
||||
|
||||
int result = 0;
|
||||
char* token = NULL;
|
||||
@@ -1179,10 +1182,10 @@ PHP_FUNCTION(locale_get_all_variants)
|
||||
/*{{{
|
||||
* Converts to lower case and also replaces all hyphens with the underscore
|
||||
*/
|
||||
static int strToMatch(char* str ,char *retstr)
|
||||
static int strToMatch(const char* str ,char *retstr)
|
||||
{
|
||||
char* anchor = NULL;
|
||||
char* anchor1 = NULL;
|
||||
const char* anchor1 = NULL;
|
||||
int result = 0;
|
||||
int len = 0;
|
||||
|
||||
@@ -1222,7 +1225,7 @@ PHP_FUNCTION(locale_filter_matches)
|
||||
{
|
||||
char* lang_tag = NULL;
|
||||
int lang_tag_len = 0;
|
||||
char* loc_range = NULL;
|
||||
const char* loc_range = NULL;
|
||||
int loc_range_len = 0;
|
||||
|
||||
int result = 0;
|
||||
@@ -1398,7 +1401,7 @@ static void array_cleanup( char* arr[] , int arr_size)
|
||||
* returns the lookup result to lookup_loc_range_src_php
|
||||
* internal function
|
||||
*/
|
||||
static char* lookup_loc_range(char* loc_range, HashTable* hash_arr, int canonicalize TSRMLS_DC)
|
||||
static char* lookup_loc_range(const char* loc_range, HashTable* hash_arr, int canonicalize TSRMLS_DC)
|
||||
{
|
||||
int i = 0;
|
||||
int cur_arr_len = 0;
|
||||
@@ -1520,7 +1523,7 @@ PHP_FUNCTION(locale_lookup)
|
||||
{
|
||||
char* fallback_loc = NULL;
|
||||
int fallback_loc_len = 0;
|
||||
char* loc_range = NULL;
|
||||
const char* loc_range = NULL;
|
||||
int loc_range_len = 0;
|
||||
|
||||
zval* arr = NULL;
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
/* {{{ */
|
||||
static void msgfmt_ctor(INTERNAL_FUNCTION_PARAMETERS)
|
||||
{
|
||||
char* locale;
|
||||
const char* locale;
|
||||
char* pattern;
|
||||
int locale_len = 0, pattern_len = 0;
|
||||
UChar* spattern = NULL;
|
||||
|
||||
@@ -103,7 +103,7 @@ PHP_FUNCTION( msgfmt_format_message )
|
||||
int spattern_len = 0;
|
||||
char *pattern = NULL;
|
||||
int pattern_len = 0;
|
||||
char *slocale = NULL;
|
||||
const char *slocale = NULL;
|
||||
int slocale_len = 0;
|
||||
MessageFormatter_object mf = {0};
|
||||
MessageFormatter_object *mfo = &mf;
|
||||
|
||||
@@ -209,6 +209,9 @@ static HashTable *umsg_parse_format(MessageFormatter_object *mfo,
|
||||
continue;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
intl_errors_set(&err, U_INVALID_FORMAT_ERROR, "Invalid part type encountered", 0 TSRMLS_CC);
|
||||
continue;
|
||||
}
|
||||
|
||||
UMessagePatternArgType argType = p.getArgType();
|
||||
|
||||
@@ -93,7 +93,7 @@ PHP_FUNCTION( msgfmt_parse_message )
|
||||
int spattern_len = 0;
|
||||
char *pattern = NULL;
|
||||
int pattern_len = 0;
|
||||
char *slocale = NULL;
|
||||
const char *slocale = NULL;
|
||||
int slocale_len = 0;
|
||||
char *source = NULL;
|
||||
int src_len = 0;
|
||||
|
||||
@@ -4,6 +4,9 @@ Bug #58756: w.r.t MessageFormatter
|
||||
<?php
|
||||
if (!extension_loaded('intl'))
|
||||
die('skip intl extension not enabled');
|
||||
if (version_compare(INTL_ICU_VERSION, '51.2') >= 0)
|
||||
die('skip for ICU < 51.2');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
ini_set("intl.error_level", E_WARNING);
|
||||
@@ -31,4 +34,4 @@ echo "msgf2: ", $msgf->format(array($time, 'date')), " ",
|
||||
--EXPECT--
|
||||
date: Tuesday, July 7, 2009 8:41:13 PM EDT
|
||||
msgf: Tuesday, July 7, 2009 8:41:13 PM EDT
|
||||
==DONE==
|
||||
==DONE==
|
||||
@@ -0,0 +1,37 @@
|
||||
--TEST--
|
||||
Bug #58756: w.r.t MessageFormatter
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('intl'))
|
||||
die('skip intl extension not enabled');
|
||||
if (version_compare(INTL_ICU_VERSION, '51.2') < 0)
|
||||
die('skip for ICU >= 51.2');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
ini_set("intl.error_level", E_WARNING);
|
||||
//ini_set("intl.default_locale", "nl");
|
||||
|
||||
$time = 1247013673;
|
||||
|
||||
ini_set('date.timezone', 'America/New_York');
|
||||
|
||||
$msgf = new MessageFormatter('en_US', '{0,date,full} {0,time,h:m:s a V}');
|
||||
|
||||
echo "date: " . date('l, F j, Y g:i:s A T', $time) . "\n";
|
||||
echo "msgf: " . $msgf->format(array($time)) . "\n";
|
||||
|
||||
//NOT FIXED:
|
||||
/*$msgf = new MessageFormatter('en_US',
|
||||
'{1, select, date {{0,date,full}} other {{0,time,h:m:s a V}}}');
|
||||
|
||||
echo "msgf2: ", $msgf->format(array($time, 'date')), " ",
|
||||
$msgf->format(array($time, 'time')), "\n";
|
||||
*/
|
||||
|
||||
?>
|
||||
==DONE==
|
||||
--EXPECT--
|
||||
date: Tuesday, July 7, 2009 8:41:13 PM EDT
|
||||
msgf: Tuesday, July 7, 2009 8:41:13 PM usnyc
|
||||
==DONE==
|
||||
@@ -2,6 +2,7 @@
|
||||
asort()
|
||||
--SKIPIF--
|
||||
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '51.2') >= 0) die('skip for ICU < 51.2'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
|
||||
@@ -0,0 +1,243 @@
|
||||
--TEST--
|
||||
asort()
|
||||
--SKIPIF--
|
||||
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '51.2') < 0) die('skip for ICU >= 51.2'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Sort associative arrays using various locales.
|
||||
*/
|
||||
|
||||
|
||||
$test_num = 1;
|
||||
|
||||
/*
|
||||
* Sort various arrays in specified locale.
|
||||
*/
|
||||
function sort_arrays( $locale, $test_arrays, $sort_flag = Collator::SORT_REGULAR )
|
||||
{
|
||||
$res_str = '';
|
||||
|
||||
$coll = ut_coll_create( $locale );
|
||||
|
||||
foreach( $test_arrays as $test_array )
|
||||
{
|
||||
// Try to sort test data.
|
||||
$res_val = ut_coll_asort( $coll, $test_array, $sort_flag );
|
||||
|
||||
// Return output data.
|
||||
$res_dump = "\n" . dump( $test_array ) .
|
||||
"\n Result: " . dump( $res_val );
|
||||
|
||||
// Preppend test signature to output string
|
||||
$md5 = md5( $res_dump );
|
||||
|
||||
global $test_num;
|
||||
|
||||
$res_str .= "\n\n".
|
||||
"Test $test_num.$md5:" .
|
||||
$res_dump;
|
||||
++$test_num;
|
||||
}
|
||||
|
||||
return $res_str;
|
||||
}
|
||||
|
||||
/*
|
||||
* Test main function.
|
||||
*/
|
||||
function ut_main()
|
||||
{
|
||||
global $test_num;
|
||||
$test_num = 1;
|
||||
$res_str = '';
|
||||
|
||||
// Sort an array in SORT_REGULAR mode using en_US locale.
|
||||
$test_params = array(
|
||||
array( 'd' => 'y' ,
|
||||
'c' => 'i' ,
|
||||
'a' => 'k' ),
|
||||
|
||||
array( 'a' => 'a' ,
|
||||
'b' => 'aaa',
|
||||
'c' => 'aa' ),
|
||||
|
||||
array( 'a' => 'a' ,
|
||||
'aaa'=> 'a' ,
|
||||
'aa' => 'a' ),
|
||||
|
||||
array( '1' => 'abc',
|
||||
'5' => '!' ,
|
||||
'2' => null ,
|
||||
'7' => '' ),
|
||||
|
||||
array( '1' => '100',
|
||||
'2' => '25' ,
|
||||
'3' => '36' ),
|
||||
|
||||
array( '1' => 5 ,
|
||||
'2' => '30' ,
|
||||
'3' => 2 )
|
||||
);
|
||||
|
||||
$res_str .= sort_arrays( 'en_US', $test_params );
|
||||
|
||||
// Sort an array in SORT_STRING mode using en_US locale.
|
||||
$test_params = array(
|
||||
array( '1' => '100',
|
||||
'2' => '25' ,
|
||||
'3' => '36' ),
|
||||
|
||||
array( '1' => 5 ,
|
||||
'2' => '30' ,
|
||||
'3' => 2 ),
|
||||
|
||||
array( '1' => 'd' ,
|
||||
'2' => '' ,
|
||||
'3' => ' a' ),
|
||||
|
||||
array( '1' => 'y' ,
|
||||
'2' => 'k' ,
|
||||
'3' => 'i' )
|
||||
);
|
||||
|
||||
$res_str .= sort_arrays( 'en_US', $test_params, Collator::SORT_STRING );
|
||||
|
||||
// Sort a non-ASCII array using ru_RU locale.
|
||||
$test_params = array(
|
||||
array( 'п' => 'у',
|
||||
'б' => 'в',
|
||||
'е' => 'а' ),
|
||||
|
||||
array( '1' => 'п',
|
||||
'4' => '',
|
||||
'7' => 'd',
|
||||
'2' => 'пп' )
|
||||
);
|
||||
|
||||
$res_str .= sort_arrays( 'ru_RU', $test_params );
|
||||
|
||||
|
||||
// Sort an array using Lithuanian locale.
|
||||
$test_params = array(
|
||||
array( 'd' => 'y',
|
||||
'c' => 'i',
|
||||
'a' => 'k' )
|
||||
);
|
||||
|
||||
$res_str .= sort_arrays( 'lt_LT', $test_params );
|
||||
|
||||
return $res_str . "\n";
|
||||
}
|
||||
|
||||
include_once( 'ut_common.inc' );
|
||||
ut_run();
|
||||
?>
|
||||
--EXPECT--
|
||||
Test 1.162b81ac12878b817fc39063097e45b5:
|
||||
array (
|
||||
'c' => 'i',
|
||||
'a' => 'k',
|
||||
'd' => 'y',
|
||||
)
|
||||
Result: true
|
||||
|
||||
Test 2.93d96e22f692d8a281b0a389f01f8d1e:
|
||||
array (
|
||||
'a' => 'a',
|
||||
'c' => 'aa',
|
||||
'b' => 'aaa',
|
||||
)
|
||||
Result: true
|
||||
|
||||
Test 3.9f25de4482bc7b58de508e278113317c:
|
||||
array (
|
||||
'aa' => 'a',
|
||||
'aaa' => 'a',
|
||||
'a' => 'a',
|
||||
)
|
||||
Result: true
|
||||
|
||||
Test 4.a85a41ea78e45b651080cfd98c0b431d:
|
||||
array (
|
||||
7 => '',
|
||||
2 => NULL,
|
||||
5 => '!',
|
||||
1 => 'abc',
|
||||
)
|
||||
Result: true
|
||||
|
||||
Test 5.99dc71f405b286e03d489061b36e6900:
|
||||
array (
|
||||
2 => '25',
|
||||
3 => '36',
|
||||
1 => '100',
|
||||
)
|
||||
Result: true
|
||||
|
||||
Test 6.bf5bba243307c9d12934e756ad4be190:
|
||||
array (
|
||||
3 => 2,
|
||||
1 => 5,
|
||||
2 => '30',
|
||||
)
|
||||
Result: true
|
||||
|
||||
Test 7.e4ee7024c61476e9e7a6c28b5e47df6f:
|
||||
array (
|
||||
1 => '100',
|
||||
2 => '25',
|
||||
3 => '36',
|
||||
)
|
||||
Result: true
|
||||
|
||||
Test 8.5fa7033dd43784be0db1474eb48b83c8:
|
||||
array (
|
||||
3 => 2,
|
||||
2 => '30',
|
||||
1 => 5,
|
||||
)
|
||||
Result: true
|
||||
|
||||
Test 9.588cdf4692bc09aa92ffe7e48f9e4579:
|
||||
array (
|
||||
2 => '',
|
||||
3 => ' a',
|
||||
1 => 'd',
|
||||
)
|
||||
Result: true
|
||||
|
||||
Test 10.be02641a47ebcccd23e4183ca3a415f7:
|
||||
array (
|
||||
3 => 'i',
|
||||
2 => 'k',
|
||||
1 => 'y',
|
||||
)
|
||||
Result: true
|
||||
|
||||
Test 11.153d9b11d1e5936afc917a94a4e11f34:
|
||||
array (
|
||||
'е' => 'а',
|
||||
'б' => 'в',
|
||||
'п' => 'у',
|
||||
)
|
||||
Result: true
|
||||
|
||||
Test 12.e1f5cb037b564dce39ffbd0a61562d59:
|
||||
array (
|
||||
4 => '',
|
||||
1 => 'п',
|
||||
2 => 'пп',
|
||||
7 => 'd',
|
||||
)
|
||||
Result: true
|
||||
|
||||
Test 13.8800d48abb960a59002eef77f1d73ae0:
|
||||
array (
|
||||
'c' => 'i',
|
||||
'd' => 'y',
|
||||
'a' => 'k',
|
||||
)
|
||||
Result: true
|
||||
@@ -2,6 +2,7 @@
|
||||
compare()
|
||||
--SKIPIF--
|
||||
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '51.2') >= 0) die('skip for ICU < 51.2'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
|
||||
@@ -0,0 +1,135 @@
|
||||
--TEST--
|
||||
compare()
|
||||
--SKIPIF--
|
||||
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '51.2') < 0) die('skip for ICU >= 51.2'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Compare various string pairs using various locales.
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* Converts comparison result to a character.
|
||||
*/
|
||||
function cmp_to_char( $comp_res )
|
||||
{
|
||||
switch( $comp_res )
|
||||
{
|
||||
case 0: // UCOL_EQUAL
|
||||
return '=';
|
||||
case 1: // UCOL_GREATER
|
||||
return '>';
|
||||
case -1: // UCOL_LESS
|
||||
return '<';
|
||||
default:
|
||||
return '?';
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Compare string pairs in the given array
|
||||
* using specified locale.
|
||||
*/
|
||||
function compare_pairs( $locale, $test_array )
|
||||
{
|
||||
$res_str = '';
|
||||
|
||||
$coll = ut_coll_create( $locale );
|
||||
|
||||
foreach( $test_array as $test_strings )
|
||||
{
|
||||
list( $str1, $str2 ) = $test_strings;
|
||||
|
||||
// Compare strings.
|
||||
$res_val = cmp_to_char( ut_coll_compare( $coll, $str1, $str2 ) );
|
||||
|
||||
// Concatenate result strings.
|
||||
$res_str .= dump( $str1 ) .
|
||||
' ' . $res_val . ' ' .
|
||||
dump( $str2 ) . "\n";
|
||||
}
|
||||
|
||||
return $res_str;
|
||||
|
||||
}
|
||||
|
||||
function ut_main()
|
||||
{
|
||||
$res_str = '';
|
||||
|
||||
// Compare strings using en_US locale.
|
||||
$test_params = array(
|
||||
array( 'abc', 'abc' ),
|
||||
array( 'Abc', 'abc' ),
|
||||
array( 'a' , 'abc' ),
|
||||
array( 'a' , '' ),
|
||||
array( '' , '' ),
|
||||
array( 'a' , 'b' ),
|
||||
array( 'ab' , 'b' ),
|
||||
array( 'ab' , 'a' ),
|
||||
array( 123 , 'abc' ),
|
||||
array( 'ac' , null ),
|
||||
array( '.' , '.' ),
|
||||
// Try to compare long strings.
|
||||
array( 'abcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcde',
|
||||
'abcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdea'),
|
||||
array( null , null )
|
||||
);
|
||||
|
||||
$res_str .= compare_pairs( 'en_US', $test_params );
|
||||
|
||||
|
||||
// Compare strings using ru_RU locale.
|
||||
$test_params = array(
|
||||
array( 'а', 'б' ),
|
||||
array( 'а', 'аа' ),
|
||||
array( 'аб', 'ба' ),
|
||||
array( 'а', ',' ),
|
||||
array( 'а', 'b' ),
|
||||
array( 'а', 'bb' ),
|
||||
array( 'а', 'ab' ),
|
||||
array( 'а', null )
|
||||
);
|
||||
|
||||
$res_str .= compare_pairs( 'ru_RU', $test_params );
|
||||
|
||||
|
||||
// Compare strings using lt_LT locale.
|
||||
$test_params = array(
|
||||
array( 'y', 'k' )
|
||||
);
|
||||
|
||||
$res_str .= compare_pairs( 'lt_LT', $test_params );
|
||||
|
||||
return $res_str;
|
||||
}
|
||||
|
||||
include_once( 'ut_common.inc' );
|
||||
ut_run();
|
||||
?>
|
||||
--EXPECT--
|
||||
'abc' = 'abc'
|
||||
'Abc' > 'abc'
|
||||
'a' < 'abc'
|
||||
'a' > ''
|
||||
'' = ''
|
||||
'a' < 'b'
|
||||
'ab' < 'b'
|
||||
'ab' > 'a'
|
||||
123 < 'abc'
|
||||
'ac' > NULL
|
||||
'.' = '.'
|
||||
'abcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcde' < 'abcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdefabcdea'
|
||||
NULL = NULL
|
||||
'а' < 'б'
|
||||
'а' < 'аа'
|
||||
'аб' < 'ба'
|
||||
'а' > ','
|
||||
'а' < 'b'
|
||||
'а' < 'bb'
|
||||
'а' < 'ab'
|
||||
'а' > NULL
|
||||
'y' < 'k'
|
||||
@@ -3,6 +3,8 @@ collator_get_sort_key()
|
||||
--SKIPIF--
|
||||
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
|
||||
<?php if(version_compare(INTL_ICU_VERSION, '4.8') < 0) print 'skip ICU >= 4.8 only'; ?>
|
||||
<?php /* XXX Obviously it fails somewhere between >= 4.8 and < 51.2 */
|
||||
if (version_compare(INTL_ICU_VERSION, '51.2') >= 0) die('skip for ICU < 51.2'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
@@ -95,4 +97,4 @@ key: 5c0a161801070107
|
||||
source: жжж
|
||||
key: 5c3a3a3a01070107
|
||||
source: эюя
|
||||
key: 5d3b3f4501070107
|
||||
key: 5d3b3f4501070107
|
||||
@@ -0,0 +1,98 @@
|
||||
--TEST--
|
||||
collator_get_sort_key()
|
||||
--SKIPIF--
|
||||
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '51.2') < 0) die('skip for ICU >= 51.2'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Get sort keys using various locales
|
||||
*/
|
||||
function sort_arrays( $locale, $data )
|
||||
{
|
||||
$res_str = '';
|
||||
|
||||
$coll = ut_coll_create( $locale );
|
||||
|
||||
foreach($data as $value) {
|
||||
$res_val = ut_coll_get_sort_key( $coll, $value );
|
||||
$res_str .= "source: ".$value."\n".
|
||||
"key: ".bin2hex($res_val)."\n";
|
||||
}
|
||||
|
||||
return $res_str;
|
||||
}
|
||||
|
||||
|
||||
function ut_main()
|
||||
{
|
||||
$res_str = '';
|
||||
|
||||
// Regular strings keys
|
||||
$test_params = array(
|
||||
'abc', 'abd', 'aaa',
|
||||
'аа', 'а', 'z',
|
||||
'', null , '3',
|
||||
'y' , 'i' , 'k'
|
||||
);
|
||||
|
||||
$res_str .= sort_arrays( 'en_US', $test_params );
|
||||
|
||||
// Sort a non-ASCII array using ru_RU locale.
|
||||
$test_params = array(
|
||||
'абг', 'абв', 'жжж', 'эюя'
|
||||
);
|
||||
|
||||
$res_str .= sort_arrays( 'ru_RU', $test_params );
|
||||
|
||||
// Sort an array using Lithuanian locale.
|
||||
$res_str .= sort_arrays( 'lt_LT', $test_params );
|
||||
|
||||
return $res_str . "\n";
|
||||
}
|
||||
|
||||
include_once( 'ut_common.inc' );
|
||||
ut_run();
|
||||
?>
|
||||
--EXPECT--
|
||||
source: abc
|
||||
key: 27292b01070107
|
||||
source: abd
|
||||
key: 27292d01070107
|
||||
source: aaa
|
||||
key: 27272701070107
|
||||
source: аа
|
||||
key: 5c0a0a01060106
|
||||
source: а
|
||||
key: 5c0a01050105
|
||||
source: z
|
||||
key: 5901050105
|
||||
source:
|
||||
key: 0101
|
||||
source:
|
||||
key: 0101
|
||||
source: 3
|
||||
key: 1801050105
|
||||
source: y
|
||||
key: 5701050105
|
||||
source: i
|
||||
key: 3701050105
|
||||
source: k
|
||||
key: 3b01050105
|
||||
source: абг
|
||||
key: 260a161a01070107
|
||||
source: абв
|
||||
key: 260a161801070107
|
||||
source: жжж
|
||||
key: 263a3a3a01070107
|
||||
source: эюя
|
||||
key: 273b3f4501070107
|
||||
source: абг
|
||||
key: 5c0a161a01070107
|
||||
source: абв
|
||||
key: 5c0a161801070107
|
||||
source: жжж
|
||||
key: 5c3a3a3a01070107
|
||||
source: эюя
|
||||
key: 5d3b3f4501070107
|
||||
@@ -2,6 +2,7 @@
|
||||
sort()
|
||||
--SKIPIF--
|
||||
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '51.2') >= 0) die('skip for ICU < 51.2'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
|
||||
@@ -0,0 +1,248 @@
|
||||
--TEST--
|
||||
sort()
|
||||
--SKIPIF--
|
||||
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '51.2') < 0) die('skip for ICU >= 51.2'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Sort arrays using various locales.
|
||||
*/
|
||||
|
||||
|
||||
$test_num = 1;
|
||||
|
||||
/*
|
||||
* Sort arrays in the given list using specified locale.
|
||||
*/
|
||||
function sort_arrays( $locale, $arrays, $sort_flag = Collator::SORT_REGULAR )
|
||||
{
|
||||
$res_str = '';
|
||||
|
||||
$coll = ut_coll_create( $locale );
|
||||
|
||||
foreach( $arrays as $array )
|
||||
{
|
||||
// Sort array values
|
||||
$res_val = ut_coll_sort( $coll, $array, $sort_flag );
|
||||
|
||||
// Concatenate the sorted array and function result
|
||||
// with output string.
|
||||
$res_dump = "\n" . dump( $array ) .
|
||||
"\n Result: " . dump( $res_val );
|
||||
|
||||
// Preppend test signature to output string
|
||||
$md5 = md5( $res_dump );
|
||||
|
||||
global $test_num;
|
||||
|
||||
$res_str .= "\n\n".
|
||||
"Test $test_num.$md5:" .
|
||||
$res_dump;
|
||||
++$test_num;
|
||||
}
|
||||
|
||||
return $res_str;
|
||||
}
|
||||
|
||||
function ut_main()
|
||||
{
|
||||
global $test_num;
|
||||
$test_num = 1;
|
||||
$res_str = '';
|
||||
|
||||
// Sort an array in SORT_REGULAR mode using en_US locale.
|
||||
$test_params = array(
|
||||
array( 'abc', 'abd', 'aaa' ),
|
||||
array( 'm' , '1' , '_' ),
|
||||
array( 'a' , 'aaa', 'aa' ),
|
||||
array( 'ba' , 'b' , 'ab' ),
|
||||
array( 'e' , 'c' , 'a' ),
|
||||
array( '100', '25' , '36' ),
|
||||
array( 5 , '30' , 2 ),
|
||||
array( 'd' , '' , ' a' ),
|
||||
array( 'd ' , 'f ' , ' a' ),
|
||||
array( 'a' , null , '3' ),
|
||||
array( 'y' , 'k' , 'i' )
|
||||
);
|
||||
|
||||
$res_str .= sort_arrays( 'en_US', $test_params );
|
||||
|
||||
$test_params = array(
|
||||
array( '100', '25' , '36' ),
|
||||
array( 5 , '30' , 2 ),
|
||||
array( 'd' , '' , ' a' ),
|
||||
array( 'y' , 'k' , 'i' )
|
||||
);
|
||||
|
||||
// Sort in en_US locale with SORT_STRING flag
|
||||
$res_str .= sort_arrays( 'en_US', $test_params, Collator::SORT_STRING );
|
||||
|
||||
|
||||
// Sort a non-ASCII array using ru_RU locale.
|
||||
$test_params = array(
|
||||
array( 'абг', 'абв', 'ааа', 'abc' ),
|
||||
array( 'аа', 'ааа' , 'а' )
|
||||
);
|
||||
|
||||
$res_str .= sort_arrays( 'ru_RU', $test_params );
|
||||
|
||||
// Sort an array using Lithuanian locale.
|
||||
$test_params = array(
|
||||
array( 'y' , 'k' , 'i' )
|
||||
);
|
||||
|
||||
$res_str .= sort_arrays( 'lt_LT', $test_params );
|
||||
|
||||
return $res_str;
|
||||
}
|
||||
|
||||
include_once( 'ut_common.inc' );
|
||||
ut_run();
|
||||
?>
|
||||
--EXPECT--
|
||||
Test 1.e8f1cd28133d79ecd660002f1c660d0e:
|
||||
array (
|
||||
0 => 'aaa',
|
||||
1 => 'abc',
|
||||
2 => 'abd',
|
||||
)
|
||||
Result: true
|
||||
|
||||
Test 2.c2ded12173dd2996927378cae37eb275:
|
||||
array (
|
||||
0 => '_',
|
||||
1 => '1',
|
||||
2 => 'm',
|
||||
)
|
||||
Result: true
|
||||
|
||||
Test 3.54071c968d71cb98c5d379145f8d7d38:
|
||||
array (
|
||||
0 => 'a',
|
||||
1 => 'aa',
|
||||
2 => 'aaa',
|
||||
)
|
||||
Result: true
|
||||
|
||||
Test 4.19abe63d6f6dfef65b0e3c9ab4826b07:
|
||||
array (
|
||||
0 => 'ab',
|
||||
1 => 'b',
|
||||
2 => 'ba',
|
||||
)
|
||||
Result: true
|
||||
|
||||
Test 5.9a8dc0a9bc771368c2f1fc3d02754610:
|
||||
array (
|
||||
0 => 'a',
|
||||
1 => 'c',
|
||||
2 => 'e',
|
||||
)
|
||||
Result: true
|
||||
|
||||
Test 6.ab530b060e5e54a65bfb8b9f8fc61870:
|
||||
array (
|
||||
0 => '25',
|
||||
1 => '36',
|
||||
2 => '100',
|
||||
)
|
||||
Result: true
|
||||
|
||||
Test 7.0718dd838509017bded2ed307a6e785f:
|
||||
array (
|
||||
0 => 2,
|
||||
1 => 5,
|
||||
2 => '30',
|
||||
)
|
||||
Result: true
|
||||
|
||||
Test 8.923d65739c5219c634616ffd100a50e4:
|
||||
array (
|
||||
0 => '',
|
||||
1 => ' a',
|
||||
2 => 'd',
|
||||
)
|
||||
Result: true
|
||||
|
||||
Test 9.289bc2f28e87d3201ec9d7e8477ae1b0:
|
||||
array (
|
||||
0 => ' a',
|
||||
1 => 'd ',
|
||||
2 => 'f ',
|
||||
)
|
||||
Result: true
|
||||
|
||||
Test 10.de0fd958484f2377a645835d7fbcf124:
|
||||
array (
|
||||
0 => NULL,
|
||||
1 => '3',
|
||||
2 => 'a',
|
||||
)
|
||||
Result: true
|
||||
|
||||
Test 11.dd2b8f0adb37c45d528cad1a0cc0f361:
|
||||
array (
|
||||
0 => 'i',
|
||||
1 => 'k',
|
||||
2 => 'y',
|
||||
)
|
||||
Result: true
|
||||
|
||||
Test 12.1e6b4d6f7df9d4580317634ea46d8208:
|
||||
array (
|
||||
0 => '100',
|
||||
1 => '25',
|
||||
2 => '36',
|
||||
)
|
||||
Result: true
|
||||
|
||||
Test 13.cec115dc9850b98dfbdf102efa09e61b:
|
||||
array (
|
||||
0 => 2,
|
||||
1 => '30',
|
||||
2 => 5,
|
||||
)
|
||||
Result: true
|
||||
|
||||
Test 14.923d65739c5219c634616ffd100a50e4:
|
||||
array (
|
||||
0 => '',
|
||||
1 => ' a',
|
||||
2 => 'd',
|
||||
)
|
||||
Result: true
|
||||
|
||||
Test 15.dd2b8f0adb37c45d528cad1a0cc0f361:
|
||||
array (
|
||||
0 => 'i',
|
||||
1 => 'k',
|
||||
2 => 'y',
|
||||
)
|
||||
Result: true
|
||||
|
||||
Test 16.49056308afb2b800363c5baa735ed247:
|
||||
array (
|
||||
0 => 'ааа',
|
||||
1 => 'абв',
|
||||
2 => 'абг',
|
||||
3 => 'abc',
|
||||
)
|
||||
Result: true
|
||||
|
||||
Test 17.91480b10473a0c96a4cd6d88c23c577a:
|
||||
array (
|
||||
0 => 'а',
|
||||
1 => 'аа',
|
||||
2 => 'ааа',
|
||||
)
|
||||
Result: true
|
||||
|
||||
Test 18.fdd3fe3981476039164aa000bf9177f2:
|
||||
array (
|
||||
0 => 'i',
|
||||
1 => 'y',
|
||||
2 => 'k',
|
||||
)
|
||||
Result: true
|
||||
@@ -2,6 +2,7 @@
|
||||
sort_with_sort_keys()
|
||||
--SKIPIF--
|
||||
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '51.2') >= 0) die('skip for ICU < 51.2'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
|
||||
@@ -0,0 +1,190 @@
|
||||
--TEST--
|
||||
sort_with_sort_keys()
|
||||
--SKIPIF--
|
||||
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '51.2') < 0) die('skip for ICU >= 51.2'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Sort arrays using various locales.
|
||||
*/
|
||||
|
||||
|
||||
$test_num = 1;
|
||||
|
||||
/*
|
||||
* Sort arrays in the given list using specified locale.
|
||||
*/
|
||||
function sort_arrays( $locale, $arrays )
|
||||
{
|
||||
$res_str = '';
|
||||
|
||||
$coll = ut_coll_create( $locale );
|
||||
|
||||
foreach( $arrays as $array )
|
||||
{
|
||||
// Sort array values
|
||||
$res_val = ut_coll_sort_with_sort_keys( $coll, $array );
|
||||
|
||||
// Concatenate the sorted array and function result
|
||||
// with output string.
|
||||
$res_dump = "\n" . dump( $array ) .
|
||||
"\n Result: " . dump( $res_val );
|
||||
|
||||
|
||||
// Preppend test signature to output string
|
||||
$md5 = md5( $res_dump );
|
||||
|
||||
global $test_num;
|
||||
|
||||
$res_str .= "\n\n".
|
||||
"Test $test_num.$md5:" .
|
||||
$res_dump;
|
||||
++$test_num;
|
||||
}
|
||||
|
||||
return $res_str;
|
||||
}
|
||||
|
||||
|
||||
function ut_main()
|
||||
{
|
||||
global $test_num;
|
||||
$test_num = 1;
|
||||
$res_str = '';
|
||||
|
||||
// Sort an array in SORT_REGULAR mode using en_US locale.
|
||||
$test_params = array(
|
||||
array( 'abc', 'abd', 'aaa' ),
|
||||
array( 'm' , '1' , '_' ),
|
||||
array( 'a' , 'aaa', 'aa' ),
|
||||
array( 'ba' , 'b' , 'ab' ),
|
||||
array( 'e' , 'c' , 'a' ),
|
||||
array( 'd' , '' , ' a' ),
|
||||
array( 'd ' , 'f ' , ' a' ),
|
||||
array( 'a' , null , '3' ),
|
||||
array( 'y' , 'i' , 'k' )
|
||||
);
|
||||
|
||||
$res_str .= sort_arrays( 'en_US', $test_params );
|
||||
|
||||
// Sort a non-ASCII array using ru_RU locale.
|
||||
$test_params = array(
|
||||
array( 'абг', 'абв', 'ааа', 'abc' ),
|
||||
array( 'аа', 'ааа', 'а' )
|
||||
);
|
||||
|
||||
$res_str .= sort_arrays( 'ru_RU', $test_params );
|
||||
|
||||
// Array with data for sorting.
|
||||
$test_params = array(
|
||||
array( 'y' , 'i' , 'k' )
|
||||
);
|
||||
|
||||
// Sort an array using Lithuanian locale.
|
||||
$res_str .= sort_arrays( 'lt_LT', $test_params );
|
||||
|
||||
return $res_str . "\n";
|
||||
}
|
||||
|
||||
include_once( 'ut_common.inc' );
|
||||
ut_run();
|
||||
?>
|
||||
--EXPECT--
|
||||
Test 1.e8f1cd28133d79ecd660002f1c660d0e:
|
||||
array (
|
||||
0 => 'aaa',
|
||||
1 => 'abc',
|
||||
2 => 'abd',
|
||||
)
|
||||
Result: true
|
||||
|
||||
Test 2.c2ded12173dd2996927378cae37eb275:
|
||||
array (
|
||||
0 => '_',
|
||||
1 => '1',
|
||||
2 => 'm',
|
||||
)
|
||||
Result: true
|
||||
|
||||
Test 3.54071c968d71cb98c5d379145f8d7d38:
|
||||
array (
|
||||
0 => 'a',
|
||||
1 => 'aa',
|
||||
2 => 'aaa',
|
||||
)
|
||||
Result: true
|
||||
|
||||
Test 4.19abe63d6f6dfef65b0e3c9ab4826b07:
|
||||
array (
|
||||
0 => 'ab',
|
||||
1 => 'b',
|
||||
2 => 'ba',
|
||||
)
|
||||
Result: true
|
||||
|
||||
Test 5.9a8dc0a9bc771368c2f1fc3d02754610:
|
||||
array (
|
||||
0 => 'a',
|
||||
1 => 'c',
|
||||
2 => 'e',
|
||||
)
|
||||
Result: true
|
||||
|
||||
Test 6.923d65739c5219c634616ffd100a50e4:
|
||||
array (
|
||||
0 => '',
|
||||
1 => ' a',
|
||||
2 => 'd',
|
||||
)
|
||||
Result: true
|
||||
|
||||
Test 7.289bc2f28e87d3201ec9d7e8477ae1b0:
|
||||
array (
|
||||
0 => ' a',
|
||||
1 => 'd ',
|
||||
2 => 'f ',
|
||||
)
|
||||
Result: true
|
||||
|
||||
Test 8.de0fd958484f2377a645835d7fbcf124:
|
||||
array (
|
||||
0 => NULL,
|
||||
1 => '3',
|
||||
2 => 'a',
|
||||
)
|
||||
Result: true
|
||||
|
||||
Test 9.dd2b8f0adb37c45d528cad1a0cc0f361:
|
||||
array (
|
||||
0 => 'i',
|
||||
1 => 'k',
|
||||
2 => 'y',
|
||||
)
|
||||
Result: true
|
||||
|
||||
Test 10.49056308afb2b800363c5baa735ed247:
|
||||
array (
|
||||
0 => 'ааа',
|
||||
1 => 'абв',
|
||||
2 => 'абг',
|
||||
3 => 'abc',
|
||||
)
|
||||
Result: true
|
||||
|
||||
Test 11.91480b10473a0c96a4cd6d88c23c577a:
|
||||
array (
|
||||
0 => 'а',
|
||||
1 => 'аа',
|
||||
2 => 'ааа',
|
||||
)
|
||||
Result: true
|
||||
|
||||
Test 12.fdd3fe3981476039164aa000bf9177f2:
|
||||
array (
|
||||
0 => 'i',
|
||||
1 => 'y',
|
||||
2 => 'k',
|
||||
)
|
||||
Result: true
|
||||
@@ -4,8 +4,8 @@ IntlDateFormatter, calendars and time zone
|
||||
date.timezone=Atlantic/Azores
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('intl'))
|
||||
die('skip intl extension not enabled');
|
||||
if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '51.2') >= 0) die('skip for ICU < 51.2'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
ini_set("intl.error_level", E_WARNING);
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
--TEST--
|
||||
IntlDateFormatter, calendars and time zone
|
||||
--INI--
|
||||
date.timezone=Atlantic/Azores
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '51.2') < 0) die('skip for ICU >= 51.2'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
ini_set("intl.error_level", E_WARNING);
|
||||
|
||||
$fmt1 = new IntlDateFormatter('en_US',
|
||||
IntlDateFormatter::FULL,
|
||||
IntlDateFormatter::FULL,
|
||||
'GMT+05:12',
|
||||
IntlDateFormatter::TRADITIONAL);
|
||||
$fmt2 = new IntlDateFormatter('en_US',
|
||||
IntlDateFormatter::FULL,
|
||||
IntlDateFormatter::FULL,
|
||||
'GMT+05:12',
|
||||
IntlDateFormatter::GREGORIAN);
|
||||
$fmt3 = new IntlDateFormatter('en_US@calendar=hebrew',
|
||||
IntlDateFormatter::FULL,
|
||||
IntlDateFormatter::FULL,
|
||||
'GMT+05:12',
|
||||
IntlDateFormatter::TRADITIONAL);
|
||||
var_dump($fmt1->format(strtotime('2012-01-01 00:00:00 +0000')));
|
||||
var_dump($fmt2->format(strtotime('2012-01-01 00:00:00 +0000')));
|
||||
var_dump($fmt3->format(strtotime('2012-01-01 00:00:00 +0000')));
|
||||
|
||||
new IntlDateFormatter('en_US@calendar=hebrew',
|
||||
IntlDateFormatter::FULL,
|
||||
IntlDateFormatter::FULL,
|
||||
'GMT+05:12',
|
||||
-1);
|
||||
?>
|
||||
==DONE==
|
||||
--EXPECTF--
|
||||
string(47) "Sunday, January 1, 2012 at 5:12:00 AM GMT+05:12"
|
||||
string(47) "Sunday, January 1, 2012 at 5:12:00 AM GMT+05:12"
|
||||
string(48) "Sunday, Tevet 6, 5772 AM at 5:12:00 AM GMT+05:12"
|
||||
|
||||
Warning: IntlDateFormatter::__construct(): datefmt_create: invalid value for calendar type; it must be one of IntlDateFormatter::TRADITIONAL (locale's default calendar) or IntlDateFormatter::GREGORIAN. Alternatively, it can be an IntlCalendar object in %sdateformat_calendars_variant2.php on line %d
|
||||
==DONE==
|
||||
@@ -2,8 +2,8 @@
|
||||
IntlDateFormatter: several forms of the calendar arg
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('intl'))
|
||||
die('skip intl extension not enabled');
|
||||
if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '51.2') >= 0) die('skip for ICU < 51.2'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
ini_set("intl.error_level", E_WARNING);
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
--TEST--
|
||||
IntlDateFormatter: several forms of the calendar arg
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '51.2') < 0) die('skip for ICU >= 51.2'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
ini_set("intl.error_level", E_WARNING);
|
||||
ini_set("intl.default_locale", "pt_PT");
|
||||
ini_set("date.timezone", 'Atlantic/Azores');
|
||||
|
||||
$ts = strtotime('2012-01-01 00:00:00 UTC');
|
||||
|
||||
$cal = new IntlGregorianCalendar('UTC', NULL);
|
||||
$df = new IntlDateFormatter('es_ES', 0, 0, NULL, $cal);
|
||||
echo $df->format($ts), "\n";
|
||||
|
||||
$cal = IntlCalendar::createInstance('UTC', 'en@calendar=islamic');
|
||||
$df = new IntlDateFormatter('es_ES', 0, 0, NULL, $cal);
|
||||
echo $df->format($ts), "\n";
|
||||
|
||||
//override calendar's timezone
|
||||
$cal = new IntlGregorianCalendar('UTC', NULL);
|
||||
$df = new IntlDateFormatter('es_ES', 0, 0, 'Europe/Madrid', $cal);
|
||||
echo $df->format($ts), "\n";
|
||||
|
||||
//default calendar is gregorian
|
||||
$df = new IntlDateFormatter('es_ES@calendar=islamic', 0, 0);
|
||||
echo $df->format($ts), "\n";
|
||||
|
||||
//try now with traditional
|
||||
$df = new IntlDateFormatter('es_ES@calendar=islamic', 0, 0, NULL, IntlDateFormatter::TRADITIONAL);
|
||||
echo $df->format($ts), "\n";
|
||||
|
||||
//the timezone can be overridden when not specifying a calendar
|
||||
$df = new IntlDateFormatter('es_ES@calendar=islamic', 0, 0, 'UTC', IntlDateFormatter::TRADITIONAL);
|
||||
echo $df->format($ts), "\n";
|
||||
|
||||
$df = new IntlDateFormatter('es_ES', 0, 0, 'UTC', 0);
|
||||
echo $df->format($ts), "\n";
|
||||
|
||||
?>
|
||||
==DONE==
|
||||
--EXPECTF--
|
||||
domingo%S 1 de enero de 2012 00:00:00 GMT
|
||||
domingo%S 8 de Safar de 1433 00:00:00 GMT
|
||||
domingo%S 1 de enero de 2012 01:00:00 Hora estándar de Europa central
|
||||
sábado%S 31 de diciembre de 2011 d.C. 23:00:00 Hora %Sde las Azores
|
||||
sábado%S 7 de Safar de 1433 AH 23:00:00 Hora %Sde las Azores
|
||||
domingo%S 8 de Safar de 1433 AH 00:00:00 GMT
|
||||
domingo%S 1 de enero de 2012 00:00:00 GMT
|
||||
==DONE==
|
||||
@@ -2,6 +2,7 @@
|
||||
datefmt_format_code()
|
||||
--SKIPIF--
|
||||
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '51.2') >= 0) die('skip for ICU < 51.2'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
IntlDateFormatter::formatObject(): IntlCalendar tests
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('intl'))
|
||||
die('skip intl extension not enabled');
|
||||
if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '51.2') >= 0) die('skip for ICU < 51.2'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
ini_set("intl.error_level", E_WARNING);
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
--TEST--
|
||||
IntlDateFormatter::formatObject(): IntlCalendar tests
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '51.2') < 0) die('skip for ICU >= 51.2'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
ini_set("intl.error_level", E_WARNING);
|
||||
ini_set("intl.default_locale", "pt_PT");
|
||||
ini_set("date.timezone", "Europe/Lisbon");
|
||||
|
||||
$cal = IntlCalendar::fromDateTime('2012-01-01 00:00:00'); //Europe/Lisbon
|
||||
echo IntlDateFormatter::formatObject($cal), "\n";
|
||||
echo IntlDateFormatter::formatObject($cal, IntlDateFormatter::FULL), "\n";
|
||||
echo IntlDateFormatter::formatObject($cal, null, "en-US"), "\n";
|
||||
echo IntlDateFormatter::formatObject($cal, array(IntlDateFormatter::SHORT, IntlDateFormatter::FULL), "en-US"), "\n";
|
||||
echo IntlDateFormatter::formatObject($cal, 'E y-MM-d HH,mm,ss.SSS v', "en-US"), "\n";
|
||||
|
||||
$cal = IntlCalendar::fromDateTime('2012-01-01 05:00:00+03:00');
|
||||
echo datefmt_format_object($cal, IntlDateFormatter::FULL), "\n";
|
||||
|
||||
$cal = IntlCalendar::createInstance(null,'en-US@calendar=islamic-civil');
|
||||
$cal->setTime(strtotime('2012-01-01 00:00:00')*1000.);
|
||||
echo IntlDateFormatter::formatObject($cal), "\n";
|
||||
echo IntlDateFormatter::formatObject($cal, IntlDateFormatter::FULL, "en-US"), "\n";
|
||||
|
||||
?>
|
||||
==DONE==
|
||||
|
||||
--EXPECTF--
|
||||
01/01/2012, 00:00:00
|
||||
Domingo, 1 de Janeiro de 2012 às 00:00:00 Hora %Sda Europa Ocidental
|
||||
Jan 1, 2012, 12:00:00 AM
|
||||
1/1/12, 12:00:00 AM Western European Standard %STime
|
||||
Sun 2012-01-1 00,00,00.000 Portugal Time
|
||||
Domingo, 1 de Janeiro de 2012 às 05:00:00 GMT+03:00
|
||||
06/02/1433, 00:00:00
|
||||
Sunday, Safar 6, 1433 at 12:00:00 AM Western European Standard Time
|
||||
==DONE==
|
||||
@@ -2,8 +2,8 @@
|
||||
IntlDateFormatter::formatObject(): DateTime tests
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('intl'))
|
||||
die('skip intl extension not enabled');
|
||||
if (!extension_loaded('intl')) die('skip intl extension not enabled') ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '51.2') >= 0) die('skip for ICU < 51.2'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
ini_set("intl.error_level", E_WARNING);
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
--TEST--
|
||||
IntlDateFormatter::formatObject(): DateTime tests
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '51.2') < 0) die('skip for ICU >= 51.2'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
ini_set("intl.error_level", E_WARNING);
|
||||
ini_set("intl.default_locale", "pt_PT");
|
||||
ini_set("date.timezone", "Europe/Lisbon");
|
||||
|
||||
$dt = new DateTime('2012-01-01 00:00:00'); //Europe/Lisbon
|
||||
echo IntlDateFormatter::formatObject($dt), "\n";
|
||||
echo IntlDateFormatter::formatObject($dt, IntlDateFormatter::FULL), "\n";
|
||||
echo IntlDateFormatter::formatObject($dt, null, "en-US"), "\n";
|
||||
echo IntlDateFormatter::formatObject($dt, array(IntlDateFormatter::SHORT, IntlDateFormatter::FULL), "en-US"), "\n";
|
||||
echo IntlDateFormatter::formatObject($dt, 'E y-MM-d HH,mm,ss.SSS v', "en-US"), "\n";
|
||||
|
||||
$dt = new DateTime('2012-01-01 05:00:00+03:00');
|
||||
echo IntlDateFormatter::formatObject($dt, IntlDateFormatter::FULL), "\n";
|
||||
|
||||
?>
|
||||
==DONE==
|
||||
|
||||
--EXPECTF--
|
||||
01/01/2012, 00:00:00
|
||||
Domingo, 1 de Janeiro de 2012 às 00:00:00 Hora %Sda Europa Ocidental
|
||||
Jan 1, 2012, 12:00:00 AM
|
||||
1/1/12, 12:00:00 AM Western European Standard %STime
|
||||
Sun 2012-01-1 00,00,00.000 Portugal Time
|
||||
Domingo, 1 de Janeiro de 2012 às 05:00:00 GMT+03:00
|
||||
==DONE==
|
||||
@@ -2,6 +2,7 @@
|
||||
datefmt_format_code() and datefmt_parse_code()
|
||||
--SKIPIF--
|
||||
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '51.2') >= 0) die('skip for ICU < 51.2'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
|
||||
@@ -0,0 +1,295 @@
|
||||
--TEST--
|
||||
datefmt_format_code() and datefmt_parse_code()
|
||||
--SKIPIF--
|
||||
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '51.2') < 0) die('skip for ICU >= 51.2'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Test for the datefmt_format function
|
||||
*/
|
||||
|
||||
|
||||
function ut_main()
|
||||
{
|
||||
$timezone = 'GMT+05:00';
|
||||
|
||||
$locale_arr = array (
|
||||
'en_US'
|
||||
);
|
||||
|
||||
$datetype_arr = array (
|
||||
IntlDateFormatter::FULL,
|
||||
IntlDateFormatter::LONG,
|
||||
IntlDateFormatter::MEDIUM
|
||||
);
|
||||
|
||||
$res_str = '';
|
||||
|
||||
|
||||
$time_arr = array (
|
||||
0,
|
||||
-1200000,
|
||||
1200000,
|
||||
2200000000,
|
||||
-2200000000,
|
||||
90099999,
|
||||
3600,
|
||||
-3600
|
||||
);
|
||||
|
||||
$localtime_arr1 = array (
|
||||
'tm_sec' => 24 ,
|
||||
'tm_min' => 3,
|
||||
'tm_hour' => 19,
|
||||
'tm_mday' => 3,
|
||||
'tm_mon' => 3,
|
||||
'tm_year' => 105,
|
||||
);
|
||||
$localtime_arr2 = array (
|
||||
'tm_sec' => 21,
|
||||
'tm_min' => 5,
|
||||
'tm_hour' => 7,
|
||||
'tm_mday' => 13,
|
||||
'tm_mon' => 7,
|
||||
'tm_year' => 205,
|
||||
);
|
||||
$localtime_arr3 = array (
|
||||
'tm_sec' => 11,
|
||||
'tm_min' => 13,
|
||||
'tm_hour' => 0,
|
||||
'tm_mday' => 17,
|
||||
'tm_mon' => 11,
|
||||
'tm_year' => -5
|
||||
);
|
||||
|
||||
$localtime_arr = array (
|
||||
$localtime_arr1,
|
||||
$localtime_arr2,
|
||||
$localtime_arr3
|
||||
);
|
||||
|
||||
//Test format and parse with a timestamp : long
|
||||
foreach( $time_arr as $timestamp_entry){
|
||||
$res_str .= "\n------------\n";
|
||||
$res_str .= "\nInput timestamp is : $timestamp_entry";
|
||||
$res_str .= "\n------------\n";
|
||||
foreach( $locale_arr as $locale_entry ){
|
||||
foreach( $datetype_arr as $datetype_entry ) {
|
||||
$res_str .= "\nIntlDateFormatter locale= $locale_entry ,datetype = $datetype_entry ,timetype =$datetype_entry ";
|
||||
$fmt = ut_datefmt_create( $locale_entry , $datetype_entry ,$datetype_entry,$timezone);
|
||||
$formatted = ut_datefmt_format( $fmt , $timestamp_entry);
|
||||
$res_str .= "\nFormatted timestamp is : $formatted";
|
||||
$parsed = ut_datefmt_parse( $fmt , $formatted);
|
||||
if( intl_get_error_code() == U_ZERO_ERROR){
|
||||
$res_str .= "\nParsed timestamp is : $parsed";
|
||||
}else{
|
||||
$res_str .= "\nError while parsing as: '".intl_get_error_message()."'";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Test format and parse with a localtime :array
|
||||
foreach( $localtime_arr as $localtime_entry){
|
||||
$res_str .= "\n------------\n";
|
||||
$res_str .= "\nInput localtime is : ";
|
||||
foreach( $localtime_entry as $key => $value){
|
||||
$res_str .= "$key : '$value' , ";
|
||||
}
|
||||
|
||||
$res_str .= "\n------------\n";
|
||||
foreach( $locale_arr as $locale_entry ){
|
||||
foreach( $datetype_arr as $datetype_entry ) {
|
||||
$res_str .= "\nIntlDateFormatter locale= $locale_entry ,datetype = $datetype_entry ,timetype =$datetype_entry ";
|
||||
$fmt = ut_datefmt_create( $locale_entry , $datetype_entry ,$datetype_entry,$timezone);
|
||||
$formatted1 = ut_datefmt_format( $fmt , $localtime_entry);
|
||||
if( intl_get_error_code() == U_ZERO_ERROR){
|
||||
$res_str .= "\nFormatted localtime_array is : $formatted1";
|
||||
}else{
|
||||
$res_str .= "\nError while formatting as: '".intl_get_error_message()."'";
|
||||
}
|
||||
//Parsing
|
||||
$parsed_arr = ut_datefmt_localtime( $fmt, $formatted1 );
|
||||
|
||||
if( $parsed_arr){
|
||||
$res_str .= "\nParsed array is: ";
|
||||
foreach( $parsed_arr as $key => $value){
|
||||
$res_str .= "$key : '$value' , ";
|
||||
}
|
||||
}
|
||||
/*
|
||||
else{
|
||||
//$res_str .= "No values found from LocaleTime parsing.";
|
||||
$res_str .= "\tError : '".intl_get_error_message()."'";
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $res_str;
|
||||
|
||||
}
|
||||
|
||||
include_once( 'ut_common.inc' );
|
||||
|
||||
// Run the test
|
||||
ut_run();
|
||||
?>
|
||||
--EXPECT--
|
||||
------------
|
||||
|
||||
Input timestamp is : 0
|
||||
------------
|
||||
|
||||
IntlDateFormatter locale= en_US ,datetype = 0 ,timetype =0
|
||||
Formatted timestamp is : Thursday, January 1, 1970 at 5:00:00 AM GMT+05:00
|
||||
Parsed timestamp is : 0
|
||||
IntlDateFormatter locale= en_US ,datetype = 1 ,timetype =1
|
||||
Formatted timestamp is : January 1, 1970 at 5:00:00 AM GMT+5
|
||||
Parsed timestamp is : 0
|
||||
IntlDateFormatter locale= en_US ,datetype = 2 ,timetype =2
|
||||
Formatted timestamp is : Jan 1, 1970, 5:00:00 AM
|
||||
Parsed timestamp is : 0
|
||||
------------
|
||||
|
||||
Input timestamp is : -1200000
|
||||
------------
|
||||
|
||||
IntlDateFormatter locale= en_US ,datetype = 0 ,timetype =0
|
||||
Formatted timestamp is : Thursday, December 18, 1969 at 7:40:00 AM GMT+05:00
|
||||
Parsed timestamp is : -1200000
|
||||
IntlDateFormatter locale= en_US ,datetype = 1 ,timetype =1
|
||||
Formatted timestamp is : December 18, 1969 at 7:40:00 AM GMT+5
|
||||
Parsed timestamp is : -1200000
|
||||
IntlDateFormatter locale= en_US ,datetype = 2 ,timetype =2
|
||||
Formatted timestamp is : Dec 18, 1969, 7:40:00 AM
|
||||
Parsed timestamp is : -1200000
|
||||
------------
|
||||
|
||||
Input timestamp is : 1200000
|
||||
------------
|
||||
|
||||
IntlDateFormatter locale= en_US ,datetype = 0 ,timetype =0
|
||||
Formatted timestamp is : Thursday, January 15, 1970 at 2:20:00 AM GMT+05:00
|
||||
Parsed timestamp is : 1200000
|
||||
IntlDateFormatter locale= en_US ,datetype = 1 ,timetype =1
|
||||
Formatted timestamp is : January 15, 1970 at 2:20:00 AM GMT+5
|
||||
Parsed timestamp is : 1200000
|
||||
IntlDateFormatter locale= en_US ,datetype = 2 ,timetype =2
|
||||
Formatted timestamp is : Jan 15, 1970, 2:20:00 AM
|
||||
Parsed timestamp is : 1200000
|
||||
------------
|
||||
|
||||
Input timestamp is : 2200000000
|
||||
------------
|
||||
|
||||
IntlDateFormatter locale= en_US ,datetype = 0 ,timetype =0
|
||||
Formatted timestamp is : Monday, September 19, 2039 at 4:06:40 AM GMT+05:00
|
||||
Parsed timestamp is : 2200000000
|
||||
IntlDateFormatter locale= en_US ,datetype = 1 ,timetype =1
|
||||
Formatted timestamp is : September 19, 2039 at 4:06:40 AM GMT+5
|
||||
Parsed timestamp is : 2200000000
|
||||
IntlDateFormatter locale= en_US ,datetype = 2 ,timetype =2
|
||||
Formatted timestamp is : Sep 19, 2039, 4:06:40 AM
|
||||
Parsed timestamp is : 2200000000
|
||||
------------
|
||||
|
||||
Input timestamp is : -2200000000
|
||||
------------
|
||||
|
||||
IntlDateFormatter locale= en_US ,datetype = 0 ,timetype =0
|
||||
Formatted timestamp is : Sunday, April 15, 1900 at 5:53:20 AM GMT+05:00
|
||||
Parsed timestamp is : -2200000000
|
||||
IntlDateFormatter locale= en_US ,datetype = 1 ,timetype =1
|
||||
Formatted timestamp is : April 15, 1900 at 5:53:20 AM GMT+5
|
||||
Parsed timestamp is : -2200000000
|
||||
IntlDateFormatter locale= en_US ,datetype = 2 ,timetype =2
|
||||
Formatted timestamp is : Apr 15, 1900, 5:53:20 AM
|
||||
Parsed timestamp is : -2200000000
|
||||
------------
|
||||
|
||||
Input timestamp is : 90099999
|
||||
------------
|
||||
|
||||
IntlDateFormatter locale= en_US ,datetype = 0 ,timetype =0
|
||||
Formatted timestamp is : Thursday, November 9, 1972 at 12:46:39 AM GMT+05:00
|
||||
Parsed timestamp is : 90099999
|
||||
IntlDateFormatter locale= en_US ,datetype = 1 ,timetype =1
|
||||
Formatted timestamp is : November 9, 1972 at 12:46:39 AM GMT+5
|
||||
Parsed timestamp is : 90099999
|
||||
IntlDateFormatter locale= en_US ,datetype = 2 ,timetype =2
|
||||
Formatted timestamp is : Nov 9, 1972, 12:46:39 AM
|
||||
Parsed timestamp is : 90099999
|
||||
------------
|
||||
|
||||
Input timestamp is : 3600
|
||||
------------
|
||||
|
||||
IntlDateFormatter locale= en_US ,datetype = 0 ,timetype =0
|
||||
Formatted timestamp is : Thursday, January 1, 1970 at 6:00:00 AM GMT+05:00
|
||||
Parsed timestamp is : 3600
|
||||
IntlDateFormatter locale= en_US ,datetype = 1 ,timetype =1
|
||||
Formatted timestamp is : January 1, 1970 at 6:00:00 AM GMT+5
|
||||
Parsed timestamp is : 3600
|
||||
IntlDateFormatter locale= en_US ,datetype = 2 ,timetype =2
|
||||
Formatted timestamp is : Jan 1, 1970, 6:00:00 AM
|
||||
Parsed timestamp is : 3600
|
||||
------------
|
||||
|
||||
Input timestamp is : -3600
|
||||
------------
|
||||
|
||||
IntlDateFormatter locale= en_US ,datetype = 0 ,timetype =0
|
||||
Formatted timestamp is : Thursday, January 1, 1970 at 4:00:00 AM GMT+05:00
|
||||
Parsed timestamp is : -3600
|
||||
IntlDateFormatter locale= en_US ,datetype = 1 ,timetype =1
|
||||
Formatted timestamp is : January 1, 1970 at 4:00:00 AM GMT+5
|
||||
Parsed timestamp is : -3600
|
||||
IntlDateFormatter locale= en_US ,datetype = 2 ,timetype =2
|
||||
Formatted timestamp is : Jan 1, 1970, 4:00:00 AM
|
||||
Parsed timestamp is : -3600
|
||||
------------
|
||||
|
||||
Input localtime is : tm_sec : '24' , tm_min : '3' , tm_hour : '19' , tm_mday : '3' , tm_mon : '3' , tm_year : '105' ,
|
||||
------------
|
||||
|
||||
IntlDateFormatter locale= en_US ,datetype = 0 ,timetype =0
|
||||
Formatted localtime_array is : Sunday, April 3, 2005 at 7:03:24 PM GMT+05:00
|
||||
Parsed array is: tm_sec : '24' , tm_min : '3' , tm_hour : '19' , tm_year : '105' , tm_mday : '3' , tm_wday : '0' , tm_yday : '93' , tm_mon : '3' , tm_isdst : '0' ,
|
||||
IntlDateFormatter locale= en_US ,datetype = 1 ,timetype =1
|
||||
Formatted localtime_array is : April 3, 2005 at 7:03:24 PM GMT+5
|
||||
Parsed array is: tm_sec : '24' , tm_min : '3' , tm_hour : '19' , tm_year : '105' , tm_mday : '3' , tm_wday : '0' , tm_yday : '93' , tm_mon : '3' , tm_isdst : '0' ,
|
||||
IntlDateFormatter locale= en_US ,datetype = 2 ,timetype =2
|
||||
Formatted localtime_array is : Apr 3, 2005, 7:03:24 PM
|
||||
Parsed array is: tm_sec : '24' , tm_min : '3' , tm_hour : '19' , tm_year : '105' , tm_mday : '3' , tm_wday : '0' , tm_yday : '93' , tm_mon : '3' , tm_isdst : '0' ,
|
||||
------------
|
||||
|
||||
Input localtime is : tm_sec : '21' , tm_min : '5' , tm_hour : '7' , tm_mday : '13' , tm_mon : '7' , tm_year : '205' ,
|
||||
------------
|
||||
|
||||
IntlDateFormatter locale= en_US ,datetype = 0 ,timetype =0
|
||||
Formatted localtime_array is : Thursday, August 13, 2105 at 7:05:21 AM GMT+05:00
|
||||
Parsed array is: tm_sec : '21' , tm_min : '5' , tm_hour : '7' , tm_year : '205' , tm_mday : '13' , tm_wday : '4' , tm_yday : '225' , tm_mon : '7' , tm_isdst : '0' ,
|
||||
IntlDateFormatter locale= en_US ,datetype = 1 ,timetype =1
|
||||
Formatted localtime_array is : August 13, 2105 at 7:05:21 AM GMT+5
|
||||
Parsed array is: tm_sec : '21' , tm_min : '5' , tm_hour : '7' , tm_year : '205' , tm_mday : '13' , tm_wday : '4' , tm_yday : '225' , tm_mon : '7' , tm_isdst : '0' ,
|
||||
IntlDateFormatter locale= en_US ,datetype = 2 ,timetype =2
|
||||
Formatted localtime_array is : Aug 13, 2105, 7:05:21 AM
|
||||
Parsed array is: tm_sec : '21' , tm_min : '5' , tm_hour : '7' , tm_year : '205' , tm_mday : '13' , tm_wday : '4' , tm_yday : '225' , tm_mon : '7' , tm_isdst : '0' ,
|
||||
------------
|
||||
|
||||
Input localtime is : tm_sec : '11' , tm_min : '13' , tm_hour : '0' , tm_mday : '17' , tm_mon : '11' , tm_year : '-5' ,
|
||||
------------
|
||||
|
||||
IntlDateFormatter locale= en_US ,datetype = 0 ,timetype =0
|
||||
Formatted localtime_array is : Tuesday, December 17, 1895 at 12:13:11 AM GMT+05:00
|
||||
Parsed array is: tm_sec : '11' , tm_min : '13' , tm_hour : '0' , tm_year : '-5' , tm_mday : '17' , tm_wday : '2' , tm_yday : '351' , tm_mon : '11' , tm_isdst : '0' ,
|
||||
IntlDateFormatter locale= en_US ,datetype = 1 ,timetype =1
|
||||
Formatted localtime_array is : December 17, 1895 at 12:13:11 AM GMT+5
|
||||
Parsed array is: tm_sec : '11' , tm_min : '13' , tm_hour : '0' , tm_year : '-5' , tm_mday : '17' , tm_wday : '2' , tm_yday : '351' , tm_mon : '11' , tm_isdst : '0' ,
|
||||
IntlDateFormatter locale= en_US ,datetype = 2 ,timetype =2
|
||||
Formatted localtime_array is : Dec 17, 1895, 12:13:11 AM
|
||||
Parsed array is: tm_sec : '11' , tm_min : '13' , tm_hour : '0' , tm_year : '-5' , tm_mday : '17' , tm_wday : '2' , tm_yday : '351' , tm_mon : '11' , tm_isdst : '0' ,
|
||||
@@ -0,0 +1,423 @@
|
||||
--TEST--
|
||||
datefmt_format_code()
|
||||
--SKIPIF--
|
||||
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '51.2') < 0) die('skip for ICU >= 51.2'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
//ini_set("intl.error_level", E_WARNING);
|
||||
|
||||
/*
|
||||
* Test for the datefmt_format function
|
||||
*/
|
||||
|
||||
|
||||
function ut_main()
|
||||
{
|
||||
$timezone = 'GMT-10:00';
|
||||
|
||||
$locale_arr = array (
|
||||
'en_US'
|
||||
);
|
||||
|
||||
$datetype_arr = array (
|
||||
IntlDateFormatter::FULL,
|
||||
IntlDateFormatter::LONG,
|
||||
IntlDateFormatter::MEDIUM,
|
||||
IntlDateFormatter::SHORT,
|
||||
IntlDateFormatter::NONE
|
||||
);
|
||||
|
||||
$res_str = '';
|
||||
|
||||
|
||||
$time_arr = array (
|
||||
0,
|
||||
-1200000,
|
||||
1200000,
|
||||
2200000000.0,
|
||||
-2200000000.0,
|
||||
90099999,
|
||||
3600,
|
||||
-3600
|
||||
);
|
||||
|
||||
$localtime_arr1 = array (
|
||||
'tm_sec' => 24 ,
|
||||
'tm_min' => 3,
|
||||
'tm_hour' => 19,
|
||||
'tm_mday' => 3,
|
||||
'tm_mon' => 3,
|
||||
'tm_year' => 105,
|
||||
);
|
||||
$localtime_arr2 = array (
|
||||
'tm_sec' => 21,
|
||||
'tm_min' => 5,
|
||||
'tm_hour' => 7,
|
||||
'tm_mday' => 13,
|
||||
'tm_mon' => 4,
|
||||
'tm_year' => 205,
|
||||
);
|
||||
$localtime_arr3 = array (
|
||||
'tm_sec' => 11,
|
||||
'tm_min' => 13,
|
||||
'tm_hour' => 0,
|
||||
'tm_mday' => 17,
|
||||
'tm_mon' => 11,
|
||||
'tm_year' => -5
|
||||
);
|
||||
|
||||
$localtime_arr = array (
|
||||
$localtime_arr1,
|
||||
$localtime_arr2,
|
||||
$localtime_arr3
|
||||
);
|
||||
|
||||
$d1 = new DateTime("2010-01-01 01:02:03", new DateTimeZone("UTC"));
|
||||
$d2 = new DateTime("2000-12-31 03:04:05", new DateTimeZone("UTC"));
|
||||
$d2->setTimezone(new DateTimeZone("PDT"));
|
||||
$dates = array(
|
||||
$d1,
|
||||
$d2,
|
||||
new StdClass(),
|
||||
);
|
||||
|
||||
//Test format with input as a timestamp : integer
|
||||
foreach( $time_arr as $timestamp_entry){
|
||||
$res_str .= "\n------------\n";
|
||||
$res_str .= "\nInput timestamp is : $timestamp_entry";
|
||||
$res_str .= "\n------------\n";
|
||||
foreach( $locale_arr as $locale_entry ){
|
||||
foreach( $datetype_arr as $datetype_entry )
|
||||
{
|
||||
$res_str .= "\nIntlDateFormatter locale= $locale_entry ,datetype = $datetype_entry ,timetype =$datetype_entry ";
|
||||
$fmt = ut_datefmt_create( $locale_entry , $datetype_entry ,$datetype_entry, $timezone, IntlDateFormatter::GREGORIAN);
|
||||
$formatted = ut_datefmt_format( $fmt , $timestamp_entry);
|
||||
$res_str .= "\nFormatted timestamp is : $formatted";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Test format with input as a localtime :array
|
||||
foreach( $localtime_arr as $localtime_entry){
|
||||
$res_str .= "\n------------\n";
|
||||
$res_str .= "\nInput localtime is : ";
|
||||
foreach( $localtime_entry as $key => $value){
|
||||
$res_str .= "$key : '$value' , ";
|
||||
}
|
||||
|
||||
$res_str .= "\n------------\n";
|
||||
foreach( $locale_arr as $locale_entry ){
|
||||
foreach( $datetype_arr as $datetype_entry )
|
||||
{
|
||||
$res_str .= "\nIntlDateFormatter locale= $locale_entry ,datetype = $datetype_entry ,timetype =$datetype_entry ";
|
||||
$fmt = ut_datefmt_create( $locale_entry , $datetype_entry ,$datetype_entry, $timezone, IntlDateFormatter::GREGORIAN );
|
||||
$formatted1 = ut_datefmt_format( $fmt , $localtime_entry);
|
||||
if( intl_get_error_code() == U_ZERO_ERROR){
|
||||
$res_str .= "\nFormatted localtime_array is : $formatted1";
|
||||
}else{
|
||||
$res_str .= "\nError while formatting as: '".intl_get_error_message()."'";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach($dates as $date_entry) {
|
||||
foreach( $locale_arr as $locale_entry ){
|
||||
foreach( $datetype_arr as $datetype_entry ) {
|
||||
$res_str .= "\n------------";
|
||||
$res_str .= "\nDate is: ".var_export($date_entry, true);
|
||||
$res_str .= "\n------------";
|
||||
|
||||
$fmt = ut_datefmt_create( $locale_entry , $datetype_entry ,$datetype_entry, $timezone, IntlDateFormatter::GREGORIAN );
|
||||
$formatted1 = ut_datefmt_format( $fmt , $date_entry);
|
||||
if( intl_get_error_code() == U_ZERO_ERROR){
|
||||
$res_str .= "\nFormatted DateTime is : $formatted1";
|
||||
}else{
|
||||
$res_str .= "\nError while formatting as: '".intl_get_error_message()."'";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $res_str;
|
||||
|
||||
}
|
||||
|
||||
include_once( 'ut_common.inc' );
|
||||
|
||||
// Run the test
|
||||
ut_run();
|
||||
?>
|
||||
--EXPECT--
|
||||
------------
|
||||
|
||||
Input timestamp is : 0
|
||||
------------
|
||||
|
||||
IntlDateFormatter locale= en_US ,datetype = 0 ,timetype =0
|
||||
Formatted timestamp is : Wednesday, December 31, 1969 at 2:00:00 PM GMT-10:00
|
||||
IntlDateFormatter locale= en_US ,datetype = 1 ,timetype =1
|
||||
Formatted timestamp is : December 31, 1969 at 2:00:00 PM GMT-10
|
||||
IntlDateFormatter locale= en_US ,datetype = 2 ,timetype =2
|
||||
Formatted timestamp is : Dec 31, 1969, 2:00:00 PM
|
||||
IntlDateFormatter locale= en_US ,datetype = 3 ,timetype =3
|
||||
Formatted timestamp is : 12/31/69, 2:00 PM
|
||||
IntlDateFormatter locale= en_US ,datetype = -1 ,timetype =-1
|
||||
Formatted timestamp is : 19691231 02:00 PM
|
||||
------------
|
||||
|
||||
Input timestamp is : -1200000
|
||||
------------
|
||||
|
||||
IntlDateFormatter locale= en_US ,datetype = 0 ,timetype =0
|
||||
Formatted timestamp is : Wednesday, December 17, 1969 at 4:40:00 PM GMT-10:00
|
||||
IntlDateFormatter locale= en_US ,datetype = 1 ,timetype =1
|
||||
Formatted timestamp is : December 17, 1969 at 4:40:00 PM GMT-10
|
||||
IntlDateFormatter locale= en_US ,datetype = 2 ,timetype =2
|
||||
Formatted timestamp is : Dec 17, 1969, 4:40:00 PM
|
||||
IntlDateFormatter locale= en_US ,datetype = 3 ,timetype =3
|
||||
Formatted timestamp is : 12/17/69, 4:40 PM
|
||||
IntlDateFormatter locale= en_US ,datetype = -1 ,timetype =-1
|
||||
Formatted timestamp is : 19691217 04:40 PM
|
||||
------------
|
||||
|
||||
Input timestamp is : 1200000
|
||||
------------
|
||||
|
||||
IntlDateFormatter locale= en_US ,datetype = 0 ,timetype =0
|
||||
Formatted timestamp is : Wednesday, January 14, 1970 at 11:20:00 AM GMT-10:00
|
||||
IntlDateFormatter locale= en_US ,datetype = 1 ,timetype =1
|
||||
Formatted timestamp is : January 14, 1970 at 11:20:00 AM GMT-10
|
||||
IntlDateFormatter locale= en_US ,datetype = 2 ,timetype =2
|
||||
Formatted timestamp is : Jan 14, 1970, 11:20:00 AM
|
||||
IntlDateFormatter locale= en_US ,datetype = 3 ,timetype =3
|
||||
Formatted timestamp is : 1/14/70, 11:20 AM
|
||||
IntlDateFormatter locale= en_US ,datetype = -1 ,timetype =-1
|
||||
Formatted timestamp is : 19700114 11:20 AM
|
||||
------------
|
||||
|
||||
Input timestamp is : 2200000000
|
||||
------------
|
||||
|
||||
IntlDateFormatter locale= en_US ,datetype = 0 ,timetype =0
|
||||
Formatted timestamp is : Sunday, September 18, 2039 at 1:06:40 PM GMT-10:00
|
||||
IntlDateFormatter locale= en_US ,datetype = 1 ,timetype =1
|
||||
Formatted timestamp is : September 18, 2039 at 1:06:40 PM GMT-10
|
||||
IntlDateFormatter locale= en_US ,datetype = 2 ,timetype =2
|
||||
Formatted timestamp is : Sep 18, 2039, 1:06:40 PM
|
||||
IntlDateFormatter locale= en_US ,datetype = 3 ,timetype =3
|
||||
Formatted timestamp is : 9/18/39, 1:06 PM
|
||||
IntlDateFormatter locale= en_US ,datetype = -1 ,timetype =-1
|
||||
Formatted timestamp is : 20390918 01:06 PM
|
||||
------------
|
||||
|
||||
Input timestamp is : -2200000000
|
||||
------------
|
||||
|
||||
IntlDateFormatter locale= en_US ,datetype = 0 ,timetype =0
|
||||
Formatted timestamp is : Saturday, April 14, 1900 at 2:53:20 PM GMT-10:00
|
||||
IntlDateFormatter locale= en_US ,datetype = 1 ,timetype =1
|
||||
Formatted timestamp is : April 14, 1900 at 2:53:20 PM GMT-10
|
||||
IntlDateFormatter locale= en_US ,datetype = 2 ,timetype =2
|
||||
Formatted timestamp is : Apr 14, 1900, 2:53:20 PM
|
||||
IntlDateFormatter locale= en_US ,datetype = 3 ,timetype =3
|
||||
Formatted timestamp is : 4/14/00, 2:53 PM
|
||||
IntlDateFormatter locale= en_US ,datetype = -1 ,timetype =-1
|
||||
Formatted timestamp is : 19000414 02:53 PM
|
||||
------------
|
||||
|
||||
Input timestamp is : 90099999
|
||||
------------
|
||||
|
||||
IntlDateFormatter locale= en_US ,datetype = 0 ,timetype =0
|
||||
Formatted timestamp is : Wednesday, November 8, 1972 at 9:46:39 AM GMT-10:00
|
||||
IntlDateFormatter locale= en_US ,datetype = 1 ,timetype =1
|
||||
Formatted timestamp is : November 8, 1972 at 9:46:39 AM GMT-10
|
||||
IntlDateFormatter locale= en_US ,datetype = 2 ,timetype =2
|
||||
Formatted timestamp is : Nov 8, 1972, 9:46:39 AM
|
||||
IntlDateFormatter locale= en_US ,datetype = 3 ,timetype =3
|
||||
Formatted timestamp is : 11/8/72, 9:46 AM
|
||||
IntlDateFormatter locale= en_US ,datetype = -1 ,timetype =-1
|
||||
Formatted timestamp is : 19721108 09:46 AM
|
||||
------------
|
||||
|
||||
Input timestamp is : 3600
|
||||
------------
|
||||
|
||||
IntlDateFormatter locale= en_US ,datetype = 0 ,timetype =0
|
||||
Formatted timestamp is : Wednesday, December 31, 1969 at 3:00:00 PM GMT-10:00
|
||||
IntlDateFormatter locale= en_US ,datetype = 1 ,timetype =1
|
||||
Formatted timestamp is : December 31, 1969 at 3:00:00 PM GMT-10
|
||||
IntlDateFormatter locale= en_US ,datetype = 2 ,timetype =2
|
||||
Formatted timestamp is : Dec 31, 1969, 3:00:00 PM
|
||||
IntlDateFormatter locale= en_US ,datetype = 3 ,timetype =3
|
||||
Formatted timestamp is : 12/31/69, 3:00 PM
|
||||
IntlDateFormatter locale= en_US ,datetype = -1 ,timetype =-1
|
||||
Formatted timestamp is : 19691231 03:00 PM
|
||||
------------
|
||||
|
||||
Input timestamp is : -3600
|
||||
------------
|
||||
|
||||
IntlDateFormatter locale= en_US ,datetype = 0 ,timetype =0
|
||||
Formatted timestamp is : Wednesday, December 31, 1969 at 1:00:00 PM GMT-10:00
|
||||
IntlDateFormatter locale= en_US ,datetype = 1 ,timetype =1
|
||||
Formatted timestamp is : December 31, 1969 at 1:00:00 PM GMT-10
|
||||
IntlDateFormatter locale= en_US ,datetype = 2 ,timetype =2
|
||||
Formatted timestamp is : Dec 31, 1969, 1:00:00 PM
|
||||
IntlDateFormatter locale= en_US ,datetype = 3 ,timetype =3
|
||||
Formatted timestamp is : 12/31/69, 1:00 PM
|
||||
IntlDateFormatter locale= en_US ,datetype = -1 ,timetype =-1
|
||||
Formatted timestamp is : 19691231 01:00 PM
|
||||
------------
|
||||
|
||||
Input localtime is : tm_sec : '24' , tm_min : '3' , tm_hour : '19' , tm_mday : '3' , tm_mon : '3' , tm_year : '105' ,
|
||||
------------
|
||||
|
||||
IntlDateFormatter locale= en_US ,datetype = 0 ,timetype =0
|
||||
Formatted localtime_array is : Sunday, April 3, 2005 at 7:03:24 PM GMT-10:00
|
||||
IntlDateFormatter locale= en_US ,datetype = 1 ,timetype =1
|
||||
Formatted localtime_array is : April 3, 2005 at 7:03:24 PM GMT-10
|
||||
IntlDateFormatter locale= en_US ,datetype = 2 ,timetype =2
|
||||
Formatted localtime_array is : Apr 3, 2005, 7:03:24 PM
|
||||
IntlDateFormatter locale= en_US ,datetype = 3 ,timetype =3
|
||||
Formatted localtime_array is : 4/3/05, 7:03 PM
|
||||
IntlDateFormatter locale= en_US ,datetype = -1 ,timetype =-1
|
||||
Formatted localtime_array is : 20050403 07:03 PM
|
||||
------------
|
||||
|
||||
Input localtime is : tm_sec : '21' , tm_min : '5' , tm_hour : '7' , tm_mday : '13' , tm_mon : '4' , tm_year : '205' ,
|
||||
------------
|
||||
|
||||
IntlDateFormatter locale= en_US ,datetype = 0 ,timetype =0
|
||||
Formatted localtime_array is : Wednesday, May 13, 2105 at 7:05:21 AM GMT-10:00
|
||||
IntlDateFormatter locale= en_US ,datetype = 1 ,timetype =1
|
||||
Formatted localtime_array is : May 13, 2105 at 7:05:21 AM GMT-10
|
||||
IntlDateFormatter locale= en_US ,datetype = 2 ,timetype =2
|
||||
Formatted localtime_array is : May 13, 2105, 7:05:21 AM
|
||||
IntlDateFormatter locale= en_US ,datetype = 3 ,timetype =3
|
||||
Formatted localtime_array is : 5/13/05, 7:05 AM
|
||||
IntlDateFormatter locale= en_US ,datetype = -1 ,timetype =-1
|
||||
Formatted localtime_array is : 21050513 07:05 AM
|
||||
------------
|
||||
|
||||
Input localtime is : tm_sec : '11' , tm_min : '13' , tm_hour : '0' , tm_mday : '17' , tm_mon : '11' , tm_year : '-5' ,
|
||||
------------
|
||||
|
||||
IntlDateFormatter locale= en_US ,datetype = 0 ,timetype =0
|
||||
Formatted localtime_array is : Tuesday, December 17, 1895 at 12:13:11 AM GMT-10:00
|
||||
IntlDateFormatter locale= en_US ,datetype = 1 ,timetype =1
|
||||
Formatted localtime_array is : December 17, 1895 at 12:13:11 AM GMT-10
|
||||
IntlDateFormatter locale= en_US ,datetype = 2 ,timetype =2
|
||||
Formatted localtime_array is : Dec 17, 1895, 12:13:11 AM
|
||||
IntlDateFormatter locale= en_US ,datetype = 3 ,timetype =3
|
||||
Formatted localtime_array is : 12/17/95, 12:13 AM
|
||||
IntlDateFormatter locale= en_US ,datetype = -1 ,timetype =-1
|
||||
Formatted localtime_array is : 18951217 12:13 AM
|
||||
------------
|
||||
Date is: DateTime::__set_state(array(
|
||||
'date' => '2010-01-01 01:02:03',
|
||||
'timezone_type' => 3,
|
||||
'timezone' => 'UTC',
|
||||
))
|
||||
------------
|
||||
Formatted DateTime is : Thursday, December 31, 2009 at 3:02:03 PM GMT-10:00
|
||||
------------
|
||||
Date is: DateTime::__set_state(array(
|
||||
'date' => '2010-01-01 01:02:03',
|
||||
'timezone_type' => 3,
|
||||
'timezone' => 'UTC',
|
||||
))
|
||||
------------
|
||||
Formatted DateTime is : December 31, 2009 at 3:02:03 PM GMT-10
|
||||
------------
|
||||
Date is: DateTime::__set_state(array(
|
||||
'date' => '2010-01-01 01:02:03',
|
||||
'timezone_type' => 3,
|
||||
'timezone' => 'UTC',
|
||||
))
|
||||
------------
|
||||
Formatted DateTime is : Dec 31, 2009, 3:02:03 PM
|
||||
------------
|
||||
Date is: DateTime::__set_state(array(
|
||||
'date' => '2010-01-01 01:02:03',
|
||||
'timezone_type' => 3,
|
||||
'timezone' => 'UTC',
|
||||
))
|
||||
------------
|
||||
Formatted DateTime is : 12/31/09, 3:02 PM
|
||||
------------
|
||||
Date is: DateTime::__set_state(array(
|
||||
'date' => '2010-01-01 01:02:03',
|
||||
'timezone_type' => 3,
|
||||
'timezone' => 'UTC',
|
||||
))
|
||||
------------
|
||||
Formatted DateTime is : 20091231 03:02 PM
|
||||
------------
|
||||
Date is: DateTime::__set_state(array(
|
||||
'date' => '2000-12-30 19:04:05',
|
||||
'timezone_type' => 3,
|
||||
'timezone' => 'America/Los_Angeles',
|
||||
))
|
||||
------------
|
||||
Formatted DateTime is : Saturday, December 30, 2000 at 5:04:05 PM GMT-10:00
|
||||
------------
|
||||
Date is: DateTime::__set_state(array(
|
||||
'date' => '2000-12-30 19:04:05',
|
||||
'timezone_type' => 3,
|
||||
'timezone' => 'America/Los_Angeles',
|
||||
))
|
||||
------------
|
||||
Formatted DateTime is : December 30, 2000 at 5:04:05 PM GMT-10
|
||||
------------
|
||||
Date is: DateTime::__set_state(array(
|
||||
'date' => '2000-12-30 19:04:05',
|
||||
'timezone_type' => 3,
|
||||
'timezone' => 'America/Los_Angeles',
|
||||
))
|
||||
------------
|
||||
Formatted DateTime is : Dec 30, 2000, 5:04:05 PM
|
||||
------------
|
||||
Date is: DateTime::__set_state(array(
|
||||
'date' => '2000-12-30 19:04:05',
|
||||
'timezone_type' => 3,
|
||||
'timezone' => 'America/Los_Angeles',
|
||||
))
|
||||
------------
|
||||
Formatted DateTime is : 12/30/00, 5:04 PM
|
||||
------------
|
||||
Date is: DateTime::__set_state(array(
|
||||
'date' => '2000-12-30 19:04:05',
|
||||
'timezone_type' => 3,
|
||||
'timezone' => 'America/Los_Angeles',
|
||||
))
|
||||
------------
|
||||
Formatted DateTime is : 20001230 05:04 PM
|
||||
------------
|
||||
Date is: stdClass::__set_state(array(
|
||||
))
|
||||
------------
|
||||
Error while formatting as: 'datefmt_format: invalid object type for date/time (only IntlCalendar and DateTime permitted): U_ILLEGAL_ARGUMENT_ERROR'
|
||||
------------
|
||||
Date is: stdClass::__set_state(array(
|
||||
))
|
||||
------------
|
||||
Error while formatting as: 'datefmt_format: invalid object type for date/time (only IntlCalendar and DateTime permitted): U_ILLEGAL_ARGUMENT_ERROR'
|
||||
------------
|
||||
Date is: stdClass::__set_state(array(
|
||||
))
|
||||
------------
|
||||
Error while formatting as: 'datefmt_format: invalid object type for date/time (only IntlCalendar and DateTime permitted): U_ILLEGAL_ARGUMENT_ERROR'
|
||||
------------
|
||||
Date is: stdClass::__set_state(array(
|
||||
))
|
||||
------------
|
||||
Error while formatting as: 'datefmt_format: invalid object type for date/time (only IntlCalendar and DateTime permitted): U_ILLEGAL_ARGUMENT_ERROR'
|
||||
------------
|
||||
Date is: stdClass::__set_state(array(
|
||||
))
|
||||
------------
|
||||
Error while formatting as: 'datefmt_format: invalid object type for date/time (only IntlCalendar and DateTime permitted): U_ILLEGAL_ARGUMENT_ERROR'
|
||||
@@ -2,8 +2,8 @@
|
||||
IntlDateFormatter: setCalendar()/getCalendar()/getCalendarObject()
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('intl'))
|
||||
die('skip intl extension not enabled');
|
||||
if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '51.2') >= 0) die('skip for ICU < 51.2'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
ini_set("intl.error_level", E_WARNING);
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
--TEST--
|
||||
IntlDateFormatter: setCalendar()/getCalendar()/getCalendarObject()
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '51.2') < 0) die('skip for ICU >= 51.2'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
ini_set("intl.error_level", E_WARNING);
|
||||
ini_set("intl.default_locale", "pt_PT");
|
||||
ini_set("date.timezone", 'Atlantic/Azores');
|
||||
|
||||
$ts = strtotime('2012-01-01 00:00:00 UTC');
|
||||
|
||||
function d(IntlDateFormatter $df) {
|
||||
global $ts;
|
||||
echo $df->format($ts), "\n";
|
||||
var_dump($df->getCalendar(),
|
||||
$df->getCalendarObject()->getType(),
|
||||
$df->getCalendarObject()->getTimeZone()->getId());
|
||||
echo "\n";
|
||||
}
|
||||
|
||||
$df = new IntlDateFormatter('fr@calendar=islamic', 0, 0, 'Europe/Minsk');
|
||||
d($df);
|
||||
|
||||
|
||||
//changing the calendar with a cal type should not change tz
|
||||
$df->setCalendar(IntlDateFormatter::TRADITIONAL);
|
||||
d($df);
|
||||
|
||||
//but changing with an actual calendar should
|
||||
$cal = IntlCalendar::createInstance("UTC");
|
||||
$df->setCalendar($cal);
|
||||
d($df);
|
||||
|
||||
?>
|
||||
==DONE==
|
||||
--EXPECT--
|
||||
dimanche 1 janvier 2012 ap. J.-C. 03:00:00 UTC+03:00
|
||||
int(1)
|
||||
string(9) "gregorian"
|
||||
string(12) "Europe/Minsk"
|
||||
|
||||
dimanche 8 safar 1433 AH 03:00:00 UTC+03:00
|
||||
int(0)
|
||||
string(7) "islamic"
|
||||
string(12) "Europe/Minsk"
|
||||
|
||||
dimanche 1 janvier 2012 ap. J.-C. 00:00:00 UTC
|
||||
bool(false)
|
||||
string(9) "gregorian"
|
||||
string(3) "UTC"
|
||||
|
||||
==DONE==
|
||||
@@ -2,8 +2,8 @@
|
||||
IntlDateFormatter: get/setTimeZone()
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('intl'))
|
||||
die('skip intl extension not enabled');
|
||||
if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '51.2') >= 0) die('skip for ICU < 51.2'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
ini_set("intl.error_level", E_WARNING);
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
--TEST--
|
||||
IntlDateFormatter: get/setTimeZone()
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '51.2') < 0) die('skip for ICU >= 51.2'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
ini_set("intl.error_level", E_WARNING);
|
||||
ini_set("intl.default_locale", "pt_PT");
|
||||
ini_set("date.timezone", 'Atlantic/Azores');
|
||||
|
||||
$ts = strtotime('2012-01-01 00:00:00 UTC');
|
||||
|
||||
function d(IntlDateFormatter $df) {
|
||||
global $ts;
|
||||
echo $df->format($ts), "\n";
|
||||
var_dump(
|
||||
$df->getTimeZoneID(),
|
||||
$df->getTimeZone()->getID());
|
||||
echo "\n";
|
||||
}
|
||||
|
||||
$df = new IntlDateFormatter('pt_PT', 0, 0, 'Europe/Minsk');
|
||||
d($df);
|
||||
|
||||
$df->setTimeZone(NULL);
|
||||
d($df);
|
||||
|
||||
$df->setTimeZone('Europe/Madrid');
|
||||
d($df);
|
||||
|
||||
$df->setTimeZone(IntlTimeZone::createTimeZone('Europe/Paris'));
|
||||
d($df);
|
||||
|
||||
$df->setTimeZone(new DateTimeZone('Europe/Amsterdam'));
|
||||
d($df);
|
||||
|
||||
?>
|
||||
==DONE==
|
||||
--EXPECTF--
|
||||
Domingo, 1 de Janeiro de 2012 às 03:00:00 GMT+03:00
|
||||
string(12) "Europe/Minsk"
|
||||
string(12) "Europe/Minsk"
|
||||
|
||||
Sábado, 31 de Dezembro de 2011 às 23:00:00 Hor%s %Sdos Açores
|
||||
string(15) "Atlantic/Azores"
|
||||
string(15) "Atlantic/Azores"
|
||||
|
||||
Domingo, 1 de Janeiro de 2012 às 01:00:00 Hor%s %Sda Europa Central
|
||||
string(13) "Europe/Madrid"
|
||||
string(13) "Europe/Madrid"
|
||||
|
||||
Domingo, 1 de Janeiro de 2012 às 01:00:00 Hor%s %Sda Europa Central
|
||||
string(12) "Europe/Paris"
|
||||
string(12) "Europe/Paris"
|
||||
|
||||
Domingo, 1 de Janeiro de 2012 às 01:00:00 Hor%s %Sda Europa Central
|
||||
string(16) "Europe/Amsterdam"
|
||||
string(16) "Europe/Amsterdam"
|
||||
|
||||
==DONE==
|
||||
@@ -5,6 +5,7 @@ date.timezone=Atlantic/Azores
|
||||
--SKIPIF--
|
||||
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
|
||||
<?php if(version_compare(INTL_ICU_VERSION, '4.8') < 0) print 'skip'; ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '51.2') >= 0) die('skip for ICU < 51.2'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
|
||||
@@ -0,0 +1,85 @@
|
||||
--TEST--
|
||||
datefmt_set_timezone_id_code() icu >= 4.8
|
||||
--INI--
|
||||
date.timezone=Atlantic/Azores
|
||||
--SKIPIF--
|
||||
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '51.2') < 0) die('skip for ICU >= 51.2'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
ini_set("intl.error_level", E_WARNING);
|
||||
ini_set("error_reporting", ~E_DEPRECATED);
|
||||
|
||||
/*
|
||||
* Test for the datefmt_set_timezone_id function
|
||||
*/
|
||||
|
||||
|
||||
function ut_main()
|
||||
{
|
||||
$timezone_id_arr = array (
|
||||
'America/New_York',
|
||||
'America/Los_Angeles',
|
||||
'America/Chicago',
|
||||
'CN'
|
||||
);
|
||||
$timestamp_entry = 0;
|
||||
|
||||
$res_str = '';
|
||||
|
||||
$fmt = ut_datefmt_create( "en_US", IntlDateFormatter::FULL, IntlDateFormatter::FULL, 'US/Pacific' , IntlDateFormatter::GREGORIAN );
|
||||
$timezone_id = ut_datefmt_get_timezone_id( $fmt );
|
||||
$res_str .= "\nAfter creation of the dateformatter : timezone_id= $timezone_id\n";
|
||||
|
||||
foreach( $timezone_id_arr as $timezone_id_entry )
|
||||
{
|
||||
|
||||
$res_str .= "-----------";
|
||||
$res_str .= "\nTrying to set timezone_id= $timezone_id_entry";
|
||||
ut_datefmt_set_timezone_id( $fmt , $timezone_id_entry );
|
||||
$timezone_id = ut_datefmt_get_timezone_id( $fmt );
|
||||
$res_str .= "\nAfter call to set_timezone_id : timezone_id= $timezone_id";
|
||||
$formatted = ut_datefmt_format( $fmt, 0);
|
||||
$res_str .= "\nFormatting timestamp=0 resulted in $formatted";
|
||||
$formatted = ut_datefmt_format( $fmt, 3600);
|
||||
$res_str .= "\nFormatting timestamp=3600 resulted in $formatted";
|
||||
$res_str .= "\n";
|
||||
|
||||
}
|
||||
|
||||
return $res_str;
|
||||
|
||||
}
|
||||
|
||||
include_once( 'ut_common.inc' );
|
||||
|
||||
// Run the test
|
||||
ut_run();
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: IntlDateFormatter::setTimeZoneId(): datefmt_set_timezone: no such time zone: 'CN' in %sut_common.inc on line %d
|
||||
|
||||
Warning: datefmt_set_timezone_id(): datefmt_set_timezone: no such time zone: 'CN' in %sut_common.inc on line %d
|
||||
|
||||
After creation of the dateformatter : timezone_id= US/Pacific
|
||||
-----------
|
||||
Trying to set timezone_id= America/New_York
|
||||
After call to set_timezone_id : timezone_id= America/New_York
|
||||
Formatting timestamp=0 resulted in Wednesday, December 31, 1969 at 7:00:00 PM Eastern Standard Time
|
||||
Formatting timestamp=3600 resulted in Wednesday, December 31, 1969 at 8:00:00 PM Eastern Standard Time
|
||||
-----------
|
||||
Trying to set timezone_id= America/Los_Angeles
|
||||
After call to set_timezone_id : timezone_id= America/Los_Angeles
|
||||
Formatting timestamp=0 resulted in Wednesday, December 31, 1969 at 4:00:00 PM Pacific Standard Time
|
||||
Formatting timestamp=3600 resulted in Wednesday, December 31, 1969 at 5:00:00 PM Pacific Standard Time
|
||||
-----------
|
||||
Trying to set timezone_id= America/Chicago
|
||||
After call to set_timezone_id : timezone_id= America/Chicago
|
||||
Formatting timestamp=0 resulted in Wednesday, December 31, 1969 at 6:00:00 PM Central Standard Time
|
||||
Formatting timestamp=3600 resulted in Wednesday, December 31, 1969 at 7:00:00 PM Central Standard Time
|
||||
-----------
|
||||
Trying to set timezone_id= CN
|
||||
After call to set_timezone_id : timezone_id= America/Chicago
|
||||
Formatting timestamp=0 resulted in Wednesday, December 31, 1969 at 6:00:00 PM Central Standard Time
|
||||
Formatting timestamp=3600 resulted in Wednesday, December 31, 1969 at 7:00:00 PM Central Standard Time
|
||||
@@ -2,8 +2,8 @@
|
||||
IntlDateFormatter: several forms of the timezone arg
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('intl'))
|
||||
die('skip intl extension not enabled');
|
||||
if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '51.2') >= 0) die('skip for ICU < 51.2'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
ini_set("intl.error_level", E_WARNING);
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
--TEST--
|
||||
IntlDateFormatter: several forms of the timezone arg
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '51.2') < 0) die('skip for ICU >= 51.2'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
ini_set("intl.error_level", E_WARNING);
|
||||
ini_set("date.timezone", 'Atlantic/Azores');
|
||||
|
||||
$ts = strtotime('2012-01-01 00:00:00 UTC');
|
||||
|
||||
//should use Atlantic/Azores
|
||||
$df = new IntlDateFormatter('es_ES', 0, 0, NULL);
|
||||
echo $df->format($ts), "\n";
|
||||
|
||||
$df = new IntlDateFormatter('es_ES', 0, 0, 'Europe/Amsterdam');
|
||||
echo $df->format($ts), "\n";
|
||||
|
||||
$df = new IntlDateFormatter('es_ES', 0, 0, new DateTimeZone('Europe/Lisbon'));
|
||||
echo $df->format($ts), "\n";
|
||||
|
||||
$df = new IntlDateFormatter('es_ES', 0, 0, IntlTimeZone::createTimeZone('America/New_York'));
|
||||
echo $df->format($ts), "\n";
|
||||
|
||||
//time zone has priority
|
||||
$df = new IntlDateFormatter('es_ES', 0, 0, 'Europe/Amsterdam', new IntlGregorianCalendar('Europe/Lisbon'));
|
||||
echo $df->format($ts), "\n";
|
||||
|
||||
//calendar has priority
|
||||
$df = new IntlDateFormatter('es_ES', 0, 0, NULL, new IntlGregorianCalendar('Europe/Lisbon'));
|
||||
echo $df->format($ts), "\n";
|
||||
|
||||
$df = new IntlDateFormatter('es_ES', 0, 0, 'Europe/Amsterdam', 0);
|
||||
echo $df->format($ts), "\n";
|
||||
|
||||
--EXPECTF--
|
||||
sábado%S, 31 de diciembre de 2011 23:00:00 Hora estándar de las Azores
|
||||
domingo%S, 1 de enero de 2012 01:00:00 Hora estándar de Europa central
|
||||
domingo%S, 1 de enero de 2012 00:00:00 Hora%S de Europa occidental
|
||||
sábado%S, 31 de diciembre de 2011 19:00:00 Hora estándar oriental
|
||||
domingo%S, 1 de enero de 2012 01:00:00 Hora estándar de Europa central
|
||||
domingo%S, 1 de enero de 2012 00:00:00 Hora%S de Europa occidental
|
||||
domingo%S, 1 de enero de 2012 01:00:00 Hora estándar de Europa central
|
||||
@@ -2,6 +2,7 @@
|
||||
numfmt_get_locale()
|
||||
--SKIPIF--
|
||||
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '51.2') >= 0) die('skip for ICU < 51.2'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
--TEST--
|
||||
numfmt_get_locale()
|
||||
--SKIPIF--
|
||||
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '51.2') < 0) die('skip for ICU >= 51.2'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Get locale.
|
||||
*/
|
||||
|
||||
function ut_main()
|
||||
{
|
||||
$locales = array(
|
||||
'en_UK',
|
||||
'en_US@California',
|
||||
'fr_CA',
|
||||
);
|
||||
|
||||
$loc_types = array(
|
||||
Locale::ACTUAL_LOCALE => 'actual',
|
||||
Locale::VALID_LOCALE => 'valid',
|
||||
);
|
||||
|
||||
$res_str = '';
|
||||
|
||||
foreach( $locales as $locale )
|
||||
{
|
||||
$fmt = ut_nfmt_create( $locale, NumberFormatter::DECIMAL );
|
||||
$res_str .= "$locale: ";
|
||||
foreach( $loc_types as $loc_type => $loc_type_name )
|
||||
$res_str .= sprintf( " %s=%s",
|
||||
$loc_type_name,
|
||||
dump( ut_nfmt_get_locale( $fmt, $loc_type ) ) );
|
||||
$res_str .= "\n";
|
||||
}
|
||||
|
||||
return $res_str;
|
||||
}
|
||||
|
||||
include_once( 'ut_common.inc' );
|
||||
|
||||
// Run the test
|
||||
ut_run();
|
||||
?>
|
||||
--EXPECT--
|
||||
en_UK: actual='en' valid='en'
|
||||
en_US@California: actual='en' valid='en'
|
||||
fr_CA: actual='fr' valid='fr_CA'
|
||||
@@ -1,8 +1,9 @@
|
||||
--TEST--
|
||||
locale_filter_matches.phpt() icu >= 4.8
|
||||
locale_filter_matches.phpt() icu >= 4.8 && icu < 51.2
|
||||
--SKIPIF--
|
||||
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
|
||||
<?php if(version_compare(INTL_ICU_VERSION, '4.8') < 0) print 'skip'; ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '51.2') >= 0) die('skip for ICU < 51.2'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
|
||||
@@ -0,0 +1,366 @@
|
||||
--TEST--
|
||||
locale_filter_matches.phpt() ICU >= 51.2
|
||||
--SKIPIF--
|
||||
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '51.2') < 0) die('skip for ICU >= 51.2'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Try parsing different Locales
|
||||
* with Procedural and Object methods.
|
||||
*/
|
||||
|
||||
function ut_main()
|
||||
{
|
||||
$loc_ranges = array(
|
||||
'de-de',
|
||||
'sl_IT',
|
||||
'sl_IT_Nedis',
|
||||
'jbo',
|
||||
'art-lojban',
|
||||
'sl_IT'
|
||||
);
|
||||
|
||||
$lang_tags = array(
|
||||
'de-DEVA',
|
||||
'de-DE-1996',
|
||||
'de-DE',
|
||||
'zh_Hans',
|
||||
'de-CH-1996',
|
||||
'sl_IT',
|
||||
'sl_IT_nedis-a-kirti-x-xyz',
|
||||
'sl_IT_rozaj',
|
||||
'sl_IT_NEDIS_ROJAZ_1901',
|
||||
'i-enochian',
|
||||
'sgn-CH-de',
|
||||
'art-lojban',
|
||||
'i-lux',
|
||||
'art-lojban',
|
||||
'jbo',
|
||||
'en_sl_IT'
|
||||
);
|
||||
|
||||
$res_str = '';
|
||||
$isCanonical = false;
|
||||
foreach($loc_ranges as $loc_range){
|
||||
foreach($lang_tags as $lang_tag){
|
||||
$res_str .="--------------\n";
|
||||
$result= ut_loc_locale_filter_matches( $lang_tag , $loc_range , $isCanonical);
|
||||
$res_str .= "loc_range:$loc_range matches lang_tag $lang_tag ? ";
|
||||
if( $result){
|
||||
$res_str .= "YES\n";
|
||||
}else{
|
||||
$res_str .= "NO\n";
|
||||
}
|
||||
//canonicalized version
|
||||
$result= ut_loc_locale_filter_matches( $lang_tag , $loc_range , !($isCanonical));
|
||||
$can_loc_range = ut_loc_canonicalize($loc_range);
|
||||
$can_lang_tag = ut_loc_canonicalize($lang_tag);
|
||||
$res_str .= "loc_range:$can_loc_range canonically matches lang_tag $can_lang_tag ? ";
|
||||
if( $result){
|
||||
$res_str .= "YES\n";
|
||||
}else{
|
||||
$res_str .= "NO\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$res_str .= "\n";
|
||||
return $res_str;
|
||||
|
||||
}
|
||||
|
||||
include_once( 'ut_common.inc' );
|
||||
ut_run();
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
--------------
|
||||
loc_range:de-de matches lang_tag de-DEVA ? NO
|
||||
loc_range:de_DE canonically matches lang_tag de_Deva ? NO
|
||||
--------------
|
||||
loc_range:de-de matches lang_tag de-DE-1996 ? YES
|
||||
loc_range:de_DE canonically matches lang_tag de_DE_1996 ? YES
|
||||
--------------
|
||||
loc_range:de-de matches lang_tag de-DE ? YES
|
||||
loc_range:de_DE canonically matches lang_tag de_DE ? YES
|
||||
--------------
|
||||
loc_range:de-de matches lang_tag zh_Hans ? NO
|
||||
loc_range:de_DE canonically matches lang_tag zh_Hans ? NO
|
||||
--------------
|
||||
loc_range:de-de matches lang_tag de-CH-1996 ? NO
|
||||
loc_range:de_DE canonically matches lang_tag de_CH_1996 ? NO
|
||||
--------------
|
||||
loc_range:de-de matches lang_tag sl_IT ? NO
|
||||
loc_range:de_DE canonically matches lang_tag sl_IT ? NO
|
||||
--------------
|
||||
loc_range:de-de matches lang_tag sl_IT_nedis-a-kirti-x-xyz ? NO
|
||||
loc_range:de_DE canonically matches lang_tag sl_IT_NEDIS_A_KIRTI_X_XYZ ? NO
|
||||
--------------
|
||||
loc_range:de-de matches lang_tag sl_IT_rozaj ? NO
|
||||
loc_range:de_DE canonically matches lang_tag sl_IT_ROZAJ ? NO
|
||||
--------------
|
||||
loc_range:de-de matches lang_tag sl_IT_NEDIS_ROJAZ_1901 ? NO
|
||||
loc_range:de_DE canonically matches lang_tag sl_IT_NEDIS_ROJAZ_1901 ? NO
|
||||
--------------
|
||||
loc_range:de-de matches lang_tag i-enochian ? NO
|
||||
loc_range:de_DE canonically matches lang_tag @x=i-enochian ? NO
|
||||
--------------
|
||||
loc_range:de-de matches lang_tag sgn-CH-de ? NO
|
||||
loc_range:de_DE canonically matches lang_tag sgn_CH_DE ? NO
|
||||
--------------
|
||||
loc_range:de-de matches lang_tag art-lojban ? NO
|
||||
loc_range:de_DE canonically matches lang_tag art__LOJBAN ? NO
|
||||
--------------
|
||||
loc_range:de-de matches lang_tag i-lux ? NO
|
||||
loc_range:de_DE canonically matches lang_tag lb ? NO
|
||||
--------------
|
||||
loc_range:de-de matches lang_tag art-lojban ? NO
|
||||
loc_range:de_DE canonically matches lang_tag art__LOJBAN ? NO
|
||||
--------------
|
||||
loc_range:de-de matches lang_tag jbo ? NO
|
||||
loc_range:de_DE canonically matches lang_tag jbo ? NO
|
||||
--------------
|
||||
loc_range:de-de matches lang_tag en_sl_IT ? NO
|
||||
loc_range:de_DE canonically matches lang_tag en_SL_IT ? NO
|
||||
--------------
|
||||
loc_range:sl_IT matches lang_tag de-DEVA ? NO
|
||||
loc_range:sl_IT canonically matches lang_tag de_Deva ? NO
|
||||
--------------
|
||||
loc_range:sl_IT matches lang_tag de-DE-1996 ? NO
|
||||
loc_range:sl_IT canonically matches lang_tag de_DE_1996 ? NO
|
||||
--------------
|
||||
loc_range:sl_IT matches lang_tag de-DE ? NO
|
||||
loc_range:sl_IT canonically matches lang_tag de_DE ? NO
|
||||
--------------
|
||||
loc_range:sl_IT matches lang_tag zh_Hans ? NO
|
||||
loc_range:sl_IT canonically matches lang_tag zh_Hans ? NO
|
||||
--------------
|
||||
loc_range:sl_IT matches lang_tag de-CH-1996 ? NO
|
||||
loc_range:sl_IT canonically matches lang_tag de_CH_1996 ? NO
|
||||
--------------
|
||||
loc_range:sl_IT matches lang_tag sl_IT ? YES
|
||||
loc_range:sl_IT canonically matches lang_tag sl_IT ? YES
|
||||
--------------
|
||||
loc_range:sl_IT matches lang_tag sl_IT_nedis-a-kirti-x-xyz ? YES
|
||||
loc_range:sl_IT canonically matches lang_tag sl_IT_NEDIS_A_KIRTI_X_XYZ ? YES
|
||||
--------------
|
||||
loc_range:sl_IT matches lang_tag sl_IT_rozaj ? YES
|
||||
loc_range:sl_IT canonically matches lang_tag sl_IT_ROZAJ ? YES
|
||||
--------------
|
||||
loc_range:sl_IT matches lang_tag sl_IT_NEDIS_ROJAZ_1901 ? YES
|
||||
loc_range:sl_IT canonically matches lang_tag sl_IT_NEDIS_ROJAZ_1901 ? YES
|
||||
--------------
|
||||
loc_range:sl_IT matches lang_tag i-enochian ? NO
|
||||
loc_range:sl_IT canonically matches lang_tag @x=i-enochian ? NO
|
||||
--------------
|
||||
loc_range:sl_IT matches lang_tag sgn-CH-de ? NO
|
||||
loc_range:sl_IT canonically matches lang_tag sgn_CH_DE ? NO
|
||||
--------------
|
||||
loc_range:sl_IT matches lang_tag art-lojban ? NO
|
||||
loc_range:sl_IT canonically matches lang_tag art__LOJBAN ? NO
|
||||
--------------
|
||||
loc_range:sl_IT matches lang_tag i-lux ? NO
|
||||
loc_range:sl_IT canonically matches lang_tag lb ? NO
|
||||
--------------
|
||||
loc_range:sl_IT matches lang_tag art-lojban ? NO
|
||||
loc_range:sl_IT canonically matches lang_tag art__LOJBAN ? NO
|
||||
--------------
|
||||
loc_range:sl_IT matches lang_tag jbo ? NO
|
||||
loc_range:sl_IT canonically matches lang_tag jbo ? NO
|
||||
--------------
|
||||
loc_range:sl_IT matches lang_tag en_sl_IT ? NO
|
||||
loc_range:sl_IT canonically matches lang_tag en_SL_IT ? NO
|
||||
--------------
|
||||
loc_range:sl_IT_Nedis matches lang_tag de-DEVA ? NO
|
||||
loc_range:sl_IT_NEDIS canonically matches lang_tag de_Deva ? NO
|
||||
--------------
|
||||
loc_range:sl_IT_Nedis matches lang_tag de-DE-1996 ? NO
|
||||
loc_range:sl_IT_NEDIS canonically matches lang_tag de_DE_1996 ? NO
|
||||
--------------
|
||||
loc_range:sl_IT_Nedis matches lang_tag de-DE ? NO
|
||||
loc_range:sl_IT_NEDIS canonically matches lang_tag de_DE ? NO
|
||||
--------------
|
||||
loc_range:sl_IT_Nedis matches lang_tag zh_Hans ? NO
|
||||
loc_range:sl_IT_NEDIS canonically matches lang_tag zh_Hans ? NO
|
||||
--------------
|
||||
loc_range:sl_IT_Nedis matches lang_tag de-CH-1996 ? NO
|
||||
loc_range:sl_IT_NEDIS canonically matches lang_tag de_CH_1996 ? NO
|
||||
--------------
|
||||
loc_range:sl_IT_Nedis matches lang_tag sl_IT ? NO
|
||||
loc_range:sl_IT_NEDIS canonically matches lang_tag sl_IT ? NO
|
||||
--------------
|
||||
loc_range:sl_IT_Nedis matches lang_tag sl_IT_nedis-a-kirti-x-xyz ? YES
|
||||
loc_range:sl_IT_NEDIS canonically matches lang_tag sl_IT_NEDIS_A_KIRTI_X_XYZ ? YES
|
||||
--------------
|
||||
loc_range:sl_IT_Nedis matches lang_tag sl_IT_rozaj ? NO
|
||||
loc_range:sl_IT_NEDIS canonically matches lang_tag sl_IT_ROZAJ ? NO
|
||||
--------------
|
||||
loc_range:sl_IT_Nedis matches lang_tag sl_IT_NEDIS_ROJAZ_1901 ? YES
|
||||
loc_range:sl_IT_NEDIS canonically matches lang_tag sl_IT_NEDIS_ROJAZ_1901 ? YES
|
||||
--------------
|
||||
loc_range:sl_IT_Nedis matches lang_tag i-enochian ? NO
|
||||
loc_range:sl_IT_NEDIS canonically matches lang_tag @x=i-enochian ? NO
|
||||
--------------
|
||||
loc_range:sl_IT_Nedis matches lang_tag sgn-CH-de ? NO
|
||||
loc_range:sl_IT_NEDIS canonically matches lang_tag sgn_CH_DE ? NO
|
||||
--------------
|
||||
loc_range:sl_IT_Nedis matches lang_tag art-lojban ? NO
|
||||
loc_range:sl_IT_NEDIS canonically matches lang_tag art__LOJBAN ? NO
|
||||
--------------
|
||||
loc_range:sl_IT_Nedis matches lang_tag i-lux ? NO
|
||||
loc_range:sl_IT_NEDIS canonically matches lang_tag lb ? NO
|
||||
--------------
|
||||
loc_range:sl_IT_Nedis matches lang_tag art-lojban ? NO
|
||||
loc_range:sl_IT_NEDIS canonically matches lang_tag art__LOJBAN ? NO
|
||||
--------------
|
||||
loc_range:sl_IT_Nedis matches lang_tag jbo ? NO
|
||||
loc_range:sl_IT_NEDIS canonically matches lang_tag jbo ? NO
|
||||
--------------
|
||||
loc_range:sl_IT_Nedis matches lang_tag en_sl_IT ? NO
|
||||
loc_range:sl_IT_NEDIS canonically matches lang_tag en_SL_IT ? NO
|
||||
--------------
|
||||
loc_range:jbo matches lang_tag de-DEVA ? NO
|
||||
loc_range:jbo canonically matches lang_tag de_Deva ? NO
|
||||
--------------
|
||||
loc_range:jbo matches lang_tag de-DE-1996 ? NO
|
||||
loc_range:jbo canonically matches lang_tag de_DE_1996 ? NO
|
||||
--------------
|
||||
loc_range:jbo matches lang_tag de-DE ? NO
|
||||
loc_range:jbo canonically matches lang_tag de_DE ? NO
|
||||
--------------
|
||||
loc_range:jbo matches lang_tag zh_Hans ? NO
|
||||
loc_range:jbo canonically matches lang_tag zh_Hans ? NO
|
||||
--------------
|
||||
loc_range:jbo matches lang_tag de-CH-1996 ? NO
|
||||
loc_range:jbo canonically matches lang_tag de_CH_1996 ? NO
|
||||
--------------
|
||||
loc_range:jbo matches lang_tag sl_IT ? NO
|
||||
loc_range:jbo canonically matches lang_tag sl_IT ? NO
|
||||
--------------
|
||||
loc_range:jbo matches lang_tag sl_IT_nedis-a-kirti-x-xyz ? NO
|
||||
loc_range:jbo canonically matches lang_tag sl_IT_NEDIS_A_KIRTI_X_XYZ ? NO
|
||||
--------------
|
||||
loc_range:jbo matches lang_tag sl_IT_rozaj ? NO
|
||||
loc_range:jbo canonically matches lang_tag sl_IT_ROZAJ ? NO
|
||||
--------------
|
||||
loc_range:jbo matches lang_tag sl_IT_NEDIS_ROJAZ_1901 ? NO
|
||||
loc_range:jbo canonically matches lang_tag sl_IT_NEDIS_ROJAZ_1901 ? NO
|
||||
--------------
|
||||
loc_range:jbo matches lang_tag i-enochian ? NO
|
||||
loc_range:jbo canonically matches lang_tag @x=i-enochian ? NO
|
||||
--------------
|
||||
loc_range:jbo matches lang_tag sgn-CH-de ? NO
|
||||
loc_range:jbo canonically matches lang_tag sgn_CH_DE ? NO
|
||||
--------------
|
||||
loc_range:jbo matches lang_tag art-lojban ? NO
|
||||
loc_range:jbo canonically matches lang_tag art__LOJBAN ? NO
|
||||
--------------
|
||||
loc_range:jbo matches lang_tag i-lux ? NO
|
||||
loc_range:jbo canonically matches lang_tag lb ? NO
|
||||
--------------
|
||||
loc_range:jbo matches lang_tag art-lojban ? NO
|
||||
loc_range:jbo canonically matches lang_tag art__LOJBAN ? NO
|
||||
--------------
|
||||
loc_range:jbo matches lang_tag jbo ? YES
|
||||
loc_range:jbo canonically matches lang_tag jbo ? YES
|
||||
--------------
|
||||
loc_range:jbo matches lang_tag en_sl_IT ? NO
|
||||
loc_range:jbo canonically matches lang_tag en_SL_IT ? NO
|
||||
--------------
|
||||
loc_range:art-lojban matches lang_tag de-DEVA ? NO
|
||||
loc_range:art__LOJBAN canonically matches lang_tag de_Deva ? NO
|
||||
--------------
|
||||
loc_range:art-lojban matches lang_tag de-DE-1996 ? NO
|
||||
loc_range:art__LOJBAN canonically matches lang_tag de_DE_1996 ? NO
|
||||
--------------
|
||||
loc_range:art-lojban matches lang_tag de-DE ? NO
|
||||
loc_range:art__LOJBAN canonically matches lang_tag de_DE ? NO
|
||||
--------------
|
||||
loc_range:art-lojban matches lang_tag zh_Hans ? NO
|
||||
loc_range:art__LOJBAN canonically matches lang_tag zh_Hans ? NO
|
||||
--------------
|
||||
loc_range:art-lojban matches lang_tag de-CH-1996 ? NO
|
||||
loc_range:art__LOJBAN canonically matches lang_tag de_CH_1996 ? NO
|
||||
--------------
|
||||
loc_range:art-lojban matches lang_tag sl_IT ? NO
|
||||
loc_range:art__LOJBAN canonically matches lang_tag sl_IT ? NO
|
||||
--------------
|
||||
loc_range:art-lojban matches lang_tag sl_IT_nedis-a-kirti-x-xyz ? NO
|
||||
loc_range:art__LOJBAN canonically matches lang_tag sl_IT_NEDIS_A_KIRTI_X_XYZ ? NO
|
||||
--------------
|
||||
loc_range:art-lojban matches lang_tag sl_IT_rozaj ? NO
|
||||
loc_range:art__LOJBAN canonically matches lang_tag sl_IT_ROZAJ ? NO
|
||||
--------------
|
||||
loc_range:art-lojban matches lang_tag sl_IT_NEDIS_ROJAZ_1901 ? NO
|
||||
loc_range:art__LOJBAN canonically matches lang_tag sl_IT_NEDIS_ROJAZ_1901 ? NO
|
||||
--------------
|
||||
loc_range:art-lojban matches lang_tag i-enochian ? NO
|
||||
loc_range:art__LOJBAN canonically matches lang_tag @x=i-enochian ? NO
|
||||
--------------
|
||||
loc_range:art-lojban matches lang_tag sgn-CH-de ? NO
|
||||
loc_range:art__LOJBAN canonically matches lang_tag sgn_CH_DE ? NO
|
||||
--------------
|
||||
loc_range:art-lojban matches lang_tag art-lojban ? YES
|
||||
loc_range:art__LOJBAN canonically matches lang_tag art__LOJBAN ? YES
|
||||
--------------
|
||||
loc_range:art-lojban matches lang_tag i-lux ? NO
|
||||
loc_range:art__LOJBAN canonically matches lang_tag lb ? NO
|
||||
--------------
|
||||
loc_range:art-lojban matches lang_tag art-lojban ? YES
|
||||
loc_range:art__LOJBAN canonically matches lang_tag art__LOJBAN ? YES
|
||||
--------------
|
||||
loc_range:art-lojban matches lang_tag jbo ? NO
|
||||
loc_range:art__LOJBAN canonically matches lang_tag jbo ? NO
|
||||
--------------
|
||||
loc_range:art-lojban matches lang_tag en_sl_IT ? NO
|
||||
loc_range:art__LOJBAN canonically matches lang_tag en_SL_IT ? NO
|
||||
--------------
|
||||
loc_range:sl_IT matches lang_tag de-DEVA ? NO
|
||||
loc_range:sl_IT canonically matches lang_tag de_Deva ? NO
|
||||
--------------
|
||||
loc_range:sl_IT matches lang_tag de-DE-1996 ? NO
|
||||
loc_range:sl_IT canonically matches lang_tag de_DE_1996 ? NO
|
||||
--------------
|
||||
loc_range:sl_IT matches lang_tag de-DE ? NO
|
||||
loc_range:sl_IT canonically matches lang_tag de_DE ? NO
|
||||
--------------
|
||||
loc_range:sl_IT matches lang_tag zh_Hans ? NO
|
||||
loc_range:sl_IT canonically matches lang_tag zh_Hans ? NO
|
||||
--------------
|
||||
loc_range:sl_IT matches lang_tag de-CH-1996 ? NO
|
||||
loc_range:sl_IT canonically matches lang_tag de_CH_1996 ? NO
|
||||
--------------
|
||||
loc_range:sl_IT matches lang_tag sl_IT ? YES
|
||||
loc_range:sl_IT canonically matches lang_tag sl_IT ? YES
|
||||
--------------
|
||||
loc_range:sl_IT matches lang_tag sl_IT_nedis-a-kirti-x-xyz ? YES
|
||||
loc_range:sl_IT canonically matches lang_tag sl_IT_NEDIS_A_KIRTI_X_XYZ ? YES
|
||||
--------------
|
||||
loc_range:sl_IT matches lang_tag sl_IT_rozaj ? YES
|
||||
loc_range:sl_IT canonically matches lang_tag sl_IT_ROZAJ ? YES
|
||||
--------------
|
||||
loc_range:sl_IT matches lang_tag sl_IT_NEDIS_ROJAZ_1901 ? YES
|
||||
loc_range:sl_IT canonically matches lang_tag sl_IT_NEDIS_ROJAZ_1901 ? YES
|
||||
--------------
|
||||
loc_range:sl_IT matches lang_tag i-enochian ? NO
|
||||
loc_range:sl_IT canonically matches lang_tag @x=i-enochian ? NO
|
||||
--------------
|
||||
loc_range:sl_IT matches lang_tag sgn-CH-de ? NO
|
||||
loc_range:sl_IT canonically matches lang_tag sgn_CH_DE ? NO
|
||||
--------------
|
||||
loc_range:sl_IT matches lang_tag art-lojban ? NO
|
||||
loc_range:sl_IT canonically matches lang_tag art__LOJBAN ? NO
|
||||
--------------
|
||||
loc_range:sl_IT matches lang_tag i-lux ? NO
|
||||
loc_range:sl_IT canonically matches lang_tag lb ? NO
|
||||
--------------
|
||||
loc_range:sl_IT matches lang_tag art-lojban ? NO
|
||||
loc_range:sl_IT canonically matches lang_tag art__LOJBAN ? NO
|
||||
--------------
|
||||
loc_range:sl_IT matches lang_tag jbo ? NO
|
||||
loc_range:sl_IT canonically matches lang_tag jbo ? NO
|
||||
--------------
|
||||
loc_range:sl_IT matches lang_tag en_sl_IT ? NO
|
||||
loc_range:sl_IT canonically matches lang_tag en_SL_IT ? NO
|
||||
@@ -1,8 +1,9 @@
|
||||
--TEST--
|
||||
locale_get_display_name() icu >= 4.8
|
||||
locale_get_display_name() icu >= 4.8 && icu < 51.2
|
||||
--SKIPIF--
|
||||
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
|
||||
<?php if(version_compare(INTL_ICU_VERSION, '4.8') < 0) print 'skip'; ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '51.2') >= 0) die('skip for ICU < 51.2'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
|
||||
@@ -0,0 +1,342 @@
|
||||
--TEST--
|
||||
locale_get_display_name() icu >= 51.2
|
||||
--SKIPIF--
|
||||
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '51.2') < 0) die('skip for ICU >= 51.2'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Try getting the display_name for different locales
|
||||
* with Procedural and Object methods.
|
||||
*/
|
||||
|
||||
function ut_main()
|
||||
{
|
||||
$res_str='';
|
||||
|
||||
$disp_locales=array('en','fr','de');
|
||||
|
||||
$locales = array(
|
||||
'sl_IT_nedis_KIRTI',
|
||||
'sl_IT_nedis-a-kirti-x-xyz',
|
||||
'sl_IT_rozaj',
|
||||
'sl_IT_NEDIS_ROJAZ_1901',
|
||||
'i-enochian',
|
||||
'zh-hakka',
|
||||
'zh-wuu',
|
||||
'i-tay',
|
||||
'sgn-BE-nl',
|
||||
'sgn-CH-de',
|
||||
'sl_IT_rozaj@currency=EUR',
|
||||
'uk-ua_CALIFORNIA@currency=;currency=GRN',
|
||||
'root',
|
||||
'uk@currency=EURO',
|
||||
'Hindi',
|
||||
//Simple language subtag
|
||||
'de',
|
||||
'fr',
|
||||
'ja',
|
||||
'i-enochian', //(example of a grandfathered tag)
|
||||
//Language subtag plus Script subtag:
|
||||
'zh-Hant',
|
||||
'zh-Hans',
|
||||
'sr-Cyrl',
|
||||
'sr-Latn',
|
||||
//Language-Script-Region
|
||||
'zh-Hans-CN',
|
||||
'sr-Latn-CS',
|
||||
//Language-Variant
|
||||
'sl-rozaj',
|
||||
'sl-nedis',
|
||||
//Language-Region-Variant
|
||||
'de-CH-1901',
|
||||
'sl-IT-nedis',
|
||||
//Language-Script-Region-Variant
|
||||
'sl-Latn-IT-nedis',
|
||||
//Language-Region:
|
||||
'de-DE',
|
||||
'en-US',
|
||||
'es-419',
|
||||
//Private use subtags:
|
||||
'de-CH-x-phonebk',
|
||||
'az-Arab-x-AZE-derbend',
|
||||
//Extended language subtags
|
||||
'zh-min',
|
||||
'zh-min-nan-Hant-CN',
|
||||
//Private use registry values
|
||||
'x-whatever',
|
||||
'qaa-Qaaa-QM-x-southern',
|
||||
'sr-Latn-QM',
|
||||
'sr-Qaaa-CS',
|
||||
/*Tags that use extensions (examples ONLY: extensions MUST be defined
|
||||
by revision or update to this document or by RFC): */
|
||||
'en-US-u-islamCal',
|
||||
'zh-CN-a-myExt-x-private',
|
||||
'en-a-myExt-b-another',
|
||||
//Some Invalid Tags:
|
||||
'de-419-DE',
|
||||
'a-DE',
|
||||
'ar-a-aaa-b-bbb-a-ccc'
|
||||
);
|
||||
|
||||
|
||||
$res_str = '';
|
||||
|
||||
foreach( $locales as $locale )
|
||||
{
|
||||
$res_str .= "locale='$locale'\n";
|
||||
foreach( $disp_locales as $disp_locale )
|
||||
{
|
||||
$scr = ut_loc_get_display_name( $locale ,$disp_locale );
|
||||
$scr = str_replace(array('(', ')'), '#', $scr);
|
||||
$res_str .= "disp_locale=$disp_locale : display_name=$scr";
|
||||
$res_str .= "\n";
|
||||
}
|
||||
$res_str .= "-----------------\n";
|
||||
}
|
||||
|
||||
return $res_str;
|
||||
|
||||
}
|
||||
|
||||
include_once( 'ut_common.inc' );
|
||||
ut_run();
|
||||
|
||||
?>
|
||||
--EXPECTREGEX--
|
||||
locale='sl_IT_nedis_KIRTI'
|
||||
disp_locale=en : display_name=Slovenian #Italy, NEDIS_KIRTI#
|
||||
disp_locale=fr : display_name=slovène #Italie, NEDIS_KIRTI#
|
||||
disp_locale=de : display_name=Slowenisch #Italien, NEDIS_KIRTI#
|
||||
-----------------
|
||||
locale='sl_IT_nedis-a-kirti-x-xyz'
|
||||
disp_locale=en : display_name=Slovenian #Italy, NEDIS_A_KIRTI_X_XYZ#
|
||||
disp_locale=fr : display_name=slovène #Italie, NEDIS_A_KIRTI_X_XYZ#
|
||||
disp_locale=de : display_name=Slowenisch #Italien, NEDIS_A_KIRTI_X_XYZ#
|
||||
-----------------
|
||||
locale='sl_IT_rozaj'
|
||||
disp_locale=en : display_name=Slovenian #Italy, Resian#
|
||||
disp_locale=fr : display_name=slovène #Italie, dialecte de Resia#
|
||||
disp_locale=de : display_name=Slowenisch #Italien, (ROZAJ|Resianisch)#
|
||||
-----------------
|
||||
locale='sl_IT_NEDIS_ROJAZ_1901'
|
||||
disp_locale=en : display_name=Slovenian #Italy, NEDIS_ROJAZ_1901#
|
||||
disp_locale=fr : display_name=slovène #Italie, NEDIS_ROJAZ_1901#
|
||||
disp_locale=de : display_name=Slowenisch #Italien, NEDIS_ROJAZ_1901#
|
||||
-----------------
|
||||
locale='i-enochian'
|
||||
disp_locale=en : display_name=i-enochian #Private-Use=i-enochian#
|
||||
disp_locale=fr : display_name=i-enochian #Usage privé=i-enochian#
|
||||
disp_locale=de : display_name=i-enochian #Privatnutzung=i-enochian#
|
||||
-----------------
|
||||
locale='zh-hakka'
|
||||
disp_locale=en : display_name=Chinese( #HAKKA#)?
|
||||
disp_locale=fr : display_name=chinois( #HAKKA#)?
|
||||
disp_locale=de : display_name=Chinesisch( #HAKKA#)?
|
||||
-----------------
|
||||
locale='zh-wuu'
|
||||
disp_locale=en : display_name=Chinese #WUU#
|
||||
disp_locale=fr : display_name=chinois #WUU#
|
||||
disp_locale=de : display_name=Chinesisch #WUU#
|
||||
-----------------
|
||||
locale='i-tay'
|
||||
disp_locale=en : display_name=i-tay
|
||||
disp_locale=fr : display_name=i-tay
|
||||
disp_locale=de : display_name=i-tay
|
||||
-----------------
|
||||
locale='sgn-BE-nl'
|
||||
disp_locale=en : display_name=Sign Languages? #Belgium, NL#
|
||||
disp_locale=fr : display_name=langues? des signes #Belgique, NL#
|
||||
disp_locale=de : display_name=Gebärdensprache #Belgien, NL#
|
||||
-----------------
|
||||
locale='sgn-CH-de'
|
||||
disp_locale=en : display_name=Sign Languages? #Switzerland, DE#
|
||||
disp_locale=fr : display_name=langues? des signes #Suisse, DE#
|
||||
disp_locale=de : display_name=Gebärdensprache #Schweiz, DE#
|
||||
-----------------
|
||||
locale='sl_IT_rozaj@currency=EUR'
|
||||
disp_locale=en : display_name=Slovenian #Italy, Resian, [Cc]urrency=Euro#
|
||||
disp_locale=fr : display_name=slovène #Italie, dialecte de Resia, [Dd]evise=euro#
|
||||
disp_locale=de : display_name=Slowenisch #Italien, (ROZAJ|Resianisch), Währung=Euro#
|
||||
-----------------
|
||||
locale='uk-ua_CALIFORNIA@currency=;currency=GRN'
|
||||
disp_locale=en : display_name=Ukrainian #Ukraine, CALIFORNIA, [Cc]urrency#
|
||||
disp_locale=fr : display_name=ukrainien #Ukraine, CALIFORNIA, [Dd]evise#
|
||||
disp_locale=de : display_name=Ukrainisch #Ukraine, CALIFORNIA, Währung#
|
||||
-----------------
|
||||
locale='root'
|
||||
disp_locale=en : display_name=Root
|
||||
disp_locale=fr : display_name=racine
|
||||
disp_locale=de : display_name=[Rr]oot
|
||||
-----------------
|
||||
locale='uk@currency=EURO'
|
||||
disp_locale=en : display_name=Ukrainian #[Cc]urrency=EURO#
|
||||
disp_locale=fr : display_name=ukrainien #[Dd]evise=EURO#
|
||||
disp_locale=de : display_name=Ukrainisch #Währung=EURO#
|
||||
-----------------
|
||||
locale='Hindi'
|
||||
disp_locale=en : display_name=hindi
|
||||
disp_locale=fr : display_name=hindi
|
||||
disp_locale=de : display_name=hindi
|
||||
-----------------
|
||||
locale='de'
|
||||
disp_locale=en : display_name=German
|
||||
disp_locale=fr : display_name=allemand
|
||||
disp_locale=de : display_name=Deutsch
|
||||
-----------------
|
||||
locale='fr'
|
||||
disp_locale=en : display_name=French
|
||||
disp_locale=fr : display_name=français
|
||||
disp_locale=de : display_name=Französisch
|
||||
-----------------
|
||||
locale='ja'
|
||||
disp_locale=en : display_name=Japanese
|
||||
disp_locale=fr : display_name=japonais
|
||||
disp_locale=de : display_name=Japanisch
|
||||
-----------------
|
||||
locale='i-enochian'
|
||||
disp_locale=en : display_name=i-enochian #Private-Use=i-enochian#
|
||||
disp_locale=fr : display_name=i-enochian #Usage privé=i-enochian#
|
||||
disp_locale=de : display_name=i-enochian #Privatnutzung=i-enochian#
|
||||
-----------------
|
||||
locale='zh-Hant'
|
||||
disp_locale=en : display_name=Chinese #Traditional#
|
||||
disp_locale=fr : display_name=chinois #traditionnel#
|
||||
disp_locale=de : display_name=Chinesisch #Traditionell#
|
||||
-----------------
|
||||
locale='zh-Hans'
|
||||
disp_locale=en : display_name=Chinese #Simplified#
|
||||
disp_locale=fr : display_name=chinois #simplifié#
|
||||
disp_locale=de : display_name=Chinesisch #Vereinfacht#
|
||||
-----------------
|
||||
locale='sr-Cyrl'
|
||||
disp_locale=en : display_name=Serbian #Cyrillic#
|
||||
disp_locale=fr : display_name=serbe #cyrillique#
|
||||
disp_locale=de : display_name=Serbisch #Kyrillisch#
|
||||
-----------------
|
||||
locale='sr-Latn'
|
||||
disp_locale=en : display_name=Serbian #Latin#
|
||||
disp_locale=fr : display_name=serbe #latin#
|
||||
disp_locale=de : display_name=Serbisch #Lateinisch#
|
||||
-----------------
|
||||
locale='zh-Hans-CN'
|
||||
disp_locale=en : display_name=Chinese #Simplified, China#
|
||||
disp_locale=fr : display_name=chinois #simplifié, Chine#
|
||||
disp_locale=de : display_name=Chinesisch #Vereinfacht, China#
|
||||
-----------------
|
||||
locale='sr-Latn-CS'
|
||||
disp_locale=en : display_name=Serbian #Latin, Serbia#
|
||||
disp_locale=fr : display_name=serbe #latin, Serbie#
|
||||
disp_locale=de : display_name=Serbisch #Lateinisch, Serbien#
|
||||
-----------------
|
||||
locale='sl-rozaj'
|
||||
disp_locale=en : display_name=Slovenian #Resian#
|
||||
disp_locale=fr : display_name=slovène #dialecte de Resia#
|
||||
disp_locale=de : display_name=Slowenisch( #(ROZAJ|Resianisch)#)?
|
||||
-----------------
|
||||
locale='sl-nedis'
|
||||
disp_locale=en : display_name=Slovenian #Natisone dialect#
|
||||
disp_locale=fr : display_name=slovène #dialecte de Natisone#
|
||||
disp_locale=de : display_name=Slowenisch #Natisone-Dialekt#
|
||||
-----------------
|
||||
locale='de-CH-1901'
|
||||
disp_locale=en : display_name=German #Switzerland, Traditional German orthography#
|
||||
disp_locale=fr : display_name=allemand #Suisse, orthographe allemande traditionnelle#
|
||||
disp_locale=de : display_name=Deutsch #Schweiz, (1901|[aA]lte deutsche Rechtschreibung)#
|
||||
-----------------
|
||||
locale='sl-IT-nedis'
|
||||
disp_locale=en : display_name=Slovenian #Italy, Natisone dialect#
|
||||
disp_locale=fr : display_name=slovène #Italie, dialecte de Natisone#
|
||||
disp_locale=de : display_name=Slowenisch #Italien, (NEDIS|Natisone-Dialekt)#
|
||||
-----------------
|
||||
locale='sl-Latn-IT-nedis'
|
||||
disp_locale=en : display_name=Slovenian #Latin, Italy, Natisone dialect#
|
||||
disp_locale=fr : display_name=slovène #latin, Italie, dialecte de Natisone#
|
||||
disp_locale=de : display_name=Slowenisch #Lateinisch, Italien, (NEDIS|Natisone-Dialekt)#
|
||||
-----------------
|
||||
locale='de-DE'
|
||||
disp_locale=en : display_name=German #Germany#
|
||||
disp_locale=fr : display_name=allemand #Allemagne#
|
||||
disp_locale=de : display_name=Deutsch #Deutschland#
|
||||
-----------------
|
||||
locale='en-US'
|
||||
disp_locale=en : display_name=English #United States#
|
||||
disp_locale=fr : display_name=anglais #États-Unis#
|
||||
disp_locale=de : display_name=Englisch #Vereinigte Staaten#
|
||||
-----------------
|
||||
locale='es-419'
|
||||
disp_locale=en : display_name=Spanish #Latin America#
|
||||
disp_locale=fr : display_name=espagnol #Amérique latine#
|
||||
disp_locale=de : display_name=Spanisch #Lateinamerika#
|
||||
-----------------
|
||||
locale='de-CH-x-phonebk'
|
||||
disp_locale=en : display_name=German #Switzerland, Private-Use=phonebk#
|
||||
disp_locale=fr : display_name=allemand #Suisse, Usage privé=phonebk#
|
||||
disp_locale=de : display_name=Deutsch #Schweiz, Privatnutzung=phonebk#
|
||||
-----------------
|
||||
locale='az-Arab-x-AZE-derbend'
|
||||
disp_locale=en : display_name=Azerbaijani #Arabic, Private-Use=aze-derbend#
|
||||
disp_locale=fr : display_name=azéri #arabe, Usage privé=aze-derbend#
|
||||
disp_locale=de : display_name=Aserbaidschanisch #Arabisch, Privatnutzung=aze-derbend#
|
||||
-----------------
|
||||
locale='zh-min'
|
||||
disp_locale=en : display_name=Chinese #MIN#
|
||||
disp_locale=fr : display_name=chinois #MIN#
|
||||
disp_locale=de : display_name=Chinesisch #MIN#
|
||||
-----------------
|
||||
locale='zh-min-nan-Hant-CN'
|
||||
disp_locale=en : display_name=Chinese #MIN, NAN_HANT_CN#
|
||||
disp_locale=fr : display_name=chinois #MIN, NAN_HANT_CN#
|
||||
disp_locale=de : display_name=Chinesisch #MIN, NAN_HANT_CN#
|
||||
-----------------
|
||||
locale='x-whatever'
|
||||
disp_locale=en : display_name=x-whatever #Private-Use=whatever#
|
||||
disp_locale=fr : display_name=x-whatever #Usage privé=whatever#
|
||||
disp_locale=de : display_name=x-whatever #Privatnutzung=whatever#
|
||||
-----------------
|
||||
locale='qaa-Qaaa-QM-x-southern'
|
||||
disp_locale=en : display_name=qaa #Qaaa, QM, Private-Use=southern#
|
||||
disp_locale=fr : display_name=qaa #Qaaa, QM, Usage privé=southern#
|
||||
disp_locale=de : display_name=qaa #Qaaa, QM, Privatnutzung=southern#
|
||||
-----------------
|
||||
locale='sr-Latn-QM'
|
||||
disp_locale=en : display_name=Serbian #Latin, QM#
|
||||
disp_locale=fr : display_name=serbe #latin, QM#
|
||||
disp_locale=de : display_name=Serbisch #Lateinisch, QM#
|
||||
-----------------
|
||||
locale='sr-Qaaa-CS'
|
||||
disp_locale=en : display_name=Serbian #Qaaa, Serbia#
|
||||
disp_locale=fr : display_name=serbe #Qaaa, Serbie#
|
||||
disp_locale=de : display_name=Serbisch #Qaaa, Serbien#
|
||||
-----------------
|
||||
locale='en-US-u-islamCal'
|
||||
disp_locale=en : display_name=English #United States, attribute=islamcal#
|
||||
disp_locale=fr : display_name=anglais #États-Unis, attribute=islamcal#
|
||||
disp_locale=de : display_name=Englisch #Vereinigte Staaten, attribute=islamcal#
|
||||
-----------------
|
||||
locale='zh-CN-a-myExt-x-private'
|
||||
disp_locale=en : display_name=Chinese #China, a=myext, Private-Use=private#
|
||||
disp_locale=fr : display_name=chinois #Chine, a=myext, Usage privé=private#
|
||||
disp_locale=de : display_name=Chinesisch #China, a=myext, Privatnutzung=private#
|
||||
-----------------
|
||||
locale='en-a-myExt-b-another'
|
||||
disp_locale=en : display_name=English #a=myext, b=another#
|
||||
disp_locale=fr : display_name=anglais #a=myext, b=another#
|
||||
disp_locale=de : display_name=Englisch #a=myext, b=another#
|
||||
-----------------
|
||||
locale='de-419-DE'
|
||||
disp_locale=en : display_name=German #Latin America, DE#
|
||||
disp_locale=fr : display_name=allemand #Amérique latine, DE#
|
||||
disp_locale=de : display_name=Deutsch #Lateinamerika, DE#
|
||||
-----------------
|
||||
locale='a-DE'
|
||||
disp_locale=en : display_name=a #Germany#
|
||||
disp_locale=fr : display_name=a #Allemagne#
|
||||
disp_locale=de : display_name=a #Deutschland#
|
||||
-----------------
|
||||
locale='ar-a-aaa-b-bbb-a-ccc'
|
||||
disp_locale=en : display_name=Arabic #a=aaa, b=bbb#
|
||||
disp_locale=fr : display_name=arabe #a=aaa, b=bbb#
|
||||
disp_locale=de : display_name=Arabisch #a=aaa, b=bbb#
|
||||
-----------------
|
||||
@@ -1,8 +1,9 @@
|
||||
--TEST--
|
||||
locale_get_display_region() icu >= 4.8
|
||||
locale_get_display_region() icu >= 4.8 && icu < 51.2
|
||||
--SKIPIF--
|
||||
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
|
||||
<?php if(version_compare(INTL_ICU_VERSION, '4.8') < 0) print 'skip'; ?>
|
||||
<?php if (version_compare(INTL_ICU_VERSION, '51.2') >= 0) die('skip for ICU < 51.2'); ?>
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
|
||||
Loaded 100 of 292 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user