N°6937 - Symfony 6.4 - Handle Symfony configuration files

This commit is contained in:
Benjamin Dalsass
2024-02-26 10:38:36 +01:00
committed by Molkobain
parent c7a8d90364
commit b29597110e
18 changed files with 19 additions and 15 deletions

View File

@@ -93,7 +93,7 @@
"require": "3.4.*"
},
"runtime": {
"dotenv_path": "symfony/.env"
"dotenv_path": "resources/symfony/.env"
}
},
"scripts": {

View File

@@ -14,7 +14,7 @@ if (!is_object($app)) {
$runtime = $_SERVER['APP_RUNTIME'] ?? $_ENV['APP_RUNTIME'] ?? 'Symfony\\Component\\Runtime\\SymfonyRuntime';
$runtime = new $runtime(($_SERVER['APP_RUNTIME_OPTIONS'] ?? $_ENV['APP_RUNTIME_OPTIONS'] ?? []) + [
'dotenv_path' => 'symfony/.env',
'dotenv_path' => 'resources/symfony/.env',
'project_dir' => dirname(__DIR__, 1),
]);

View File

@@ -15,6 +15,6 @@
# https://symfony.com/doc/current/best_practices.html#use-environment-variables-for-infrastructure-configuration
###> symfony/framework-bundle ###
#APP_ENV=dev
APP_ENV=prod
#APP_SECRET=extracted from iTop general configuration in ./symfony/packages/itop_configuration_bridge.php
###< symfony/framework-bundle ###

View File

@@ -19,8 +19,8 @@
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
require_once(__DIR__ . '/../../../approot.inc.php');
require_once(__DIR__ . '/../../../application/startup.inc.php');
require_once(__DIR__.'/../../../../approot.inc.php');
require_once(__DIR__.'/../../../../application/startup.inc.php');
return static function (ContainerConfigurator $container) {

View File

@@ -0,0 +1,9 @@
<?php
// compute app kernel prod container
$sEnv = utils::GetCurrentEnvironment();
$sAppKernelProdContainer = APPROOT . "/data/cache-$sEnv/symfony/App_KernelProdContainer.preload.php";
if (file_exists($sAppKernelProdContainer)) {
require $sAppKernelProdContainer;
}

View File

@@ -1,5 +1,5 @@
controllers:
resource:
path: ../../sources/Controller/
path: ../../../sources/Controller/
namespace: Combodo\iTop\Controller
type: attribute

View File

@@ -14,9 +14,9 @@ services:
# makes classes in src/ available to be used as services
# this creates a service per class whose id is the fully-qualified class name
Combodo\iTop\:
resource: '../../sources'
resource: '../../../sources'
exclude:
- '../../sources/alias.php'
- '../../../sources/alias.php'
# add more service definitions when explicit configuration is needed
# please note that last definitions always *replace* previous ones

View File

@@ -35,7 +35,7 @@ class Kernel extends BaseKernel
private function getConfigDir(): string
{
return $this->getProjectDir() . '/symfony/config';
return $this->getProjectDir() . '/resources/symfony/config';
}
public function getCacheDir(): string
@@ -46,6 +46,6 @@ class Kernel extends BaseKernel
public function getLogDir(): string
{
return $this->getProjectDir() . 'log/symfony';
return $this->getProjectDir() . '/log/symfony';
}
}

View File

@@ -1,5 +0,0 @@
<?php
if (file_exists(dirname(__DIR__).'/var/cache/prod/App_KernelProdContainer.preload.php')) {
require dirname(__DIR__).'/var/cache/prod/App_KernelProdContainer.preload.php';
}