Crear una buena instalación limpia de CodeIgniter

Descargar las fuentes

Crear una buena instalación vacía de CodeIgniter es simple, aunque hay muchísimas cosas que configurar para disponer del framework operativo.

Existen muchísimos sitios donde descargar CodeIgniter, a mí me gusta hacerlo desde este enlace de Github, que corresponde a British Columbia Institute of Technology, universidad que se hizo cargo del proyecto tras el abandono del mantenimiento por parte de Ellislab, quien lo desarrolló originalmente.

Asumo que tienes un servidor web en funcionamiento y conoces los lugares donde puedes descargarte los fuentes que antes hemos descrito. Igualmente que conoces el mecanismo de direcciones URL. No obstante aquí haremos un repaso de todo ello.

Tras la descarga

Pantalla de bienvenida

He desempaquetado el código fuente en mi public_html/codeigniter dejando las carpetas fuera de la carpeta contenedora. Esta pantalla de bienvenida es el resultado, y comprobación, que CodeIgniter está ya funcionando. Ahora comienza la configuración.

Configurar .htaccess

«Llevarse bien» con Apache es fundamental para una aplicación rápida y funcional. CodeIgniter enruta todos los archivos a partir de su index.php, como esto puede ser bastante repetitivo estéticamente, tendremos que instalar como root el módulo rewrite así, obviamente si lo tienes ya instalado puedes saltarte el siguiente paso:

Instalación del módulo rewrite para apache

$ sudo a2enmod rewrite
$ sudo /etc/init.d/apache2 restart

En nuestro directorio raíz, en mi caso public_html/codeigniter, coloco el archivo .htaccess, que dará instrucciones a Apache para suprimir index.php en la ruta URL en las direcciones de nuestra aplicación. Como podéis ver en las lineas resaltadas de la uno a la cuatro.

El resto de lineas las uso para comprimir el código que transporto, y asignar caducidad a los determinados ficheros según me interese. Ya hablaremos de esto otro día…

  1. RewriteEngine On
  2. RewriteCond %{REQUEST_FILENAME} !-f
  3. RewriteCond %{REQUEST_FILENAME} !-d
  4. RewriteRule ^(.*)$ ./index.php/$1 [L]
  5.  
  6. ErrorDocument 404 /index.php
  7. mod_gzip_on Yes
  8. mod_gzip_dechunk Yes
  9. mod_gzip_item_include file .(html?|txt|css|js|php|pl)$
  10. mod_gzip_item_include handler ^cgi-script$
  11. mod_gzip_item_include mime ^text/.*
  12. mod_gzip_item_include mime ^application/x-javascript.*
  13. mod_gzip_item_exclude mime ^image/.*
  14. mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
  15. ExpiresActive On
  16. ExpiresDefault "access plus 1 seconds"
  17. ExpiresByType text/html "access plus 1 seconds"
  18. ExpiresByType image/gif "access plus 2592000 seconds"
  19. ExpiresByType image/jpeg "access plus 2592000 seconds"
  20. ExpiresByType image/png "access plus 2592000 seconds"
  21. ExpiresByType text/css "access plus 604800 seconds"
  22. ExpiresByType text/javascript "access plus 216000 seconds"
  23. ExpiresByType application/x-javascript "access plus 216000 seconds"

Enrutado

Abrimos el archivo application/config/routes.php y vamos a informar a nuestro CodeIgniter que el «controller de bienvenida», ya no se llamará “welcome” lo renombraremos a “initio“.

  1. $route['default_controller'] = 'initio';
  2. $route['404_override'] = '';
  3. $route['translate_uri_dashes'] = FALSE;

Ahora renombramos el archivo application/controllers/Welcome.php como  application/controllers/Initio.php.

Importante: que la primera letra de los controladores sean mayúsculas

Cambio del nombre de la clase de Initio.php

