Application.php 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295
  1. <?php
  2. namespace Illuminate\Contracts\Foundation;
  3. use Closure;
  4. use Illuminate\Contracts\Container\Container;
  5. interface Application extends Container
  6. {
  7. /**
  8. * Get the version number of the application.
  9. *
  10. * @return string
  11. */
  12. public function version();
  13. /**
  14. * Get the base path of the Laravel installation.
  15. *
  16. * @return string
  17. */
  18. public function basePath();
  19. /**
  20. * Get the path to the bootstrap directory.
  21. *
  22. * @param string $path Optionally, a path to append to the bootstrap 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 Optionally, a path to append to the config path
  30. * @return string
  31. */
  32. public function configPath($path = '');
  33. /**
  34. * Get the path to the database directory.
  35. *
  36. * @param string $path Optionally, a path to append to the database path
  37. * @return string
  38. */
  39. public function databasePath($path = '');
  40. /**
  41. * Get the path to the environment file directory.
  42. *
  43. * @return string
  44. */
  45. public function environmentPath();
  46. /**
  47. * Get the path to the resources directory.
  48. *
  49. * @param string $path
  50. * @return string
  51. */
  52. public function resourcePath($path = '');
  53. /**
  54. * Get the path to the storage directory.
  55. *
  56. * @return string
  57. */
  58. public function storagePath();
  59. /**
  60. * Get or check the current application environment.
  61. *
  62. * @param string|array $environments
  63. * @return string|bool
  64. */
  65. public function environment(...$environments);
  66. /**
  67. * Determine if the application is running in the console.
  68. *
  69. * @return bool
  70. */
  71. public function runningInConsole();
  72. /**
  73. * Determine if the application is running unit tests.
  74. *
  75. * @return bool
  76. */
  77. public function runningUnitTests();
  78. /**
  79. * Determine if the application is currently down for maintenance.
  80. *
  81. * @return bool
  82. */
  83. public function isDownForMaintenance();
  84. /**
  85. * Register all of the configured providers.
  86. *
  87. * @return void
  88. */
  89. public function registerConfiguredProviders();
  90. /**
  91. * Register a service provider with the application.
  92. *
  93. * @param \Illuminate\Support\ServiceProvider|string $provider
  94. * @param bool $force
  95. * @return \Illuminate\Support\ServiceProvider
  96. */
  97. public function register($provider, $force = false);
  98. /**
  99. * Register a deferred provider and service.
  100. *
  101. * @param string $provider
  102. * @param string|null $service
  103. * @return void
  104. */
  105. public function registerDeferredProvider($provider, $service = null);
  106. /**
  107. * Resolve a service provider instance from the class name.
  108. *
  109. * @param string $provider
  110. * @return \Illuminate\Support\ServiceProvider
  111. */
  112. public function resolveProvider($provider);
  113. /**
  114. * Boot the application's service providers.
  115. *
  116. * @return void
  117. */
  118. public function boot();
  119. /**
  120. * Register a new boot listener.
  121. *
  122. * @param callable $callback
  123. * @return void
  124. */
  125. public function booting($callback);
  126. /**
  127. * Register a new "booted" listener.
  128. *
  129. * @param callable $callback
  130. * @return void
  131. */
  132. public function booted($callback);
  133. /**
  134. * Run the given array of bootstrap classes.
  135. *
  136. * @param array $bootstrappers
  137. * @return void
  138. */
  139. public function bootstrapWith(array $bootstrappers);
  140. /**
  141. * Determine if the application configuration is cached.
  142. *
  143. * @return bool
  144. */
  145. public function configurationIsCached();
  146. /**
  147. * Detect the application's current environment.
  148. *
  149. * @param \Closure $callback
  150. * @return string
  151. */
  152. public function detectEnvironment(Closure $callback);
  153. /**
  154. * Get the environment file the application is using.
  155. *
  156. * @return string
  157. */
  158. public function environmentFile();
  159. /**
  160. * Get the fully qualified path to the environment file.
  161. *
  162. * @return string
  163. */
  164. public function environmentFilePath();
  165. /**
  166. * Get the path to the configuration cache file.
  167. *
  168. * @return string
  169. */
  170. public function getCachedConfigPath();
  171. /**
  172. * Get the path to the cached services.php file.
  173. *
  174. * @return string
  175. */
  176. public function getCachedServicesPath();
  177. /**
  178. * Get the path to the cached packages.php file.
  179. *
  180. * @return string
  181. */
  182. public function getCachedPackagesPath();
  183. /**
  184. * Get the path to the routes cache file.
  185. *
  186. * @return string
  187. */
  188. public function getCachedRoutesPath();
  189. /**
  190. * Get the current application locale.
  191. *
  192. * @return string
  193. */
  194. public function getLocale();
  195. /**
  196. * Get the application namespace.
  197. *
  198. * @return string
  199. *
  200. * @throws \RuntimeException
  201. */
  202. public function getNamespace();
  203. /**
  204. * Get the registered service provider instances if any exist.
  205. *
  206. * @param \Illuminate\Support\ServiceProvider|string $provider
  207. * @return array
  208. */
  209. public function getProviders($provider);
  210. /**
  211. * Determine if the application has been bootstrapped before.
  212. *
  213. * @return bool
  214. */
  215. public function hasBeenBootstrapped();
  216. /**
  217. * Load and boot all of the remaining deferred providers.
  218. *
  219. * @return void
  220. */
  221. public function loadDeferredProviders();
  222. /**
  223. * Set the environment file to be loaded during bootstrapping.
  224. *
  225. * @param string $file
  226. * @return $this
  227. */
  228. public function loadEnvironmentFrom($file);
  229. /**
  230. * Determine if the application routes are cached.
  231. *
  232. * @return bool
  233. */
  234. public function routesAreCached();
  235. /**
  236. * Set the current application locale.
  237. *
  238. * @param string $locale
  239. * @return void
  240. */
  241. public function setLocale($locale);
  242. /**
  243. * Determine if middleware has been disabled for the application.
  244. *
  245. * @return bool
  246. */
  247. public function shouldSkipMiddleware();
  248. /**
  249. * Terminate the application.
  250. *
  251. * @return void
  252. */
  253. public function terminate();
  254. }