note 66186 deleted from function.ob-end-clean by bjori
| From: | bjori@php.net | Date: | Tue, 16 May 2006 21:52:33 +0000 |
| Subject: | note 66186 deleted from function.ob-end-clean by bjori | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-111413@lists.php.net to get a copy of this message | ||
Note Submitter: ganderson at gpsinsight dot com
Reason: useless
----
I am using output buffers to throw an exception during a database connect. Since the sybase_pconnect
function does not throw an exception:
// use output buffers to catch warnings on database connect
ob_start()
$this->dbh = sybase_pconnect($this->db_server,$this->db_user,$this->db_password);
if (ob_get_length()>0 || $this->dbh===false) {
throw new Database_LoginException("Could not login");
}
ob_end_clean();
After trying to connect, it tests to see if the output buffer was written to (a warning) then cleans
that and throws an exception.