php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #53995 resourcebundle_locales wait a string
Submitted: 2011-02-11 14:55 UTC Modified: 2012-01-07 18:23 UTC
Votes:2
Avg. Score:4.0 ± 1.0
Reproduced:2 of 2 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: jinmoku at hotmail dot com Assigned: frozenfire (profile)
Status: Closed Package: I18N and L10N related
PHP Version: 5.3.5 OS:
Private report: No CVE-ID: None
 [2011-02-11 14:55 UTC] jinmoku at hotmail dot com
Description:
------------
doc : http://fr.php.net/manual/en/resourcebundle.locales.php

Object oriented style
array ResourceBundle::getLocales ( void )

Procedural style
array resourcebundle_locales ( ResourceBundle $r )



-- CORRECT TEST SCRIPT --
<?php
$bundle = realpath('./ressource');

$r = resourcebundle_locales($bundle);
echo join("\n", $r);

$r = ResourceBundle::getLocales($bundle);
echo join("\n", $r);

Test script:
---------------
<?php
$bundle = realpath('./ressource');

$r = resourcebundle_create( 'es', $bundle);
echo join("\n", resourcebundle_locales($r));

$r = new ResourceBundle( 'es', $bundle);
echo join("\n", $r->getLocales());

Expected result:
----------------
es
rootes
root

Actual result:
--------------
<?php
$bundle = realpath('./ressource');

$r = resourcebundle_create( 'es', $bundle);
echo join("\n", resourcebundle_locales($r));

$r = new ResourceBundle( 'es', $bundle);
echo join("\n", $r->getLocales());

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-02-11 14:57 UTC] jinmoku at hotmail dot com
sorry

Actual result:
--------------
Warning: resourcebundle_locales() expects parameter 1 to be string, object given in C:\www\test\index.php on line 6

Warning: resourcebundle_locales(): resourcebundle_locales: unable to parse input params in C:\www\test\index.php on line 6

Warning: join(): Invalid arguments passed in C:\www\test\index.php on line 6

Warning: ResourceBundle::getLocales() expects exactly 1 parameter, 0 given in C:\www\test\index.php on line 9

Warning: ResourceBundle::getLocales(): resourcebundle_locales: unable to parse input params in C:\www\test\index.php on line 9

Warning: join(): Invalid arguments passed in C:\www\test\index.php on line 9
 [2011-06-13 19:06 UTC] franssen dot roland at gmail dot com
The argument must be the bundle name (e.g. "/usr/data/resources").

I agree the docs are unclear on this.
 [2011-12-05 21:35 UTC] frozenfire@php.net
Automatic comment from SVN on behalf of frozenfire
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=320463
Log: Fixed and clarified both the procedural and OOP variants, and updated examples. Addresses bug #53995.
 [2011-12-05 21:36 UTC] frozenfire@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: frozenfire
 [2011-12-05 21:36 UTC] frozenfire@php.net
I've fixed and clarified the documentation. Can you please confirm that I've done 
so correctly? I'm not familiar with the extension, but the sources for it are 
somewhat clear.
 [2012-01-07 18:23 UTC] frozenfire@php.net
-Status: Feedback +Status: Closed
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Mon Sep 20 14:03:38 2021 UTC