当前位置: 首页>>代码示例>>PHP>>正文


PHP Context::getDbInfo方法代码示例

本文整理汇总了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;
 }
开发者ID:hottaro,项目名称:xpressengine,代码行数:22,代码来源:counter.class.php

示例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;
 }
开发者ID:hottaro,项目名称:xpressengine,代码行数:23,代码来源:install.controller.php

示例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;
     }
 }
开发者ID:rubythonode,项目名称:xe-core,代码行数:25,代码来源:install.controller.php

示例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;
     }
 }
开发者ID:ddmshu,项目名称:xe-core,代码行数:35,代码来源:admin.admin.controller.php

示例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;
 }
开发者ID:ned3y2k,项目名称:xe-core,代码行数:15,代码来源:Password.class.php


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