Application.php 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. <?php
  2. namespace Illuminate\Contracts\Foundation;
  3. use Illuminate\Contracts\Container\Container;
  4. interface Application extends Container
  5. {
  6. /**
  7. * Get the version number of the application.
  8. *
  9. * @return string
  10. */
  11. public function version();
  12. /**
  13. * Get the base path of the Laravel installation.
  14. *
  15. * @param string $path
  16. * @return string
  17. */
  18. public function basePath($path = '');
  19. /**
  20. * Get the path to the bootstrap directory.
  21. *
  22. * @param string $path
  23. * @return string
  24. */
  25. public function bootstrapPath($path = '');
  26. /**
  27. * Get the path to the application configuration files.
  28. *
  29. * @param string $path
  30. * @return string
  31. */
  32. public function configPath($path = '');
  33. /**
  34. * Get the path to the database directory.
  35. *
  36. * @param string $path
  37. * @return string
  38. */
  39. public function databasePath($path = '');
  40. /**
  41. * Get the path to the resources directory.
  42. *
  43. * @param string $path
  44. * @return string
  45. */
  46. public function resourcePath($path = '');
  47. /**
  48. * Get the path to the storage directory.
  49. *
  50. * @return string
  51. */
  52. public function storagePath();
  53. /**
  54. * Get or check the current application environment.
  55. *
  56. * @param string|array $environments
  57. * @return string|bool
  58. */
  59. public function environment(...$environments);
  60. /**
  61. * Determine if the application is running in the console.
  62. *
  63. * @return bool
  64. */
  65. public function runningInConsole();
  66. /**
  67. * Determine if the application is running unit tests.
  68. *
  69. * @return bool
  70. */
  71. public function runningUnitTests();
  72. /**
  73. * Determine if the application is currently down for maintenance.
  74. *
  75. * @return bool
  76. */
  77. public function isDownForMaintenance();
  78. /**
  79. * Register all of the configured providers.
  80. *
  81. * @return void
  82. */
  83. public function registerConfiguredProviders();
  84. /**
  85. * Register a service provider with the application.
  86. *
  87. * @param \Illuminate\Support\ServiceProvider|string $provider
  88. * @param bool $force
  89. * @return \Illuminate\Support\ServiceProvider
  90. */
  91. public function register($provider, $force = false);
  92. /**
  93. * Register a deferred provider and service.
  94. *
  95. * @param string $provider
  96. * @param string|null $service
  97. * @return void
  98. */
  99. public function registerDeferredProvider($provider, $service = null);
  100. /**
  101. * Resolve a service provider instance from the class name.
  102. *
  103. * @param string $provider
  104. * @return \Illuminate\Support\ServiceProvider
  105. */
  106. public function resolveProvider($provider);
  107. /**
  108. * Boot the application's service providers.
  109. *
  110. * @return void
  111. */
  112. public function boot();
  113. /**
  114. * Register a new boot listener.
  115. *
  116. * @param callable $callback
  117. * @return void
  118. */
  119. public function booting($callback);
  120. /**
  121. * Register a new "booted" listener.
  122. *
  123. * @param callable $callback
  124. * @return void
  125. */
  126. public function booted($callback);
  127. /**
  128. * Run the given array of bootstrap classes.
  129. *
  130. * @param array $bootstrappers
  131. * @return void
  132. */
  133. public function bootstrapWith(array $bootstrappers);
  134. /**
  135. * Get the current application locale.
  136. *
  137. * @return string
  138. */
  139. public function getLocale();
  140. /**
  141. * Get the application namespace.
  142. *
  143. * @return string
  144. *
  145. * @throws \RuntimeException
  146. */
  147. public function getNamespace();
  148. /**
  149. * Get the registered service provider instances if any exist.
  150. *
  151. * @param \Illuminate\Support\ServiceProvider|string $provider
  152. * @return array
  153. */
  154. public function getProviders($provider);
  155. /**
  156. * Determine if the application has been bootstrapped before.
  157. *
  158. * @return bool
  159. */
  160. public function hasBeenBootstrapped();
  161. /**
  162. * Load and boot all of the remaining deferred providers.
  163. *
  164. * @return void
  165. */
  166. public function loadDeferredProviders();
  167. /**
  168. * Set the current application locale.
  169. *
  170. * @param string $locale
  171. * @return void
  172. */
  173. public function setLocale($locale);
  174. /**
  175. * Determine if middleware has been disabled for the application.
  176. *
  177. * @return bool
  178. */
  179. public function shouldSkipMiddleware();
  180. /**
  181. * Terminate the application.
  182. *
  183. * @return void
  184. */
  185. public function terminate();
  186. }