Skip to content

Commit 5f8de40

Browse files
committed
AppKernel. Доработки.
1 parent 149ae8d commit 5f8de40

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
"vlucas/phpdotenv": "3.* || 4.*"
5151
},
5252
"require-dev": {
53-
"proklung/bitrix-phpunit-testing-tools": "^1.1",
53+
"proklung/bitrix-phpunit-testing-tools": "^1.4",
5454
"icanhazstring/composer-unused": "^0.7.5"
5555
},
5656
"extra": {

src/Services/AppKernel.php

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@ class AppKernel extends Kernel
5656
*/
5757
protected $projectDir;
5858

59+
/**
60+
* @var string $warmupDir
61+
*/
62+
protected $warmupDir;
63+
5964
/**
6065
* AppKernel constructor.
6166
*
@@ -112,6 +117,15 @@ public function getProjectDir(): string
112117
return $this->projectDir;
113118
}
114119

120+
/**
121+
* {@inheritdoc}
122+
*/
123+
public function getBuildDir(): string
124+
{
125+
// Returns $this->getCacheDir() for backward compatibility
126+
return $this->getCacheDir();
127+
}
128+
115129
/**
116130
* Параметры ядра. Пути, debug & etc.
117131
*
@@ -123,10 +137,11 @@ public function getKernelParameters(): array
123137

124138
return [
125139
'kernel.project_dir' => realpath($this->getProjectDir()) ?: $this->getProjectDir(),
126-
// Deprecated. Для совместимости.
127140
'kernel.root_dir' => realpath($this->getProjectDir()) ?: $this->getProjectDir(),
128141
'kernel.environment' => $this->environment,
142+
'kernel.runtime_environment' => '%env(default:kernel.environment:APP_RUNTIME_ENV)%',
129143
'kernel.debug' => $this->debug,
144+
'kernel.build_dir' => realpath($buildDir = $this->warmupDir ?: $this->getBuildDir()) ?: $buildDir,
130145
'kernel.cache_dir' => $this->getCacheDir(),
131146
'kernel.logs_dir' => $this->getLogDir(),
132147
'kernel.http.host' => $_SERVER['HTTP_HOST'],

0 commit comments

Comments
 (0)