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


PHP load_conf_from_db函数代码示例

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


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

示例1: plugin_activate

function plugin_activate($id, $version, &$errors)
{
    global $conf;
    /* Cleaning obsolete files */
    /* *********************** */
    PH_Obsolete_Files();
    include_once PH_PATH . 'include/upgradedb.inc.php';
    /* Check database upgrade */
    /* ********************** */
    $conf_PH = unserialize($conf['PruneHistory']);
    if (isset($conf_PH[0])) {
        if (version_compare($conf_PH['PHVersion'], '1.1.0') < 0) {
            /* upgrade from 1.0 to 1.1 */
            /* *********************** */
            upgrade_100_110();
        }
    }
    /* Update plugin version number in #_config table */
    /* and check consistency of #_plugins table       */
    /* ********************************************** */
    PH_version_update();
    /* Reload plugin parameters */
    /* ************************ */
    load_conf_from_db('param like \'PruneHistory\'');
}
开发者ID:Eric-Piwigo,项目名称:Prune_History,代码行数:25,代码来源:maintain.inc.php

示例2: plugin_activate

function plugin_activate($id, $version, &$errors)
{
    global $conf;
    /* Cleaning obsolete files */
    /* *********************** */
    regfluxbb_obsolete_files();
    include_once REGFLUXBB_PATH . 'include/upgradedb.inc.php';
    /* Database upgrade */
    /* **************** */
    $conf_RegFluxBB = isset($conf['Register_FluxBB']) ? explode(";", $conf['Register_FluxBB']) : array();
    if (isset($conf_RegFluxBB[0]) and strpos($conf_RegFluxBB[0], "{") === false) {
        upgrade_240_250();
    }
    /* Check database upgrade for version > 2.5.0 */
    /* ****************************************** */
    $conf_Register_FluxBB = unserialize($conf['Register_FluxBB']);
    if (isset($conf_Register_FluxBB['REGFLUXBB_VERSION'])) {
        if (version_compare($conf_Register_FluxBB['REGFLUXBB_VERSION'], '2.5.5') < 0) {
            /* upgrade from 2.5.x to 2.5.5 */
            /* *************************** */
            upgrade_250_255();
        }
    }
    /* Update plugin version number in #_config table */
    /* and check consistency of #_plugins table       */
    /* ********************************************** */
    RegFluxBB_version_update();
    /* Reload plugin parameters */
    /* ************************ */
    load_conf_from_db('param like \'Register_FluxBB\'');
}
开发者ID:Eric-Piwigo,项目名称:Register_FluxBB,代码行数:31,代码来源:maintain.inc.php

示例3: plugin_activate

function plugin_activate($id, $version, &$errors)
{
    global $conf;
    /* Cleaning obsolete files */
    /* *********************** */
    CM_Obsolete_Files();
    include_once CM_PATH . 'include/upgradedb.inc.php';
    $conf_CM = unserialize($conf['CommentsManager']);
    // Database upgrade process
    if (isset($conf_CM[0])) {
        $conf_CM = unserialize($conf['CommentsManager']);
        // upgrade from 2.2.0 to 2.2.1
        if (version_compare($conf_CM[0], '2.2.1') < 0) {
            upgradeCM_220_221();
        }
        // upgrade from 2.2.1 to 2.2.2
        if (version_compare($conf_CM[0], '2.2.2') < 0) {
            upgradeCM_221_222();
        }
        // upgrade from 2.4 to 2.5
        if (version_compare($conf_CM[0], '2.5.0') < 0) {
            upgradeCM_240_250();
        }
        // Preset for future upgrades
        //  if (isset($conf_CM['CMVersion']))
        //  {
        //  }
    }
    // Update plugin version number in #_config table and check consistency of #_plugins table
    CM_version_update();
    load_conf_from_db('param like \'CommentsManager\'');
}
开发者ID:Eric-Piwigo,项目名称:Comments_Access_Manager,代码行数:32,代码来源:maintain.inc.php

示例4: activate

 function activate($theme_version, &$errors = array())
 {
     global $conf, $prefixeTable;
     if (empty($conf['smartpocket'])) {
         $conf['smartpocket'] = serialize($this->default_conf);
         $query = "\n  INSERT INTO " . CONFIG_TABLE . " (param,value,comment)\n  VALUES ('smartpocket' , '" . pwg_db_real_escape_string($conf['smartpocket']) . "' , 'loop#autohide');";
         pwg_query($query);
     } elseif (count(unserialize($conf['smartpocket'])) != 2) {
         $conff = unserialize($conf['smartpocket']);
         $config = array('loop' => !empty($conff['loop']) ? $conff['loop'] : true, 'autohide' => !empty($conff['autohide']) ? $conff['autohide'] : 5000);
         conf_update_param('smartpocket', pwg_db_real_escape_string(serialize($config)));
         load_conf_from_db();
     }
     $this->installed = true;
 }
开发者ID:HassenLin,项目名称:piwigo_utf8filename,代码行数:15,代码来源:maintain.inc.php

示例5: execute_sqlfile

        // We fill the tables with basic informations
        execute_sqlfile(PHPWG_ROOT_PATH . 'install/config.sql', DEFAULT_PREFIX_TABLE, $prefixeTable, 'mysql');
        $query = '
INSERT INTO ' . $prefixeTable . 'config (param,value,comment) 
   VALUES (\'secret_key\',md5(' . pwg_db_cast_to_text(DB_RANDOM_FUNCTION . '()') . '),
   \'a secret key specific to the gallery for internal use\');';
        pwg_query($query);
        conf_update_param('piwigo_db_version', get_branch_from_version(PHPWG_VERSION));
        conf_update_param('gallery_title', l10n('Just another Piwigo gallery'));
        conf_update_param('page_banner', '<h1>%gallery_title%</h1>' . "\n\n<p>" . l10n('Welcome to my photo gallery') . '</p>');
        // fill languages table
        foreach ($languages->fs_languages as $language_code => $fs_language) {
            $languages->perform_action('activate', $language_code);
        }
        // fill $conf global array
        load_conf_from_db();
        // PWG_CHARSET is required for building the fs_themes array in the
        // themes class
        if (!defined('PWG_CHARSET')) {
            define('PWG_CHARSET', 'utf-8');
        }
        activate_core_themes();
        activate_core_plugins();
        $insert = array('id' => 1, 'galleries_url' => PHPWG_ROOT_PATH . 'galleries/');
        mass_inserts(SITES_TABLE, array_keys($insert), array($insert));
        // webmaster admin user
        $inserts = array(array('id' => 1, 'username' => $admin_name, 'password' => md5($admin_pass1), 'mail_address' => $admin_mail), array('id' => 2, 'username' => 'guest'));
        mass_inserts(USERS_TABLE, array_keys($inserts[0]), $inserts);
        create_user_infos(array(1, 2), array('language' => $language));
        // Available upgrades must be ignored after a fresh installation. To
        // make PWG avoid upgrading, we must tell it upgrades have already been
开发者ID:thunderrabbit,项目名称:Piwigo,代码行数:31,代码来源:install.php

示例6: perform_action

    /**
     * Perform requested actions
     * @param string - action
     * @param string - plugin id
     * @param array - errors
     */
    function perform_action($action, $plugin_id, $options = array())
    {
        if (isset($this->db_plugins_by_id[$plugin_id])) {
            $crt_db_plugin = $this->db_plugins_by_id[$plugin_id];
        }
        if ($action !== 'update') {
            // wait for files to be updated
            $plugin_maintain = self::build_maintain_class($plugin_id);
        }
        $errors = array();
        switch ($action) {
            case 'install':
                if (!empty($crt_db_plugin) or !isset($this->fs_plugins[$plugin_id])) {
                    break;
                }
                $plugin_maintain->install($this->fs_plugins[$plugin_id]['version'], $errors);
                if (empty($errors)) {
                    $query = '
INSERT INTO ' . PLUGINS_TABLE . ' (id,version)
  VALUES (\'' . $plugin_id . '\', \'' . $this->fs_plugins[$plugin_id]['version'] . '\')
;';
                    pwg_query($query);
                }
                break;
            case 'update':
                $previous_version = $this->fs_plugins[$plugin_id]['version'];
                $errors[0] = $this->extract_plugin_files('upgrade', $options['revision'], $plugin_id);
                if ($errors[0] === 'ok') {
                    $this->get_fs_plugin($plugin_id);
                    // refresh plugins list
                    $new_version = $this->fs_plugins[$plugin_id]['version'];
                    $plugin_maintain = self::build_maintain_class($plugin_id);
                    $plugin_maintain->update($previous_version, $new_version, $errors);
                    if ($new_version != 'auto') {
                        $query = '
UPDATE ' . PLUGINS_TABLE . '
  SET version=\'' . $new_version . '\'
  WHERE id=\'' . $plugin_id . '\'
;';
                        pwg_query($query);
                    }
                }
                break;
            case 'activate':
                if (!isset($crt_db_plugin)) {
                    $errors = $this->perform_action('install', $plugin_id);
                    list($crt_db_plugin) = get_db_plugins(null, $plugin_id);
                    load_conf_from_db();
                } elseif ($crt_db_plugin['state'] == 'active') {
                    break;
                }
                if (empty($errors)) {
                    $plugin_maintain->activate($crt_db_plugin['version'], $errors);
                }
                if (empty($errors)) {
                    $query = '
UPDATE ' . PLUGINS_TABLE . '
  SET state=\'active\'
  WHERE id=\'' . $plugin_id . '\'
;';
                    pwg_query($query);
                }
                break;
            case 'deactivate':
                if (!isset($crt_db_plugin) or $crt_db_plugin['state'] != 'active') {
                    break;
                }
                $query = '
UPDATE ' . PLUGINS_TABLE . '
  SET state=\'inactive\'
  WHERE id=\'' . $plugin_id . '\'
;';
                pwg_query($query);
                $plugin_maintain->deactivate();
                break;
            case 'uninstall':
                if (!isset($crt_db_plugin)) {
                    break;
                }
                if ($crt_db_plugin['state'] == 'active') {
                    $this->perform_action('deactivate', $plugin_id);
                }
                $query = '
DELETE FROM ' . PLUGINS_TABLE . '
  WHERE id=\'' . $plugin_id . '\'
;';
                pwg_query($query);
                $plugin_maintain->uninstall();
                break;
            case 'restore':
                $this->perform_action('uninstall', $plugin_id);
                unset($this->db_plugins_by_id[$plugin_id]);
                $errors = $this->perform_action('activate', $plugin_id);
                break;
//.........这里部分代码省略.........
开发者ID:lcorbasson,项目名称:Piwigo,代码行数:101,代码来源:plugins.class.php

示例7: str_replace

                if (isset($_POST[$nbm_user['param']])) {
                    $value = $_POST[$nbm_user['param']];
                    $query = '
update
' . CONFIG_TABLE . '
set
  value = \'' . str_replace("\\'", "''", $value) . '\'
where
  param = \'' . $nbm_user['param'] . '\';';
                    pwg_query($query);
                    $updated_param_count += 1;
                }
            }
            $page['infos'][] = l10n_dec('%d parameter was updated.', '%d parameters were updated.', $updated_param_count);
            // Reload conf with new values
            load_conf_from_db('param like \'nbm\\_%\'');
        }
    case 'subscribe':
        if (isset($_POST['falsify']) and isset($_POST['cat_true'])) {
            $check_key_treated = unsubscribe_notification_by_mail(true, $_POST['cat_true']);
            do_timeout_treatment('cat_true', $check_key_treated);
        } else {
            if (isset($_POST['trueify']) and isset($_POST['cat_false'])) {
                $check_key_treated = subscribe_notification_by_mail(true, $_POST['cat_false']);
                do_timeout_treatment('cat_false', $check_key_treated);
            }
        }
        break;
    case 'send':
        if (isset($_POST['send_submit']) and isset($_POST['send_selection']) and isset($_POST['send_customize_mail_content'])) {
            $check_key_treated = do_action_send_mail_notification('send', $_POST['send_selection'], stripslashes($_POST['send_customize_mail_content']));
开发者ID:donseba,项目名称:Piwigo,代码行数:31,代码来源:notification_by_mail.php

示例8: plugin_activate


//.........这里部分代码省略.........
            /* ******************************** */
            upgrade_213_214();
        }
        /* upgrade from branch 2.14 to 2.15 */
        /* ******************************** */
        upgrade_214_215();
    }
    /* Old version is > 2.15 */
    /* ********************* */
    $query = '
SELECT param
  FROM ' . CONFIG_TABLE . '
WHERE param = "UserAdvManager_Redir"
;';
    $count = pwg_db_num_rows(pwg_query($query));
    if ($count == 0) {
        upgrade_2153_2154();
    }
    /* Check for upgrade from 2.15 to 2.16 */
    /* *********************************** */
    $query = '
SELECT param
  FROM ' . CONFIG_TABLE . '
WHERE param = "UserAdvManager_Version"
;';
    $count = pwg_db_num_rows(pwg_query($query));
    if ($count == 0) {
        /* upgrade from branch 2.15 to 2.16 */
        /* ******************************** */
        upgrade_215_2160();
    }
    /* Check database upgrade since version 2.16.0 */
    /* ******************************************* */
    if (isset($conf['UserAdvManager_Version'])) {
        if (version_compare($conf['UserAdvManager_Version'], '2.20.0') < 0) {
            /* upgrade from branch 2.16 to 2.20 */
            /* ******************************** */
            upgrade_216_220();
        }
        if (version_compare($conf['UserAdvManager_Version'], '2.20.4') < 0) {
            /* upgrade from version 2.20.3 to 2.20.4 */
            /* ************************************* */
            upgrade_2203_2204();
        }
        if (version_compare($conf['UserAdvManager_Version'], '2.20.7') < 0) {
            /* upgrade from version 2.20.4 to 2.20.7 */
            /* ************************************* */
            upgrade_2204_2207();
        }
        if (version_compare($conf['UserAdvManager_Version'], '2.20.8') < 0) {
            /* upgrade from version 2.20.7 to 2.20.8 */
            /* ************************************* */
            upgrade_2207_2208();
        }
        if (version_compare($conf['UserAdvManager_Version'], '2.30.0') < 0) {
            /* upgrade from version 2.20.8 to 2.30.0 */
            /* ************************************* */
            upgrade_2208_2300();
        }
        if (version_compare($conf['UserAdvManager_Version'], '2.30.2') < 0) {
            /* upgrade from version 2.30.x to 2.30.2 */
            /* ************************************* */
            upgrade_2300_2302();
        }
        if (version_compare($conf['UserAdvManager_Version'], '2.40.0') < 0) {
            /* upgrade from version 2.30.x to 2.40.0 */
            /* ************************************* */
            upgrade_2300_2400();
        }
        if (version_compare($conf['UserAdvManager_Version'], '2.41.0') < 0) {
            /* upgrade from version 2.40.x to 2.41.0 */
            /* ************************************* */
            upgrade_2400_2410();
        }
        if (version_compare($conf['UserAdvManager_Version'], '2.50.0') < 0) {
            /* upgrade from version 2.41.x to 2.50.0 */
            /* ************************************* */
            upgrade_2410_2500();
        }
        if (version_compare($conf['UserAdvManager_Version'], '2.50.11') < 0) {
            /* upgrade from version 2.50.x to 2.50.11 */
            /* ************************************** */
            upgrade_2500_25011();
        }
        if (version_compare($conf['UserAdvManager_Version'], '2.51.0') < 0) {
            /* upgrade from version 2.50.x to 2.51.0 */
            /* ************************************* */
            upgrade_2500_2510();
        }
        if (version_compare($conf['UserAdvManager_Version'], '2.70.3') < 0) {
            /* upgrade from version 2.51.0 to 2.70.3 */
            /* ************************************* */
            upgrade_2510_2703();
        }
    }
    // Update plugin version number in #_config table and check consistency of #_plugins table
    // ---------------------------------------------------------------------------------------
    UAM_version_update();
    load_conf_from_db('param like \'UserAdvManager\\_%\'');
}
开发者ID:Eric-Piwigo,项目名称:UserAdvManager,代码行数:101,代码来源:maintain.inc.php


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