CodeIgniter basic configuration details

  • 2020-11-18 06:08:16
  • OfStack

$config [' base_url] = "https: / / www. ofstack. com/". CodeIgniter will generate links, form addresses and so on based on the url of your website.
$config['index_page'] = "index.php" CodeIgniter root index.php file name, which CodeIgniter will use to generate the link address. If you use URL with hidden index.php, set it to an empty string: $config['index_page'] = "".
$config['uri_protocol'] = "AUTO" the format used by CodeIgniter to generate URL, set to "AUTO" automatic detection. If the link does not work properly, try the following values: PATH_INFO, QUERY_STRING, REQUEST_URI, ORIG_PATH_INFO.
$config [' url_suffix] = "". The URL suffix used when CodeIgniter generates links. To achieve pseudo-static, set $config['url_suffix'] = ".html ".
$config [' language] = "english". The default language for the CodeIgniter program
$config [' charset] = "UTF - 8". The character set used by CodeIgniter programs by default
$config [' enable_hooks] = FALSE. Whether to enable hooks, which allow you to change or add the core running functionality of the system without modifying the system core files.
$config [' subclass_prefix] = 'MY_'. Sets the class name prefix to use when extending the CodeIgniter class library
$config [' permitted_uri_chars] = 'a - z 0-9 ~ %. : _ \ -'. Sets the characters allowed in CodeIgniter URL, which is 1 regular expression. When the CodeIgniter URL that the visitor is trying to visit contains other characters, a warning is given. The characters used by CodeIgniter URL should be restricted as much as possible to improve security, which can effectively filter injection attacks. If set to null, all characters are allowed, which is highly recommended.
$config [' enable_query_strings] = FALSE. CodeIgniter URL USES segmented URL by default. This option also allows CodeIgniter to turn on URL as a query string. You can use the query string to pass the controller and function that you want to access. For example: index php? c=controller & m = method. CodeIgniter USES segmented URL by default, and many features of URL for query strings are not supported.
$config [' controller_trigger] = 'c'. CodeIgniter takes the value corresponding to this option in the query string as the name of the CodeIgniter controller.
$config [' function_trigger] = 'm'. CodeIgniter takes the value corresponding to this option in the query string as the name of the CodeIgniter controller method
$config [' log_threshold] = 0. Enable error logging and set what types of errors are logged.
0 = Turn off error logging
1 = Log error messages
2 = Record debugging information
3 = Record notification information
4 = Record all information
$config [' log_path] = "". If you do not want to use the default error logging directory configuration (system/logs/), you can set up the full server directory.
$config['log_date_format'] = 'ES140en-ES141en-ES142en H:i:s'] CodeIgniter error log time format
$config [' cache_path] = "". If you don't want to use the default cache directory (system/cache/) to store the cache, you can set up the full server directory
$config [' encryption_key] = "". The key used by CodeIgniter
$config [' global_xss_filtering] = FALSE. Whether to automatically filter cross-script attacks against input data (GET, POST)
$config [' compress_output] = FALSE. Gzip compression enabled for the fastest page load times
$config [' time_reference] = 'local'. Set the time format: "local", "GMT"
$config [' rewrite_short_tags] = FALSE. If you want to use a short tag but the PHP server does not support it, CodeIgniter can override the short tag to support this 1 capability.
$config [' proxy_ips] = "". If visitors come to your site through a proxy server, you must set up the proxy server IP list to identify the visitors as IP.

Related articles: