-
Notifications
You must be signed in to change notification settings - Fork 0
/
Test.php
66 lines (57 loc) · 1.68 KB
/
Test.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<?php
declare(strict_types=1);
/*
* @author Aaron Scherer <aequasi@gmail.com>
* @date 2019
* @license https://opensource.org/licenses/MIT
*/
require_once __DIR__.'/vendor/autoload.php';
use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait;
use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
/**
* @author Aaron Scherer <aequasi@gmail.com>
* @date 2019
*
* @license http://opensource.org/licenses/MIT
*
* @internal
* @coversNothing
*/
class Test extends \Symfony\Component\HttpKernel\Kernel
{
use MicroKernelTrait;
public const CONFIG_EXTS = '.{php,xml,yaml,yml}';
/**
* Returns an array of bundles to register.
*
* @return iterable|\Symfony\Component\HttpKernel\Bundle\BundleInterface An iterable of bundle instances
*/
public function registerBundles()
{
yield new \Symfony\Bundle\FrameworkBundle\FrameworkBundle();
yield new \Secretary\Bundle\SecretaryBundle\SecretaryBundle();
}
/**
* Add or import routes into your application.
*
* $routes->import('config/routing.yml');
* $routes->add('/admin', 'App\Controller\AdminController::dashboard', 'admin_dashboard');
*
*/
protected function configureRoutes(Symfony\Component\Routing\RouteCollectionBuilder $routes)
{
}
/**
* {@inheritDc}.
*
* @throws Exception
*/
protected function configureContainer(ContainerBuilder $c, LoaderInterface $loader)
{
$loader->load(__DIR__.'/services'.self::CONFIG_EXTS, 'glob');
}
}
$k = new Test('dev', true);
$k->boot();
var_dump($k->getContainer()->getParameter('foo'));