|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-02-15 22:56 UTC] johannes@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 06 17:00:01 2025 UTC |
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.