本文整理汇总了PHP中DB_Helper::getConfig方法的典型用法代码示例。如果您正苦于以下问题:PHP DB_Helper::getConfig方法的具体用法?PHP DB_Helper::getConfig怎么用?PHP DB_Helper::getConfig使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DB_Helper
的用法示例。
在下文中一共展示了DB_Helper::getConfig方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct($schema_dir)
{
$this->db = DB_Helper::getInstance();
$this->dir = $schema_dir;
$this->config = DB_Helper::getConfig();
$this->table_prefix = $this->config['table_prefix'];
$this->logger = function ($e) {
echo $e, "\n";
};
}
示例2: define
// common init for upgrade scripts
define('INSTALL_PATH', dirname(__FILE__) . '/..');
define('CONFIG_PATH', INSTALL_PATH . '/config');
// avoid setup redirecting us
if (!file_exists(CONFIG_PATH . '/setup.php') || !filesize(CONFIG_PATH . '/setup.php') || !is_readable(CONFIG_PATH . '/setup.php')) {
error_log("ERROR: Can't get setup.php in '" . CONFIG_PATH . "'");
error_log('Did you forgot to copy config from old install? Is file readable?');
exit(1);
}
// load init only if no autoloader present
if (!class_exists('DB_Helper')) {
require_once INSTALL_PATH . '/init.php';
}
$in_setup = defined('IN_SETUP');
global $dbconfig, $db;
$dbconfig = DB_Helper::getConfig();
$db = DB_Helper::getInstance();
function exec_sql_file($input_file)
{
if (!file_exists($input_file) && !is_readable($input_file)) {
throw new RuntimeException("Can't read file: {$input_file}");
}
global $dbconfig, $db;
// use *.php for complex updates
if (substr($input_file, -4) == '.php') {
$queries = array();
require $input_file;
} else {
$queries = explode(';', file_get_contents($input_file));
}
foreach ($queries as $query) {