當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CI_Config類代碼示例

本文整理匯總了PHP中CI_Config的典型用法代碼示例。如果您正苦於以下問題:PHP CI_Config類的具體用法?PHP CI_Config怎麽用?PHP CI_Config使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了CI_Config類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getConfigArray

 /**
  * Returns configuration array for given config file.
  * 
  * @param string $config name of config file without extension.
  * @return array<mixed> values of config file.
  */
 public function getConfigArray($config)
 {
     if (file_exists(APPPATH . 'config/' . $config . '.php')) {
         $configObject = new CI_Config();
         $configObject->load($config, TRUE);
         return $configObject->config[$config];
     }
     return NULL;
 }
開發者ID:andrejjursa,項目名稱:fmfi-tis,代碼行數:15,代碼來源:configurator.php

示例2: show_php_error

 /**
  * Native PHP error handler
  *
  * @param	string	$severity	the error severity
  * @param	string	$message	the error string
  * @param	string	$filepath	the error filepath
  * @param	string	$line		the error line number
  */
 function show_php_error($severity, $message, $filepath, $line)
 {
     $severity = !isset($this->levels[$severity]) ? $severity : $this->levels[$severity];
     $filepath = str_replace("\\", "/", $filepath);
     /**
      * For safety reasons we do not show the full file path
      */
     if (FALSE !== strpos($filepath, '/')) {
         $x = explode('/', $filepath);
         $filepath = $x[count($x) - 2] . '/' . end($x);
     }
     if (ob_get_level() > $this->ob_level + 1) {
         ob_end_flush();
     }
     include_once BASEPATH . 'core/Config' . EXT;
     $config = new CI_Config();
     ob_start();
     include APPPATH . 'views/themes/' . $config->item('theme') . '/errors/error_php' . EXT;
     $buffer = ob_get_contents();
     ob_end_clean();
     echo $buffer;
 }
開發者ID:naterkane,項目名稱:local.to,代碼行數:30,代碼來源:App_Exceptions.php

示例3:

 /**
  * Constructor
  *
  * @access  public
  * @return  void
  */
 function __construct()
 {
     parent::__construct();
     $this->config_path = APPPATH . 'config/config' . EXT;
     $this->database_path = APPPATH . 'config/database' . EXT;
     $this->autoload_path = APPPATH . 'config/autoload' . EXT;
 }
開發者ID:denzilferreira,項目名稱:aware-server,代碼行數:13,代碼來源:MY_config.php

示例4: load

 public function load($file = '', $use_sections = FALSE, $fail_gracefully = FALSE)
 {
     // first we need to check if this is called before CI_controller
     // if yes, well just use default
     if (!class_exists('CI_controller')) {
         return parent::load($file, $use_sections, $fail_gracefully);
     }
     if (in_array($file, $this->is_loaded, TRUE)) {
         return $this->item($file);
     }
     $_module = Modules::$current;
     if ($path = modules::find($file, $_module, 'config')) {
         // this file expected contain $config var
         include $path;
         if (!isset($config) or !is_array($config)) {
             show_error("{$path} does not contain a valid config array");
         }
         log_message('debug', "File loaded: {$path}");
         $current_config =& $this->config;
         if ($use_sections === TRUE) {
             if (isset($current_config[$file])) {
                 $current_config[$file] = array_merge($current_config[$file], $config);
             } else {
                 $current_config[$file] = $config;
             }
         } else {
             $current_config = array_merge($current_config, $config);
         }
         $this->is_loaded[] = $file;
         unset($config);
         return $this->item($file);
     }
     return parent::load($file, $use_sections, $fail_gracefully);
 }
開發者ID:egig,項目名稱:CodeIgniter-HMVC-Support,代碼行數:34,代碼來源:Config.php

示例5: load

 public function load($file = 'config', $use_sections = FALSE, $fail_gracefully = FALSE, $_module = '')
 {
     if (in_array($file, $this->is_loaded, TRUE)) {
         return $this->item($file);
     }
     $_module or $_module = CI::$APP->router->fetch_module();
     list($path, $file) = Modules::find($file, $_module, 'config/');
     if ($path === FALSE) {
         parent::load($file, $use_sections, $fail_gracefully);
         return $this->item($file);
     }
     if ($config = Modules::load_file($file, $path, 'config')) {
         /* reference to the config array */
         $current_config =& $this->config;
         if ($use_sections === TRUE) {
             if (isset($current_config[$file])) {
                 $current_config[$file] = array_merge($current_config[$file], $config);
             } else {
                 $current_config[$file] = $config;
             }
         } else {
             $current_config = array_merge($current_config, $config);
         }
         $this->is_loaded[] = $file;
         unset($config);
         return $this->item($file);
     }
 }
