本文整理汇总了PHP中Context::getDbInfo方法的典型用法代码示例。如果您正苦于以下问题:PHP Context::getDbInfo方法的具体用法?PHP Context::getDbInfo怎么用?PHP Context::getDbInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Context
的用法示例。
在下文中一共展示了Context::getDbInfo方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: checkUpdate
/**
* @brief 설치가 이상이 없는지 체크하는 method
**/
function checkUpdate()
{
$db_info = Context::getDbInfo();
// 카운터에 site_srl추가
$oDB =& DB::getInstance();
if (!$oDB->isColumnExists('counter_log', 'site_srl')) {
return true;
}
if ($db_info->db_type == 'cubrid') {
if (!$oDB->isIndexExists('counter_log', $oDB->prefix . 'counter_log_idx_site_counter_log')) {
return true;
}
} else {
if (!$oDB->isIndexExists('counter_log', 'idx_site_counter_log')) {
return true;
}
}
return false;
}
示例2: makeConfigFile
/**
* @brief config 파일을 생성
* 모든 설정이 이상없이 끝난 후에 config파일 생성
**/
function makeConfigFile()
{
$config_file = Context::getConfigFile();
//if(file_exists($config_file)) return;
$db_info = Context::getDbInfo();
if (!$db_info) {
return;
}
$buff = '<?php if(!defined("__ZBXE__")) exit();' . "\n";
foreach ($db_info as $key => $val) {
$buff .= sprintf("\$db_info->%s = '%s';\n", $key, str_replace("'", "\\'", $val));
}
$buff .= "?>";
FileHandler::writeFile($config_file, $buff);
if (@file_exists($config_file)) {
return true;
}
return false;
}
示例3: makeConfigFile
/**
* @brief Create config file
* Create the config file when all settings are completed
*/
function makeConfigFile()
{
try {
$config_file = Context::getConfigFile();
//if(file_exists($config_file)) return;
$db_info = Context::getDbInfo();
if (!$db_info) {
return;
}
$buff = $this->_getDBConfigFileContents($db_info);
FileHandler::writeFile($config_file, $buff);
if (@file_exists($config_file)) {
FileHandler::removeFile($this->db_tmp_config_file);
FileHandler::removeFile($this->etc_tmp_config_file);
return true;
}
return false;
} catch (Exception $e) {
return false;
}
}
示例4: procAdminUpdateEmbedWhitelist
function procAdminUpdateEmbedWhitelist()
{
$vars = Context::getRequestVars();
$db_info = Context::getDbInfo();
$white_object = $vars->embed_white_object;
$white_object = preg_replace("/[\r\n|\r|\n]+/", '|@|', $white_object);
$white_object = preg_replace("/[\\s\\'\"]+/", '', $white_object);
$white_object = explode('|@|', $white_object);
$white_object = array_unique($white_object);
$white_iframe = $vars->embed_white_iframe;
$white_iframe = preg_replace("/[\r\n|\r|\n]+/", '|@|', $white_iframe);
$white_iframe = preg_replace("/[\\s\\'\"]+/", '', $white_iframe);
$white_iframe = explode('|@|', $white_iframe);
$white_iframe = array_unique($white_iframe);
$whitelist = new stdClass();
$whitelist->object = $white_object;
$whitelist->iframe = $white_iframe;
$db_info->embed_white_object = $white_object;
$db_info->embed_white_iframe = $white_iframe;
$oInstallController = getController('install');
if (!$oInstallController->makeConfigFile()) {
return new Object(-1, 'msg_invalid_request');
}
require_once _XE_PATH_ . 'classes/security/EmbedFilter.class.php';
$oEmbedFilter = EmbedFilter::getInstance();
$oEmbedFilter->_makeWhiteDomainList($whitelist);
if (!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON'))) {
$returnUrl = Context::get('success_return_url');
if (!$returnUrl) {
$returnUrl = getNotEncodedUrl('', 'act', 'dispAdminConfigGeneral');
}
header('location:' . $returnUrl);
return;
}
}
示例5: getSecretKey
/**
* @brief Get the secret key for this site
* @return bool
*/
public static function getSecretKey()
{
// If the secret key does not exist, the config file needs to be updated
$db_info = Context::getDbInfo();
if (!isset($db_info->secret_key)) {
$db_info->secret_key = self::createSecureSalt(48, 'alnum');
Context::setDBInfo($db_info);
getController('install')->makeConfigFile();
}
return $db_info->secret_key;
}