Bug #55873 [Com]: resourcebundle shoud throw error if it desn't recognize the file
| From: | jinmoku at hotmail dot com | Date: | Tue, 21 Feb 2012 10:14:43 +0000 |
| Subject: | Bug #55873 [Com]: resourcebundle shoud throw error if it desn't recognize the file | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-167692@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=55873&edit=1
ID: 55873
Comment by: jinmoku at hotmail dot com
Reported by: miha dot vrhovnik at domenca dot com
Summary: resourcebundle shoud throw error if it desn't
recognize the file
Status: Open
Type: Bug
Package: I18N and L10N related
Operating System: Linux
PHP Version: 5.3.8
Block user comment: N
Private report: N
New Comment:
use the ini directive : intl.error_level
Previous Comments:
------------------------------------------------------------------------
[2011-10-08 15:45:23] miha dot vrhovnik at domenca dot com
Description:
------------
ICU 4.4 upgraded it's resource file format. If you are using older version of ICU e.g 4.2 and
try to load a newer version of resource file function returns null but there is no way of developer
knowing what the hell happened. Getting some sort of error message would be most welcome otherwise
you just get a WTF moment.
Test script:
---------------
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
$resourceDir = __DIR__;
//2 files needed ar it seems ther Resoucebundle won't reload? the same file or something like
that another bug?
$resFile_v1 = $resourceDir . '/en1.res';
$resFile_v2 = $resourceDir . '/en2.res';
$fileData_v1 =
base64_decode('IADaJxQAAAAAAAIAUmVzQgECAAABBAAAAAAAAAAAAAALAAAgBgAAAAgAAAANAAAADQAAAAEAAAAA
AAAAZm9vAAMAAABiAGEAcgAAAAEAHAAIAAAA');
$fileData_v2 =
base64_decode('IADaJxQAAAAAAAIAUmVzQgIAAAABBAAAAAAAAAAAAAAFAABQBwAAAAkAAAANAAAADQAAAAEAAAAA
AAAADQAAAGZvbwAAAGIAYQByAAAAAQAgAAEA
');
file_put_contents($resFile_v1, $fileData_v1);
$rb = new ResourceBundle('en1', $resourceDir);
var_dump($rb);
/output object(ResourceBundle)#1 (0) {
}
*/
file_put_contents($resFile_v2, $fileData_v2);
$rb = new ResourceBundle('en2', $resourceDir);
var_dump($rb);
/output object(ResourceBundle)#1 (0) {
}
*/
//no error no warning nothing
unlink($resFile_v1);
unlink($resFile_v2);
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=55873&edit=1