forked from 1up-lab/OneupFlysystemBundle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
OneupFlysystemBundle.php
37 lines (30 loc) · 1.09 KB
/
OneupFlysystemBundle.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
<?php
namespace Oneup\FlysystemBundle;
use Oneup\FlysystemBundle\DependencyInjection\Compiler\FilesystemPass;
use Oneup\FlysystemBundle\StreamWrapper\StreamWrapperManager;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpKernel\Bundle\Bundle;
class OneupFlysystemBundle extends Bundle
{
public function build(ContainerBuilder $container)
{
$container->addCompilerPass(new FilesystemPass());
}
public function boot()
{
parent::boot();
/* @var StreamWrapperManager $manager */
if ($manager = $this->container->get('oneup_flysystem.stream_wrapper.manager', ContainerInterface::NULL_ON_INVALID_REFERENCE)) {
$manager->register();
}
}
public function shutdown()
{
parent::shutdown();
/* @var StreamWrapperManager $manager */
if ($manager = $this->container->get('oneup_flysystem.stream_wrapper.manager', ContainerInterface::NULL_ON_INVALID_REFERENCE)) {
$manager->unregister();
}
}
}