/** * 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; }
/** * 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; }
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); }
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); } }
/** * 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(); }
/** * 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); } }
function base_url($uri = '') { $url = parent::base_url($uri); if ($_SERVER['SERVER_PORT'] == 443) { $url = str_replace('http://', 'https://', $url); } return $url; }
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); }
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); }
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; }
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); }
/** * @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); }
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); }
/** * 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; }
/** * 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); } }
function site_url($uri = '') { if (is_array($uri)) { $uri = implode('/', $uri); } if (class_exists('CI_Controller')) { $CI =& get_instance(); //echo parent::site_url(); exit; //--------------------if($CI->config->item('language') == 'english') return parent::site_url($uri); $uri = $CI->lang->localized($uri); //echo $uri; exit; } //echo $uri; exit; $site_url = parent::site_url($uri); $site_url = rtrim($site_url, '/'); $site_url .= "/"; return $site_url; }
public function load($file = 'config', $use_sections = FALSE, $fail_gracefully = FALSE, $_module = '') { //if (in_array($file, $this->is_loaded, TRUE)) return $this->item($file); //echo "Модуль до определения = $_module<br>"; if ($_module === false) { $_module = ''; } else { $_module or $_module = CI::$APP->router->fetch_module(); } //echo "Модуль после определения = $_module<br>"; list($path, $file) = Modules::find($file, $_module, 'config/'); if ($path === FALSE) { parent::load($file, $use_sections, $fail_gracefully); return $this->item($file); } //echo "Путь - $path, файл-$file<br>"; // добавлено для корректной работы уже загруженных файлов модулей $file_path = $path . $file . EXT; //echo "Данные $file_path:<br>"; //print_r($this->item($file_path)); //if (in_array($file_path, $this->is_loaded, TRUE)) 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); $current_config[$file] = $this->array_merge_recursive_distinct($current_config[$file], $config); } else { $current_config[$file] = $config; } } else { $current_config = array_merge($current_config, $config); } //$this->is_loaded[] = $file; // исправлено на: $this->is_loaded[] = $file_path; unset($config); return $this->item($file); } }
/** * Load Config File * * @access public * @param string the config file name * @param boolean if configuration values should be loaded into their own section * @param boolean true if errors should just return false, false if an error message should be displayed * @return boolean if the file was loaded correctly */ function load($file = '', $use_sections = FALSE, $fail_gracefully = FALSE) { // Call default config loader $load = parent::load($file, $use_sections, true); // Now check for any custom configs $file = empty($file) ? 'config' : $file; $ext = pathinfo($file, PATHINFO_EXTENSION); $ext = empty($ext) ? '.php' : ''; $file = $file . $ext; // Set the custom locations $locations = array(); if (defined('ENVIRONMENT')) { array_push($locations, CUSTOMPATH . 'config/' . ENVIRONMENT . '/' . $file); } array_push($locations, CUSTOMPATH . 'config/' . $file); // Loop thru the locations // If found, load the file // Loop thru configs in there // If value is array, loop again to apply to avoid overwriting any existing configs (IE: adding a new error code) foreach ($locations as $file) { if (file_exists($file)) { $load = true; include_once $file; if (isset($config) && is_array($config)) { foreach ($config as $k => $v) { if (is_array($v)) { foreach ($v as $kk => $vv) { $this->config[$k][$kk] = $vv; } } else { $this->config[$k] = $v; } } unset($config); } break; } } // Return load return $load; }
/** * Constructor * * @access public * @return void */ function __construct() { parent::__construct(); $define_path = ""; if (defined('ENVIRONMENT')) { switch (ENVIRONMENT) { case 'development': $this->define_path = APPPATH . 'config/development/database' . EXT; break; case 'testing': case 'production': $this->define_path = APPPATH . 'config/production/database' . EXT; break; default: exit('The application environment is not set correctly.'); } } $this->config_path = APPPATH . 'config/config' . EXT; $this->database_path = $this->define_path; $this->autoload_path = APPPATH . 'config/autoload' . EXT; $tem_index = getcwd(); $this->index_path = $tem_index . "/index.php"; }
function load($file = '', $use_sections = FALSE, $fail_gracefully = FALSE) { if ($app_path = WPCI::active_app_path(FALSE)) { $file_path = $app_path . '/config/' . $file . EXT; if (file_exists($file_path)) { if (in_array($file_path, $this->is_loaded, TRUE)) { return TRUE; } @(include $file_path); if ($use_sections === TRUE) { if (isset($this->config[$file])) { $this->config[$file] = array_merge($this->config[$file], $config); } else { $this->config[$file] = $config; } } else { $this->config = array_merge($this->config, $config); } return TRUE; } } parent::load($file, $use_sections, $fail_gracefully); }
} } public function __construct() { $config = new CI_Config(); $this->app_code = $config->item('app_code'); $this->client_code = $config->item('client_code'); $this->target = $config->item('target_core'); $api = array('tes' => 'ksc/pasien/generate', 'doctype' => 'ksc/doctortypes/index', 'doctypePasien' => 'ksc/doctortypes/pasienlist', 'pasienDetail' => 'ksc/pasien/detail', 'pasienSaveMedrec' => 'ksc/pasien/savemedrec', 'logDaftar' => 'ksc/daftar/logs');
/** * Constructor * */ public function __construct() { parent::__construct(); //2008-04-21 KUNIHARU Tsujioka $this->_is_ssl(); }
function Config_data() { parent::__construct(); $CI =& get_instance(); define("THEME_FOLDER", "templates/blue"); }
public function real_site_url($uri) { return self::url_trim(parent::site_url($uri)); }
function __construct() { parent::__construct(); $this->_config_paths = array(APPPATH, ARCHPATH); }
/** * Constructor * * @access public * @return null */ function MY_Config() { parent::CI_Config(); }
/** * Fetch a config item and add a slash after it * * This is installer aware and will always return the correct path in the * ExpressionEngine install * * @param string $item the config item * @return string the config value */ public function slash_item($item) { $pref = parent::slash_item($item); if (defined('EE_APPPATH')) { $pref = str_replace(APPPATH, EE_APPPATH, $pref); } return $pref; }
function __construct() { parent::__construct(); }
| always be used to set the mode correctly. | */ define('FILE_READ_MODE', 0644); define('FILE_WRITE_MODE', 0666); define('DIR_READ_MODE', 0755); define('DIR_WRITE_MODE', 0777); /* |-------------------------------------------------------------------------- | File Stream Modes |-------------------------------------------------------------------------- | | These modes are used when working with fopen()/popen() | */ define('FOPEN_READ', 'rb'); define('FOPEN_READ_WRITE', 'r+b'); define('FOPEN_WRITE_CREATE_DESTRUCTIVE', 'wb'); // truncates existing file data, use with care define('FOPEN_READ_WRITE_CREATE_DESTRUCTIVE', 'w+b'); // truncates existing file data, use with care define('FOPEN_WRITE_CREATE', 'ab'); define('FOPEN_READ_WRITE_CREATE', 'a+b'); define('FOPEN_WRITE_CREATE_STRICT', 'xb'); define('FOPEN_READ_WRITE_CREATE_STRICT', 'x+b'); require FCPATH . "system/core/Config.php"; $url = new CI_Config(); define("BASEURL", $url->base_url()); define("SITEURL", $url->site_url()); /* End of file constants.php */ /* Location: ./application/config/constants.php */
public function real_site_url($uri) { return parent::site_url($uri); }