本文整理匯總了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
}