|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2011-07-07 11:40 UTC] scottmac@php.net
-Status: Open
+Status: Wont fix
[2011-07-07 11:40 UTC] scottmac@php.net
[2011-07-07 11:43 UTC] ivan dot enderlin at hoa-project dot net
-Status: Wont fix
+Status: Closed
[2011-07-07 11:43 UTC] ivan dot enderlin at hoa-project dot net
[2014-07-31 18:31 UTC] sun at unleashedmind dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Nov 18 22:00:01 2025 UTC |
Description: ------------ It seems like SQLite does not considere stream wrappers to access to database file (with \SQLite3 class or PDO driver). Test script: --------------- <?php /** * $ echo "CREATE TABLE t ( x INTEGER PRIMARY KEY ASC, y, z );" |\ * sqlite3 -init 0 Foo.sqlite */ class W { public function stream_open ( $path, $mode, $options, &$openedPath ) { return fopen('Foo.sqlite', $mode); } public function url_stat ( $path, $flags ) { return stat('Foo.sqlite'); } } stream_wrapper_register('sw', 'W'); var_dump(fopen('sw://foo', 'r')); var_dump(file_exists('sw://foo')); var_dump(new \SQLite3('Foo.sqlite')); var_dump(new \SQLite3('sw://foo')); Expected result: ---------------- resource(7) of type (stream) bool(true) object(SQLite3)#1 (0) { } object(SQLite3)#2 (0) { } Actual result: -------------- resource(7) of type (stream) bool(true) object(SQLite3)#1 (0) { } Fatal error: Uncaught exception 'Exception' with message 'Unable to open database: unable to open database file' in ….php:27 Stack trace: #0 ….php(27): SQLite3->__construct('sw://foo') #1 {main} thrown in ….php on line 27