|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #67911 ResourceBundle is always permanent
Submitted: 2014-08-26 16:50 UTC Modified: 2021-06-27 04:22 UTC
From: bdesef at yahoo dot de Assigned: cmb (profile)
Status: No Feedback Package: intl (PECL)
PHP Version: 5.5.16 OS: Windows
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
Solve the problem:
26 - 21 = ?
Subscribe to this entry?

 [2014-08-26 16:50 UTC] bdesef at yahoo dot de
It seems that ResourceBundles will never get destroyed. This is favorable for performance reasons, as the resource files do not need to be reloaded at each request.
However, when developing a page it is very annoying. The lock handle that ResourceBundle puts on the resource file (on Windows) requires you to restart your webserver whenever you want to rebuild your language files.
It would be nice to have a forth parameter $persistent in the constructor of ResourceBundle which can trigger this behavior.

Bug #53969 says this was just the way ICU worked; however, a function ures_close is given by ICU. uresbund.cpp says in entryCloseInt:
  Entries are left in the cache. TODO: add ures_flushCache() to force a flush of the cache.
If this makes it impossible to provide disabled persistency, this bug should be left open until the TODO is done within ICU.

Test script:
   class rb extends ResourceBundle {
      public function __destruct() {
         echo 'I will never come up.';
   $rb = new rb('en_US', 'path/to/res/files', true);


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2017-12-28 11:30 UTC]
The fact that __destruct() was not called is an unrelated issue, fixed in
 [2021-06-14 16:59 UTC]
-Assigned To: +Assigned To: cmb
 [2021-06-15 13:59 UTC]
-Status: Assigned +Status: Feedback
 [2021-06-15 13:59 UTC]
When the object is destroyed, we already call ures_close(), but
still the resource file is locked.  So that persistent behavior is
not intended by PHP, and it seems to me that is an upstream issue.
 [2021-06-27 04:22 UTC] pecl-dev at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sat Dec 02 21:01:27 2023 UTC