Constants.php 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <?php
  2. //--------------------------------------------------------------------
  3. // App Namespace
  4. //--------------------------------------------------------------------
  5. // This defines the default Namespace that is used throughout
  6. // CodeIgniter to refer to the Application directory. Change
  7. // this constant to change the namespace that all application
  8. // classes should use.
  9. //
  10. // NOTE: changing this will require manually modifying the
  11. // existing namespaces of App\* namespaced-classes.
  12. //
  13. defined('APP_NAMESPACE') || define('APP_NAMESPACE', 'App');
  14. /*
  15. |--------------------------------------------------------------------------
  16. | Composer Path
  17. |--------------------------------------------------------------------------
  18. |
  19. | The path that Composer's autoload file is expected to live. By default,
  20. | the vendor folder is in the Root directory, but you can customize that here.
  21. */
  22. defined('COMPOSER_PATH') || define('COMPOSER_PATH', ROOTPATH . 'vendor/autoload.php');
  23. /*
  24. |--------------------------------------------------------------------------
  25. | Timing Constants
  26. |--------------------------------------------------------------------------
  27. |
  28. | Provide simple ways to work with the myriad of PHP functions that
  29. | require information to be in seconds.
  30. */
  31. defined('SECOND') || define('SECOND', 1);
  32. defined('MINUTE') || define('MINUTE', 60);
  33. defined('HOUR') || define('HOUR', 3600);
  34. defined('DAY') || define('DAY', 86400);
  35. defined('WEEK') || define('WEEK', 604800);
  36. defined('MONTH') || define('MONTH', 2592000);
  37. defined('YEAR') || define('YEAR', 31536000);
  38. defined('DECADE') || define('DECADE', 315360000);
  39. /*
  40. |--------------------------------------------------------------------------
  41. | Exit Status Codes
  42. |--------------------------------------------------------------------------
  43. |
  44. | Used to indicate the conditions under which the script is exit()ing.
  45. | While there is no universal standard for error codes, there are some
  46. | broad conventions. Three such conventions are mentioned below, for
  47. | those who wish to make use of them. The CodeIgniter defaults were
  48. | chosen for the least overlap with these conventions, while still
  49. | leaving room for others to be defined in future versions and user
  50. | applications.
  51. |
  52. | The three main conventions used for determining exit status codes
  53. | are as follows:
  54. |
  55. | Standard C/C++ Library (stdlibc):
  56. | http://www.gnu.org/software/libc/manual/html_node/Exit-Status.html
  57. | (This link also contains other GNU-specific conventions)
  58. | BSD sysexits.h:
  59. | http://www.gsp.com/cgi-bin/man.cgi?section=3&topic=sysexits
  60. | Bash scripting:
  61. | http://tldp.org/LDP/abs/html/exitcodes.html
  62. |
  63. */
  64. defined('EXIT_SUCCESS') || define('EXIT_SUCCESS', 0); // no errors
  65. defined('EXIT_ERROR') || define('EXIT_ERROR', 1); // generic error
  66. defined('EXIT_CONFIG') || define('EXIT_CONFIG', 3); // configuration error
  67. defined('EXIT_UNKNOWN_FILE') || define('EXIT_UNKNOWN_FILE', 4); // file not found
  68. defined('EXIT_UNKNOWN_CLASS') || define('EXIT_UNKNOWN_CLASS', 5); // unknown class
  69. defined('EXIT_UNKNOWN_METHOD') || define('EXIT_UNKNOWN_METHOD', 6); // unknown class member
  70. defined('EXIT_USER_INPUT') || define('EXIT_USER_INPUT', 7); // invalid user input
  71. defined('EXIT_DATABASE') || define('EXIT_DATABASE', 8); // database error
  72. defined('EXIT__AUTO_MIN') || define('EXIT__AUTO_MIN', 9); // lowest automatically-assigned error code
  73. defined('EXIT__AUTO_MAX') || define('EXIT__AUTO_MAX', 125); // highest automatically-assigned error code