Skip to content

Compile with Pdo\Sqlite::loadExtension() by default? #17251

Closed as not planned
Closed as not planned
@stancl

Description

@stancl

Description

Apologies if this isn't the right place to ask a question like this, but am I understanding correctly that compiling PHP with PDO_SQLITE_OMIT_LOAD_EXTENSION=0 adds a loadExtension() method to PDO\Sqlite, letting developers load SQLite extensions?

(Added in #12804)

See:

[AC_DEFINE([PDO_SQLITE_OMIT_LOAD_EXTENSION], [1],
#ifndef PDO_SQLITE_OMIT_LOAD_EXTENSION
/* Attempts to load an SQLite extension library. */
PHP_METHOD(Pdo_Sqlite, loadExtension)

I'm curious why this is omitted by default. The RFC clarifies that the approach used in the PR above only allows loading extensions using the C API, not SQLite statements, so there shouldn't be any risks?

Is it because the sqlite library on the server may be compiled with SQLITE_OMIT_LOAD_EXTENSION and the method has no way of knowing that?

Being able to load SQLite extensions in PDO, without recompiling PHP, would be very helpful imo since there's a decent number of questions online asking how to achieve certain things with PDO (which is often a requirement e.g. in Laravel's ORM) vs the SQLite3 class directly.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions