• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP initialise_cfg函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: costcenter_custom_contexts_setup

    /**
     * Test case for custom context classes
     */
    public function costcenter_custom_contexts_setup() {
     
        global $CFG;
        static $customcontexts = array(
            27 => 'context_costcenter'
       
        );

        // save any existing custom contexts
        $existingcustomcontexts = get_config(null, 'custom_context_classes');

        set_config('custom_context_classes', serialize($customcontexts));
        initialise_cfg();
        context_helper::reset_levels();
        $alllevels = context_helper::get_all_levels();
        
      ///  $this->assertEquals($alllevels[11], 'context_costcenter');
        

        // clean-up & restore any custom contexts
        //set_config('custom_context_classes', ($existingcustomcontexts === false) ? null : $existingcustomcontexts);
       // initialise_cfg();
       // context_helper::reset_levels();
      //  $alllevels = context_helper::get_all_levels();
        
      //  print_object($alllevels);
    }
开发者ID:narasimhaeabyas,项目名称:tataaiapro,代码行数:30,代码来源:costcenter_contextlib.php


示例2: initialise_cfg

 /**
  * Load global $CFG;
  * @internal
  * @static
  * @return void
  */
 public static function initialise_cfg()
 {
     global $DB;
     $dbhash = false;
     try {
         $dbhash = $DB->get_field('config', 'value', array('name' => 'phpunittest'));
     } catch (Exception $e) {
         // not installed yet
         initialise_cfg();
         return;
     }
     if ($dbhash !== core_component::get_all_versions_hash()) {
         // do not set CFG - the only way forward is to drop and reinstall
         return;
     }
     // standard CFG init
     initialise_cfg();
 }
开发者ID:sumitnegi933,项目名称:Moodle_lms_New,代码行数:24,代码来源:util.php


示例3: setup_validate_php_configuration

// Messagelib functions
require_once $CFG->libdir . '/modinfolib.php';
// Cached information on course-module instances
// make sure PHP is not severly misconfigured
setup_validate_php_configuration();
// Connect to the database
setup_DB();
// Disable errors for now - needed for installation when debug enabled in config.php
if (isset($CFG->debug)) {
    $originalconfigdebug = $CFG->debug;
    unset($CFG->debug);
} else {
    $originalconfigdebug = -1;
}
// Load up any configuration from the config table
initialise_cfg();
// Verify upgrade is not running unless we are in a script that needs to execute in any case
if (!defined('NO_UPGRADE_CHECK') and isset($CFG->upgraderunning)) {
    if ($CFG->upgraderunning < time()) {
        unset_config('upgraderunning');
    } else {
        print_error('upgraderunning');
    }
}
// Turn on SQL logging if required
if (!empty($CFG->logsql)) {
    $DB->set_logging(true);
}
// Prevent warnings from roles when upgrading with debug on
if (isset($CFG->debug)) {
    $originaldatabasedebug = $CFG->debug;
开发者ID:hatone,项目名称:moodle,代码行数:31,代码来源:setup.php


示例4: reset_all_data

 /**
  * Reset contents of all database tables to initial values, reset caches, etc.
  */
 public static function reset_all_data()
 {
     // Reset database.
     self::reset_database();
     // Purge dataroot directory.
     self::reset_dataroot();
     // Reset all static caches.
     accesslib_clear_all_caches(true);
     // Reset the nasty strings list used during the last test.
     nasty_strings::reset_used_strings();
     filter_manager::reset_caches();
     // Reset course and module caches.
     if (class_exists('format_base')) {
         // If file containing class is not loaded, there is no cache there anyway.
         format_base::reset_course_cache(0);
     }
     get_fast_modinfo(0, 0, true);
     // Inform data generator.
     self::get_data_generator()->reset();
     // Initialise $CFG with default values. This is needed for behat cli process, so we don't have modified
     // $CFG values from the old run. @see set_config.
     initialise_cfg();
 }
开发者ID:janeklb,项目名称:moodle,代码行数:26,代码来源:util.php


示例5: costcenter_custom_contexts_setup

 function costcenter_custom_contexts_setup() {
     
        global $CFG;
        static $customcontexts = array(
            27 => 'context_costcenter'
       
        );

        // save any existing custom contexts
        $existingcustomcontexts = get_config(null, 'custom_context_classes');

        set_config('custom_context_classes', serialize($customcontexts));
        initialise_cfg();
        context_helper::reset_levels();
        $alllevels = context_helper::get_all_levels();        

    }
开发者ID:narasimhaeabyas,项目名称:tataaiapro,代码行数:17,代码来源:moodlelib.php


示例6: test_customcontexts

 /**
  * Test case for custom context classes
  */
 public function test_customcontexts()
 {
     global $CFG;
     static $customcontexts = array(11 => 'context_bogus1', 12 => 'context_bogus2', 13 => 'context_bogus3');
     // save any existing custom contexts
     $existingcustomcontexts = get_config(null, 'custom_context_classes');
     set_config('custom_context_classes', serialize($customcontexts));
     initialise_cfg();
     context_helper::reset_levels();
     $alllevels = context_helper::get_all_levels();
     $this->assertEquals($alllevels[11], 'context_bogus1');
     $this->assertEquals($alllevels[12], 'context_bogus2');
     $this->assertEquals($alllevels[13], 'context_bogus3');
     // clean-up & restore any custom contexts
     set_config('custom_context_classes', $existingcustomcontexts === false ? null : $existingcustomcontexts);
     initialise_cfg();
     context_helper::reset_levels();
 }
开发者ID:evltuma,项目名称:moodle,代码行数:21,代码来源:customcontext_test.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP initialise_filepicker函数代码示例发布时间:2022-05-15
下一篇:
PHP init_var函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap