#51052 [NEW]: mysql vs mysqli within output buffer handler

From: Date: Mon, 15 Feb 2010 22:24:27 +0000
Subject: #51052 [NEW]: mysql vs mysqli within output buffer handler
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-147668@lists.php.net to get a copy of this message
From: trobinson at gksystems dot com Operating system: PHP version: 5.3.1 PHP Bug Type: Feature/Change Request Bug description: mysql vs mysqli within output buffer handler Description: ------------ I have a templating system which replaces placeholders with MySQL-derived content, using an output buffer handler. Any html file can be used as a template, by placing one line at the top of the file: <?php include('mysetup.php'); ?> The beauty of output control EOF handling is that there is no need to add any PHP code at the *end* of the html file. mysetup.php connects to a MySQL database, does some db work, then calls ob_start('myhandler'); As of PHP 5.1.x, all objects are destroyed before calling myhandler. If I used mysqli_connect within mysetup, my db connection has been closed, so I need to reconnect in myhandler. However, if I used mysql_connect then my db connection is still valid within myhandler. I discovered this when upgrading my code to use mysqli. I'm switching back to mysql, to avoid the overhead of connecting to the database twice. It seems to me that it is a bit heavy-handed to destroy all objects before calling an output handler. It would be more reasonable to destroy just those objects created after registering the output handler. MY FEATURE REQUEST: Please don't *break* the current behaviour of the mysql extension in a future version of PHP. -- Edit bug report at http://bugs.php.net/?id=51052&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=51052&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=51052&r=trysnapshot53 Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=51052&r=trysnapshot60 Fixed in SVN: http://bugs.php.net/fix.php?id=51052&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=51052&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=51052&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=51052&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=51052&r=needscript Try newer version: http://bugs.php.net/fix.php?id=51052&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=51052&r=support Expected behavior: http://bugs.php.net/fix.php?id=51052&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=51052&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=51052&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=51052&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=51052&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=51052&r=dst IIS Stability: http://bugs.php.net/fix.php?id=51052&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=51052&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=51052&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=51052&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=51052&r=mysqlcfg

« previous php.bugs (#147668) next »