本文整理汇总了PHP中Quote::migrate方法的典型用法代码示例。如果您正苦于以下问题:PHP Quote::migrate方法的具体用法?PHP Quote::migrate怎么用?PHP Quote::migrate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Quote
的用法示例。
在下文中一共展示了Quote::migrate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: User
<?php
require_once "../models/Base.php";
require_once "../models/User.php";
require_once "../models/Quote.php";
// $user = new User;
$user = new User();
$quote = new Quote();
$user->migrate();
$quote->migrate();
if (isset($_SERVER["SERVER_NAME"])) {
die("This script must be run from the command line.");
}
require "../db/bootstrap.php";
print "Initializing the quotes database...";
$first = $quote->findByQuote($quotes[0]["quote"]);
if ($first) {
print " (already filled) ";
} else {
foreach ($quotes as $q) {
$quote->newQuote($q["who"], $q["quote"], 1);
}
}
print "done\n\n";
$stdin = fopen("php://stdin", "r");
print "Let's create a new user\n";
print "Please enter the administrator's email: ";
$email = trim(fgets($stdin));
print "Administrator's password: ";
$password = trim(fgets($stdin));
$user->newUser($email, $password, 1);