本文整理匯總了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) {