開發者ID:pay-test,項目名稱:ci2,代碼行數:28,代碼來源:Config.php

示例6: __construct

 /**
  * Constructor
  *
  */
 public function __construct()
 {
     parent::__construct();
     // Change this path before release.
     $this->config_path = APPPATH . 'config/config' . EXT;
     $this->database_path = APPPATH . 'config/database' . EXT;
     $this->_initialize();
 }
開發者ID:rmdort,項目名稱:adiee,代碼行數:12,代碼來源:EE_Config.php

示例7: load

 /**
  * Load a config file - Overrides built-in CodeIgniter config file loader
  *
  * @param string $file
  * @param boolean $use_sections
  * @param boolean $fail_gracefully
  */
 function load($file = '', $use_sections = FALSE, $fail_gracefully = FALSE)
 {
     parent::load($file, $use_sections, $fail_gracefully);
     //Local settings override permanent settings always.
     if (is_readable(FCPATH . 'config.local.php')) {
         parent::load('config.local.php', $use_sections, $fail_gracefully);
     }
 }
開發者ID:rcdelacruz,項目名稱:globe-mds-touch,代碼行數:15,代碼來源:MY_Config.php

示例8:

 function base_url($uri = '')
 {
     $url = parent::base_url($uri);
     if ($_SERVER['SERVER_PORT'] == 443) {
         $url = str_replace('http://', 'https://', $url);
     }
     return $url;
 }
開發者ID:hqlulu,項目名稱:startbbs,代碼行數:8,代碼來源:MY_Config.php

示例9: implode

 function site_url($uri = '')
 {
     if (is_array($uri)) {
         $uri = implode('/', $uri);
     }
     if (class_exists('CI_Controller')) {
         $uri = get_instance()->lang->localized($uri);
     }
     return parent::site_url($uri);
 }
開發者ID:Razican,項目名稱:MegaPublik,代碼行數:10,代碼來源:MP_Config.php

示例10: site_url

 public function site_url($uri = '', $protocol = NULL)
 {
     if (is_array($uri)) {
         $uri = implode('/', $uri);
     }
     if (function_exists('get_instance')) {
         $uri = get_instance()->lang->localized($uri);
     }
     return parent::site_url($uri, $protocol);
 }
開發者ID:orcun-yuksel,項目名稱:DMC,代碼行數:10,代碼來源:MY_Config.php

示例11: item

 public function item($item, $index = '')
 {
     $config = parent::item($item, $index);
     if ($config === NULL) {
         if (class_exists('CI_Controller')) {
             return $this->_database_config($item, $index);
         }
     }
     return $config;
 }
開發者ID:barayuda,項目名稱:k-starter,代碼行數:10,代碼來源:MY_Config.php

示例12: implode

 function site_url($uri = '', $protocol = NULL)
 {
     if (is_array($uri)) {
         $uri = implode('/', $uri);
     }
     if (class_exists('CI_Controller')) {
         $CI =& get_instance();
         $uri = $CI->lang->localized($uri);
     }
     return parent::site_url($uri);
 }
開發者ID:sidecia,項目名稱:wiyoitrip,代碼行數:11,代碼來源:MY_Config.php

示例13: site_url

 /**
  * @param string $uri
  * @param null $protocol
  * @return string
  */
 public function site_url($uri = '', $protocol = NULL)
 {
     global $LANG;
     if (is_array($uri)) {
         $uri = implode('/', $uri);
     }
     if (class_exists('CI_Controller')) {
         $uri = $LANG->localized($uri);
     }
     return parent::site_url($uri);
 }
開發者ID:lalcebo,項目名稱:codeigniter-skeleton,代碼行數:16,代碼來源:MY_Config.php

示例14: implode

 function site_url($uri = '')
 {
     if (is_array($uri)) {
         $uri = implode('/', $uri);
     }
     if (function_exists('get_instance')) {
         $CI =& get_instance();
         $uri = $CI->lang->localized($uri);
     }
     return parent::site_url($uri);
 }
開發者ID:pjmoore92,項目名稱:teamo-webtranslator,代碼行數:11,代碼來源:MY_Config.php

示例15: site_url

 /**
  * Site URL
  * Returns base_url . index_page [. uri_string]
  *
  * @param	mixed	the URI string or an array of segments
  * @return	string
  */
 public function site_url($uri = '')
 {
     //get ci instance
     $ci = get_instance();
     //check whether sef service is installed
     if ($ci->service->is_installed('sef')) {
         //get service
         $sef = $ci->service->get_service('sef');
         //process the search friendly url
         return $sef->site_url($uri);
     } else {
         return parent::site_url($uri);
     }
 }
開發者ID:colonia,項目名稱:tomatocart-v2,代碼行數:21,代碼來源:TOC_Config.php


注:本文中的CI_Config類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。