%PDF- %GIF98; %PNG;
Server : ApacheSystem : Linux host.digitalbabaji.in 4.18.0-513.11.1.el8_9.x86_64 #1 SMP Wed Jan 17 02:00:40 EST 2024 x86_64 User : addictionfreeind ( 1003) PHP Version : 7.2.34 Disable Function : exec,passthru,shell_exec,system Directory : /home/addictionfreeind/www/admin1/vendor/phpro/grumphp/src/Configuration/ |
Upload File : |
<?php
declare(strict_types=1);
namespace GrumPHP\Configuration;
use GrumPHP\Util\Filesystem;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\Console\DependencyInjection\AddConsoleCommandPass;
use Symfony\Component\DependencyInjection\ContainerBuilder as SymfonyContainerBuilder;
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
final class ContainerBuilder
{
public static function buildFromConfiguration(string $path): SymfonyContainerBuilder
{
$filesystem = new Filesystem();
$container = new SymfonyContainerBuilder();
// Register extensions
$container->registerExtension(new GrumPHPExtension());
// Add compiler passes:
$container->addCompilerPass(new Compiler\ExtensionCompilerPass());
$container->addCompilerPass(new Compiler\PhpParserCompilerPass());
$container->addCompilerPass(new Compiler\TaskCompilerPass());
$container->addCompilerPass(new Compiler\TestSuiteCompilerPass());
$container->addCompilerPass(Compiler\RegisterListenersPass::create());
$container->addCompilerPass(new AddConsoleCommandPass());
// Load basic service file + custom user configuration
$configDir = dirname(__DIR__, 2).$filesystem->ensureValidSlashes('/resources/config');
$loader = new YamlFileLoader($container, new FileLocator($configDir));
$loader->load('config.yml');
$loader->load('console.yml');
$loader->load('fixer.yml');
$loader->load('formatter.yml');
$loader->load('linters.yml');
$loader->load('locators.yml');
$loader->load('parsers.yml');
$loader->load('runner.yml');
$loader->load('services.yml');
$loader->load('subscribers.yml');
$loader->load('tasks.yml');
$loader->load('util.yml');
// Load grumphp.yml file:
if ($filesystem->exists($path)) {
$loader->load($path);
}
// Add additional paths
$container->setParameter('config_file', $path);
// Compile configuration to make sure that tasks are added to the taskrunner
$container->compile();
return $container;
}
}