From:             
Operating system: Linux
PHP version:      5.3.8
Package:          I18N and L10N related
Bug Type:         Bug
Bug description:resourcebundle shoud throw error if it desn't recognize the file

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 bug report at https://bugs.php.net/bug.php?id=55873&edit=1
-- 
Try a snapshot (PHP 5.4):            
https://bugs.php.net/fix.php?id=55873&r=trysnapshot54
Try a snapshot (PHP 5.3):            
https://bugs.php.net/fix.php?id=55873&r=trysnapshot53
Try a snapshot (trunk):              
https://bugs.php.net/fix.php?id=55873&r=trysnapshottrunk
Fixed in SVN:                        
https://bugs.php.net/fix.php?id=55873&r=fixed
Fixed in SVN and need be documented: 
https://bugs.php.net/fix.php?id=55873&r=needdocs
Fixed in release:                    
https://bugs.php.net/fix.php?id=55873&r=alreadyfixed
Need backtrace:                      
https://bugs.php.net/fix.php?id=55873&r=needtrace
Need Reproduce Script:               
https://bugs.php.net/fix.php?id=55873&r=needscript
Try newer version:                   
https://bugs.php.net/fix.php?id=55873&r=oldversion
Not developer issue:                 
https://bugs.php.net/fix.php?id=55873&r=support
Expected behavior:                   
https://bugs.php.net/fix.php?id=55873&r=notwrong
Not enough info:                     
https://bugs.php.net/fix.php?id=55873&r=notenoughinfo
Submitted twice:                     
https://bugs.php.net/fix.php?id=55873&r=submittedtwice
register_globals:                    
https://bugs.php.net/fix.php?id=55873&r=globals
PHP 4 support discontinued:          
https://bugs.php.net/fix.php?id=55873&r=php4
Daylight Savings:                    https://bugs.php.net/fix.php?id=55873&r=dst
IIS Stability:                       
https://bugs.php.net/fix.php?id=55873&r=isapi
Install GNU Sed:                     
https://bugs.php.net/fix.php?id=55873&r=gnused
Floating point limitations:          
https://bugs.php.net/fix.php?id=55873&r=float
No Zend Extensions:                  
https://bugs.php.net/fix.php?id=55873&r=nozend
MySQL Configuration Error:           
https://bugs.php.net/fix.php?id=55873&r=mysqlcfg

Reply via email to