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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: t dot oelgarte at asysgmbh dot de
New email:
PHP Version: OS:

 

 [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

Add a Patch

Pull Requests

Add a Pull Request

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 Apr 20 04:01:28 2024 UTC