Edit report at https://bugs.php.net/bug.php?id=62000&edit=1

 ID:                 62000
 Comment by:         sicommnend at gmail dot com
 Reported by:        sicommnend at gmail dot com
 Summary:            sqlite3 db in ob_start callback fails
 Status:             Open
 Type:               Bug
 Package:            SQLite related
 Operating System:   Linux
 PHP Version:        5.3.6
 Block user comment: N
 Private report:     N

 New Comment:

SQLite Library  3.7.4
SQLite Library  2.8.17

SQLite versions, just tested on SQLite 2 and same problem.

I notice in SQLite 2 if I use the procedural programming method the output is 
returned of the output buffer but no database activity.

However if I use the OOP method I get no output, no error, or no database 
activity.

In either method though, the SQLite database is still unreachable.


Previous Comments:
------------------------------------------------------------------------
[2012-05-12 03:03:41] sicommnend at gmail dot com

Edited version to be more exact.

------------------------------------------------------------------------
[2012-05-12 02:58:40] sicommnend at gmail dot com

Wrong PHP version meant 5.3

------------------------------------------------------------------------
[2012-05-10 21:45:08] sicommnend at gmail dot com

The test script I posted above will suceed, this is the one that will fail. Got 
my testing scripts mixed up there.

<?php
ob_start('callbackfunc');
echo 'test test test test test test test test test ';
function callbackfunc($buffer) {
        $DB = new SQLite3('db');
        $DB->exec('CREATE TABLE test (one int, two text);');
        $DB->exec('INSERT INTO test VALUES (10, \'some text\')');
        return $buffer;
}
?>

------------------------------------------------------------------------
[2012-05-10 21:43:12] sicommnend at gmail dot com

Description:
------------
If you connect to a SQLite3 database in the ob_start callback function then the 
script exits without any output and the database doesn't get written to.

In the test script if you move the SQLite3 database code out of the callback 
function the script works, however it fails if there is any connection to a 
SQLite3 database withing the callback function.

Test script:
---------------
<?php
ob_start('callbackfunc');
echo 'test test test test test test test test test ';
function callbackfunc($buffer) {

        return $buffer;
}

        $DB = new SQLite3('db');
        $DB->exec('CREATE TABLE test (one int, two text);');
        $DB->exec('INSERT INTO test VALUES (10, \'some text\')');
?>

Expected result:
----------------
The database gets written to and the output gets sent.

Actual result:
--------------
Script exits with no output and database is not created.


------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=62000&edit=1

Reply via email to