/** * Constructor * * @access public */ public function __construct() { self::$config = config_load('authentication'); $this->db = new Database(); $this->session = new Session(); $this->auto_login(); $this->delete_inactive_users(); }
/** * Constructor * * @access public */ public function __construct() { if (!extension_loaded('pdo')) { die('The PDO extension is required.'); } self::$config = config_load('database'); self::connect(); }
/** * 从configure file中读取配置并写入conf对象中<p> * @param string $conf_dir : directory of configure file * @param string $conf_file: name of configure file * @param object &$conf: 提供了load($arr)方法的对象 * @return true on success or false on failure */ function bigpipe_load_file($conf_dir, $conf_file, &$conf) { $content = config_load($conf_dir, $conf_file); if (false === $content) { BigpipeLog::warning('[%s:%u][%s][fail to load config file][path:%s][file:%s]', __FILE__, __LINE__, __FUNCTION__, $conf_dir, $conf_file); return false; } return $conf->load($content); }
public function setUp() { $conf_dir = './conf'; $conf_file = 'test_queue_util.conf'; $conf_content = config_load($conf_dir, $conf_file); $this->meta_conf = $conf_content['meta']; $this->queue_conf = $conf_content['UTIL']; $this->stub_meta = $this->getMockBuilder('BigpipeMetaManager')->disableOriginalConstructor()->getMock(); BigpipeQueueAdministrationTools::$unittest = true; }
/** * Constructor * * @access public */ public function __construct() { self::$config = config_load('cart'); $this->db = new Database(); $this->session = new Session(); $this->error = new Error(); $this->delete_carts(); if (!$this->session->get('cart_session')) { $this->cart_session(); } }
/** * Load a config item */ function config_item($name, $item) { static $config_item = array(); if (!isset($config_item[$item])) { $config = config_load($name); if (!isset($config[$item])) { return FALSE; } $config_item[$item] = $config[$item]; } return $config_item[$item]; }
function &getConfig($reload = false) { if (!isset($this->config) || $reload) { if (isset($_SESSION['load_count'])) { $_SESSION['load_count'] += 1; } else { $_SESSION['load_count'] = 1; } $configinstance = config_load(); $this->config =& parse_config($configinstance); } return $this->config; }
function system_init() { system_sanitizequery(); system_unregister_globals(); system_prepare_iis(); $GLOBALS['fpdb'] = new FPDB(); $GLOBALS['fp_widgets'] = new widget_indexer(); $GLOBALS['smarty'] =& $GLOBALS['_FP_SMARTY']; $smarty =& $GLOBALS['smarty']; $GLOBALS['fp_config'] = config_load(); cookie_setup(); sess_setup(); user_loggedin(); ob_start(); $GLOBALS['theme'] = theme_loadsettings(); $GLOBALS['lang'] = lang_load(); plugin_loadall(); // init smarty $smarty->compile_dir = CACHE_DIR; $smarty->cache_dir = SMARTY_DIR . 'cache/'; $smarty->caching = 0; do_action('init'); ob_end_clean(); }
<?php /*! pimpmylog - 1.7.10 - 65d6f147e509133fc5f09642ba82b149ef750ef2*/ /* * pimpmylog * http://pimpmylog.com * * Copyright (c) 2015 Potsky, contributors * Licensed under the GPLv3 license. */ include_once 'global.inc.php'; list($badges, $files) = config_load(); /* |-------------------------------------------------------------------------- | Login |-------------------------------------------------------------------------- | */ if (!Sentinel::isAuthSet()) { die; } $current_user = Sentinel::attempt($files); /* |-------------------------------------------------------------------------- | Error handling |-------------------------------------------------------------------------- | */ function myErrorHandler($errno, $errstr, $errfile, $errline) { global $return;
/** * Constructor * * @access public */ public function __construct() { self::$config = config_load('upload'); $this->error = new Error(); }
/** * Constructor * * @access public */ public function __construct($tpl_path) { self::$config = config_load('template'); $this->tpl_path = $tpl_path; }
function config_section_exists($key) { global $AUR_CONFIG; config_load(); return array_key_exists($key, $AUR_CONFIG); }
} // html header function admin_title($title, $sep) { global $lang; return $title = "{$title} {$sep} {$lang['admin']['head']}"; } add_filter('wp_title', 'admin_title', 10, 2); // setup admin_header function admin_header_default_action() { global $panel, $action; do_action("admin_{$panel}_{$action}_head"); } add_filter('admin_head', 'admin_header_default_action'); $fp_config = config_load(); system_init(); main(); admin_panelstrings('admin.' . ADMIN_PANEL); theme_init($smarty); $smarty->register_function('controlpanel', 'showcontrolpanel'); $v = $lang['admin'][$panel][$action]; $smarty->assign_by_ref('panelstrings', $v); $smarty->assign_by_ref('plang', $v); if (isset($_GET['mod'])) { switch ($_GET['mod']) { case 'inline': $smarty->display(ABS_PATH . ADMIN_DIR . 'admin-inline.tpl'); break; case 'ajax': echo $smarty->get_template_vars('success');
* pimpmylog * http://pimpmylog.com * * Copyright (c) 2015 Potsky, contributors * Licensed under the GPLv3 license. */ /*! pimpmylog - 1.6.2 - 0e09a3e0b9c484aad1511108d7f86bc34dfbc7ce*/ /* * pimpmylog * http://pimpmylog.com * * Copyright (c) 2014 Potsky, contributors * Licensed under the GPLv3 license. */ include_once 'global.inc.php'; list($badges, $files) = config_load(false); header('Content-type: application/json'); if (!csrf_verify()) { $logs['error'] = __('Please refresh the page.'); echo json_encode($logs); die; } /* |-------------------------------------------------------------------------- | Special AJAX functions |-------------------------------------------------------------------------- | */ if (isset($_POST['action'])) { switch ($_POST['action']) { case 'upgradegitpull':
/** * 测试读取queue client */ public function testBigpipeQueueConf() { $conf_dir = './conf'; $conf_file = 'queue_util.conf'; $content = config_load($conf_dir, $conf_file); $this->assertTrue(false != $content); $conf = new BigpipeQueueConf(); // 测试1 成功分支 $this->assertTrue($conf->load($content)); // 测试2 失败 $queue = $content['queue']; $content['queue'] = null; $this->assertFalse($conf->load($content)); $content['queue'] = $queue; }
echo "[Failure] [open queue client log]\n"; print_r($log_conf); echo "\n"; } // 订阅参数 $conf_dir = './conf'; $conf_file = 'util_1.conf'; $args = $_SERVER['argv']; $prog_name = array_shift($args); if (2 == count($args)) { // 读取命令行参数 $conf_dir = $args[0]; $conf_file = $args[1]; } printf("load configure [dir:%s][file:%s]\n", $conf_dir, $conf_file); $conf_content = config_load($conf_dir, $conf_file); if (false === $conf_content) { echo config_error_message(); die; } $stat = null; $ret = BigpipeQueueAdministrationTools::create_queue($conf_content['meta'], $conf_content['UTIL'], $stat); if (false === $ret) { echo "afwul\n"; } else { echo "success\n"; print_r($stat); echo "\n"; } BigpipeLog::close(); ?>
/** * Constructor * * @access public */ public function __construct() { self::$config = config_load('cart'); $this->paypal_response = ''; }
function load_module_config($module, $name = 'mod', $filename = 'config.php', $array = FALSE) { // Get our filename and use the load_config method $file = path(ROOT, "modules", $module, "config", $filename); config_load($file, $name, $array); }
<?php /*************************************************************************** * * Copyright (c) 2012 Baidu.com, Inc. All Rights Reserved * ****************************************************************************/ require_once dirname(__FILE__) . '/../frame/bigpipe_common.inc.php'; require_once dirname(__FILE__) . '/../frame/BigpipeLog.class.php'; require_once dirname(__FILE__) . '/../frame/bigpipe_configures.inc.php'; require_once dirname(__FILE__) . '/../BigpipeQueueClient.class.php'; // 初始化log配置 $log_dir = './conf'; $log_file = 'queue_util_example.conf'; $log_content = config_load($log_dir, $log_file); $conf = new BigpipeQueueConf(); if (false === $log_content) { echo config_error_message(); } else { if (false === $conf->load($log_content)) { echo "[Failure][load configure][use default configure]\n"; } } $log_conf = new BigpipeLogConf(); $log_conf->file = 'queue-client.php'; $log_conf->severity = BigpipeLogSeverity::DEBUG; if (BigpipeLog::init($log_conf)) { echo "[Success] [open queue client log]\n"; print_r($log_conf); echo "\n"; } else {