本文整理匯總了PHP中Installer::readSQLFile方法的典型用法代碼示例。如果您正苦於以下問題:PHP Installer::readSQLFile方法的具體用法?PHP Installer::readSQLFile怎麽用?PHP Installer::readSQLFile使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Installer
的用法示例。
在下文中一共展示了Installer::readSQLFile方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: intval
# Do updates based on version
# But cascade the updates
$CURRENT_VERSION = intval(str_replace('.', '', $CURRENT_VERSION));
$latestversion = intval(str_replace('.', '', UPDATE_VERSION));
$mysqlDiff = new MySQLDiff(array('dbuser' => DBASE_USER, 'dbpass' => DBASE_PASS, 'dbname' => DBASE_NAME, 'dbhost' => DBASE_SERVER, 'dumpxml' => 'sql/structure.xml'));
$diffs_done = $mysqlDiff->getSQLDiffs();
if (!is_array($diffs_done)) {
$diffs_done = array();
}
# Run it local so it's logged
foreach ($diffs_done as $sql) {
DB::query($sql);
}
/* Run the update fixtures file */
echo '<h2>Populating Update Data...</h2>';
$sqlLines = Installer::readSQLFile(SITE_ROOT . '/install/fixtures/update.sql', TABLE_PREFIX);
foreach ($sqlLines as $sql) {
DB::query($sql['sql']);
if (DB::errno() != 0 && DB::errno() != 1062) {
echo '<div id="error" style="text-align: left;">Writing to "' . $sql['table'] . '" table... ';
echo "<br /><br />" . DB::error();
echo '</div>';
}
}
OperationsData::updateAircraftRankLevels();
/* Add them to the default group */
$status_type_list = Config::get('PILOT_STATUS_TYPES');
$pilot_list = PilotData::getAllPilots();
foreach ($pilot_list as $pilot) {
echo "Fixing settings for " . $pilot->firstname . " " . $pilot->lastname . "<br>";
PilotData::resetLedgerforPilot($pilot->pilotid);
示例2: dirname
<?php
include dirname(__FILE__) . '/bootstrap.inc.php';
include SITE_ROOT . '/install/includes/Installer.class.php';
echo '<pre>';
$_POST['TABLE_PREFIX'] = 'phpvms_';
$sql = Installer::readSQLFile(SITE_ROOT . '/install/sql/install.sql');
print_r($sql);