PHP code example of symplify / symplify-kernel

1. Go to this page and download the library: Download symplify/symplify-kernel library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

symplify / symplify-kernel example snippets


use Psr\Container\ContainerInterface;
use Symplify\SymplifyKernel\ContainerBuilderFactory;

final class MonorepoBuilderKernel
{
    /**
     * @param string[] $configFiles
     */
    public function createFromConfigs(array $configFiles): ContainerInterface
    {
        // local config here
        $configFiles[] = __DIR__ . '/../../config/config.php';

        $containerBuilderFactory = new ContainerBuilderFactory();
        $containerBuilder = $containerBuilderFactory->create($configFiles, [], []);

        // build the container
        $containerBuilder->compile();

        return $containerBuilder;
    }
}

$easyCIKernel = new MonorepoBuilderKernel();
$easyCIKernel->createFromConfigs([__DIR__ . '/config/config.php']);

$container = $easyCIKernel->getContainer();

/** @var Application $application */
$application = $container->get(Application::class);
exit($application->run());