importing-dump-from-file.php 461 B

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