1 | <?php |
||
2 | |||
3 | declare(strict_types=1); |
||
4 | |||
5 | /* |
||
6 | * This file is part of the Valkyrja Framework package. |
||
7 | * |
||
8 | * (c) Melech Mizrachi <[email protected]> |
||
9 | * |
||
10 | * For the full copyright and license information, please view the LICENSE |
||
11 | * file that was distributed with this source code. |
||
12 | */ |
||
13 | |||
14 | namespace Valkyrja\Application; |
||
15 | |||
16 | use Twig\Extension\ExtensionInterface as TwigExtensionInterface; |
||
17 | use Valkyrja\Application\Constant\ComponentClass; |
||
18 | use Valkyrja\Application\Contract\Application; |
||
19 | use Valkyrja\Application\Support\Component; |
||
20 | use Valkyrja\Auth\Constant\RouteName; |
||
21 | use Valkyrja\Auth\Constant\SessionId; |
||
22 | use Valkyrja\Auth\Contract\Authenticator; |
||
23 | use Valkyrja\Auth\Entity\Contract\User; |
||
24 | use Valkyrja\Auth\Entity\User as UserEntity; |
||
25 | use Valkyrja\Auth\SessionAuthenticator; |
||
26 | use Valkyrja\Auth\Store\Contract\Store; |
||
27 | use Valkyrja\Auth\Store\OrmStore; |
||
28 | use Valkyrja\Broadcast\Contract\Broadcaster; |
||
29 | use Valkyrja\Broadcast\PusherBroadcaster; |
||
30 | use Valkyrja\Cache\Contract\Cache; |
||
31 | use Valkyrja\Cache\RedisCache; |
||
32 | use Valkyrja\Cli\Middleware\Contract\CommandDispatchedMiddleware; |
||
33 | use Valkyrja\Cli\Middleware\Contract\CommandMatchedMiddleware; |
||
34 | use Valkyrja\Cli\Middleware\Contract\CommandNotMatchedMiddleware; |
||
35 | use Valkyrja\Cli\Middleware\Contract\ExitedMiddleware; |
||
36 | use Valkyrja\Cli\Middleware\Contract\InputReceivedMiddleware; |
||
37 | use Valkyrja\Cli\Middleware\Contract\ThrowableCaughtMiddleware; |
||
38 | use Valkyrja\Crypt\Contract\Crypt; |
||
39 | use Valkyrja\Crypt\SodiumCrypt; |
||
40 | use Valkyrja\Filesystem\Contract\Filesystem; |
||
41 | use Valkyrja\Filesystem\FlysystemFilesystem; |
||
42 | use Valkyrja\Filesystem\LocalFlysystemFilesystem; |
||
43 | use Valkyrja\Http\Client\Contract\Client; |
||
44 | use Valkyrja\Http\Client\GuzzleClient; |
||
45 | use Valkyrja\Http\Message\Constant\HeaderName; |
||
46 | use Valkyrja\Http\Message\Enum\SameSite; |
||
47 | use Valkyrja\Http\Middleware\Contract\RequestReceivedMiddleware as HttpRequestReceivedMiddleware; |
||
48 | use Valkyrja\Http\Middleware\Contract\RouteDispatchedMiddleware as HttpRouteDispatchedMiddleware; |
||
49 | use Valkyrja\Http\Middleware\Contract\RouteMatchedMiddleware as HttpRouteMatchedMiddleware; |
||
50 | use Valkyrja\Http\Middleware\Contract\RouteNotMatchedMiddleware as HttpRouteNotMatchedMiddleware; |
||
51 | use Valkyrja\Http\Middleware\Contract\SendingResponseMiddleware as HttpSendingResponseMiddleware; |
||
52 | use Valkyrja\Http\Middleware\Contract\TerminatedMiddleware as HttpTerminatedMiddleware; |
||
53 | use Valkyrja\Http\Middleware\Contract\ThrowableCaughtMiddleware as HttpThrowableCaughtMiddleware; |
||
54 | use Valkyrja\Jwt\Contract\Jwt; |
||
55 | use Valkyrja\Jwt\Enum\Algorithm; |
||
56 | use Valkyrja\Jwt\FirebaseJwt; |
||
57 | use Valkyrja\Log\Contract\Logger; |
||
58 | use Valkyrja\Log\PsrLogger; |
||
59 | use Valkyrja\Mail\Contract\Mailer; |
||
60 | use Valkyrja\Mail\MailgunMailer; |
||
61 | use Valkyrja\Orm\Contract\Manager; |
||
62 | use Valkyrja\Orm\MysqlManager; |
||
63 | use Valkyrja\Session\Contract\Session; |
||
64 | use Valkyrja\Session\PhpSession; |
||
65 | use Valkyrja\Sms\Contract\Sms; |
||
66 | use Valkyrja\Sms\VonageSms; |
||
67 | use Valkyrja\View\Contract\Renderer; |
||
68 | use Valkyrja\View\PhpRenderer; |
||
69 | |||
70 | /** |
||
71 | * Class Env. |
||
72 | * |
||
73 | * @author Melech Mizrachi |
||
74 | * |
||
75 | * @see https://psalm.dev/r/eb18b4d7ae This one is fine |
||
76 | * @see https://psalm.dev/r/36fd31ac0e This on breaks, the moment we use an annotation?!!?!? |
||
77 | */ |
||
78 | class Env |
||
79 | { |
||
80 | /************************************************************ |
||
81 | * |
||
82 | * Application component env variables. |
||
83 | * |
||
84 | ************************************************************/ |
||
85 | |||
86 | /** @var non-empty-string */ |
||
87 | public const string APP_ENV = 'local'; |
||
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||
88 | /** @var non-empty-string */ |
||
89 | public const string APP_NAMESPACE = 'App'; |
||
90 | /** @var bool */ |
||
91 | public const bool APP_DEBUG_MODE = true; |
||
92 | /** @var non-empty-string */ |
||
93 | public const string APP_URL = 'localhost'; |
||
94 | /** @var non-empty-string */ |
||
95 | public const string APP_TIMEZONE = 'UTC'; |
||
96 | /** @var non-empty-string */ |
||
97 | public const string APP_VERSION = Application::VERSION; |
||
98 | /** @var non-empty-string */ |
||
99 | public const string APP_KEY = 'some_secret_app_key'; |
||
100 | /** @var class-string<Component>[] */ |
||
101 | public const array APP_COMPONENTS = [ |
||
102 | ComponentClass::API, |
||
103 | ComponentClass::AUTH, |
||
104 | ComponentClass::BROADCAST, |
||
105 | ComponentClass::CACHE, |
||
106 | ComponentClass::CRYPT, |
||
107 | ComponentClass::FILESYSTEM, |
||
108 | ComponentClass::JWT, |
||
109 | ComponentClass::LOG, |
||
110 | ComponentClass::MAIL, |
||
111 | ComponentClass::NOTIFICATION, |
||
112 | ComponentClass::ORM, |
||
113 | ComponentClass::SESSION, |
||
114 | ComponentClass::SMS, |
||
115 | ComponentClass::VIEW, |
||
116 | ]; |
||
117 | /** @var non-empty-string */ |
||
118 | public const string APP_DIR = __DIR__ . '/..'; |
||
119 | /** @var non-empty-string */ |
||
120 | public const string APP_CACHE_FILE_PATH = __DIR__ . '/../storage/framework/cache/cache.php'; |
||
121 | |||
122 | /************************************************************ |
||
123 | * |
||
124 | * Auth component env variables. |
||
125 | * |
||
126 | ************************************************************/ |
||
127 | |||
128 | /** @var class-string<Authenticator> */ |
||
129 | public const string AUTH_DEFAULT_AUTHENTICATOR = SessionAuthenticator::class; |
||
130 | /** @var class-string<Store> */ |
||
131 | public const string AUTH_DEFAULT_STORE = OrmStore::class; |
||
132 | /** @var class-string<User> */ |
||
133 | public const string AUTH_DEFAULT_USER_ENTITY = UserEntity::class; |
||
134 | /** @var non-empty-string */ |
||
135 | public const string AUTH_DEFAULT_SESSION_ID = SessionId::AUTHENTICATED_USERS; |
||
136 | /** @var non-empty-string */ |
||
137 | public const string AUTH_DEFAULT_AUTHORIZATION_HEADER = HeaderName::AUTHORIZATION; |
||
138 | /** @var non-empty-string */ |
||
139 | public const string AUTH_AUTHENTICATE_ROUTE = RouteName::AUTHENTICATE; |
||
140 | /** @var non-empty-string|null */ |
||
141 | public const string|null AUTH_AUTHENTICATE_URL = null; |
||
142 | /** @var non-empty-string */ |
||
143 | public const string AUTH_NOT_AUTHENTICATED_ROUTE = RouteName::DASHBOARD; |
||
144 | /** @var non-empty-string|null */ |
||
145 | public const string|null AUTH_NOT_AUTHENTICATED_URL = null; |
||
146 | /** @var non-empty-string */ |
||
147 | public const string AUTH_PASSWORD_CONFIRM_ROUTE = RouteName::PASSWORD_CONFIRM; |
||
148 | /** @var positive-int */ |
||
149 | public const int AUTH_PASSWORD_TIMEOUT = 10800; |
||
150 | |||
151 | /************************************************************ |
||
152 | * |
||
153 | * Broadcast component env variables. |
||
154 | * |
||
155 | ************************************************************/ |
||
156 | |||
157 | /** @var class-string<Broadcaster> */ |
||
158 | public const string BROADCAST_DEFAULT_BROADCASTER = PusherBroadcaster::class; |
||
159 | /** @var non-empty-string */ |
||
160 | public const string BROADCAST_PUSHER_KEY = 'pusher-key'; |
||
161 | /** @var non-empty-string */ |
||
162 | public const string BROADCAST_PUSHER_SECRET = 'pusher-secret'; |
||
163 | /** @var non-empty-string */ |
||
164 | public const string BROADCAST_PUSHER_ID = 'pusher-id'; |
||
165 | /** @var non-empty-string */ |
||
166 | public const string BROADCAST_PUSHER_CLUSTER = 'us1'; |
||
167 | /** @var bool */ |
||
168 | public const bool BROADCAST_PUSHER_USE_TLS = true; |
||
169 | /** @var class-string<Logger> */ |
||
170 | public const string BROADCAST_LOG_LOGGER = Logger::class; |
||
171 | |||
172 | /************************************************************ |
||
173 | * |
||
174 | * Cache component env variables. |
||
175 | * |
||
176 | ************************************************************/ |
||
177 | |||
178 | /** @var class-string<Cache> */ |
||
179 | public const string CACHE_DEFAULT = RedisCache::class; |
||
180 | /** @var non-empty-string */ |
||
181 | public const string CACHE_REDIS_HOST = '127.0.0.1'; |
||
182 | /** @var int */ |
||
183 | public const int CACHE_REDIS_PORT = 6379; |
||
184 | /** @var string */ |
||
185 | public const string CACHE_REDIS_PREFIX = ''; |
||
186 | /** @var string */ |
||
187 | public const string CACHE_LOG_PREFIX = ''; |
||
188 | /** @var class-string<Logger> */ |
||
189 | public const string CACHE_LOG_LOGGER = Logger::class; |
||
190 | /** @var string */ |
||
191 | public const string CACHE_NULL_PREFIX = ''; |
||
192 | |||
193 | /************************************************************ |
||
194 | * |
||
195 | * Cli Interaction component env variables. |
||
196 | * |
||
197 | ************************************************************/ |
||
198 | |||
199 | /** @var bool */ |
||
200 | public const bool CLI_INTERACTION_IS_QUIET = false; |
||
201 | /** @var bool */ |
||
202 | public const bool CLI_INTERACTION_IS_INTERACTIVE = true; |
||
203 | /** @var bool */ |
||
204 | public const bool CLI_INTERACTION_IS_SILENT = false; |
||
205 | |||
206 | /************************************************************ |
||
207 | * |
||
208 | * Cli Middleware component env variables. |
||
209 | * |
||
210 | ************************************************************/ |
||
211 | |||
212 | /** @var class-string<InputReceivedMiddleware>[] */ |
||
213 | public const array CLI_MIDDLEWARE_INPUT_RECEIVED = []; |
||
214 | /** @var class-string<CommandMatchedMiddleware>[] */ |
||
215 | public const array CLI_MIDDLEWARE_COMMAND_MATCHED = []; |
||
216 | /** @var class-string<CommandNotMatchedMiddleware>[] */ |
||
217 | public const array CLI_MIDDLEWARE_COMMAND_NOT_MATCHED = []; |
||
218 | /** @var class-string<CommandDispatchedMiddleware>[] */ |
||
219 | public const array CLI_MIDDLEWARE_COMMAND_DISPATCHED = []; |
||
220 | /** @var class-string<ThrowableCaughtMiddleware>[] */ |
||
221 | public const array CLI_MIDDLEWARE_THROWABLE_CAUGHT = []; |
||
222 | /** @var class-string<ExitedMiddleware>[] */ |
||
223 | public const array CLI_MIDDLEWARE_EXITED = []; |
||
224 | |||
225 | /************************************************************ |
||
226 | * |
||
227 | * Crypt component env variables. |
||
228 | * |
||
229 | ************************************************************/ |
||
230 | |||
231 | /** @var class-string<Crypt> */ |
||
232 | public const string CRYPT_DEFAULT = SodiumCrypt::class; |
||
233 | |||
234 | /************************************************************ |
||
235 | * |
||
236 | * Filesystem component env variables. |
||
237 | * |
||
238 | ************************************************************/ |
||
239 | |||
240 | /** @var class-string<Filesystem> */ |
||
241 | public const string FILESYSTEM_DEFAULT = FlysystemFilesystem::class; |
||
242 | /** @var class-string<FlysystemFilesystem> */ |
||
243 | public const string FLYSYSTEM_FILESYSTEM_DEFAULT = LocalFlysystemFilesystem::class; |
||
244 | /** @var non-empty-string */ |
||
245 | public const string FILESYSTEM_FLYSYSTEM_LOCAL_DIR = __DIR__ . '/../storage/app'; |
||
246 | /** @var non-empty-string */ |
||
247 | public const string FILESYSTEM_FLYSYSTEM_S3_KEY = 's3-key'; |
||
248 | /** @var non-empty-string */ |
||
249 | public const string FILESYSTEM_FLYSYSTEM_S3_SECRET = 's3-secret'; |
||
250 | /** @var non-empty-string */ |
||
251 | public const string FILESYSTEM_FLYSYSTEM_S3_REGION = 'us-east-1'; |
||
252 | /** @var non-empty-string */ |
||
253 | public const string FILESYSTEM_FLYSYSTEM_S3_VERSION = 'latest'; |
||
254 | /** @var non-empty-string */ |
||
255 | public const string FILESYSTEM_FLYSYSTEM_S3_BUCKET = 's3-bucket'; |
||
256 | /** @var string */ |
||
257 | public const string FILESYSTEM_FLYSYSTEM_S3_PREFIX = ''; |
||
258 | /** @var array<string, mixed> */ |
||
259 | public const array FILESYSTEM_FLYSYSTEM_S3_OPTIONS = []; |
||
260 | |||
261 | /************************************************************ |
||
262 | * |
||
263 | * Http Client component env variables. |
||
264 | * |
||
265 | ************************************************************/ |
||
266 | |||
267 | /** @var class-string<Client> */ |
||
268 | public const string HTTP_CLIENT_DEFAULT = GuzzleClient::class; |
||
269 | |||
270 | /************************************************************ |
||
271 | * |
||
272 | * Http Middleware component env variables. |
||
273 | * |
||
274 | ************************************************************/ |
||
275 | |||
276 | /** @var class-string<HttpRequestReceivedMiddleware>[] */ |
||
277 | public const array HTTP_MIDDLEWARE_REQUEST_RECEIVED = []; |
||
278 | /** @var class-string<HttpRouteDispatchedMiddleware>[] */ |
||
279 | public const array HTTP_MIDDLEWARE_ROUTE_DISPATCHED = []; |
||
280 | /** @var class-string<HttpThrowableCaughtMiddleware>[] */ |
||
281 | public const array HTTP_MIDDLEWARE_THROWABLE_CAUGHT = []; |
||
282 | /** @var class-string<HttpRouteMatchedMiddleware>[] */ |
||
283 | public const array HTTP_MIDDLEWARE_ROUTE_MATCHED = []; |
||
284 | /** @var class-string<HttpRouteNotMatchedMiddleware>[] */ |
||
285 | public const array HTTP_MIDDLEWARE_ROUTE_NOT_MATCHED = []; |
||
286 | /** @var class-string<HttpSendingResponseMiddleware>[] */ |
||
287 | public const array HTTP_MIDDLEWARE_SENDING_RESPONSE = []; |
||
288 | /** @var class-string<HttpTerminatedMiddleware>[] */ |
||
289 | public const array HTTP_MIDDLEWARE_TERMINATED = []; |
||
290 | |||
291 | /************************************************************ |
||
292 | * |
||
293 | * Jwt component env variables. |
||
294 | * |
||
295 | ************************************************************/ |
||
296 | |||
297 | /** @var class-string<Jwt> */ |
||
298 | public const string JWT_DEFAULT = FirebaseJwt::class; |
||
299 | /** @var Algorithm */ |
||
300 | public const Algorithm JWT_ALGORITHM = Algorithm::HS256; |
||
301 | /** @var non-empty-string */ |
||
302 | public const string JWT_HS_KEY = 'key'; |
||
303 | /** @var non-empty-string */ |
||
304 | public const string JWT_RS_PRIVATE_KEY = 'private-key'; |
||
305 | /** @var non-empty-string */ |
||
306 | public const string JWT_RS_PUBLIC_KEY = 'public-key'; |
||
307 | /** @var non-empty-string */ |
||
308 | public const string JWT_EDDSA_PRIVATE_KEY = 'private-key'; |
||
309 | /** @var non-empty-string */ |
||
310 | public const string JWT_EDDSA_PUBLIC_KEY = 'public-key'; |
||
311 | |||
312 | /************************************************************ |
||
313 | * |
||
314 | * Log component env variables. |
||
315 | * |
||
316 | ************************************************************/ |
||
317 | |||
318 | /** @var class-string<Logger> */ |
||
319 | public const string LOG_DEFAULT_LOGGER = PsrLogger::class; |
||
320 | |||
321 | /************************************************************ |
||
322 | * |
||
323 | * Mail component env variables. |
||
324 | * |
||
325 | ************************************************************/ |
||
326 | |||
327 | /** @var class-string<Mailer> */ |
||
328 | public const string MAIL_DEFAULT_MAILER = MailgunMailer::class; |
||
329 | /** @var non-empty-string */ |
||
330 | public const string MAIL_MAILGUN_API_KEY = 'api-key'; |
||
331 | /** @var non-empty-string */ |
||
332 | public const string MAIL_MAILGUN_DOMAIN = 'domain'; |
||
333 | /** @var non-empty-string */ |
||
334 | public const string MAIL_PHP_MAILER_HOST = 'host'; |
||
335 | /** @var int */ |
||
336 | public const int MAIL_PHP_MAILER_PORT = 25; |
||
337 | /** @var non-empty-string */ |
||
338 | public const string MAIL_PHP_MAILER_USERNAME = 'username'; |
||
339 | /** @var non-empty-string */ |
||
340 | public const string MAIL_PHP_MAILER_PASSWORD = 'password'; |
||
341 | /** @var non-empty-string */ |
||
342 | public const string MAIL_PHP_MAILER_ENCRYPTION = 'ssl'; |
||
343 | |||
344 | /************************************************************ |
||
345 | * |
||
346 | * Orm component env variables. |
||
347 | * |
||
348 | ************************************************************/ |
||
349 | |||
350 | /** @var class-string<Manager> */ |
||
351 | public const string ORM_DEFAULT_MANAGER = MysqlManager::class; |
||
352 | /** @var non-empty-string */ |
||
353 | public const string ORM_PGSQL_HOST = '127.0.0.1'; |
||
354 | /** @var positive-int */ |
||
355 | public const int ORM_PGSQL_PORT = 6379; |
||
356 | /** @var non-empty-string|null */ |
||
357 | public const string|null ORM_PGSQL_DB = 'valkyrja'; |
||
358 | /** @var non-empty-string|null */ |
||
359 | public const string|null ORM_PGSQL_USER = 'valkyrja'; |
||
360 | /** @var non-empty-string|null */ |
||
361 | public const string|null ORM_PGSQL_PASSWORD = 'pgsql-password'; |
||
362 | /** @var non-empty-string|null */ |
||
363 | public const string|null ORM_PGSQL_CHARSET = 'utf8'; |
||
364 | /** @var array<int, int|bool>|null */ |
||
365 | public const array|null ORM_PGSQL_OPTIONS = null; |
||
366 | /** @var non-empty-string */ |
||
367 | public const string ORM_PGSQL_SCHEMA = 'public'; |
||
368 | /** @var non-empty-string */ |
||
369 | public const string ORM_PGSQL_SSL_MODE = 'prefer'; |
||
370 | /** @var non-empty-string */ |
||
371 | public const string ORM_MYSQL_HOST = '127.0.0.1'; |
||
372 | /** @var positive-int */ |
||
373 | public const int ORM_MYSQL_PORT = 3306; |
||
374 | /** @var non-empty-string */ |
||
375 | public const string ORM_MYSQL_DB = 'valkyrja'; |
||
376 | /** @var non-empty-string */ |
||
377 | public const string ORM_MYSQL_USER = 'valkyrja'; |
||
378 | /** @var non-empty-string */ |
||
379 | public const string ORM_MYSQL_PASSWORD = 'mysql-password'; |
||
380 | /** @var non-empty-string */ |
||
381 | public const string ORM_MYSQL_CHARSET = 'utf8mb4'; |
||
382 | /** @var array<int, int|bool>|null */ |
||
383 | public const array|null ORM_MYSQL_OPTIONS = null; |
||
384 | /** @var bool|null */ |
||
385 | public const bool|null ORM_MYSQL_STRICT = null; |
||
386 | /** @var non-empty-string|null */ |
||
387 | public const string|null ORM_MYSQL_ENGINE = null; |
||
388 | /** @var non-empty-string */ |
||
389 | public const string ORM_SQLITE_HOST = '127.0.0.1'; |
||
390 | /** @var positive-int */ |
||
391 | public const int ORM_SQLITE_PORT = 3306; |
||
392 | /** @var non-empty-string */ |
||
393 | public const string ORM_SQLITE_DB = 'valkyrja'; |
||
394 | /** @var non-empty-string */ |
||
395 | public const string ORM_SQLITE_USER = 'valkyrja'; |
||
396 | /** @var non-empty-string */ |
||
397 | public const string ORM_SQLITE_PASSWORD = 'sqlite-password'; |
||
398 | /** @var non-empty-string */ |
||
399 | public const string ORM_SQLITE_CHARSET = 'utf8'; |
||
400 | /** @var array<int, int|bool>|null */ |
||
401 | public const array|null ORM_SQLITE_OPTIONS = null; |
||
402 | |||
403 | /************************************************************ |
||
404 | * |
||
405 | * Session component env variables. |
||
406 | * |
||
407 | ************************************************************/ |
||
408 | |||
409 | /** @var class-string<Session> */ |
||
410 | public const string SESSION_DEFAULT = PhpSession::class; |
||
411 | /** @var non-empty-string|null */ |
||
412 | public const string|null SESSION_PHP_ID = null; |
||
413 | /** @var non-empty-string|null */ |
||
414 | public const string|null SESSION_PHP_NAME = null; |
||
415 | /** @var non-empty-string */ |
||
416 | public const string SESSION_COOKIE_PARAM_PATH = '/'; |
||
417 | /** @var non-empty-string|null */ |
||
418 | public const string|null SESSION_COOKIE_PARAM_DOMAIN = null; |
||
419 | /** @var int */ |
||
420 | public const int SESSION_COOKIE_PARAM_LIFETIME = 0; |
||
421 | /** @var bool */ |
||
422 | public const bool SESSION_COOKIE_PARAM_SECURE = false; |
||
423 | /** @var bool */ |
||
424 | public const bool SESSION_COOKIE_PARAM_HTTP_ONLY = false; |
||
425 | /** @var SameSite */ |
||
426 | public const SameSite SESSION_COOKIE_PARAM_SAME_SITE = SameSite::NONE; |
||
427 | |||
428 | /************************************************************ |
||
429 | * |
||
430 | * SMS component env variables. |
||
431 | * |
||
432 | ************************************************************/ |
||
433 | /** @var class-string<Sms> */ |
||
434 | public const string SMS_DEFAULT_MESSENGER = VonageSms::class; |
||
435 | /** @var non-empty-string */ |
||
436 | public const string SMS_VONAGE_KEY = 'vonage-key'; |
||
437 | /** @var non-empty-string */ |
||
438 | public const string SMS_VONAGE_SECRET = 'vonage-secret'; |
||
439 | |||
440 | /************************************************************ |
||
441 | * |
||
442 | * View component env variables. |
||
443 | * |
||
444 | ************************************************************/ |
||
445 | /** @var class-string<Renderer> */ |
||
446 | public const string VIEW_DEFAULT_RENDERER = PhpRenderer::class; |
||
447 | /** @var non-empty-string */ |
||
448 | public const string VIEW_ORKA_FILE_EXTENSION = '.orka.phtml'; |
||
449 | /** @var non-empty-string */ |
||
450 | public const string VIEW_ORKA_DIR = __DIR__ . '/../resources/views'; |
||
451 | /** @var array<string, string> */ |
||
452 | public const array VIEW_ORKA_PATHS = []; |
||
453 | /** @var non-empty-string */ |
||
454 | public const string VIEW_PHP_FILE_EXTENSION = '.phtml'; |
||
455 | /** @var non-empty-string */ |
||
456 | public const string VIEW_PHP_DIR = __DIR__ . '/../resources/views'; |
||
457 | /** @var array<string, string> */ |
||
458 | public const array VIEW_PHP_PATHS = []; |
||
459 | /** @var array<string, string> */ |
||
460 | public const array VIEW_TWIG_PATHS = []; |
||
461 | /** @var class-string<TwigExtensionInterface>[] */ |
||
462 | public const array VIEW_TWIG_EXTENSIONS = []; |
||
463 | /** @var non-empty-string */ |
||
464 | public const string VIEW_TWIG_COMPILED_DIR = __DIR__ . '/../storage/views'; |
||
465 | } |
||
466 |