当前位置: 首页>>代码示例>>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;未经允许,请勿转载。