本文整理汇总了PHP中execute_sql_file函数的典型用法代码示例。如果您正苦于以下问题:PHP execute_sql_file函数的具体用法?PHP execute_sql_file怎么用?PHP execute_sql_file使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了execute_sql_file函数的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: uninstall
public function uninstall()
{
$uninstall_sql = './Addons/ConfigureAccount/uninstall.sql';
if (file_exists($uninstall_sql)) {
execute_sql_file($uninstall_sql);
}
return true;
}
开发者ID:chenpusn,项目名称:haozhixian_bak,代码行数:8,代码来源:ConfigureAccountAddon.class.php
示例2: uninstall
public function uninstall()
{
$uninstall = './Addons/DanangTools/uninstall.sql';
if (file_exists($uninstall)) {
execute_sql_file($uninstall);
}
return true;
}
开发者ID:wmk223,项目名称:amango_V3,代码行数:8,代码来源:DanangToolsAddon.class.php
示例3: uninstall
public function uninstall()
{
/**
* 当该插件含有uninstal.sql时候,请放置于插件根目录,并将下面4行注释去掉
* 若无安装sql时 默认返回true
*/
$uninstall_sql = './Addons/Sharephotos/uninstall.sql';
if (file_exists($uninstall_sql)) {
execute_sql_file($uninstall_sql);
}
return true;
}
开发者ID:fedkey,项目名称:amango,代码行数:12,代码来源:SharephotosAddon.class.php
示例4: uninstall
public function uninstall()
{
$tablename = array();
$tablename = M('addonsexcel')->field('tablename')->select();
$model = M();
foreach ($tablename as $key => $value) {
$sql = <<<sql
DROP TABLE {$value['tablename']};
sql;
$model->execute($sql);
}
$uninstall_sql = './Addons/Excelimport/uninstall.sql';
if (file_exists($uninstall_sql)) {
execute_sql_file($uninstall_sql);
}
return true;
}
开发者ID:fedkey,项目名称:amango,代码行数:17,代码来源:ExcelimportAddon.class.php
示例5: lance_install
function lance_install($lang, $DEBUG = FALSE)
{
$PHP_SELF = $_SERVER['PHP_SELF'];
include CONFIG_PATH . 'dbconnect.php';
include ROOT_PATH . 'version.php';
//verif si create / alter table possible !!!
if (!test_create_table($DEBUG)) {
echo "<font color=\"red\"><b>CREATE TABLE</b> " . _('install_impossible_sur_db') . " <b>{$mysql_database}</b> (" . _('install_verif_droits_mysql') . " <b>{$mysql_user}</b>)...</font><br> \n";
echo "<br>" . _('install_puis') . " ...<br>\n";
echo "<form action=\"{$PHP_SELF}\" method=\"POST\">\n";
echo "<input type=\"submit\" value=\"" . _('form_redo') . "\">\n";
echo "</form>\n";
} elseif (!test_drop_table($DEBUG)) {
echo "<font color=\"red\"><b>DROP TABLE</b> " . _('install_impossible_sur_db') . " <b>{$mysql_database}</b> (" . _('install_verif_droits_mysql') . " <b>{$mysql_user}</b>)...</font><br> \n";
echo "<br>" . _('install_puis') . " ...<br>\n";
echo "<form action=\"{$PHP_SELF}\" method=\"POST\">\n";
echo "<input type=\"submit\" value=\"" . _('form_redo') . "\">\n";
echo "</form>\n";
} else {
//on execute le script [nouvelle vesion].sql qui crée et initialise les tables
$file_sql = "sql/php_conges_v{$config_php_conges_version}.sql";
if (file_exists($file_sql)) {
$result = execute_sql_file($file_sql, $DEBUG);
}
/*************************************/
// FIN : mise à jour de la "installed_version" et de la langue dans la table conges_config
$sql_update_version = "UPDATE conges_config SET conf_valeur = '{$config_php_conges_version}' WHERE conf_nom='installed_version' ";
$result_update_version = SQL::query($sql_update_version);
$sql_update_lang = "UPDATE conges_config SET conf_valeur = '{$lang}' WHERE conf_nom='lang' ";
$result_update_lang = SQL::query($sql_update_lang);
$tab_url = explode("/", $_SERVER['PHP_SELF']);
array_pop($tab_url);
array_pop($tab_url);
$url_accueil = implode("/", $tab_url);
// on prend l'url complet sans le /install/install.php à la fin
$sql_update_lang = "UPDATE conges_config SET conf_valeur = '{$url_accueil}' WHERE conf_nom='URL_ACCUEIL_CONGES' ";
$result_update_lang = SQL::query($sql_update_lang);
$comment_log = "Install de php_conges (version = {$config_php_conges_version}) ";
log_action(0, "", "", $comment_log, $DEBUG);
/*************************************/
// on propose la page de config ....
echo "<br><br><h2>" . _('install_ok') . " !</h2><br>\n";
echo "<META HTTP-EQUIV=REFRESH CONTENT=\"2; URL=../config/\">";
}
}
开发者ID:kakargias,项目名称:php-conges,代码行数:45,代码来源:install.php
示例6: restaure
public static function restaure($fichier_restaure_name, $fichier_restaure_tmpname, $fichier_restaure_size, $fichier_restaure_error)
{
$PHP_SELF = $_SERVER['PHP_SELF'];
$session = session_id();
$return = '';
header_popup();
$return .= '<h1>' . _('admin_sauve_db_titre') . '</h1>';
if ($fichier_restaure_error != 0 || $fichier_restaure_size == 0) {
//message d'erreur et renvoit sur la page précédente (choix fichier)
$return .= '<form action="' . $PHP_SELF . '?session=' . $session . '" method="POST">';
$return .= '<table>';
$return .= '<tr>';
$return .= '<th>' . _('admin_sauve_db_bad_file') . ' : <br>' . $fichier_restaure_name . '</th>';
$return .= '</tr><tr>';
$return .= '<td align="center">';
$return .= '<input type="hidden" name="choix_action" value="restaure">';
$return .= '<input type="submit" value="' . _('form_redo') . '">';
$return .= '</td>';
$return .= '</tr><tr>';
$return .= '<td align="center">';
$return .= '<input type="button" value="' . _('form_cancel') . '" onClick="javascript:window.close();">';
$return .= '</td>';
$return .= '</tr></table></form>';
} else {
$result = execute_sql_file($fichier_restaure_tmpname);
$return .= '<form action="" method="POST">';
$return .= '<table>';
$return .= '<tr>';
$return .= '<th>' . _('admin_sauve_db_restaure_ok') . ' !</th>';
$return .= '</tr>';
$return .= '<tr>';
$return .= '<td align="center"> </td>';
$return .= '</tr>';
$return .= '<tr>';
$return .= '<td align="center">';
$return .= '<input type="button" value="' . _('form_close_window') . '" onClick="javascript:window.close();">';
$return .= '</td>';
$return .= '</tr></table></form>';
}
echo $return;
bottom();
}
开发者ID:TexGG,项目名称:Libertempo,代码行数:42,代码来源:Fonctions.php
示例7: display_form
display_form($error_message);
exit;
}
}
$link = mysql_select_db($dbname, $con);
if (!$link) {
$error_message = 'Not connected : ' . mysql_error();
display_form($error_message);
exit;
}
if (are_tables_created($dbprefix, $con)) {
$error_message = 'Tables already installed.Try another Database or Table Prefix.';
display_form($error_message);
exit;
}
execute_sql_file("sql/install.sql", $dbprefix, $con);
$conn->Close();
// Edit config/database.php file
$sample_database_file = "application/config/sample-database.php";
$database_file = "application/config/database.php";
rename($sample_database_file, $database_file);
$line_array = file($database_file);
for ($i = 0; $i < count($line_array); $i++) {
if (strstr($line_array[$i], "['default']['hostname']")) {
$line_array[$i] = '$db[\'default\'][\'hostname\'] = \'' . $server . '\';' . "\r\n";
}
if (strstr($line_array[$i], "['default']['username']")) {
$line_array[$i] = '$db[\'default\'][\'username\'] = \'' . $username . '\';' . "\r\n";
}
if (strstr($line_array[$i], "['default']['password']")) {
$line_array[$i] = '$db[\'default\'][\'password\'] = \'' . $password . '\';' . "\r\n";
开发者ID:Anuragigts,项目名称:25_clinic,代码行数:31,代码来源:install.php
示例8: add_comon_model
function add_comon_model()
{
$install_sql = './Application/Admin/Conf/common_model.sql';
if (file_exists($install_sql)) {
execute_sql_file($install_sql);
}
$this->success('增加成功');
}
开发者ID:Rayuu,项目名称:weiphp,代码行数:8,代码来源:ModelController.class.php
示例9: restaure
function restaure($fichier_restaure_name, $fichier_restaure_tmpname, $fichier_restaure_size, $fichier_restaure_error, $DEBUG = FALSE)
{
$PHP_SELF = $_SERVER['PHP_SELF'];
$session = session_id();
header_popup();
echo "<h1>" . _('admin_sauve_db_titre') . "</h1>\n";
if ($fichier_restaure_error != 0 || $fichier_restaure_size == 0) {
//message d'erreur et renvoit sur la page précédente (choix fichier)
echo "<form action=\"{$PHP_SELF}?session={$session}\" method=\"POST\">\n";
echo "<table>\n";
echo "<tr>\n";
echo "<th> " . _('admin_sauve_db_bad_file') . " : <br>{$fichier_restaure_name}</th>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td align=\"center\">\n";
echo "\t<input type=\"hidden\" name=\"choix_action\" value=\"restaure\">\n";
echo "\t<input type=\"submit\" value=\"" . _('form_redo') . "\">\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td align=\"center\">\n";
echo "\t<input type=\"button\" value=\"" . _('form_cancel') . "\" onClick=\"javascript:window.close();\">\n";
echo "</td>\n";
echo "</tr>\n";
echo "</table>\n";
echo "</form>\n";
} else {
//affichage du contenu :
//readfile($fichier_restaure_tmpname);
$result = execute_sql_file($fichier_restaure_tmpname, $DEBUG);
/* // on lit le fichier et on met chaque ligne dans un tableau
$tab_lines = file ($fichier_restaure_tmpname);
// puis parcourt du tableau :
// si la ligne n'est pas un commentaire (commence par # (après avoir enlevé les espaces de debut de chaine))
// on l'ajoute a la requete sql )
$sql2="";
foreach ($tab_lines as $line_num => $line)
{
$line=trim($line);
if(substr($line,0,1)=="#")
{
//echo "#<b>$line_num</b> $line<br>\n";
}
else
{
//echo "$line<br>\n";
//execution de la requete sql:
$sql2=$line;
//echo "$sql2<br>";
$ReqLog = SQL::query($sql2) ;
}
}
*/
echo "<form action=\"\" method=\"POST\">\n";
echo "<table>\n";
echo "<tr>\n";
echo "<th>" . _('admin_sauve_db_restaure_ok') . " !</th>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td align=\"center\"> </td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td align=\"center\">\n";
echo "\t<input type=\"button\" value=\"" . _('form_close_window') . "\" onClick=\"javascript:window.close();\">\n";
echo "</td>\n";
echo "</tr>\n";
echo "</table>\n";
echo "</form>\n";
}
bottom();
}
开发者ID:kakargias,项目名称:php-conges,代码行数:71,代码来源:admin_db_sauve.php
示例10: restaure
function restaure($fichier_restaure_name, $fichier_restaure_tmpname, $fichier_restaure_size, $fichier_restaure_error, $DEBUG = FALSE)
{
$PHP_SELF = $_SERVER['PHP_SELF'];
$session = session_id();
header_popup();
echo "<h1>" . _('admin_sauve_db_titre') . "</h1>\n";
if ($fichier_restaure_error != 0 || $fichier_restaure_size == 0) {
//message d'erreur et renvoit sur la page précédente (choix fichier)
echo "<form action=\"{$PHP_SELF}?session={$session}\" method=\"POST\">\n";
echo "<table>\n";
echo "<tr>\n";
echo "<th> " . _('admin_sauve_db_bad_file') . " : <br>{$fichier_restaure_name}</th>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td align=\"center\">\n";
echo "\t<input type=\"hidden\" name=\"choix_action\" value=\"restaure\">\n";
echo "\t<input type=\"submit\" value=\"" . _('form_redo') . "\">\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td align=\"center\">\n";
echo "\t<input type=\"button\" value=\"" . _('form_cancel') . "\" onClick=\"javascript:window.close();\">\n";
echo "</td>\n";
echo "</tr>\n";
echo "</table>\n";
echo "</form>\n";
} else {
$result = execute_sql_file($fichier_restaure_tmpname, $DEBUG);
echo "<form action=\"\" method=\"POST\">\n";
echo "<table>\n";
echo "<tr>\n";
echo "<th>" . _('admin_sauve_db_restaure_ok') . " !</th>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td align=\"center\"> </td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td align=\"center\">\n";
echo "\t<input type=\"button\" value=\"" . _('form_close_window') . "\" onClick=\"javascript:window.close();\">\n";
echo "</td>\n";
echo "</tr>\n";
echo "</table>\n";
echo "</form>\n";
}
bottom();
}
开发者ID:coz787,项目名称:Libertempo,代码行数:46,代码来源:admin_db_sauve.php
示例11: set_time_limit
set_time_limit(0);
$prefix = C('DB_PREFIX');
$map['name'] = 'SYSTEM_UPDATRE_VERSION';
$res = M('config')->where($map)->getField('value');
if ($res < 20140711) {
$this->error('该补丁包需要先升级到7月11号发布补丁包版本再升级');
exit;
}
if ($res >= 20140826) {
$this->error('请不要重复执行数据库升级');
exit;
}
unset($map);
$install_sql = './update.sql';
execute_sql_file($install_sql);
M('config')->where('name="WEB_SITE_CLOSE"')->setField('extra', "0:关闭 \r\n1:开启");
M('config')->where('name="WEB_SITE_VERIFY"')->setField('extra', "0:关闭 \r\n1:开启");
$modelArr = array('Chat' => array('config' => '{"tuling_key":"d812d695a5e0df258df952698faca6cc","tuling_url":"http:\\/\\/www.tuling123.com\\/openapi\\/api","simsim_key":"41250a68-3cb5-43c8-9aa2-d7b3caf519b1","simsim_url":"http:\\/\\/sandbox.api.simsimi.com\\/request.p","i9_url":"http:\\/\\/www.xiaojo.com\\/bot\\/chata.php","rand_reply":"\\u6211\\u4eca\\u5929\\u7d2f\\u4e86\\uff0c\\u660e\\u5929\\u518d\\u966a\\u4f60\\u804a\\u5929\\u5427\\r\\n\\u54c8\\u54c8~~\\r\\n\\u4f60\\u8bdd\\u597d\\u591a\\u554a\\uff0c\\u4e0d\\u8ddf\\u4f60\\u804a\\u4e86\\r\\n\\u867d\\u7136\\u4e0d\\u61c2\\uff0c\\u4f46\\u89c9\\u5f97\\u4f60\\u8bf4\\u5f97\\u5f88\\u5bf9"}'), 'Wecome' => array('config' => '{"type":"1","title":"","description":"欢迎关注,请绑定帐号后体验更多功能","pic_url":"","url":""}'));
foreach ($modelArr as $name => $save) {
$res = M('addons')->where("name='{$name}'")->save($save);
// dump ( $res );
// lastsql ();
}
$sqlArr = array(0 => 'INSERT INTO wp_addons (`name`,`title`,`description`,`status`,`config`,`author`,`version`,`create_time`,`has_adminlist`,`type`,`cate_id`) VALUES (\'YouaskService\',\'你问我答客服系统\',\'一个支持你问我答,关键词制定客服的客服系统\',\'1\',\'null\',\'陌路生人\',\'0.1\',\'1403947448\',\'1\',\'1\',\'1\');');
foreach ($sqlArr as $vo) {
$res = M()->execute($vo);
// dump ( $res );
// dump ( $vo );
}
$modelArr = array('keyword' => array('field_sort' => '{"1":["keyword","keyword_type","addon","aim_id","keyword_length","cTime","extra_text","extra_int"]}'), 'custom_menu' => array('field_sort' => '{"1":["sort","pid","title","keyword","url"]}', 'list_grid' => 'title:10%菜单名\\r\\nkeyword:10%关联关键词\\r\\nurl:50%关联URL\\r\\nsort:5%排序号\\r\\nid:10%操作:[EDIT]|编辑,[DELETE]|删除'), 'weisite_category' => array('field_sort' => '{"1":["title","icon","url","is_show","status","sort","pid"]}', 'list_grid' => 'title:15%分类标题\\r\\nicon|get_img-html:分类图片\\r\\nurl:30%外链 sort:10%排序号\\r\\nis_show|get_name_by_status:10%显示\\r\\nid:10%操作:[EDIT]|编辑,[DELETE]|删除'), 'weisite_cms' => array('field_sort' => '{"1":["keyword","keyword_type","title","intro","cate_id","cover","content","sort"]}', 'list_grid' => 'keyword:关键词\\r\\nkeyword_type|get_name_by_status:关键词类型\\r\\ntitle:标题\\r\\ncate_id:所属分类\\r\\nsort:排序号\\r\\nview_count:浏览数\\r\\nid:操作:[EDIT]&module_id=[pid]|编辑,[DELETE]|删除'), 'weisite_slideshow' => array('list_grid' => 'title:标题\\r\\nimg:图片\\r\\nurl:链接地址\\r\\nis_show|get_name_by_status:显示\\r\\nsort:排序\\r\\nid:操作:[EDIT]&module_id=[pid]|编辑,[DELETE]|删除'));
开发者ID:cnspica,项目名称:weilian,代码行数:30,代码来源:update_db_tool.php
示例12: e3_insert_into_conges_config
function e3_insert_into_conges_config($DEBUG = FALSE)
{
$PHP_SELF = $_SERVER['PHP_SELF'];
// verif si le fichier "data_conges_config_v1.1.sql" (qui contient les requetes INSERT)existe et est lisible ....
// la verif a du etre faite en debut de la procedure d'install ...
$result = execute_sql_file("sql/data_conges_config_v1.1.sql", $DEBUG);
if ($DEBUG) {
if (!$result) {
echo "erreur : e3_insert_into_conges_config<br>execute_sql_file(\"sql/data_conges_config_v1.1.sql\")...\n";
exit;
}
}
}
开发者ID:kakargias,项目名称:php-conges,代码行数:13,代码来源:upgrade_from_v1.0.php
示例13: lance_maj
//.........这里部分代码省略.........
echo "<a href=\"{$PHP_SELF}?etape=3&version={$installed_version}&lang={$lang}\">" . _('install_etape') . " 2 OK</a><br>\n";
}
}
} else {
if (!$DEBUG) {
echo "<META HTTP-EQUIV=REFRESH CONTENT=\"0; URL={$PHP_SELF}?etape=3&version={$installed_version}&lang={$lang}\">";
} else {
echo "<a href=\"{$PHP_SELF}?etape=3&version={$installed_version}&lang={$lang}\">" . _('install_etape') . " 2 OK</a><br>\n";
}
}
} elseif ($etape == 3) {
// ATTENTION on ne passe cette étape que si on est en version inferieure à 1.0 ! (donc en v0.xxx) (sinon on passe à l'étape 4)
if (substr($installed_version, 0, 1) != "0") {
if (!$DEBUG) {
echo "<META HTTP-EQUIV=REFRESH CONTENT=\"0; URL={$PHP_SELF}?etape=4&version={$installed_version}&lang={$lang}\">";
} else {
echo "<a href=\"{$PHP_SELF}?etape=4&version={$installed_version}&lang={$lang}\">" . _('install_etape') . " 3 OK</a><br>\n";
}
} else {
//on lance l'execution de fichier sql de migration l'un après l'autre jusqu a la version 0.10.1 ..
$db_version = explode(".", $installed_version);
$db_sub_version = (int) $db_version[1];
for ($i = $db_sub_version; $i <= 10; $i++) {
if ($i == 10) {
// si on en est à v0.10 on passe en v1.0
$sql_file = "sql/upgrade_v0.10_to_v1.0.sql";
} else {
$j = $i + 1;
$sql_file = "sql/upgrade_v0." . $i . "_to_v0." . $j . ".sql";
}
if ($DEBUG) {
echo "sql_file = {$sql_file}<br>\n";
}
execute_sql_file($sql_file, $DEBUG);
}
if (!$DEBUG) {
echo "<META HTTP-EQUIV=REFRESH CONTENT=\"0; URL={$PHP_SELF}?etape=4&version=1.0&lang={$lang}\">";
} else {
echo "<a href=\"{$PHP_SELF}?etape=4&version=1.0&lang={$lang}\">" . _('install_etape') . " 3 OK</a><br>\n";
}
}
} elseif ($etape == 4) {
// on est au moins à la version 1.0 ....
// ensuite tout se fait en php (plus de script de migration sql)
// on determine la version la + élevée entre $installed_version et 1.0 , et on part de celle là !
if (substr($installed_version, 0, 1) == "0") {
$start_version = "1.0";
} else {
$start_version = $installed_version;
}
//on lance l'execution (include) des scripts d'upgrade l'un après l'autre jusqu a la version voulue ($config_php_conges_version) ..
if ($start_version == "1.0") {
$file_upgrade = 'upgrade_from_v1.0.php';
$new_installed_version = "1.1";
// execute le script php d'upgrade de la version1.0 (vers la suivante (1.1))
echo "<META HTTP-EQUIV=REFRESH CONTENT=\"0; URL={$file_upgrade}?version={$new_installed_version}&lang={$lang}\">";
} elseif ($start_version == "1.1") {
$file_upgrade = 'upgrade_from_v1.1.php';
$new_installed_version = "1.1.1";
// execute le script php d'upgrade de la version1.1 (vers la suivante (1.1.1))
echo "<META HTTP-EQUIV=REFRESH CONTENT=\"0; URL={$file_upgrade}?version={$new_installed_version}&lang={$lang}\">";
} elseif ($start_version == "1.1.1") {
$file_upgrade = 'upgrade_from_v1.1.1.php';
$new_installed_version = "1.2";
// execute le script php d'upgrade de la version1.1.1 (vers la suivante (1.2))
echo "<META HTTP-EQUIV=REFRESH CONTENT=\"0; URL={$file_upgrade}?version={$new_installed_version}&lang={$lang}\">";
开发者ID:kakargias,项目名称:php-conges,代码行数:67,代码来源:mise_a_jour.php
示例14: sysupdate
public function sysupdate()
{
//SQL更新
$update_sql = './Update/update.sql';
if (file_exists($update_sql)) {
execute_sql_file($update_sql);
}
$this->success('系统更新完成', U('index'));
}
开发者ID:fedkey,项目名称:amango,代码行数:9,代码来源:AddonsController.class.php
注:本文中的execute_sql_file函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论