PHP code example of moxio / sqlite-extended-api

1. Go to this page and download the library: Download moxio/sqlite-extended-api library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

moxio / sqlite-extended-api example snippets



use Moxio\SQLiteExtendedAPI\Facade;

// Existing PDO connection
$pdo = new \PDO('sqlite::memory:');

// Wrap it using this library
$wrapped_connection = Facade::wrapPDO($pdo);

// Call extended APIs on the wrapped connection object
$wrapped_connection->loadExtension('mod_spatialite.so');

$wrapped_connection->loadExtension('mod_spatialite.so');

var_dump($wrapped_connection->getDatabaseFilename());