Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.10.15

Bug #6445 PEAR::registerShutdownFunc doesn't work in static calls
Submitted: 2006-01-08 21:14 UTC
From: soporte at onfocus dot cl Assigned: cellog
Status: Closed Package: PEAR
PHP Version: Irrelevant OS: Irrelevant
Roadmaps: (Not assigned)    
Subscription  


 [2006-01-08 21:14 UTC] soporte at onfocus dot cl
Description: ------------ System::mktemp calls PEAR::registerShutdownFunc but that method fails if used statically. This is not specific to System package, but all who use PEAR::registerShutdownFunc . Test script: --------------- <?php require_once 'System.php'; $path = System::mktemp('deleteme'); ?> ===================== patch in PEAR.php#248 ===================== function registerShutdownFunc($func, $args = array()) { if (!isset($GLOBALS['_PEAR_SHUTDOWN_REGISTERED'])) { register_shutdown_function("_PEAR_call_destructors"); $GLOBALS['_PEAR_SHUTDOWN_REGISTERED'] = true; } $GLOBALS['_PEAR_shutdown_funcs'][] = array($func, $args); } Expected result: ---------------- file deleted after script execution. Actual result: -------------- file never deleted.

Comments

 [2006-01-23 05:38 UTC] cellog
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better. Nice catch! Thanks