php.net |  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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: bdesef at yahoo dot de
New email:
PHP Version: OS:

 

 [2014-08-26 16:50 UTC] bdesef at yahoo dot de
Description:
------------
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:
---------------
<?php
   class rb extends ResourceBundle {
      public function __destruct() {
         echo 'I will never come up.';
      }
   }
   $rb = new rb('en_US', 'path/to/res/files', true);
?>


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-12-28 11:30 UTC] nikic@php.net
The fact that __destruct() was not called is an unrelated issue, fixed in https://github.com/php/php-src/commit/3538cbe6c03172c069862f3fdd345c990a734d7a.
 [2021-06-14 16:59 UTC] cmb@php.net
-Assigned To: +Assigned To: cmb
 [2021-06-15 13:59 UTC] cmb@php.net
-Status: Assigned +Status: Feedback
 [2021-06-15 13:59 UTC] cmb@php.net
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-2024 The PHP Group
All rights reserved.
Last updated: Thu Oct 10 23:01:26 2024 UTC