Application.php 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254
  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 language files.
  42. *
  43. * @param string $path
  44. * @return string
  45. */
  46. public function langPath($path = '');
  47. /**
  48. * Get the path to the public directory.
  49. *
  50. * @param string $path
  51. * @return string
  52. */
  53. public function publicPath($path = '');
  54. /**
  55. * Get the path to the resources directory.
  56. *
  57. * @param string $path
  58. * @return string
  59. */
  60. public function resourcePath($path = '');
  61. /**
  62. * Get the path to the storage directory.
  63. *
  64. * @param string $path
  65. * @return string
  66. */
  67. public function storagePath($path = '');
  68. /**
  69. * Get or check the current application environment.
  70. *
  71. * @param string|array ...$environments
  72. * @return string|bool
  73. */
  74. public function environment(...$environments);
  75. /**
  76. * Determine if the application is running in the console.
  77. *
  78. * @return bool
  79. */
  80. public function runningInConsole();
  81. /**
  82. * Determine if the application is running unit tests.
  83. *
  84. * @return bool
  85. */
  86. public function runningUnitTests();
  87. /**
  88. * Determine if the application is running with debug mode enabled.
  89. *
  90. * @return bool
  91. */
  92. public function hasDebugModeEnabled();
  93. /**
  94. * Get an instance of the maintenance mode manager implementation.
  95. *
  96. * @return \Illuminate\Contracts\Foundation\MaintenanceMode
  97. */
  98. public function maintenanceMode();
  99. /**
  100. * Determine if the application is currently down for maintenance.
  101. *
  102. * @return bool
  103. */
  104. public function isDownForMaintenance();
  105. /**
  106. * Register all of the configured providers.
  107. *
  108. * @return void
  109. */
  110. public function registerConfiguredProviders();
  111. /**
  112. * Register a service provider with the application.
  113. *
  114. * @param \Illuminate\Support\ServiceProvider|string $provider
  115. * @param bool $force
  116. * @return \Illuminate\Support\ServiceProvider
  117. */
  118. public function register($provider, $force = false);
  119. /**
  120. * Register a deferred provider and service.
  121. *
  122. * @param string $provider
  123. * @param string|null $service
  124. * @return void
  125. */
  126. public function registerDeferredProvider($provider, $service = null);
  127. /**
  128. * Resolve a service provider instance from the class name.
  129. *
  130. * @param string $provider
  131. * @return \Illuminate\Support\ServiceProvider
  132. */
  133. public function resolveProvider($provider);
  134. /**
  135. * Boot the application's service providers.
  136. *
  137. * @return void
  138. */
  139. public function boot();
  140. /**
  141. * Register a new boot listener.
  142. *
  143. * @param callable $callback
  144. * @return void
  145. */
  146. public function booting($callback);
  147. /**
  148. * Register a new "booted" listener.
  149. *
  150. * @param callable $callback
  151. * @return void
  152. */
  153. public function booted($callback);
  154. /**
  155. * Run the given array of bootstrap classes.
  156. *
  157. * @param array $bootstrappers
  158. * @return void
  159. */
  160. public function bootstrapWith(array $bootstrappers);
  161. /**
  162. * Get the current application locale.
  163. *
  164. * @return string
  165. */
  166. public function getLocale();
  167. /**
  168. * Get the application namespace.
  169. *
  170. * @return string
  171. *
  172. * @throws \RuntimeException
  173. */
  174. public function getNamespace();
  175. /**
  176. * Get the registered service provider instances if any exist.
  177. *
  178. * @param \Illuminate\Support\ServiceProvider|string $provider
  179. * @return array
  180. */
  181. public function getProviders($provider);
  182. /**
  183. * Determine if the application has been bootstrapped before.
  184. *
  185. * @return bool
  186. */
  187. public function hasBeenBootstrapped();
  188. /**
  189. * Load and boot all of the remaining deferred providers.
  190. *
  191. * @return void
  192. */
  193. public function loadDeferredProviders();
  194. /**
  195. * Set the current application locale.
  196. *
  197. * @param string $locale
  198. * @return void
  199. */
  200. public function setLocale($locale);
  201. /**
  202. * Determine if middleware has been disabled for the application.
  203. *
  204. * @return bool
  205. */
  206. public function shouldSkipMiddleware();
  207. /**
  208. * Register a terminating callback with the application.
  209. *
  210. * @param callable|string $callback
  211. * @return \Illuminate\Contracts\Foundation\Application
  212. */
  213. public function terminating($callback);
  214. /**
  215. * Terminate the application.
  216. *
  217. * @return void
  218. */
  219. public function terminate();
  220. }