Download the PHP package moxio/sqlite-extended-api without Composer

On this page you can find all versions of the php package moxio/sqlite-extended-api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package sqlite-extended-api

Latest Stable Version Buy us a tree

moxio/sqlite-extended-api

Exposes SQLite APIs that are otherwise not available in PHP. You can connect to an SQLite database as you normally would using PHP's PDO extension, then use this library to call SQLite API methods that PDO does not offer (e.g. loading extensions).

Warning: under the hood, this library makes use of Z-Engine, which proclaims itself not ready for production until version 1.0.0. Use it at your own risk.

Requirements

This library requires PHP version 7.4 or higher with the FFI extension enabled. It only works with x64 non-thread-safe builds of PHP.

Installation

Install as a dependency using composer:

Usage

If you have an existing PDO connection to an SQLite database, you can use the wrapPDO() static method on the Facade class to obtain access to extra SQLite APIs:

See the next section for methods available on the wrapped connection.

Exposed APIs

Below is a short overview; see WrappedConnection for details.

Loading SQLite extensions

Load additional SQLite extension libraries using loadExtension($shared_library):

This corresponds to the loadExtension method in PHP's SQLite3 extension, or `sqlite3_load_extension in the SQLite C interface. Returns true if the extension was successfully loaded, false if it was not.

Obtaining the database filename

To obtain the full disk path of the database connected to, use getDatabaseFilename():

For an in-memory database, this returns an empty string.

How does this work?

In short: we use the awesome Z-Engine project by Alexander Lisachenko and PHP's Foreign Function Interface (FFI) to resolve your PHP variable to the raw connection pointer for the SQLite C API, then call that C API using FFI.

More details can be found in this blog post.

Versioning

This project adheres to Semantic Versioning.

Contributing

Contributions to this project are more than welcome. If there are other SQLite APIs that you would like to be able to use in PHP, feel free to send a PR or to file a feature request.

License

This project is released under the MIT license.

Treeware

This package is Treeware. If you use it in production, then we'd appreciate it if you buy the world a tree to thank us for our work. By contributing to the Treeware forest you'll be creating employment for local families and restoring wildlife habitats.


Made with love, coffee and fun by the Moxio team from Delft, The Netherlands. Interested in joining our awesome team? Check out our vacancies (in Dutch).


All versions of sqlite-extended-api with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4 || ^8.0
ext-ffi Version *
lisachenko/z-engine Version ^0.8.0 || ^0.9.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package moxio/sqlite-extended-api contains the following files

Loading the files please wait ....