當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。