Application.php 5.0 KB

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