vendor/oneup/flysystem-bundle/OneupFlysystemBundle.php line 11

Open in your IDE?
  1. <?php
  2. namespace Oneup\FlysystemBundle;
  3. use Oneup\FlysystemBundle\DependencyInjection\Compiler\FilesystemPass;
  4. use Oneup\FlysystemBundle\StreamWrapper\StreamWrapperManager;
  5. use Symfony\Component\DependencyInjection\ContainerBuilder;
  6. use Symfony\Component\DependencyInjection\ContainerInterface;
  7. use Symfony\Component\HttpKernel\Bundle\Bundle;
  8. class OneupFlysystemBundle extends Bundle
  9. {
  10. public function build(ContainerBuilder $container)
  11. {
  12. $container->addCompilerPass(new FilesystemPass());
  13. }
  14. public function boot()
  15. {
  16. parent::boot();
  17. /* @var StreamWrapperManager $manager */
  18. if ($manager = $this->container->get('oneup_flysystem.stream_wrapper.manager', ContainerInterface::NULL_ON_INVALID_REFERENCE)) {
  19. $manager->register();
  20. }
  21. }
  22. public function shutdown()
  23. {
  24. parent::shutdown();
  25. /* @var StreamWrapperManager $manager */
  26. if ($manager = $this->container->get('oneup_flysystem.stream_wrapper.manager', ContainerInterface::NULL_ON_INVALID_REFERENCE)) {
  27. $manager->unregister();
  28. }
  29. }
  30. }