index.php 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <?php
  2. /**
  3. * KumbiaPHP web & app Framework.
  4. *
  5. * LICENSE
  6. *
  7. * This source file is subject to the new BSD license that is bundled
  8. * with this package in the file LICENSE.txt.
  9. * It is also available through the world-wide-web at this URL:
  10. * http://wiki.kumbiaphp.com/Licencia
  11. * If you did not receive a copy of the license and are unable to
  12. * obtain it through the world-wide-web, please send an email
  13. * to [email protected] so we can send you a copy immediately.
  14. *
  15. * @copyright Copyright (c) 2005 - 2017 Kumbia Team (http://www.kumbiaphp.com)
  16. * @license http://wiki.kumbiaphp.com/Licencia New BSD License
  17. */
  18. /**
  19. * Esta sección prepara el entorno
  20. * Todo esto se puede hacer desde la configuracion del
  21. * Servidor/PHP, en caso de no poder usarlo desde ahí
  22. * Puedes descomentar estas lineas.
  23. */
  24. //*Locale*
  25. //setlocale(LC_ALL, 'es_ES');
  26. //*Timezone*
  27. //ini_set('date.timezone', 'America/New_York');
  28. /**
  29. * @TODO
  30. * REVISAR ESTA SECCIÓN
  31. */
  32. const APP_CHARSET = 'UTF-8';
  33. /**
  34. * Indicar si la aplicacion se encuentra en produccion
  35. * directamente desde el index.php.
  36. */
  37. const PRODUCTION = false;
  38. /**
  39. * Descomentar para mostrar los errores.
  40. */
  41. //error_reporting(E_ALL ^ E_STRICT);ini_set('display_errors', 'On');
  42. /**
  43. * Define el APP_PATH.
  44. *
  45. * APP_PATH:
  46. * - Ruta al directorio de la aplicación (por defecto la ruta al directorio app)
  47. * - Esta ruta se utiliza para cargar los archivos de la aplicacion
  48. * - En producción, es recomendable ponerla manual
  49. */
  50. //define('APP_PATH', dirname(__DIR__).'/app/');
  51. const APP_PATH = '/kumbiaphp/bench/app/';
  52. /**
  53. * Define el CORE_PATH.
  54. *
  55. * CORE_PATH:
  56. * - Ruta al directorio que contiene el núcleo de Kumbia (por defecto la ruta al directorio core)
  57. */
  58. //define('CORE_PATH', dirname(dirname(APP_PATH)).'/vendor/Kumbia/core/');
  59. const CORE_PATH = '/kumbiaphp/vendor/Kumbia/core/';
  60. /**
  61. * Define el PUBLIC_PATH.
  62. *
  63. * PUBLIC_PATH:
  64. * - Path para genera la Url en los links a acciones y controladores
  65. * - Esta ruta la utiliza Kumbia como base para generar las Urls para acceder de lado de
  66. * cliente (con el navegador web) y es relativa al DOCUMENT_ROOT del servidor web
  67. *
  68. * EN PRODUCCION ESTA CONSTANTE DEBERÍA SER ESTABLECIDA MANUALMENTE
  69. */
  70. //define('PUBLIC_PATH', substr($_SERVER['SCRIPT_NAME'], 0, -9)); // - index.php string[9]
  71. const PUBLIC_PATH = '/';
  72. /**
  73. * Obtiene la url usando PATH_INFO.
  74. */
  75. $url = $_SERVER['PATH_INFO'];
  76. /**
  77. * Obtiene la url usando $_GET['_url']
  78. * Cambiar también en el .htaccess.
  79. */
  80. //$url = $_GET['_url'] ?? '/';
  81. /**
  82. * Carga el gestor de arranque
  83. * Por defecto el bootstrap del core.
  84. *
  85. * @see Bootstrap
  86. */
  87. //require APP_PATH . 'libs/bootstrap.php'; //bootstrap de app
  88. require CORE_PATH.'kumbia/bootstrap.php'; //bootstrap del core