mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
N°6937 - Symfony 6.4 - Handle Symfony configuration files
This commit is contained in:
committed by
Molkobain
parent
c7a8d90364
commit
b29597110e
@@ -93,7 +93,7 @@
|
||||
"require": "3.4.*"
|
||||
},
|
||||
"runtime": {
|
||||
"dotenv_path": "symfony/.env"
|
||||
"dotenv_path": "resources/symfony/.env"
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
|
||||
@@ -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),
|
||||
]);
|
||||
|
||||
|
||||
@@ -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 ###
|
||||
@@ -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) {
|
||||
|
||||
9
resources/symfony/config/preload.php
Normal file
9
resources/symfony/config/preload.php
Normal 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;
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
controllers:
|
||||
resource:
|
||||
path: ../../sources/Controller/
|
||||
path: ../../../sources/Controller/
|
||||
namespace: Combodo\iTop\Controller
|
||||
type: attribute
|
||||
@@ -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
|
||||
@@ -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';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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';
|
||||
}
|
||||
Reference in New Issue
Block a user