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