Editamos application/controllers/Initio.php y cambiamos el nombre de la clase en la línea 4, así:

  1. <!--?php &lt;br ?--> defined('BASEPATH') OR exit('No direct script access allowed');
  2.  
  3. class Initio extends CI_Controller {
  4.  
  5. /**
  6. * Index Page for this controller.
  7. *
  8. * Maps to the following URL
  9. * http://example.com/index.php/welcome
  10. * - or -
  11. * http://example.com/index.php/welcome/index
  12. * - or -
  13. * Since this controller is set as the default controller in
  14. * config/routes.php, it's displayed at http://example.com/
  15. *
  16. * So any other public methods not prefixed with an underscore will
  17. * map to /index.php/welcome/
  18. * @see https://codeigniter.com/user_guide/general/urls.html
  19. */
  20. public function index()
  21. {
  22. $this-&gt;load-&gt;view('welcome_message');
  23. }
  24. }

Renombrar carpetas importantes

En index.php de la raíz de nuestra instalación, cambiamos el nombre de las carpetas “system” y “application”.

  1. /*
  2. *---------------------------------------------------------------
  3. * SYSTEM DIRECTORY NAME
  4. *---------------------------------------------------------------
  5. *
  6. * This variable must contain the name of your "system" directory.
  7. * Set the path if it is not in the same directory as this file.
  8. */
  9. $system_path = 'sys_2k3lj4';
  10.  
  11. /*
  12. *---------------------------------------------------------------
  13. * APPLICATION DIRECTORY NAME
  14. *---------------------------------------------------------------
  15. *
  16. * If you want this front controller to use a different "application"
  17. * directory than the default one you can set its name here. The directory
  18. * can also be renamed or relocated anywhere on your server. If you do,
  19. * use an absolute (full) server path.
  20. * For more info please see the user guide:
  21. *
  22. * https://codeigniter.com/user_guide/general/managing_apps.html
  23. *
  24. * NO TRAILING SLASH!
  25. */
  26. $application_folder = 'app_lkEW3';

Obviamente, tras esto renombras los directorios “application” y “system” con los mismos nombres que hemos descrito en index.php. Nunca repitas nombre en las distintas instalaciones.

Configuración de la clase Email

Creamos el archivo application/config/email.php. Aunque esto va a depender muchísimo de los distintos servidores de correo que estés usando. Voy a dar el código para usar una configuración típica de gmail.

 

  1. <!--?php defined('BASEPATH') OR exit('No direct script access allowed'); $config = array( 'useragent' =&gt; 'CodeIgniter',&lt;br ?--> 'protocol' =&gt; 'smtp',
  2. //'mailpath' =&gt; '/usr/sbin/sendmail',
  3. 'smtp_host' =&gt; 'ssl://smtp.googlemail.com',
  4. 'smtp_user' =&gt; 'rocesvinto@gmail.com',
  5. 'smtp_pass' =&gt; 'b1-b4:a9e9',
  6. 'smtp_port' =&gt; 465,
  7. 'smtp_timeout' =&gt; 5,
  8. 'wordwrap' =&gt; TRUE,
  9. 'wrapchars' =&gt; 76,
  10. 'mailtype' =&gt; 'html',
  11. 'charset' =&gt; 'utf-8',
  12. 'validate' =&gt; FALSE,
  13. 'priority' =&gt; 3,
  14. 'crlf' =&gt; "\r\n",
  15. 'newline' =&gt; "\r\n",
  16. 'bcc_batch_mode' =&gt; FALSE,
  17. 'bcc_batch_size' =&gt; 200,
  18. );

