当前位置: 首页>>代码示例>>PHP>>正文


PHP split_sql_file函数代码示例

本文整理汇总了PHP中split_sql_file函数的典型用法代码示例。如果您正苦于以下问题:PHP split_sql_file函数的具体用法?PHP split_sql_file怎么用?PHP split_sql_file使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了split_sql_file函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: hs_install

function hs_install()
{
    global $CONFIG, $thisplugin, $lang_plugin_highslide_install;
    require 'plugins/highslide/include/init.inc.php';
    if ($_POST['submit'] == $lang_plugin_highslide_install['button_install']) {
        if (!isset($CONFIG['highslide_enable'])) {
            require 'include/sql_parse.php';
            $query = "INSERT INTO " . $CONFIG['TABLE_CONFIG'] . " VALUES ('highslide_enable', '1');";
            cpg_db_query($query);
            // create table
            $db_schema = $thisplugin->fullpath . '/schema.sql';
            $sql_query = fread(fopen($db_schema, 'r'), filesize($db_schema));
            $sql_query = preg_replace('/CPG_/', $CONFIG['TABLE_PREFIX'], $sql_query);
            $sql_query = remove_remarks($sql_query);
            $sql_query = split_sql_file($sql_query, ';');
            foreach ($sql_query as $q) {
                cpg_db_query($q);
            }
            // Put default setting
            $db_schema = $thisplugin->fullpath . '/basic.sql';
            $sql_query = fread(fopen($db_schema, 'r'), filesize($db_schema));
            $sql_query = preg_replace('/CPG_/', $CONFIG['TABLE_PREFIX'], $sql_query);
            $sql_query = remove_remarks($sql_query);
            $sql_query = split_sql_file($sql_query, ';');
            foreach ($sql_query as $q) {
                cpg_db_query($q);
            }
        }
        return true;
    } else {
        return 1;
    }
}
开发者ID:phill104,项目名称:branches,代码行数:33,代码来源:codebase.php

示例2: newsletter_install

function newsletter_install()
{
    global $CONFIG, $newsletter_installation, $thisplugin, $USER_DATA, $lang_plugin_newsletter;
    // Create the super cage
    $superCage = Inspekt::makeSuperCage();
    $newsletter_installation = 1;
    require 'include/sql_parse.php';
    // Perform the database changes
    $db_schema = $thisplugin->fullpath . '/schema.sql';
    $sql_query = fread(fopen($db_schema, 'r'), filesize($db_schema));
    $sql_query = preg_replace('/CPG_/', $CONFIG['TABLE_PREFIX'], $sql_query);
    $sql_query = preg_replace('/ADMIN_EMAIL/', $CONFIG['gallery_admin_email'], $sql_query);
    $sql_query = preg_replace('/ADMIN_USERNAME/', $USER_DATA['user_name'], $sql_query);
    $sql_query = preg_replace('/COPPERMINE_SITE_NAME/', $CONFIG['gallery_name'], $sql_query);
    $sql_query = remove_remarks($sql_query);
    $sql_query = split_sql_file($sql_query, ';');
    foreach ($sql_query as $q) {
        cpg_db_query($q);
    }
    // Set the plugin config defaults
    $plugin_config_defaults = array('plugin_newsletter_guest_subscriptions' => '0', 'plugin_newsletter_salutation_for_guests' => 'Dear subscriber,', 'plugin_newsletter_from_email' => $CONFIG['gallery_admin_email'], 'plugin_newsletter_from_name' => $USER_DATA['user_name'], 'plugin_newsletter_mails_per_page' => '1', 'plugin_newsletter_page_refresh_delay' => '10', 'plugin_newsletter_admin_menu_links' => '1', 'plugin_newsletter_visitor_menu_links' => '2', 'plugin_newsletter_retries' => '2', 'plugin_newsletter_default_on_register' => '0');
    foreach ($plugin_config_defaults as $key => $value) {
        if (!$CONFIG[$key]) {
            $CONFIG[$key] = $value;
        }
    }
    if ($superCage->post->keyExists('submit')) {
        newsletter_configuration_submit();
        return true;
    } else {
        return 1;
    }
}
开发者ID:phill104,项目名称:branches,代码行数:33,代码来源:codebase.php

示例3: update_history_install

function update_history_install()
{
    $superCage = Inspekt::makeSuperCage();
    global $CONFIG, $lang_plugin_update_history_config, $thisplugin;
    require 'plugins/update_history/include/init.inc.php';
    if ($superCage->post->getAlnum('submit') == $lang_plugin_update_history_config['button_install']) {
        require 'include/sql_parse.php';
        //if(!isset($CONFIG['fex_enable'])) {
        //	$query="INSERT INTO ".$CONFIG['TABLE_CONFIG']." VALUES ('fex_enable', '1');";
        //	cpg_db_query($query);
        // create table
        $db_schema = $thisplugin->fullpath . '/schema.sql';
        $sql_query = fread(fopen($db_schema, 'r'), filesize($db_schema));
        $sql_query = preg_replace('/CPG_/', $CONFIG['TABLE_PREFIX'], $sql_query);
        $sql_query = remove_remarks($sql_query);
        $sql_query = split_sql_file($sql_query, ';');
        foreach ($sql_query as $q) {
            cpg_db_query($q);
        }
        // Put default setting
        $db_schema = $thisplugin->fullpath . '/basic.sql';
        $sql_query = fread(fopen($db_schema, 'r'), filesize($db_schema));
        $sql_query = preg_replace('/CPG_/', $CONFIG['TABLE_PREFIX'], $sql_query);
        $sql_query = remove_remarks($sql_query);
        $sql_query = split_sql_file($sql_query, ';');
        foreach ($sql_query as $q) {
            cpg_db_query($q);
        }
        //}
        return true;
    } else {
        return 1;
    }
}
开发者ID:phill104,项目名称:branches,代码行数:34,代码来源:codebase.php

示例4: avmaker_configure

function avmaker_configure($stop = true)
{
    global $errors, $CONFIG;
    require 'include/sql_parse.php';
    $db_update = 'plugins/avmaker/sql/basic.sql';
    $sql_query = fread(fopen($db_update, 'r'), filesize($db_update));
    // Update table prefix
    $sql_query = preg_replace('/CPG_/', $CONFIG['TABLE_PREFIX'], $sql_query);
    $sql_query = remove_remarks($sql_query);
    $sql_query = split_sql_file($sql_query, ';');
    ?>
        <h2>Performing Database Updates<h2>
        <table class="maintable">

    <?php 
    foreach ($sql_query as $q) {
        echo "<tr><td class='debug_text' style='color: black;'>\r\n\t\t{$q}\r\n\t\t</td>";
        if (mysql_query($q)) {
            echo "<td class='debug_text' style='color: green;'>OK</td></tr>";
        } else {
            echo "<td class='debug_text' style='color: black;'>Already Done</td></tr>";
        }
    }
    echo "</table>";
    if ($stop) {
        echo <<<EOT

        <form action="{$_SERVER['REQUEST_URI']}" method="post">
            <input type="submit" value="Go!" name="submit" />
        </form>
EOT;
    }
}
开发者ID:phill104,项目名称:branches,代码行数:33,代码来源:codebase.php

示例5: social_bookmarks_install

function social_bookmarks_install()
{
    global $CONFIG, $social_bookmarks_installation, $thisplugin, $USER_DATA, $lang_plugin_social_bookmarks;
    // Create the super cage
    $superCage = Inspekt::makeSuperCage();
    $social_bookmarks_installation = 1;
    require 'include/sql_parse.php';
    // Perform the database changes
    $db_schema = $thisplugin->fullpath . '/schema.sql';
    $sql_query = fread(fopen($db_schema, 'r'), filesize($db_schema));
    $sql_query = preg_replace('/CPG_/', $CONFIG['TABLE_PREFIX'], $sql_query);
    $sql_query = remove_remarks($sql_query);
    $sql_query = split_sql_file($sql_query, ';');
    foreach ($sql_query as $q) {
        cpg_db_query($q);
    }
    // Set the plugin config defaults
    $plugin_config_defaults = array('plugin_social_bookmarks_position' => '2', 'plugin_social_bookmarks_visibility' => '2', 'plugin_social_bookmarks_greyout' => '0', 'plugin_social_bookmarks_layout' => '2', 'plugin_social_bookmarks_columns' => '5', 'plugin_social_bookmarks_smart_language' => '1', 'plugin_social_bookmarks_admin_menu' => '0');
    foreach ($plugin_config_defaults as $key => $value) {
        if (!$CONFIG[$key]) {
            $CONFIG[$key] = $value;
        }
    }
    if ($superCage->post->keyExists('submit')) {
        social_bookmarks_configuration_submit();
        return true;
    } else {
        return 1;
    }
}
开发者ID:phill104,项目名称:branches,代码行数:30,代码来源:codebase.php

示例6: final_extract_install

function final_extract_install()
{
    global $CONFIG, $lang_plugin_final_extract, $lang_plugin_final_extract_config, $thisplugin;
    require 'plugins/final_extract/configuration.php';
    require 'include/sql_parse.php';
    if (!isset($CONFIG['fex_enable'])) {
        $query = "INSERT INTO " . $CONFIG['TABLE_CONFIG'] . " VALUES ('fex_enable', '1');";
        cpg_db_query($query);
        // create table
        $db_schema = $thisplugin->fullpath . '/schema.sql';
        $sql_query = fread(fopen($db_schema, 'r'), filesize($db_schema));
        $sql_query = preg_replace('/CPG_/', $CONFIG['TABLE_PREFIX'], $sql_query);
        $sql_query = remove_remarks($sql_query);
        $sql_query = split_sql_file($sql_query, ';');
        foreach ($sql_query as $q) {
            cpg_db_query($q);
        }
        // Put default setting
        $db_schema = $thisplugin->fullpath . '/basic.sql';
        $sql_query = fread(fopen($db_schema, 'r'), filesize($db_schema));
        $sql_query = preg_replace('/CPG_/', $CONFIG['TABLE_PREFIX'], $sql_query);
        $sql_query = remove_remarks($sql_query);
        $sql_query = split_sql_file($sql_query, ';');
        foreach ($sql_query as $q) {
            cpg_db_query($q);
        }
    }
    return true;
}
开发者ID:phill104,项目名称:branches,代码行数:29,代码来源:codebase.php

示例7: external_edit_install

function external_edit_install()
{
    global $CONFIG, $thisplugin;
    require 'include/sql_parse.php';
    // Perform the database changes
    $db_schema = $thisplugin->fullpath . '/schema.sql';
    $sql_query = fread(fopen($db_schema, 'r'), filesize($db_schema));
    $sql_query = preg_replace('/CPG_/', $CONFIG['TABLE_PREFIX'], $sql_query);
    $sql_query = remove_remarks($sql_query);
    $sql_query = split_sql_file($sql_query, ';');
    foreach ($sql_query as $q) {
        cpg_db_query($q);
    }
    return true;
}
开发者ID:phill104,项目名称:branches,代码行数:15,代码来源:codebase.php

示例8: captcha_install

function captcha_install()
{
    global $CONFIG, $lang_plugin_captcha;
    require 'plugins/captcha/include/init.inc.php';
    require 'include/sql_parse.php';
    // create table
    $db_schema = 'plugins/captcha/schema.sql';
    $sql_query = fread(fopen($db_schema, 'r'), filesize($db_schema));
    $sql_query = preg_replace('/CPG_/', $CONFIG['TABLE_PREFIX'], $sql_query);
    $sql_query = remove_remarks($sql_query);
    $sql_query = split_sql_file($sql_query, ';');
    foreach ($sql_query as $q) {
        cpg_db_query($q);
    }
    return true;
}
开发者ID:alencarmo,项目名称:OCF,代码行数:16,代码来源:codebase.php

示例9: db_init

function db_init()
{
    $password = substr(md5(time() . rand(1, 9999)), rand(1, 20), 12);
    $sql_contents = preg_replace("/(#.+[\r|\n]*)/", '', file_get_contents(AROOT . 'misc' . DS . 'install.sql'));
    // 更换变量
    $sql_contents = str_replace('{password}', md5($password), $sql_contents);
    $sqls = split_sql_file($sql_contents);
    foreach ($sqls as $sql) {
        run_sql($sql);
    }
    if (db_errno() == 0) {
        info_page('数据库初始化成功,请使用【member@teamtoy.net】和【' . $password . '】<a href="/" target="new">登入并添加用户</a>');
        exit;
    } else {
        info_page(db_error());
        exit;
    }
}
开发者ID:ramo01,项目名称:1kapp,代码行数:18,代码来源:app.function.php

示例10: db_init

