-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
test.php
42 lines (33 loc) · 1.29 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
<?php
/**
* All credits to Grégoire Pineau (@lyrixx)
* https://gist.github.com/lyrixx/2ea147609dc632d26e366aef60f61a9f
*/
declare(strict_types=1);
require_once __DIR__ . '/vendor/autoload_runtime.php';
use App\Kernel;
use App\Repository\PublicKeyCredentialSourceRepository;
use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait;
use Symfony\Component\Console\Output\StreamOutput;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
return function () {
$k = new class('dev', true) extends Kernel implements CompilerPassInterface {
use MicroKernelTrait;
public function process(ContainerBuilder $container): void
{
$container->getDefinition(PublicKeyCredentialSourceRepository::class)
->setPublic(true);
$container->getDefinition('monolog.handler.console')
->setPublic(true);
}
};
$k->boot();
$c = $k->getContainer();
$c->get('monolog.handler.console')
->setOutput(new StreamOutput(fopen('php://stdout', 'w'), StreamOutput::VERBOSITY_VERY_VERBOSE));
// Start of playground
$pksRepository = $c->get(PublicKeyCredentialSourceRepository::class);
$pks = $pksRepository->findAll();
dump($pks);
};