N°6937 - Symfony 6.4 - Handle Symfony configuration files

This commit is contained in:
Benjamin Dalsass
2024-02-26 10:38:36 +01:00
parent 6a907f1fed
commit 3cb3e8a7f9
21 changed files with 23 additions and 17 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

@@ -393,6 +393,7 @@ return array(
'Combodo\\iTop\\Controller\\Base\\Layout\\ActivityPanelController' => $baseDir . '/sources/Controller/Base/Layout/ActivityPanelController.php',
'Combodo\\iTop\\Controller\\Base\\Layout\\ObjectController' => $baseDir . '/sources/Controller/Base/Layout/ObjectController.php',
'Combodo\\iTop\\Controller\\Links\\LinkSetController' => $baseDir . '/sources/Controller/Links/LinkSetController.php',
'Combodo\\iTop\\Controller\\MyController' => $baseDir . '/sources/Controller/MyController.php',
'Combodo\\iTop\\Controller\\Newsroom\\iTopNewsroomController' => $baseDir . '/sources/Controller/Newsroom/iTopNewsroomController.php',
'Combodo\\iTop\\Controller\\Notifications\\ActionController' => $baseDir . '/sources/Controller/Notifications/ActionController.php',
'Combodo\\iTop\\Controller\\Notifications\\NotificationsCenterController' => $baseDir . '/sources/Controller/Notifications/NotificationsCenterController.php',

View File

@@ -768,6 +768,7 @@ class ComposerStaticInit7f81b4a2a468a061c306af5e447a9a9f
'Combodo\\iTop\\Controller\\Base\\Layout\\ActivityPanelController' => __DIR__ . '/../..' . '/sources/Controller/Base/Layout/ActivityPanelController.php',
'Combodo\\iTop\\Controller\\Base\\Layout\\ObjectController' => __DIR__ . '/../..' . '/sources/Controller/Base/Layout/ObjectController.php',
'Combodo\\iTop\\Controller\\Links\\LinkSetController' => __DIR__ . '/../..' . '/sources/Controller/Links/LinkSetController.php',
'Combodo\\iTop\\Controller\\MyController' => __DIR__ . '/../..' . '/sources/Controller/MyController.php',
'Combodo\\iTop\\Controller\\Newsroom\\iTopNewsroomController' => __DIR__ . '/../..' . '/sources/Controller/Newsroom/iTopNewsroomController.php',
'Combodo\\iTop\\Controller\\Notifications\\ActionController' => __DIR__ . '/../..' . '/sources/Controller/Notifications/ActionController.php',
'Combodo\\iTop\\Controller\\Notifications\\NotificationsCenterController' => __DIR__ . '/../..' . '/sources/Controller/Notifications/NotificationsCenterController.php',

View File

@@ -3,7 +3,7 @@
'name' => 'combodo/itop',
'pretty_version' => 'dev-develop',
'version' => 'dev-develop',
'reference' => 'dddcb213d11aa68097d1ec9334401cea632ec944',
'reference' => '6a907f1fedf16e9778b26b6ffee5aaf634e2d50d',
'type' => 'project',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
@@ -22,7 +22,7 @@
'combodo/itop' => array(
'pretty_version' => 'dev-develop',
'version' => 'dev-develop',
'reference' => 'dddcb213d11aa68097d1ec9334401cea632ec944',
'reference' => '6a907f1fedf16e9778b26b6ffee5aaf634e2d50d',
'type' => 'project',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),

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';
}