function db_init()
{
    $password = substr(md5(time() . rand(1, 9999)), rand(1, 20), 12);
    $sql_contents = preg_replace("/(#.+[\r|\n]*)/", '', file_get_contents(AROOT . 'misc' . DS . 'install.sql'));
    // 更换变量
    $sql_contents = str_replace('{password}', md5($password), $sql_contents);
    $sqls = split_sql_file($sql_contents);
    foreach ($sqls as $sql) {
        run_sql($sql);
    }
    if (db_errno() == 0) {
        info_page(__('DATABASE_INIT_FINISHED', $password));
        exit;
    } else {
        info_page(db_error());
        exit;
    }
}
开发者ID:xianliflc,项目名称:teamirr,代码行数:18,代码来源:app.function.php

示例11: potd_install

function potd_install()
{
    global $CONFIG, $thisplugin, $lang_plugin_potd_config;
    require 'plugins/potd/include/init.inc.php';
    if ($_POST['submit'] == $lang_plugin_potd_config['button_done']) {
        require 'include/sql_parse.php';
        $db_schema = $thisplugin->fullpath . '/schema.sql';
        $sql_query = fread(fopen($db_schema, 'r'), filesize($db_schema));
        $sql_query = preg_replace('/CPG_/', $CONFIG['TABLE_PREFIX'], $sql_query);
        $sql_query = remove_remarks($sql_query);
        $sql_query = split_sql_file($sql_query, ';');
        foreach ($sql_query as $q) {
            cpg_db_query($q);
        }
        return true;
    } else {
        return 1;
    }
}
开发者ID:phill104,项目名称:branches,代码行数:19,代码来源:codebase.php

示例12: copperad_install

function copperad_install()
{
    global $CONFIG, $lang_plugin_copperad, $lang_plugin_copperad_config, $thisplugin;
    require 'plugins/copper_ad/include/init.inc.php';
    if ($_POST['submit'] == $lang_plugin_copperad_config['button_install']) {
        if (!isset($CONFIG['cpa_enable'])) {
            require 'include/sql_parse.php';
            $query = "INSERT INTO " . $CONFIG['TABLE_CONFIG'] . " VALUES ('cpa_enable', '1');";
            cpg_db_query($query);
            // Copy needed file and ADV directory ===If you can't CHMODE you gallery then comment these line 40~46 and after installation copy "banner.php.sample" and "bannermgr.php.sample" to your gallery root and remove ".sample" extention.
            copy($thisplugin->fullpath . "/banner.php.sample", "banner.php") or cpg_die(ERROR, $lang_plugin_copperad_config['permission'], __FILE__, __LINE__);
            copy($thisplugin->fullpath . "/bannermgr.php.sample", "bannermgr.php") or cpg_die(ERROR, $lang_plugin_copperad_config['permission'], __FILE__, __LINE__);
            mkdir('adv') or cpg_die(ERROR, $lang_plugin_copperad_config['permission'], __FILE__, __LINE__);
            mkdir('adv/pic') or cpg_die(ERROR, $lang_plugin_copperad_config['permission'], __FILE__, __LINE__);
            mkdir('adv/flash') or cpg_die(ERROR, $lang_plugin_copperad_config['permission'], __FILE__, __LINE__);
            copy($thisplugin->fullpath . "/adv/pic/copperad.jpg", "adv/pic/copperad.jpg") or cpg_die(ERROR, $lang_plugin_copperad_config['permission'], __FILE__, __LINE__);
            copy($thisplugin->fullpath . "/adv/flash/copperad.swf", "adv/flash/copperad.swf") or cpg_die(ERROR, $lang_plugin_copperad_config['permission'], __FILE__, __LINE__);
            // create table
            $db_schema = $thisplugin->fullpath . '/schema.sql';
            $sql_query = fread(fopen($db_schema, 'r'), filesize($db_schema));
            $sql_query = preg_replace('/CPG_/', $CONFIG['TABLE_PREFIX'], $sql_query);
            $sql_query = remove_remarks($sql_query);
            $sql_query = split_sql_file($sql_query, ';');
            foreach ($sql_query as $q) {
                cpg_db_query($q);
            }
            // Put default setting
            $db_schema = $thisplugin->fullpath . '/basic.sql';
            $sql_query = fread(fopen($db_schema, 'r'), filesize($db_schema));
            $sql_query = preg_replace('/CPG_/', $CONFIG['TABLE_PREFIX'], $sql_query);
            $sql_query = remove_remarks($sql_query);
            $sql_query = split_sql_file($sql_query, ';');
            foreach ($sql_query as $q) {
                cpg_db_query($q);
            }
        }
        return true;
    } else {
        return 1;
    }
}
开发者ID:phill104,项目名称:branches,代码行数:41,代码来源:codebase.php

示例13: multi_install