Configuración de MySql (MaríaDB)

  1. $db['default'] = array(
  2. 'dsn' =&gt; '',
  3. 'hostname' =&gt; 'localhost',
  4. 'username' =&gt; '***tu nombre de usuario ***',
  5. 'password' =&gt; '*** tu password super secreto ***',
  6. 'database' =&gt; '*** nombre de la base de datos ***',
  7. 'dbdriver' =&gt; 'mysqli',
  8. 'dbprefix' =&gt; '',
  9. 'pconnect' =&gt; FALSE,
  10. 'db_debug' =&gt; (ENVIRONMENT !== 'production'),
  11. 'cache_on' =&gt; FALSE,
  12. 'cachedir' =&gt; '',
  13. 'char_set' =&gt; 'utf8',
  14. 'dbcollat' =&gt; 'utf8_general_ci',
  15. 'swap_pre' =&gt; '',
  16. 'encrypt' =&gt; FALSE,
  17. 'compress' =&gt; FALSE,
  18. 'stricton' =&gt; FALSE,
  19. 'failover' =&gt; array(),
  20. 'save_queries' =&gt; TRUE
  21. );

Archivo de configuración

Ahora el archivo de configuración que podemos editar en la dirección application/config/config.php. Es muy importante declarar en la línea 26 base_url con la ruta absoluta http de nuestra instalación, ya que esto nos va a permitir usar la función base_url() del helper url. Nos ahorra mucho trabajo.
En la línea 317 vamos a colocar nuestra clave de encriptación, en caso que nuestra aplicación vaya a contener datos encriptados. O sea, que se coloca allí. Yo siempre coloco una clave nueva por instalación, es decir, nunca repito, y siempre de treinta y dos caracteres aleatorios.

  1. <!--?php &lt;br ?--> defined('BASEPATH') OR exit('No direct script access allowed');
  2.  
  3. /*
  4. |--------------------------------------------------------------------------
  5. | Base Site URL
  6. |--------------------------------------------------------------------------
  7. |
  8. | URL to your CodeIgniter root. Typically this will be your base URL,
  9. | WITH a trailing slash:
  10. |
  11. | http://example.com/
  12. |
  13. | WARNING: You MUST set this value!
  14. |
  15. | If it is not set, then CodeIgniter will try guess the protocol and path
  16. | your installation, but due to security concerns the hostname will be set
  17. | to $_SERVER['SERVER_ADDR'] if available, or localhost otherwise.
  18. | The auto-detection mechanism exists only for convenience during
  19. | development and MUST NOT be used in production!
  20. |
  21. | If you need to allow multiple domains, remember that this file is still
  22. | a PHP script and you can easily do that on your own.
  23. |
  24. */
  25. $config['base_url'] = 'http://my_wonderfull_app';
  26.  
  27. /*
  28. |--------------------------------------------------------------------------
  29. | Index File
  30. |--------------------------------------------------------------------------
  31. |
  32. | Typically this will be your index.php file, unless you've renamed it to
  33. | something else. If you are using mod_rewrite to remove the page set this
  34. | variable so that it is blank.
  35. |
  36. */
  37. $config['index_page'] = 'index.php';
  38.  
  39. /*
  40. |--------------------------------------------------------------------------
  41. | URI PROTOCOL
  42. |--------------------------------------------------------------------------
  43. |
  44. | This item determines which server global should be used to retrieve the
  45. | URI string. The default setting of 'REQUEST_URI' works for most servers.
  46. | If your links do not seem to work, try one of the other delicious flavors:
  47. |
  48. | 'REQUEST_URI' Uses $_SERVER['REQUEST_URI']
  49. | 'QUERY_STRING' Uses $_SERVER['QUERY_STRING']
  50. | 'PATH_INFO' Uses $_SERVER['PATH_INFO']
  51. |
  52. | WARNING: If you set this to 'PATH_INFO', URIs will always be URL-decoded!
  53. */
  54. $config['uri_protocol'] = 'REQUEST_URI';
  55.  
  56. /*
  57. |--------------------------------------------------------------------------
  58. | URL suffix
  59. |--------------------------------------------------------------------------
  60. |
  61. | This option allows you to add a suffix to all URLs generated by CodeIgniter.
  62. | For more information please see the user guide:
  63. |
  64. | https://codeigniter.com/user_guide/general/urls.html
  65. |
  66. | Note: This option is ignored for CLI requests.
  67. */
  68. $config['url_suffix'] = '';
  69.  
  70. /*
  71. |--------------------------------------------------------------------------
  72. | Default Language
  73. |--------------------------------------------------------------------------
  74. |
  75. | This determines which set of language files should be used. Make sure
  76. | there is an available translation if you intend to use something other
  77. | than english.
  78. |
  79. */
  80. $config['language'] = 'english';
  81.  
  82. /*
  83. |--------------------------------------------------------------------------
  84. | Default Character Set
  85. |--------------------------------------------------------------------------
  86. |
  87. | This determines which character set is used by default in various methods
  88. | that require a character set to be provided.
  89. |
  90. | See http://php.net/htmlspecialchars for a list of supported charsets.
  91. |
  92. */
  93. $config['charset'] = 'UTF-8';
  94.  
  95. /*
  96. |--------------------------------------------------------------------------
  97. | Enable/Disable System Hooks
  98. |--------------------------------------------------------------------------
  99. |
  100. | If you would like to use the 'hooks' feature you must enable it by
  101. | setting this variable to TRUE (boolean). See the user guide for details.
  102. |
  103. */
  104. $config['enable_hooks'] = FALSE;
  105.  
  106. /*
  107. |--------------------------------------------------------------------------
  108. | Class Extension Prefix
  109. |--------------------------------------------------------------------------
  110. |
  111. | This item allows you to set the filename/classname prefix when extending
  112. | native libraries. For more information please see the user guide:
  113. |
  114. | https://codeigniter.com/user_guide/general/core_classes.html
  115. | https://codeigniter.com/user_guide/general/creating_libraries.html
  116. |
  117. */
  118. $config['subclass_prefix'] = 'MY_';
  119.  
  120. /*
  121. |--------------------------------------------------------------------------
  122. | Composer auto-loading
  123. |--------------------------------------------------------------------------
  124. |
  125. | Enabling this setting will tell CodeIgniter to look for a Composer
  126. | package auto-loader script in application/vendor/autoload.php.
  127. |
  128. | $config['composer_autoload'] = TRUE;
  129. |
  130. | Or if you have your vendor/ directory located somewhere else, you
  131. | can opt to set a specific path as well:
  132. |
  133. | $config['composer_autoload'] = '/path/to/vendor/autoload.php';
  134. |
  135. | For more information about Composer, please visit http://getcomposer.org/
  136. |
  137. | Note: This will NOT disable or override the CodeIgniter-specific
  138. | autoloading (application/config/autoload.php)
  139. */
  140. $config['composer_autoload'] = FALSE;
  141.  
  142. /*
  143. |--------------------------------------------------------------------------
  144. | Allowed URL Characters
  145. |--------------------------------------------------------------------------
  146. |
  147. | This lets you specify which characters are permitted within your URLs.
  148. | When someone tries to submit a URL with disallowed characters they will
  149. | get a warning message.
  150. |
  151. | As a security measure you are STRONGLY encouraged to restrict URLs to
  152. | as few characters as possible. By default only these are allowed: a-z 0-9~%.:_-
  153. |
  154. | Leave blank to allow all characters -- but only if you are insane.
  155. |
  156. | The configured value is actually a regular expression character group
  157. | and it will be executed as: ! preg_match('/^[]+$/i
  158. |
  159. | DO NOT CHANGE THIS UNLESS YOU FULLY UNDERSTAND THE REPERCUSSIONS!!
  160. |
  161. | Note: This option is ignored for CLI requests.
  162. |
  163. */
  164. $config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-';
  165.  
  166. /*
  167. |--------------------------------------------------------------------------
  168. | Enable Query Strings
  169. |--------------------------------------------------------------------------
  170. |
  171. | By default CodeIgniter uses search-engine friendly segment based URLs:
  172. | example.com/who/what/where/
  173. |
  174. | You can optionally enable standard query string based URLs:
  175. | example.com?who=me&amp;what=something&amp;where=here
  176. |
  177. | Options are: TRUE or FALSE (boolean)
  178. |
  179. | The other items let you set the query string 'words' that will
  180. | invoke your controllers and its functions:
  181. | example.com/index.php?c=controller&amp;m=function
  182. |
  183. | Please note that some of the helpers won't work as expected when
  184. | this feature is enabled, since CodeIgniter is designed primarily to
  185. | use segment based URLs.
  186. |
  187. */
  188. $config['enable_query_strings'] = FALSE;
  189. $config['controller_trigger'] = 'c';
  190. $config['function_trigger'] = 'm';
  191. $config['directory_trigger'] = 'd';
  192.  
  193. /*
  194. |--------------------------------------------------------------------------
  195. | Error Logging Threshold
  196. |--------------------------------------------------------------------------
  197. |
  198. | You can enable error logging by setting a threshold over zero. The
  199. | threshold determines what gets logged. Threshold options are:
  200. |
  201. | 0 = Disables logging, Error logging TURNED OFF
  202. | 1 = Error Messages (including PHP errors)
  203. | 2 = Debug Messages
  204. | 3 = Informational Messages
  205. | 4 = All Messages
  206. |
  207. | You can also pass an array with threshold levels to show individual error types
  208. |
  209. | array(2) = Debug Messages, without Error Messages
  210. |
  211. | For a live site you'll usually only enable Errors (1) to be logged otherwise
  212. | your log files will fill up very fast.
  213. |
  214. */
  215. $config['log_threshold'] = 0;
  216.  
  217. /*
  218. |--------------------------------------------------------------------------
  219. | Error Logging Directory Path
  220. |--------------------------------------------------------------------------
  221. |
  222. | Leave this BLANK unless you would like to set something other than the default
  223. | application/logs/ directory. Use a full server path.
  224. |
  225. */
  226. $config['log_path'] = '';
  227.  
  228. /*
  229. |--------------------------------------------------------------------------
  230. | Log File Extension
  231. |--------------------------------------------------------------------------
  232. |
  233. | The default filename extension for log files. The default 'php' allows for
  234. | protecting the log files via basic scripting, when they are to be stored
  235. | under a publicly accessible directory.
  236. |
  237. | Note: Leaving it blank will default to 'php'.
  238. |
  239. */
  240. $config['log_file_extension'] = '';
  241.  
  242. /*
  243. |--------------------------------------------------------------------------
  244. | Log File Permissions
  245. |--------------------------------------------------------------------------
  246. |
  247. | The file system permissions to be applied on newly created log files.
  248. |
  249. | IMPORTANT: This MUST be an integer (no quotes) and you MUST use octal
  250. | integer notation (i.e. 0700, 0644, etc.)
  251. */
  252. $config['log_file_permissions'] = 0644;
  253.  
  254. /*
  255. |--------------------------------------------------------------------------
  256. | Date Format for Logs
  257. |--------------------------------------------------------------------------
  258. |
  259. | Each item that is logged has an associated date. You can use PHP date
  260. | codes to set your own date formatting
  261. |
  262. */
  263. $config['log_date_format'] = 'Y-m-d H:i:s';
  264.  
  265. /*
  266. |--------------------------------------------------------------------------
  267. | Error Views Directory Path
  268. |--------------------------------------------------------------------------
  269. |
  270. | Leave this BLANK unless you would like to set something other than the default
  271. | application/views/errors/ directory. Use a full server path.
  272. |
  273. */
  274. $config['error_views_path'] = '';
  275.  
  276. /*
  277. |--------------------------------------------------------------------------
  278. | Cache Directory Path
  279. |--------------------------------------------------------------------------
  280. |
  281. | Leave this BLANK unless you would like to set something other than the default
  282. | application/cache/ directory. Use a full server path.
  283. |
  284. */
  285. $config['cache_path'] = '';
  286.  
  287. /*
  288. |--------------------------------------------------------------------------
  289. | Cache Include Query String
  290. |--------------------------------------------------------------------------
  291. |
  292. | Whether to take the URL query string into consideration when generating
  293. | output cache files. Valid options are:
  294. |
  295. | FALSE = Disabled
  296. | TRUE = Enabled, take all query parameters into account.
  297. | Please be aware that this may result in numerous cache
  298. | files generated for the same page over and over again.
  299. | array('q') = Enabled, but only take into account the specified list
  300. | of query parameters.
  301. |
  302. */
  303. $config['cache_query_string'] = FALSE;
  304.  
  305. /*
  306. |--------------------------------------------------------------------------
  307. | Encryption Key
  308. |--------------------------------------------------------------------------
  309. |
  310. | If you use the Encryption class, you must set an encryption key.
  311. | See the user guide for more info.
  312. |
  313. | https://codeigniter.com/user_guide/libraries/encryption.html
  314. |
  315. */
  316. $config['encryption_key'] = 'zhH0XGJwtYQ9NqFD9LISDVauGZAu7bLL';
  317.  
  318. /*
  319. |--------------------------------------------------------------------------
  320. | Session Variables
  321. |--------------------------------------------------------------------------
  322. |
  323. | 'sess_driver'
  324. |
  325. | The storage driver to use: files, database, redis, memcached
  326. |
  327. | 'sess_cookie_name'
  328. |
  329. | The session cookie name, must contain only [0-9a-z_-] characters
  330. |
  331. | 'sess_expiration'
  332. |
  333. | The number of SECONDS you want the session to last.
  334. | Setting to 0 (zero) means expire when the browser is closed.
  335. |
  336. | 'sess_save_path'
  337. |
  338. | The location to save sessions to, driver dependent.
  339. |
  340. | For the 'files' driver, it's a path to a writable directory.
  341. | WARNING: Only absolute paths are supported!
  342. |
  343. | For the 'database' driver, it's a table name.
  344. | Please read up the manual for the format with other session drivers.
  345. |
  346. | IMPORTANT: You are REQUIRED to set a valid save path!
  347. |
  348. | 'sess_match_ip'
  349. |
  350. | Whether to match the user's IP address when reading the session data.
  351. |
  352. | WARNING: If you're using the database driver, don't forget to update
  353. | your session table's PRIMARY KEY when changing this setting.
  354. |
  355. | 'sess_time_to_update'
  356. |
  357. | How many seconds between CI regenerating the session ID.
  358. |
  359. | 'sess_regenerate_destroy'
  360. |
  361. | Whether to destroy session data associated with the old session ID
  362. | when auto-regenerating the session ID. When set to FALSE, the data
  363. | will be later deleted by the garbage collector.
  364. |
  365. | Other session cookie settings are shared with the rest of the application,
  366. | except for 'cookie_prefix' and 'cookie_httponly', which are ignored here.
  367. |
  368. */
  369. $config['sess_driver'] = 'files';
  370. $config['sess_cookie_name'] = 'ci_session';
  371. $config['sess_expiration'] = 7200;
  372. $config['sess_save_path'] = NULL;
  373. $config['sess_match_ip'] = FALSE;
  374. $config['sess_time_to_update'] = 300;
  375. $config['sess_regenerate_destroy'] = FALSE;
  376.  
  377. /*
  378. |--------------------------------------------------------------------------
  379. | Cookie Related Variables
  380. |--------------------------------------------------------------------------
  381. |
  382. | 'cookie_prefix' = Set a cookie name prefix if you need to avoid collisions
  383. | 'cookie_domain' = Set to .your-domain.com for site-wide cookies
  384. | 'cookie_path' = Typically will be a forward slash
  385. | 'cookie_secure' = Cookie will only be set if a secure HTTPS connection exists.
  386. | 'cookie_httponly' = Cookie will only be accessible via HTTP(S) (no javascript)
  387. |
  388. | Note: These settings (with the exception of 'cookie_prefix' and
  389. | 'cookie_httponly') will also affect sessions.
  390. |
  391. */
  392. $config['cookie_prefix'] = '';
  393. $config['cookie_domain'] = '';
  394. $config['cookie_path'] = '/';
  395. $config['cookie_secure'] = FALSE;
  396. $config['cookie_httponly'] = FALSE;
  397.  
  398. /*
  399. |--------------------------------------------------------------------------
  400. | Cross Site Request Forgery
  401. |--------------------------------------------------------------------------
  402. | Enables a CSRF cookie token to be set. When set to TRUE, token will be
  403. | checked on a submitted form. If you are accepting user data, it is strongly
  404. | recommended CSRF protection be enabled.
  405. |
  406. | 'csrf_token_name' = The token name
  407. | 'csrf_cookie_name' = The cookie name
  408. | 'csrf_expire' = The number in seconds the token should expire.
  409. | 'csrf_regenerate' = Regenerate token on every submission
  410. | 'csrf_exclude_uris' = Array of URIs which ignore CSRF checks
  411. */
  412. $config['csrf_protection'] = FALSE;
  413. $config['csrf_token_name'] = 'csrf_test_name';
  414. $config['csrf_cookie_name'] = 'csrf_cookie_name';
  415. $config['csrf_expire'] = 7200;
  416. $config['csrf_regenerate'] = TRUE;
  417. $config['csrf_exclude_uris'] = array();
  418.  
  419. /*
  420. |--------------------------------------------------------------------------
  421. | Output Compression
  422. |--------------------------------------------------------------------------
  423. |
  424. | Enables Gzip output compression for faster page loads. When enabled,
  425. | the output class will test whether your server supports Gzip.
  426. | Even if it does, however, not all browsers support compression
  427. | so enable only if you are reasonably sure your visitors can handle it.
  428. |
  429. | Only used if zlib.output_compression is turned off in your php.ini.
  430. | Please do not use it together with httpd-level output compression.
  431. |
  432. | VERY IMPORTANT: If you are getting a blank page when compression is enabled it
  433. | means you are prematurely outputting something to your browser. It could
  434. | even be a line of whitespace at the end of one of your scripts. For
  435. | compression to work, nothing can be sent before the output buffer is called
  436. | by the output class. Do not 'echo' any values with compression enabled.
  437. |
  438. */
  439. $config['compress_output'] = FALSE;
  440.  
  441. /*
  442. |--------------------------------------------------------------------------
  443. | Master Time Reference
  444. |--------------------------------------------------------------------------
  445. |
  446. | Options are 'local' or any PHP supported timezone. This preference tells
  447. | the system whether to use your server's local time as the master 'now'
  448. | reference, or convert it to the configured one timezone. See the 'date
  449. | helper' page of the user guide for information regarding date handling.
  450. |
  451. */
  452. $config['time_reference'] = 'local';
  453.  
  454. /*
  455. |--------------------------------------------------------------------------
  456. | Reverse Proxy IPs
  457. |--------------------------------------------------------------------------
  458. |
  459. | If your server is behind a reverse proxy, you must whitelist the proxy
  460. | IP addresses from which CodeIgniter should trust headers such as
  461. | HTTP_X_FORWARDED_FOR and HTTP_CLIENT_IP in order to properly identify
  462. | the visitor's IP address.
  463. |
  464. | You can use both an array or a comma-separated list of proxy addresses,
  465. | as well as specifying whole subnets. Here are a few examples:
  466. |
  467. | Comma-separated: '10.0.1.200,192.168.5.0/24'
  468. | Array: array('10.0.1.200', '192.168.5.0/24')
  469. */
  470. $config['proxy_ips'] = '';

Hay más, pero ya iremos describiéndolo.

Deja un comentario