本文整理匯總了PHP中SqlParser::execSqlScript方法的典型用法代碼示例。如果您正苦於以下問題:PHP SqlParser::execSqlScript方法的具體用法?PHP SqlParser::execSqlScript怎麽用?PHP SqlParser::execSqlScript使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類SqlParser
的用法示例。
在下文中一共展示了SqlParser::execSqlScript方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: displayDatabaseForm
} else {
$proxy_host = NULL;
$proxy_port = NULL;
}
displayDatabaseForm($originPage, $db_mantis_host, $db_mantis_database, $db_mantis_user, $db_mantis_pass);
$action = (string) getHttpVariable(INPUT_POST, 'action', 'none');
if ("setDatabaseInfo" == $action) {
try {
$database_version = checkDBConnection($db_mantis_host, $db_mantis_user, $db_mantis_pass, $db_mantis_database);
echo "<script type=\"text/javascript\">console.log(\"DEBUG: Mantis database_version = {$database_version}\");</script>";
checkDBprivileges($db_mantis_database);
echo "<script type=\"text/javascript\">console.log(\"Step 1/4 create config.ini file\");</script>";
createConfigFile($db_mantis_host, $db_mantis_user, $db_mantis_pass, $db_mantis_database, $proxy_host, $proxy_port);
echo "<script type=\"text/javascript\">console.log(\"Step 2/4 execSQLscript2 - create Tables\");</script>";
//$retCode = Tools::execSQLscript2(Install::FILENAME_TABLES);
$retCode = SqlParser::execSqlScript(Install::FILENAME_TABLES);
if (0 != $retCode) {
throw new Exception('ERROR: Could not execute SQL script: ' . Install::FILENAME_TABLES);
}
$request = "SELECT value from `codev_config_table` WHERE `config_id` = 'database_version' ";
if (!SqlWrapper::getInstance()->sql_query($request)) {
throw new Exception('ERROR: CodevTT database tables not created.');
}
echo "<script type=\"text/javascript\">console.log(\"Step 3/4 execSQLscript2 - create Procedures\");</script>";
// procedures are defined in install/codevtt_procedures.php
foreach ($codevtt_sqlProcedures as $query) {
$result = SqlWrapper::getInstance()->sql_query(trim($query));
if (!$result) {
throw new Exception('ERROR: SQL procedure creation failed FAILED');
}
}