Config of CodeIgniter configuration

Source: Internet
Author: User

Configuration Instructions

$config [' Language ']: Specifies the Project language pack. Note that when CodeIgniter comes with the class library error prompt language pack is located in the/system/language/english/directory, when the configuration of non-Chinese, if you need to use these class libraries, you need to copy the language package to the specified directory, Otherwise, load error will occur.

$config [' CharSet ']: set the encoding used by the system, in some need to specify the encoding function will be used, the system, the database unified code.

$config [' Enable_hooks ']: hook switch Control, set to TRUE indicates that hooks are allowed, otherwise it is not allowed.

$config [' Subclass_prefix ']: set a custom class library, a function prefix, default to My_, such as the need to rewrite the Lang method in language helper, only to create My_ in the helper directory language_herper.php, and implement the Lang function to implement "overloading." The my_ here is the value defined in the Subclass_prefix.

$config [' Permitted_uri_chars ']: sets the allowed characters in the URL.

$config [' Log_threshold ']: set the logging level to 0 to turn off logging, and 4 to log all information, normally set to 1. After setting, you need to confirm that the next logs directory has write permissions.

$config [' proxy_ips ']: when the server uses the proxy, REMOTER_ADDR obtains the proxy server IP, need from Http_x_forwarded_for, HTTP_CLIENT_IP, Http_x_client_ip, HTTP_X_CLUSTER_CLIENT_IP, or other set values. This is the proxy server IP, separated by commas.

$config [' Encryption_key ']: encrypted value, you must set this value if you want to use the sesion that comes with CI. CI's self-contained session store and cookie are encrypted for security purposes.

Configure read

The config.php file is loaded by the Get_config function during the start of CI initialization, and Config_item is provided to obtain the value of config, such as:

1 echoconfig_item(‘charset‘);

CI also provides a configuration class to maintain the configuration file. You can also get and set the value of config in the following way, and the result of calling Get_config after the setting is changed, so you can modify the value of config before some logic.

1234 //获取config中配置的charset值echo$this->config->item(‘charset‘);//重新设置config中charset的值$this->config->set_item(‘charset‘, ‘gbk‘)

Transferred from: http://pengbotao.cn/codeigniter-config-other.html

Config of CodeIgniter configuration

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.