本文整理汇总了PHP中Source::init方法的典型用法代码示例。如果您正苦于以下问题:PHP Source::init方法的具体用法?PHP Source::init怎么用?PHP Source::init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Source
的用法示例。
在下文中一共展示了Source::init方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
public function init()
{
parent::init();
}
示例2: foreach
foreach (Source::getArgList() as $arg) {
$longopts[] = "from-{$arg}:";
$longopts[] = "to-{$arg}:";
}
$options = getopt('', $longopts);
if (isset($options['help'])) {
usage();
}
if (isset($options['test'])) {
$options = array();
$options['from-file'] = 'test/dev.sql';
$options['to-file'] = 'test/live.sql';
}
define('VERBOSE', isset($options['verbose']));
$from = Source::init('from', $options);
$to = Source::init('to', $options);
$differ = new dbStructUpdater();
$to_sql = $to->getStructure();
$from_sql = $from->getStructure();
if (VERBOSE) {
notice("*** From SQL: {$from} \n");
echo $from_sql . "\n\n";
notice('***');
notice("*** To SQL: {$to} \n");
echo $to_sql;
notice('***');
}
$diffs = $differ->getUpdates($to_sql, $from_sql);
$generated = date('r');
echo "\n#\n# Structure difference between '{$from}' and '{$to}'\n#\n# Generated: {$generated}\n#\n# START DIFF;\n\n";
foreach ($diffs as $diff) {
示例3: init
public function init()
{
parent::init();
# Get module ID from the DB
}