2017-07-21 21:34:37 +02:00
|
|
|
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
?>
|
2010-08-03 12:28:07 +02:00
|
|
|
<!DOCTYPE html><link rel="stylesheet" href="data/style.css">
|
|
|
|
|
2018-05-10 21:45:11 +02:00
|
|
|
<h1>Importing SQL Dump from File | Dibi</h1>
|
2010-08-03 12:28:07 +02:00
|
|
|
|
2008-07-17 03:51:29 +00:00
|
|
|
<?php
|
|
|
|
|
2018-03-23 11:57:59 +01:00
|
|
|
if (@!include __DIR__ . '/../vendor/autoload.php') {
|
|
|
|
die('Install packages using `composer install`');
|
|
|
|
}
|
2008-07-17 03:51:29 +00:00
|
|
|
|
|
|
|
|
2018-04-17 10:03:43 +02:00
|
|
|
$dibi = new Dibi\Connection([
|
2018-05-23 17:08:25 +02:00
|
|
|
'driver' => 'sqlite',
|
2012-10-18 23:00:12 +02:00
|
|
|
'database' => 'data/sample.s3db',
|
2015-10-06 01:39:01 +02:00
|
|
|
]);
|
2008-07-17 03:51:29 +00:00
|
|
|
|
|
|
|
|
2018-04-17 10:03:43 +02:00
|
|
|
$count = $dibi->loadFile('compress.zlib://data/sample.dump.sql.gz');
|
2008-07-17 03:51:29 +00:00
|
|
|
|
2011-07-01 08:06:36 +02:00
|
|
|
echo 'Number of SQL commands:', $count;
|