1
0
mirror of https://github.com/dg/dibi.git synced 2025-01-16 21:58:36 +01:00
php-dibi/examples/importing-dump-from-file.php
2018-05-23 17:14:32 +02:00

24 lines
461 B
PHP

<?php
declare(strict_types=1);
?>
<!DOCTYPE html><link rel="stylesheet" href="data/style.css">
<h1>Importing SQL Dump from File | Dibi</h1>
<?php
if (@!include __DIR__ . '/../vendor/autoload.php') {
die('Install packages using `composer install`');
}
$dibi = new Dibi\Connection([
'driver' => 'sqlite',
'database' => 'data/sample.s3db',
]);
$count = $dibi->loadFile('compress.zlib://data/sample.dump.sql.gz');
echo 'Number of SQL commands:', $count;