Autoload.php 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. <?php
  2. namespace Config;
  3. use CodeIgniter\Config\AutoloadConfig;
  4. /**
  5. * -------------------------------------------------------------------
  6. * AUTOLOADER CONFIGURATION
  7. * -------------------------------------------------------------------
  8. *
  9. * This file defines the namespaces and class maps so the Autoloader
  10. * can find the files as needed.
  11. *
  12. * NOTE: If you use an identical key in $psr4 or $classmap, then
  13. * the values in this file will overwrite the framework's values.
  14. *
  15. * NOTE: This class is required prior to Autoloader instantiation,
  16. * and does not extend BaseConfig.
  17. *
  18. * @immutable
  19. */
  20. class Autoload extends AutoloadConfig
  21. {
  22. /**
  23. * -------------------------------------------------------------------
  24. * Namespaces
  25. * -------------------------------------------------------------------
  26. * This maps the locations of any namespaces in your application to
  27. * their location on the file system. These are used by the autoloader
  28. * to locate files the first time they have been instantiated.
  29. *
  30. * The '/app' and '/system' directories are already mapped for you.
  31. * you may change the name of the 'App' namespace if you wish,
  32. * but this should be done prior to creating any namespaced classes,
  33. * else you will need to modify all of those classes for this to work.
  34. *
  35. * Prototype:
  36. * $psr4 = [
  37. * 'CodeIgniter' => SYSTEMPATH,
  38. * 'App' => APPPATH
  39. * ];
  40. *
  41. * @var array<string, array<int, string>|string>
  42. * @phpstan-var array<string, string|list<string>>
  43. */
  44. public $psr4 = [
  45. APP_NAMESPACE => APPPATH, // For custom app namespace
  46. 'Config' => APPPATH . 'Config',
  47. ];
  48. /**
  49. * -------------------------------------------------------------------
  50. * Class Map
  51. * -------------------------------------------------------------------
  52. * The class map provides a map of class names and their exact
  53. * location on the drive. Classes loaded in this manner will have
  54. * slightly faster performance because they will not have to be
  55. * searched for within one or more directories as they would if they
  56. * were being autoloaded through a namespace.
  57. *
  58. * Prototype:
  59. * $classmap = [
  60. * 'MyClass' => '/path/to/class/file.php'
  61. * ];
  62. *
  63. * @var array<string, string>
  64. */
  65. public $classmap = [];
  66. /**
  67. * -------------------------------------------------------------------
  68. * Files
  69. * -------------------------------------------------------------------
  70. * The files array provides a list of paths to __non-class__ files
  71. * that will be autoloaded. This can be useful for bootstrap operations
  72. * or for loading functions.
  73. *
  74. * Prototype:
  75. * $files = [
  76. * '/path/to/my/file.php',
  77. * ];
  78. *
  79. * @var string[]
  80. * @phpstan-var list<string>
  81. */
  82. public $files = [];
  83. /**
  84. * -------------------------------------------------------------------
  85. * Helpers
  86. * -------------------------------------------------------------------
  87. * Prototype:
  88. * $helpers = [
  89. * 'form',
  90. * ];
  91. *
  92. * @var string[]
  93. * @phpstan-var list<string>
  94. */
  95. public $helpers = [];
  96. }