本文整理汇总了PHP中dibi::loadFile方法的典型用法代码示例。如果您正苦于以下问题:PHP dibi::loadFile方法的具体用法?PHP dibi::loadFile怎么用?PHP dibi::loadFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dibi
的用法示例。
在下文中一共展示了dibi::loadFile方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
<!DOCTYPE html><link rel="stylesheet" href="data/style.css">
<h1>Importing SQL Dump from File | dibi</h1>
<?php
require __DIR__ . '/../src/loader.php';
dibi::connect(['driver' => 'sqlite3', 'database' => 'data/sample.s3db']);
$count = dibi::loadFile('compress.zlib://data/sample.dump.sql.gz');
echo 'Number of SQL commands:', $count;
示例2:
<?php
namespace ActiveMapperTests;
require_once __DIR__ . "/../libs/Nette/loader.php";
\Nette\Debug::enable(\Nette\Debug::DEVELOPMENT);
\Nette\Environment::setVariable("tempDir", __DIR__ . "/_temp");
$loader = new \Nette\Loaders\RobotLoader();
$loader->addDirectory(__DIR__ . "/../libs");
$loader->addDirectory(__DIR__ . "/../ActiveMapper");
$loader->addDirectory(__DIR__ . "/../examples/Models");
$loader->register();
\dibi::connect(array('driver' => "sqlite3", 'database' => ":memory:", 'formatDateTime' => "'Y-m-d H:i:s'", 'lazy' => TRUE, 'profiler' => TRUE));
\dibi::loadFile(__DIR__ . "/db.structure.sql");
\dibi::loadFile(__DIR__ . "/db.data.sql");
示例3: define
<?php
// The point of this file is to be ran 1 time to set up all the tables necessary for lolscores to run.
// This script uses .sql files that have to be UPDATED after every structural change to the database.
define('WEBSECURITY', 'ok');
require '../__init.php';
if (isset($_GET["hash"]) && defined('SAFETY_HASH') && $_GET["hash"] == SAFETY_HASH) {
dibi::loadFile('../sql/lolscores.sql');
print "DB install is done.";
} else {
print "Stop hacking pls.";
}