function multi_install()
{
    global $CONFIG, $thisplugin;
    if (isset($_POST['langs'])) {
        require 'include/sql_parse.php';
        $langStr = implode(',', $_POST['langs']);
        // create table
        $db_schema = $thisplugin->fullpath . '/schema.sql';
        $sql_query = fread(fopen($db_schema, 'r'), filesize($db_schema));
        $sql_query = preg_replace('/CPG_/', $CONFIG['TABLE_PREFIX'], $sql_query);
        $sql_query = remove_remarks($sql_query);
        $sql_query = split_sql_file($sql_query, ';');
        $sql_query[] = "REPLACE INTO {$CONFIG['TABLE_CONFIG']} (name, value) VALUES ('mod_active_lang', '{$langStr}')";
        foreach ($sql_query as $q) {
            cpg_db_query($q);
        }
        return true;
    } else {
        return 1;
    }
}
开发者ID:phill104,项目名称:branches,代码行数:21,代码来源:codebase.php

示例14: QuickMSDB

     }
 }
 if (!empty($_POST['write_files'])) {
     $_SESSION['in_arrowchat'] = 1;
     if ($_SESSION['db_type'] == 1) {
         $db = new QuickMSDB($_SESSION['db_host'], $_SESSION['db_username'], $_SESSION['db_password'], $_SESSION['db_name'], false, false);
         $dbms_schema = 'schemas/mssql_schema.sql';
     } else {
         $db = new QuickDB($_SESSION['db_host'], $_SESSION['db_username'], $_SESSION['db_password'], $_SESSION['db_name'], false, false);
         $dbms_schema = 'schemas/mysql_schema.sql';
     }
     $remove_remarks = "remove_remarks";
     $delimiter = ";";
     $sql_query = @file_get_contents($dbms_schema);
     $remove_remarks($sql_query);
     $sql_query = split_sql_file($sql_query, $delimiter);
     foreach ($sql_query as $sql) {
         $db->execute($sql);
     }
     require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . "includes" . DIRECTORY_SEPARATOR . "db_initial_values.php";
     foreach ($sql_ary as $sql) {
         $db->execute($sql);
     }
     write_config_file();
     $rename = write_functions_file();
     update_config_file();
     $success = true;
 }
 if (!$success) {
     $next = array('0' => 'Install', '1' => 'onClick="document.forms[\'final_form\'].submit();"');
     require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . "layout" . DIRECTORY_SEPARATOR . "pages_final_confirm.php";
开发者ID:juliushermosura,项目名称:globeloop,代码行数:31,代码来源:index.php

示例15: table_add

 /**
  * Table Add
  *
  * This only supports input from the array format of db_tools or create_schema_files.
  */
 function table_add($table_name, $table_data = array())
 {
     global $dbms, $user;
     // Multicall
     if (is_array($table_name)) {
         foreach ($table_name as $params) {
             call_user_func_array(array($this, 'table_add'), $params);
         }
         return;
     }
     /**
      * $table_data can be empty when uninstalling a mod and table_remove was used, but no 2rd argument was given.
      * In that case we'll assume that it was a column previously added by the mod (if not the author should specify a 2rd argument) and skip this to prevent an error
      */
     if (empty($table_data)) {
         return;
     }
     $this->get_table_name($table_name);
     $this->umil_start('TABLE_ADD', $table_name);
     if ($this->table_exists($table_name)) {
         return $this->umil_end('TABLE_ALREADY_EXISTS', $table_name);
     }
     if (!is_array($table_data)) {
         return $this->umil_end('NO_TABLE_DATA');
     }
     if (!function_exists('get_available_dbms')) {
         global $phpbb_root_path, $phpEx;
         include "{$phpbb_root_path}includes/functions_install.{$phpEx}";
     }
     if (method_exists($this->db_tools, 'sql_create_table')) {
         // Added in 3.0.5
         $this->db_tools->sql_create_table($table_name, $table_data);
     } else {
         $available_dbms = get_available_dbms($dbms);
         $sql_query = $this->create_table_sql($table_name, $table_data);
         $sql_query = split_sql_file($sql_query, $available_dbms[$dbms]['DELIM']);
         foreach ($sql_query as $sql) {
             $this->db->sql_query($sql);
         }
     }
     return $this->umil_end();
 }
开发者ID:poyntesm,项目名称:phpbbgarage,代码行数:47,代码来源:umil.php


注:本文中的split_sql_file函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。