php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #55873 resourcebundle shoud throw error if it desn't recognize the file
Submitted: 2011-10-08 15:45 UTC Modified: 2012-05-24 12:38 UTC
From: miha dot vrhovnik at domenca dot com Assigned:
Status: Not a bug Package: I18N and L10N related
PHP Version: 5.3.8 OS: Linux
Private report: No CVE-ID: None
 [2011-10-08 15:45 UTC] 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);


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-02-21 10:14 UTC] jinmoku at hotmail dot com
use the ini directive : intl.error_level
 [2012-05-24 12:38 UTC] cataphract@php.net
-Status: Open +Status: Not a bug
 [2012-05-24 12:38 UTC] cataphract@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.


 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Sat Aug 08 21:01:26 2020 UTC