php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #75455 Unable to extend SQLite3 class: out of sequence error
Submitted: 2017-10-29 21:10 UTC Modified: 2017-10-29 21:21 UTC
From: t dot oelgarte at asysgmbh dot de Assigned:
Status: Closed Package: SQLite related
PHP Version: 7.1.11 OS: Ubuntu 14.04
Private report: No CVE-ID: None
 [2017-10-29 21:10 UTC] t dot oelgarte at asysgmbh dot de
Description:
------------
If i extend the SQLite3 class and overwrite it's constructor, then the call to the parent constructor (the constructor of SQLite3) will throw an Exception with the following error message: "Unable to open database: library routine called out of sequence".

Test script:
---------------
class MySqlite extends \SQLite3 {

  function __construct(string $filename, int $flags = null, string $encryption_key) {
    parent::__construct($filename, $flags, $encryption_key);
    $this->enableExceptions(true);
    $this->busyTimeout(60000);
  }

}

$con = new MySqlite('file.sqlite3');


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-10-29 21:21 UTC] t dot oelgarte at asysgmbh dot de
-Status: Open +Status: Closed
 [2017-10-29 21:21 UTC] t dot oelgarte at asysgmbh dot de
My bad. The constructor does not accept null as the second argument. Somehow my IDE made the assumption that null was an acceptable default value for the flags. Guess that isn't the case.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 13:01:31 2024 UTC