SonataUserExtension.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php
  2. /*
  3. * This file is part of the Sonata project.
  4. *
  5. * (c) Thomas Rabaix <thomas.rabaix@sonata-project.org>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Sonata\UserBundle\DependencyInjection;
  11. use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
  12. use Symfony\Component\Config\Resource\FileResource;
  13. use Symfony\Component\DependencyInjection\ContainerBuilder;
  14. use Symfony\Component\DependencyInjection\Reference;
  15. use Symfony\Component\DependencyInjection\Definition;
  16. use Symfony\Component\HttpKernel\DependencyInjection\Extension;
  17. use Symfony\Component\Config\FileLocator;
  18. /**
  19. *
  20. * @author Thomas Rabaix <thomas.rabaix@sonata-project.org>
  21. */
  22. class SonataUserExtension extends Extension
  23. {
  24. /**
  25. *
  26. * @param array $config An array of configuration settings
  27. * @param ContainerBuilder $container A ContainerBuilder instance
  28. */
  29. public function load(array $config, ContainerBuilder $container)
  30. {
  31. $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
  32. $loader->load('admin_orm.xml');
  33. $loader->load('form.xml');
  34. }
  35. /**
  36. * Returns the base path for the XSD files.
  37. *
  38. * @return string The XSD base path
  39. */
  40. public function getXsdValidationBasePath()
  41. {
  42. return __DIR__.'/../Resources/config/schema';
  43. }
  44. public function getNamespace()
  45. {
  46. return 'http://www.sonata-project.org/schema/dic/page';
  47. }
  48. public function getAlias()
  49. {
  50. return "sonata_user";
  51. }
  52. }