本文整理汇总了PHP中SqlParser::process方法的典型用法代码示例。如果您正苦于以下问题:PHP SqlParser::process方法的具体用法?PHP SqlParser::process怎么用?PHP SqlParser::process使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SqlParser
的用法示例。
在下文中一共展示了SqlParser::process方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: realpath
// open db connection
$setupPath = realpath(dirname(__FILE__));
include "{$setupPath}/setup.info.php";
include "{$setupPath}/sqlParser.class.php";
$sqlParser = new SqlParser($database_server, $database_user, $database_password, str_replace("`", "", $dbase), $table_prefix, $adminname, $adminemail, $adminpass, $database_connection_charset, $managerlanguage, $database_connection_method);
$sqlParser->mode = $installMode < 1 ? "new" : "upd";
//$sqlParser->imageUrl = 'http://' . $_SERVER['SERVER_NAME'] . $base_url . "assets/";
$sqlParser->imageUrl = "assets/";
$sqlParser->imagePath = $base_path . "assets/";
$sqlParser->fileManagerPath = $base_path;
$sqlParser->ignoreDuplicateErrors = true;
$sqlParser->connect();
// install/update database
echo "<p>" . $_lang['setup_database_creating_tables'];
if ($moduleSQLBaseFile) {
$sqlParser->process($moduleSQLBaseFile);
// display database results
if ($sqlParser->installFailed == true) {
$errors += 1;
echo "<span class=\"notok\"><b>" . $_lang['database_alerts'] . "</span></p>";
echo "<p>" . $_lang['setup_couldnt_install'] . "</p>";
echo "<p>" . $_lang['installation_error_occured'] . "<br /><br />";
for ($i = 0; $i < count($sqlParser->mysqlErrors); $i++) {
echo "<em>" . $sqlParser->mysqlErrors[$i]["error"] . "</em>" . $_lang['during_execution_of_sql'] . "<span class='mono'>" . strip_tags($sqlParser->mysqlErrors[$i]["sql"]) . "</span>.<hr />";
}
echo "</p>";
echo "<p>" . $_lang['some_tables_not_updated'] . "</p>";
return;
} else {
echo "<span class=\"ok\">" . $_lang['ok'] . "</span></p>";
}
示例2: SqlParser
include "{$setupPath}/setup.info.php";
include "{$setupPath}/sqlParser.class.php";
$sqlParser = new SqlParser($database_server, $database_user, $database_password, str_replace("`", "", $dbase), $table_prefix, $adminname, $adminemail, $adminpass, $database_connection_charset, $managerlanguage, $database_connection_method, $auto_template_logic);
$sqlParser->mode = $installMode < 1 ? "new" : "upd";
/* image and file manager paths now handled via settings screen in Manager
$sqlParser->imageUrl = 'http://' . $_SERVER['SERVER_NAME'] . $base_url . "assets/";
$sqlParser->imageUrl = "assets/";
$sqlParser->imagePath = $base_path . "assets/";
$sqlParser->fileManagerPath = $base_path;
*/
$sqlParser->ignoreDuplicateErrors = true;
$sqlParser->connect();
// install/update database
echo "<p>" . $_lang['setup_database_creating_tables'];
if ($moduleSQLBaseFile) {
$sqlParser->process($moduleSQLBaseFile);
// display database results
if ($sqlParser->installFailed == true) {
$errors += 1;
echo "<span class=\"notok\"><b>" . $_lang['database_alerts'] . "</span></p>";
echo "<p>" . $_lang['setup_couldnt_install'] . "</p>";
echo "<p>" . $_lang['installation_error_occured'] . "<br /><br />";
for ($i = 0; $i < count($sqlParser->mysqlErrors); $i++) {
echo "<em>" . $sqlParser->mysqlErrors[$i]["error"] . "</em>" . $_lang['during_execution_of_sql'] . "<span class='mono'>" . strip_tags($sqlParser->mysqlErrors[$i]["sql"]) . "</span>.<hr />";
}
echo "</p>";
echo "<p>" . $_lang['some_tables_not_updated'] . "</p>";
return;
} else {
echo "<span class=\"ok\">" . $_lang['ok'] . "</span></p>";
}
示例3: SqlParser
break;
case 'postgres':
@($conn_result = $db->connect(NO_DSN, $db_server, $tl_db_login, $tl_db_passwd, $db_name));
break;
}
// --------------------------------------------------------------------------------------------
if ($install && $conn_result['status'] != 0) {
// BUGID 3654
drop_tables($db, $db_table_prefix, $db_type);
}
// --------------------------------------------------------------------------------------------
$sqlParser = new SqlParser($db, $db_type, $db_table_prefix);
foreach ($a_sql_schema as $sql_schema) {
foreach ($sql_schema as $sql_file) {
echo "<br />Processing:" . $sql_file;
$sqlParser->process($sql_file);
}
echo "<br />";
}
// Now data migration must be done if needed
if ($migration_process != '') {
require_once $migration_functions_file;
$migration_process($db, $tables);
}
// -------------------------------------------------
// Data Operations
if (count($a_sql_data > 0)) {
foreach ($a_sql_data as $sql_data) {
if (count($sql_data > 0)) {
// echo $msg_process_data;
foreach ($sql_data as $sql_file) {
示例4: SqlParser
// cehck to see if the desired table prefix is alreay in use
echo "<p>Checking table prefix `" . $table_prefix . "`: ";
if (@($rs = mysql_query("SELECT COUNT(*) FROM {$db}." . $table_prefix . "site_content"))) {
echo "<span class='notok'>Failed!</span> - Table prefix is already in use in this database!</p>";
$errors += 1;
echo "<p>Etomite setup couldn't install into the selected database, as it already contains Etomite tables. Please choose a new table_prefix, and run setup again.</p>";
echo $pageFooter;
exit;
} else {
echo "<span class='ok'>OK!</span></p>";
}
// load the sqlParser class and attempt to load the desired SQL file
include "sqlParser.class.php";
$sqlParser = new SqlParser($host, $name, $pass, $db, $table_prefix, $adminname, $adminpass);
$sqlParser->connect();
$sqlParser->process($sqlFile);
$sqlParser->close();
// handle errors
echo "<p>Importing default site: ";
if ($sqlParser->installFailed == true) {
echo "<span class='notok'>Failed!</span> - Installation failed!</p>";
$errors += 1;
echo "<p>Etomite setup couldn't install the default site into the selected database. The last error to occur was <i>" . $sqlParser->mysqlErrors[count($sqlParser->mysqlErrors) - 1]['error'] . "</i> during the execution of SQL statement <span class=\"mono\">" . strip_tags($sqlParser->mysqlErrors[count($sqlParser->mysqlErrors) - 1]['sql']) . "</span></p>";
echo $pageFooter;
exit;
} else {
echo "<span class='ok'>OK!</span></p>";
}
// attempt to write the manager/includes/config.inc.php file
echo "<p>Writing configuration file: ";
// read in the config.inc.php template
示例5: SqlParser
$sqlParser = new SqlParser();
$sqlParser->prefix = $_SESSION['table_prefix'];
$sqlParser->adminname = $_SESSION['adminname'];
$sqlParser->adminpass = $_SESSION['adminpass'];
$sqlParser->adminemail = $_SESSION['adminemail'];
$sqlParser->connection_charset = 'utf8';
$sqlParser->connection_collation = $_SESSION['database_collation'];
$sqlParser->connection_method = $_SESSION['database_connection_method'];
$sqlParser->managerlanguage = $_SESSION['managerlanguage'];
$sqlParser->manager_theme = $default_config['manager_theme'];
$sqlParser->mode = $installmode < 1 ? 'new' : 'upd';
$sqlParser->base_path = $base_path;
$sqlParser->ignoreDuplicateErrors = true;
// install/update database
echo '<p>' . $_lang['setup_database_creating_tables'];
$sqlParser->process('both_createtables.sql');
if ($installmode == 0) {
$sqlParser->process('new_setvalues.sql');
} else {
$sqlParser->process('upd_fixvalues.sql');
}
$sqlParser->process('both_fixvalues.sql');
// display database results
if ($sqlParser->installFailed == true) {
$errors += 1;
echo '<span class="notok"><b>' . $_lang['database_alerts'] . '</b></span>';
echo '</p>';
echo "<p>" . $_lang['setup_couldnt_install'] . "</p>";
echo "<p>" . $_lang['installation_error_occured'] . "<br /><br />";
for ($i = 0; $i < count($sqlParser->mysqlErrors); $i++) {
echo "<em>" . $sqlParser->mysqlErrors[$i]["error"] . "</em>" . $_lang['during_execution_of_sql'] . "<span class='mono'>" . strip_tags($sqlParser->mysqlErrors[$i]["sql"]) . "</span>.<hr />";