Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

initial commit

  • Loading branch information...
commit 959ef582a70412dae62a731adf25d46fb988a27b 0 parents
Unai Molina authored April 11, 2012

Showing 113 changed files with 5,001 additions and 0 deletions. Show diff stats Hide diff stats

  1. 19  LICENSE
  2. 9  app/AppCache.php
  3. 36  app/AppKernel.php
  4. 13  app/Resources/views/base.html.twig
  5. 45  app/autoload.php
  6. 1,497  app/bootstrap.php.cache
  7. 108  app/check.php
  8. 60  app/config/config.yml
  9. 23  app/config/config_dev.yml
  10. 19  app/config/config_prod.yml
  11. 14  app/config/config_test.yml
  12. 16  app/config/parameters.ini
  13. 4  app/config/routing.yml
  14. 31  app/config/routing_dev.yml
  15. 38  app/config/security.yml
  16. 22  app/console
  17. 41  app/phpunit.xml.dist
  18. 9  src/Acme/DemoBundle/AcmeDemoBundle.php
  19. 57  src/Acme/DemoBundle/Controller/DemoController.php
  20. 69  src/Acme/DemoBundle/Controller/SecuredController.php
  21. 13  src/Acme/DemoBundle/Controller/WelcomeController.php
  22. 25  src/Acme/DemoBundle/ControllerListener.php
  23. 22  src/Acme/DemoBundle/DependencyInjection/AcmeDemoExtension.php
  24. 20  src/Acme/DemoBundle/Form/ContactType.php
  25. 18  src/Acme/DemoBundle/Resources/config/services.xml
  26. 293  src/Acme/DemoBundle/Resources/public/css/demo.css
  27. BIN  src/Acme/DemoBundle/Resources/public/images/blue-arrow.png
  28. BIN  src/Acme/DemoBundle/Resources/public/images/field-background.gif
  29. BIN  src/Acme/DemoBundle/Resources/public/images/logo.gif
  30. BIN  src/Acme/DemoBundle/Resources/public/images/search.png
  31. BIN  src/Acme/DemoBundle/Resources/public/images/welcome-configure.gif
  32. BIN  src/Acme/DemoBundle/Resources/public/images/welcome-demo.gif
  33. BIN  src/Acme/DemoBundle/Resources/public/images/welcome-quick-tour.gif
  34. 15  src/Acme/DemoBundle/Resources/views/Demo/contact.html.twig
  35. 9  src/Acme/DemoBundle/Resources/views/Demo/hello.html.twig
  36. 14  src/Acme/DemoBundle/Resources/views/Demo/index.html.twig
  37. 11  src/Acme/DemoBundle/Resources/views/Secured/hello.html.twig
  38. 9  src/Acme/DemoBundle/Resources/views/Secured/helloadmin.html.twig
  39. 6  src/Acme/DemoBundle/Resources/views/Secured/layout.html.twig
  40. 29  src/Acme/DemoBundle/Resources/views/Secured/login.html.twig
  41. 63  src/Acme/DemoBundle/Resources/views/Welcome/index.html.twig
  42. 49  src/Acme/DemoBundle/Resources/views/layout.html.twig
  43. 17  src/Acme/DemoBundle/Tests/Controller/DemoControllerTest.php
  44. 74  src/Acme/DemoBundle/Twig/Extension/DemoExtension.php
  45. 12  web/app.php
  46. 24  web/app_dev.php
  47. BIN  web/apple-touch-icon.png
  48. 293  web/bundles/acmedemo/css/demo.css
  49. BIN  web/bundles/acmedemo/images/blue-arrow.png
  50. BIN  web/bundles/acmedemo/images/field-background.gif
  51. BIN  web/bundles/acmedemo/images/logo.gif
  52. BIN  web/bundles/acmedemo/images/search.png
  53. BIN  web/bundles/acmedemo/images/welcome-configure.gif
  54. BIN  web/bundles/acmedemo/images/welcome-demo.gif
  55. BIN  web/bundles/acmedemo/images/welcome-quick-tour.gif
  56. 226  web/bundles/framework/css/exception.css
  57. 131  web/bundles/framework/css/exception_layout.css
  58. BIN  web/bundles/framework/images/blue_picto_less.gif
  59. BIN  web/bundles/framework/images/blue_picto_more.gif
  60. BIN  web/bundles/framework/images/border_l.png
  61. BIN  web/bundles/framework/images/border_r.png
  62. BIN  web/bundles/framework/images/btn_bg.png
  63. BIN  web/bundles/framework/images/close_quote.gif
  64. BIN  web/bundles/framework/images/exception_detected.gif
  65. BIN  web/bundles/framework/images/grey_magnifier.png
  66. BIN  web/bundles/framework/images/icon_log.png
  67. BIN  web/bundles/framework/images/input_bg.gif
  68. BIN  web/bundles/framework/images/logo_symfony.gif
  69. BIN  web/bundles/framework/images/open_quote.gif
  70. 438  web/bundles/sensiodistribution/webconfigurator/css/configure.css
  71. 374  web/bundles/sensiodistribution/webconfigurator/css/install.css
  72. BIN  web/bundles/sensiodistribution/webconfigurator/images/background-textfield.gif
  73. BIN  web/bundles/sensiodistribution/webconfigurator/images/blue-arrow.png
  74. BIN  web/bundles/sensiodistribution/webconfigurator/images/favicon.ico
  75. BIN  web/bundles/sensiodistribution/webconfigurator/images/logo-big.gif
  76. BIN  web/bundles/sensiodistribution/webconfigurator/images/logo-small.gif
  77. BIN  web/bundles/sensiodistribution/webconfigurator/images/notification.gif
  78. 442  web/bundles/webprofiler/css/profiler.css
  79. 28  web/bundles/webprofiler/css/toolbar.css
  80. BIN  web/bundles/webprofiler/favicon.ico
  81. BIN  web/bundles/webprofiler/images/close.png
  82. BIN  web/bundles/webprofiler/images/config.png
  83. BIN  web/bundles/webprofiler/images/db.png
  84. BIN  web/bundles/webprofiler/images/events.png
  85. BIN  web/bundles/webprofiler/images/exception.png
  86. BIN  web/bundles/webprofiler/images/import.png
  87. BIN  web/bundles/webprofiler/images/logger.png
  88. BIN  web/bundles/webprofiler/images/mail.png
  89. BIN  web/bundles/webprofiler/images/memory.png
  90. BIN  web/bundles/webprofiler/images/profiler/bg_submenu.gif
  91. BIN  web/bundles/webprofiler/images/profiler/border_l.png
  92. BIN  web/bundles/webprofiler/images/profiler/border_r.png
  93. BIN  web/bundles/webprofiler/images/profiler/btn_bg.png
  94. BIN  web/bundles/webprofiler/images/profiler/config.png
  95. BIN  web/bundles/webprofiler/images/profiler/db.png
  96. BIN  web/bundles/webprofiler/images/profiler/events.png
  97. BIN  web/bundles/webprofiler/images/profiler/exception.png
  98. BIN  web/bundles/webprofiler/images/profiler/grey_magnifier.png
  99. BIN  web/bundles/webprofiler/images/profiler/input_bg.gif
  100. BIN  web/bundles/webprofiler/images/profiler/logger.png
  101. BIN  web/bundles/webprofiler/images/profiler/logo_symfony_profiler.gif
  102. BIN  web/bundles/webprofiler/images/profiler/mail.png
  103. BIN  web/bundles/webprofiler/images/profiler/request.png
  104. BIN  web/bundles/webprofiler/images/profiler/security.png
  105. BIN  web/bundles/webprofiler/images/request.png
  106. BIN  web/bundles/webprofiler/images/search.png
  107. BIN  web/bundles/webprofiler/images/security.png
  108. BIN  web/bundles/webprofiler/images/spacer.gif
  109. BIN  web/bundles/webprofiler/images/symfony.png
  110. BIN  web/bundles/webprofiler/images/timer.png
  111. 212  web/config.php
  112. BIN  web/favicon.ico
  113. 4  web/robots.txt
19  LICENSE
... ...
@@ -0,0 +1,19 @@
  1
+Copyright (c) 2004-2012 Fabien Potencier
  2
+
  3
+Permission is hereby granted, free of charge, to any person obtaining a copy
  4
+of this software and associated documentation files (the "Software"), to deal
  5
+in the Software without restriction, including without limitation the rights
  6
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  7
+copies of the Software, and to permit persons to whom the Software is furnished
  8
+to do so, subject to the following conditions:
  9
+
  10
+The above copyright notice and this permission notice shall be included in all
  11
+copies or substantial portions of the Software.
  12
+
  13
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  14
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  15
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  16
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  17
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  18
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  19
+THE SOFTWARE.
9  app/AppCache.php
... ...
@@ -0,0 +1,9 @@
  1
+<?php
  2
+
  3
+require_once __DIR__.'/AppKernel.php';
  4
+
  5
+use Symfony\Bundle\FrameworkBundle\HttpCache\HttpCache;
  6
+
  7
+class AppCache extends HttpCache
  8
+{
  9
+}
36  app/AppKernel.php
... ...
@@ -0,0 +1,36 @@
  1
+<?php
  2
+
  3
+use Symfony\Component\HttpKernel\Kernel;
  4
+use Symfony\Component\Config\Loader\LoaderInterface;
  5
+
  6
+class AppKernel extends Kernel
  7
+{
  8
+    public function registerBundles()
  9
+    {
  10
+        $bundles = array(
  11
+            new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
  12
+            new Symfony\Bundle\SecurityBundle\SecurityBundle(),
  13
+            new Symfony\Bundle\TwigBundle\TwigBundle(),
  14
+            new Symfony\Bundle\MonologBundle\MonologBundle(),
  15
+            new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
  16
+            new Symfony\Bundle\DoctrineBundle\DoctrineBundle(),
  17
+            new Symfony\Bundle\AsseticBundle\AsseticBundle(),
  18
+            new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
  19
+            new JMS\SecurityExtraBundle\JMSSecurityExtraBundle(),
  20
+        );
  21
+
  22
+        if (in_array($this->getEnvironment(), array('dev', 'test'))) {
  23
+            $bundles[] = new Acme\DemoBundle\AcmeDemoBundle();
  24
+            $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
  25
+            $bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle();
  26
+            $bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
  27
+        }
  28
+
  29
+        return $bundles;
  30
+    }
  31
+
  32
+    public function registerContainerConfiguration(LoaderInterface $loader)
  33
+    {
  34
+        $loader->load(__DIR__.'/config/config_'.$this->getEnvironment().'.yml');
  35
+    }
  36
+}
13  app/Resources/views/base.html.twig
... ...
@@ -0,0 +1,13 @@
  1
+<!DOCTYPE html>
  2
+<html>
  3
+    <head>
  4
+        <meta charset="UTF-8" />
  5
+        <title>{% block title %}Welcome!{% endblock %}</title>
  6
+        {% block stylesheets %}{% endblock %}
  7
+        <link rel="shortcut icon" href="{{ asset('favicon.ico') }}" />
  8
+    </head>
  9
+    <body>
  10
+        {% block body %}{% endblock %}
  11
+        {% block javascripts %}{% endblock %}
  12
+    </body>
  13
+</html>
45  app/autoload.php
... ...
@@ -0,0 +1,45 @@
  1
+<?php
  2
+
  3
+use Symfony\Component\ClassLoader\UniversalClassLoader;
  4
+use Doctrine\Common\Annotations\AnnotationRegistry;
  5
+
  6
+$loader = new UniversalClassLoader();
  7
+$loader->registerNamespaces(array(
  8
+    'Symfony'          => array(__DIR__.'/../vendor/symfony/src', __DIR__.'/../vendor/bundles'),
  9
+    'Sensio'           => __DIR__.'/../vendor/bundles',
  10
+    'JMS'              => __DIR__.'/../vendor/bundles',
  11
+    'Doctrine\\Common' => __DIR__.'/../vendor/doctrine-common/lib',
  12
+    'Doctrine\\DBAL'   => __DIR__.'/../vendor/doctrine-dbal/lib',
  13
+    'Doctrine'         => __DIR__.'/../vendor/doctrine/lib',
  14
+    'Monolog'          => __DIR__.'/../vendor/monolog/src',
  15
+    'Assetic'          => __DIR__.'/../vendor/assetic/src',
  16
+    'Metadata'         => __DIR__.'/../vendor/metadata/src',
  17
+));
  18
+$loader->registerPrefixes(array(
  19
+    'Twig_Extensions_' => __DIR__.'/../vendor/twig-extensions/lib',
  20
+    'Twig_'            => __DIR__.'/../vendor/twig/lib',
  21
+));
  22
+
  23
+// intl
  24
+if (!function_exists('intl_get_error_code')) {
  25
+    require_once __DIR__.'/../vendor/symfony/src/Symfony/Component/Locale/Resources/stubs/functions.php';
  26
+
  27
+    $loader->registerPrefixFallbacks(array(__DIR__.'/../vendor/symfony/src/Symfony/Component/Locale/Resources/stubs'));
  28
+}
  29
+
  30
+$loader->registerNamespaceFallbacks(array(
  31
+    __DIR__.'/../src',
  32
+));
  33
+$loader->register();
  34
+
  35
+AnnotationRegistry::registerLoader(function($class) use ($loader) {
  36
+    $loader->loadClass($class);
  37
+    return class_exists($class, false);
  38
+});
  39
+AnnotationRegistry::registerFile(__DIR__.'/../vendor/doctrine/lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php');
  40
+
  41
+// Swiftmailer needs a special autoloader to allow
  42
+// the lazy loading of the init file (which is expensive)
  43
+require_once __DIR__.'/../vendor/swiftmailer/lib/classes/Swift.php';
  44
+Swift::registerAutoload(__DIR__.'/../vendor/swiftmailer/lib/swift_init.php');
  45
+
1,497  app/bootstrap.php.cache
... ...
@@ -0,0 +1,1497 @@
  1
+<?php
  2
+
  3
+namespace { require_once __DIR__.'/autoload.php'; }
  4
+
  5
+  
  6
+
  7
+
  8
+
  9
+namespace Symfony\Component\DependencyInjection
  10
+{
  11
+
  12
+
  13
+interface ContainerAwareInterface
  14
+{
  15
+    
  16
+    function setContainer(ContainerInterface $container = null);
  17
+}
  18
+}
  19
+ 
  20
+
  21
+
  22
+
  23
+namespace Symfony\Component\DependencyInjection
  24
+{
  25
+
  26
+
  27
+interface ContainerInterface
  28
+{
  29
+    const EXCEPTION_ON_INVALID_REFERENCE = 1;
  30
+    const NULL_ON_INVALID_REFERENCE      = 2;
  31
+    const IGNORE_ON_INVALID_REFERENCE    = 3;
  32
+    const SCOPE_CONTAINER                = 'container';
  33
+    const SCOPE_PROTOTYPE                = 'prototype';
  34
+
  35
+    
  36
+    function set($id, $service, $scope = self::SCOPE_CONTAINER);
  37
+
  38
+    
  39
+    function get($id, $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE);
  40
+
  41
+    
  42
+    function has($id);
  43
+
  44
+    
  45
+    function getParameter($name);
  46
+
  47
+    
  48
+    function hasParameter($name);
  49
+
  50
+    
  51
+    function setParameter($name, $value);
  52
+
  53
+    
  54
+    function enterScope($name);
  55
+
  56
+    
  57
+    function leaveScope($name);
  58
+
  59
+    
  60
+    function addScope(ScopeInterface $scope);
  61
+
  62
+    
  63
+    function hasScope($name);
  64
+
  65
+    
  66
+    function isScopeActive($name);
  67
+}
  68
+}
  69
+ 
  70
+
  71
+
  72
+
  73
+namespace Symfony\Component\DependencyInjection
  74
+{
  75
+
  76
+use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException;
  77
+use Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException;
  78
+use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
  79
+use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
  80
+use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;
  81
+
  82
+
  83
+class Container implements ContainerInterface
  84
+{
  85
+    protected $parameterBag;
  86
+    protected $services;
  87
+    protected $scopes;
  88
+    protected $scopeChildren;
  89
+    protected $scopedServices;
  90
+    protected $scopeStacks;
  91
+    protected $loading = array();
  92
+
  93
+    
  94
+    public function __construct(ParameterBagInterface $parameterBag = null)
  95
+    {
  96
+        $this->parameterBag = null === $parameterBag ? new ParameterBag() : $parameterBag;
  97
+
  98
+        $this->services       = array();
  99
+        $this->scopes         = array();
  100
+        $this->scopeChildren  = array();
  101
+        $this->scopedServices = array();
  102
+        $this->scopeStacks    = array();
  103
+
  104
+        $this->set('service_container', $this);
  105
+    }
  106
+
  107
+    
  108
+    public function compile()
  109
+    {
  110
+        $this->parameterBag->resolve();
  111
+
  112
+        $this->parameterBag = new FrozenParameterBag($this->parameterBag->all());
  113
+    }
  114
+
  115
+    
  116
+    public function isFrozen()
  117
+    {
  118
+        return $this->parameterBag instanceof FrozenParameterBag;
  119
+    }
  120
+
  121
+    
  122
+    public function getParameterBag()
  123
+    {
  124
+        return $this->parameterBag;
  125
+    }
  126
+
  127
+    
  128
+    public function getParameter($name)
  129
+    {
  130
+        return $this->parameterBag->get($name);
  131
+    }
  132
+
  133
+    
  134
+    public function hasParameter($name)
  135
+    {
  136
+        return $this->parameterBag->has($name);
  137
+    }
  138
+
  139
+    
  140
+    public function setParameter($name, $value)
  141
+    {
  142
+        $this->parameterBag->set($name, $value);
  143
+    }
  144
+
  145
+    
  146
+    public function set($id, $service, $scope = self::SCOPE_CONTAINER)
  147
+    {
  148
+        if (self::SCOPE_PROTOTYPE === $scope) {
  149
+            throw new \InvalidArgumentException('You cannot set services of scope "prototype".');
  150
+        }
  151
+
  152
+        $id = strtolower($id);
  153
+
  154
+        if (self::SCOPE_CONTAINER !== $scope) {
  155
+            if (!isset($this->scopedServices[$scope])) {
  156
+                throw new \RuntimeException('You cannot set services of inactive scopes.');
  157
+            }
  158
+
  159
+            $this->scopedServices[$scope][$id] = $service;
  160
+        }
  161
+
  162
+        $this->services[$id] = $service;
  163
+    }
  164
+
  165
+    
  166
+    public function has($id)
  167
+    {
  168
+        $id = strtolower($id);
  169
+
  170
+        return isset($this->services[$id]) || method_exists($this, 'get'.strtr($id, array('_' => '', '.' => '_')).'Service');
  171
+    }
  172
+
  173
+    
  174
+    public function get($id, $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE)
  175
+    {
  176
+        $id = strtolower($id);
  177
+
  178
+        if (isset($this->services[$id])) {
  179
+            return $this->services[$id];
  180
+        }
  181
+
  182
+        if (isset($this->loading[$id])) {
  183
+            throw new ServiceCircularReferenceException($id, array_keys($this->loading));
  184
+        }
  185
+
  186
+        if (method_exists($this, $method = 'get'.strtr($id, array('_' => '', '.' => '_')).'Service')) {
  187
+            $this->loading[$id] = true;
  188
+
  189
+            try {
  190
+                $service = $this->$method();
  191
+            } catch (\Exception $e) {
  192
+                unset($this->loading[$id]);
  193
+                throw $e;
  194
+            }
  195
+
  196
+            unset($this->loading[$id]);
  197
+
  198
+            return $service;
  199
+        }
  200
+
  201
+        if (self::EXCEPTION_ON_INVALID_REFERENCE === $invalidBehavior) {
  202
+            throw new ServiceNotFoundException($id);
  203
+        }
  204
+    }
  205
+
  206
+    
  207
+    public function getServiceIds()
  208
+    {
  209
+        $ids = array();
  210
+        $r = new \ReflectionClass($this);
  211
+        foreach ($r->getMethods() as $method) {
  212
+            if (preg_match('/^get(.+)Service$/', $method->getName(), $match)) {
  213
+                $ids[] = self::underscore($match[1]);
  214
+            }
  215
+        }
  216
+
  217
+        return array_unique(array_merge($ids, array_keys($this->services)));
  218
+    }
  219
+
  220
+    
  221
+    public function enterScope($name)
  222
+    {
  223
+        if (!isset($this->scopes[$name])) {
  224
+            throw new \InvalidArgumentException(sprintf('The scope "%s" does not exist.', $name));
  225
+        }
  226
+
  227
+        if (self::SCOPE_CONTAINER !== $this->scopes[$name] && !isset($this->scopedServices[$this->scopes[$name]])) {
  228
+            throw new \RuntimeException(sprintf('The parent scope "%s" must be active when entering this scope.', $this->scopes[$name]));
  229
+        }
  230
+
  231
+                                if (isset($this->scopedServices[$name])) {
  232
+            $services = array($this->services, $name => $this->scopedServices[$name]);
  233
+            unset($this->scopedServices[$name]);
  234
+
  235
+            foreach ($this->scopeChildren[$name] as $child) {
  236
+                $services[$child] = $this->scopedServices[$child];
  237
+                unset($this->scopedServices[$child]);
  238
+            }
  239
+
  240
+                        $this->services = call_user_func_array('array_diff_key', $services);
  241
+            array_shift($services);
  242
+
  243
+                        if (!isset($this->scopeStacks[$name])) {
  244
+                $this->scopeStacks[$name] = new \SplStack();
  245
+            }
  246
+            $this->scopeStacks[$name]->push($services);
  247
+        }
  248
+
  249
+        $this->scopedServices[$name] = array();
  250
+    }
  251
+
  252
+    
  253
+    public function leaveScope($name)
  254
+    {
  255
+        if (!isset($this->scopedServices[$name])) {
  256
+            throw new \InvalidArgumentException(sprintf('The scope "%s" is not active.', $name));
  257
+        }
  258
+
  259
+                        $services = array($this->services, $this->scopedServices[$name]);
  260
+        unset($this->scopedServices[$name]);
  261
+        foreach ($this->scopeChildren[$name] as $child) {
  262
+            if (!isset($this->scopedServices[$child])) {
  263
+                continue;
  264
+            }
  265
+
  266
+            $services[] = $this->scopedServices[$child];
  267
+            unset($this->scopedServices[$child]);
  268
+        }
  269
+        $this->services = call_user_func_array('array_diff_key', $services);
  270
+
  271
+                if (isset($this->scopeStacks[$name]) && count($this->scopeStacks[$name]) > 0) {
  272
+            $services = $this->scopeStacks[$name]->pop();
  273
+            $this->scopedServices += $services;
  274
+
  275
+            array_unshift($services, $this->services);
  276
+            $this->services = call_user_func_array('array_merge', $services);
  277
+        }
  278
+    }
  279
+
  280
+    
  281
+    public function addScope(ScopeInterface $scope)
  282
+    {
  283
+        $name = $scope->getName();
  284
+        $parentScope = $scope->getParentName();
  285
+
  286
+        if (self::SCOPE_CONTAINER === $name || self::SCOPE_PROTOTYPE === $name) {
  287
+            throw new \InvalidArgumentException(sprintf('The scope "%s" is reserved.', $name));
  288
+        }
  289
+        if (isset($this->scopes[$name])) {
  290
+            throw new \InvalidArgumentException(sprintf('A scope with name "%s" already exists.', $name));
  291
+        }
  292
+        if (self::SCOPE_CONTAINER !== $parentScope && !isset($this->scopes[$parentScope])) {
  293
+            throw new \InvalidArgumentException(sprintf('The parent scope "%s" does not exist, or is invalid.', $parentScope));
  294
+        }
  295
+
  296
+        $this->scopes[$name] = $parentScope;
  297
+        $this->scopeChildren[$name] = array();
  298
+
  299
+                while ($parentScope !== self::SCOPE_CONTAINER) {
  300
+            $this->scopeChildren[$parentScope][] = $name;
  301
+            $parentScope = $this->scopes[$parentScope];
  302
+        }
  303
+    }
  304
+
  305
+    
  306
+    public function hasScope($name)
  307
+    {
  308
+        return isset($this->scopes[$name]);
  309
+    }
  310
+
  311
+    
  312
+    public function isScopeActive($name)
  313
+    {
  314
+        return isset($this->scopedServices[$name]);
  315
+    }
  316
+
  317
+    
  318
+    static public function camelize($id)
  319
+    {
  320
+        return preg_replace_callback('/(^|_|\.)+(.)/', function ($match) { return ('.' === $match[1] ? '_' : '').strtoupper($match[2]); }, $id);
  321
+    }
  322
+
  323
+    
  324
+    static public function underscore($id)
  325
+    {
  326
+        return strtolower(preg_replace(array('/([A-Z]+)([A-Z][a-z])/', '/([a-z\d])([A-Z])/'), array('\\1_\\2', '\\1_\\2'), strtr($id, '_', '.')));
  327
+    }
  328
+}
  329
+}
  330
+ 
  331
+
  332
+
  333
+
  334
+namespace Symfony\Component\HttpKernel
  335
+{
  336
+
  337
+use Symfony\Component\HttpFoundation\Request;
  338
+use Symfony\Component\HttpFoundation\Response;
  339
+
  340
+
  341
+interface HttpKernelInterface
  342
+{
  343
+    const MASTER_REQUEST = 1;
  344
+    const SUB_REQUEST = 2;
  345
+
  346
+    
  347
+    function handle(Request $request, $type = self::MASTER_REQUEST, $catch = true);
  348
+}
  349
+}
  350
+ 
  351
+
  352
+
  353
+
  354
+namespace Symfony\Component\HttpKernel
  355
+{
  356
+
  357
+use Symfony\Component\DependencyInjection\ContainerInterface;
  358
+use Symfony\Component\HttpKernel\HttpKernelInterface;
  359
+use Symfony\Component\HttpKernel\Bundle\BundleInterface;
  360
+use Symfony\Component\Config\Loader\LoaderInterface;
  361
+
  362
+
  363
+interface KernelInterface extends HttpKernelInterface, \Serializable
  364
+{
  365
+    
  366
+    function registerBundles();
  367
+
  368
+    
  369
+    function registerContainerConfiguration(LoaderInterface $loader);
  370
+
  371
+    
  372
+    function boot();
  373
+
  374
+    
  375
+    function shutdown();
  376
+
  377
+    
  378
+    function getBundles();
  379
+
  380
+    
  381
+    function isClassInActiveBundle($class);
  382
+
  383
+    
  384
+    function getBundle($name, $first = true);
  385
+
  386
+    
  387
+    function locateResource($name, $dir = null, $first = true);
  388
+
  389
+    
  390
+    function getName();
  391
+
  392
+    
  393
+    function getEnvironment();
  394
+
  395
+    
  396
+    function isDebug();
  397
+
  398
+    
  399
+    function getRootDir();
  400
+
  401
+    
  402
+    function getContainer();
  403
+
  404
+    
  405
+    function getStartTime();
  406
+
  407
+    
  408
+    function getCacheDir();
  409
+
  410
+    
  411
+    function getLogDir();
  412
+}
  413
+}
  414
+ 
  415
+
  416
+
  417
+
  418
+namespace Symfony\Component\HttpKernel
  419
+{
  420
+
  421
+use Symfony\Component\DependencyInjection\ContainerInterface;
  422
+use Symfony\Component\DependencyInjection\ContainerBuilder;
  423
+use Symfony\Component\DependencyInjection\Dumper\PhpDumper;
  424
+use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
  425
+use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
  426
+use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
  427
+use Symfony\Component\DependencyInjection\Loader\IniFileLoader;
  428
+use Symfony\Component\DependencyInjection\Loader\PhpFileLoader;
  429
+use Symfony\Component\DependencyInjection\Loader\ClosureLoader;
  430
+use Symfony\Component\HttpFoundation\Request;
  431
+use Symfony\Component\HttpKernel\HttpKernelInterface;
  432
+use Symfony\Component\HttpKernel\Bundle\BundleInterface;
  433
+use Symfony\Component\HttpKernel\Config\FileLocator;
  434
+use Symfony\Component\HttpKernel\DependencyInjection\MergeExtensionConfigurationPass;
  435
+use Symfony\Component\HttpKernel\DependencyInjection\AddClassesToCachePass;
  436
+use Symfony\Component\HttpKernel\DependencyInjection\Extension as DIExtension;
  437
+use Symfony\Component\HttpKernel\Debug\ErrorHandler;
  438
+use Symfony\Component\HttpKernel\Debug\ExceptionHandler;
  439
+use Symfony\Component\Config\Loader\LoaderResolver;
  440
+use Symfony\Component\Config\Loader\DelegatingLoader;
  441
+use Symfony\Component\Config\ConfigCache;
  442
+use Symfony\Component\ClassLoader\ClassCollectionLoader;
  443
+use Symfony\Component\ClassLoader\DebugUniversalClassLoader;
  444
+
  445
+
  446
+abstract class Kernel implements KernelInterface
  447
+{
  448
+    protected $bundles;
  449
+    protected $bundleMap;
  450
+    protected $container;
  451
+    protected $rootDir;
  452
+    protected $environment;
  453
+    protected $debug;
  454
+    protected $booted;
  455
+    protected $name;
  456
+    protected $startTime;
  457
+    protected $classes;
  458
+
  459
+    const VERSION = '2.0.12';
  460
+
  461
+    
  462
+    public function __construct($environment, $debug)
  463
+    {
  464
+        $this->environment = $environment;
  465
+        $this->debug = (Boolean) $debug;
  466
+        $this->booted = false;
  467
+        $this->rootDir = $this->getRootDir();
  468
+        $this->name = preg_replace('/[^a-zA-Z0-9_]+/', '', basename($this->rootDir));
  469
+        $this->classes = array();
  470
+
  471
+        if ($this->debug) {
  472
+            $this->startTime = microtime(true);
  473
+        }
  474
+
  475
+        $this->init();
  476
+    }
  477
+
  478
+    public function init()
  479
+    {
  480
+        if ($this->debug) {
  481
+            ini_set('display_errors', 1);
  482
+            error_reporting(-1);
  483
+
  484
+            DebugUniversalClassLoader::enable();
  485
+            ErrorHandler::register();
  486
+            if ('cli' !== php_sapi_name()) {
  487
+                ExceptionHandler::register();
  488
+            }
  489
+        } else {
  490
+            ini_set('display_errors', 0);
  491
+        }
  492
+    }
  493
+
  494
+    public function __clone()
  495
+    {
  496
+        if ($this->debug) {
  497
+            $this->startTime = microtime(true);
  498
+        }
  499
+
  500
+        $this->booted = false;
  501
+        $this->container = null;
  502
+    }
  503
+
  504
+    
  505
+    public function boot()
  506
+    {
  507
+        if (true === $this->booted) {
  508
+            return;
  509
+        }
  510
+
  511
+                $this->initializeBundles();
  512
+
  513
+                $this->initializeContainer();
  514
+
  515
+        foreach ($this->getBundles() as $bundle) {
  516
+            $bundle->setContainer($this->container);
  517
+            $bundle->boot();
  518
+        }
  519
+
  520
+        $this->booted = true;
  521
+    }
  522
+
  523
+    
  524
+    public function shutdown()
  525
+    {
  526
+        if (false === $this->booted) {
  527
+            return;
  528
+        }
  529
+
  530
+        $this->booted = false;
  531
+
  532
+        foreach ($this->getBundles() as $bundle) {
  533
+            $bundle->shutdown();
  534
+            $bundle->setContainer(null);
  535
+        }
  536
+
  537
+        $this->container = null;
  538
+    }
  539
+
  540
+    
  541
+    public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true)
  542
+    {
  543
+        if (false === $this->booted) {
  544
+            $this->boot();
  545
+        }
  546
+
  547
+        return $this->getHttpKernel()->handle($request, $type, $catch);
  548
+    }
  549
+
  550
+    
  551
+    protected function getHttpKernel()
  552
+    {
  553
+        return $this->container->get('http_kernel');
  554
+    }
  555
+
  556
+    
  557
+    public function getBundles()
  558
+    {
  559
+        return $this->bundles;
  560
+    }
  561
+
  562
+    
  563
+    public function isClassInActiveBundle($class)
  564
+    {
  565
+        foreach ($this->getBundles() as $bundle) {
  566
+            if (0 === strpos($class, $bundle->getNamespace())) {
  567
+                return true;
  568
+            }
  569
+        }
  570
+
  571
+        return false;
  572
+    }
  573
+
  574
+    
  575
+    public function getBundle($name, $first = true)
  576
+    {
  577
+        if (!isset($this->bundleMap[$name])) {
  578
+            throw new \InvalidArgumentException(sprintf('Bundle "%s" does not exist or it is not enabled. Maybe you forgot to add it in the registerBundles() function of your %s.php file?', $name, get_class($this)));
  579
+        }
  580
+
  581
+        if (true === $first) {
  582
+            return $this->bundleMap[$name][0];
  583
+        }
  584
+
  585
+        return $this->bundleMap[$name];
  586
+    }
  587
+
  588
+    
  589
+    public function locateResource($name, $dir = null, $first = true)
  590
+    {
  591
+        if ('@' !== $name[0]) {
  592
+            throw new \InvalidArgumentException(sprintf('A resource name must start with @ ("%s" given).', $name));
  593
+        }
  594
+
  595
+        if (false !== strpos($name, '..')) {
  596
+            throw new \RuntimeException(sprintf('File name "%s" contains invalid characters (..).', $name));
  597
+        }
  598
+
  599
+        $bundleName = substr($name, 1);
  600
+        $path = '';
  601
+        if (false !== strpos($bundleName, '/')) {
  602
+            list($bundleName, $path) = explode('/', $bundleName, 2);
  603
+        }
  604
+
  605
+        $isResource = 0 === strpos($path, 'Resources') && null !== $dir;
  606
+        $overridePath = substr($path, 9);
  607
+        $resourceBundle = null;
  608
+        $bundles = $this->getBundle($bundleName, false);
  609
+        $files = array();
  610
+
  611
+        foreach ($bundles as $bundle) {
  612
+            if ($isResource && file_exists($file = $dir.'/'.$bundle->getName().$overridePath)) {
  613
+                if (null !== $resourceBundle) {
  614
+                    throw new \RuntimeException(sprintf('"%s" resource is hidden by a resource from the "%s" derived bundle. Create a "%s" file to override the bundle resource.',
  615
+                        $file,
  616
+                        $resourceBundle,
  617
+                        $dir.'/'.$bundles[0]->getName().$overridePath
  618
+                    ));
  619
+                }
  620
+
  621
+                if ($first) {
  622
+                    return $file;
  623
+                }
  624
+                $files[] = $file;
  625
+            }
  626
+
  627
+            if (file_exists($file = $bundle->getPath().'/'.$path)) {
  628
+                if ($first && !$isResource) {
  629
+                    return $file;
  630
+                }
  631
+                $files[] = $file;
  632
+                $resourceBundle = $bundle->getName();
  633
+            }
  634
+        }
  635
+
  636
+        if (count($files) > 0) {
  637
+            return $first && $isResource ? $files[0] : $files;
  638
+        }
  639
+
  640
+        throw new \InvalidArgumentException(sprintf('Unable to find file "%s".', $name));
  641
+    }
  642
+
  643
+    
  644
+    public function getName()
  645
+    {
  646
+        return $this->name;
  647
+    }
  648
+
  649
+    
  650
+    public function getEnvironment()
  651
+    {
  652
+        return $this->environment;
  653
+    }
  654
+
  655
+    
  656
+    public function isDebug()
  657
+    {
  658
+        return $this->debug;
  659
+    }
  660
+
  661
+    
  662
+    public function getRootDir()
  663
+    {
  664
+        if (null === $this->rootDir) {
  665
+            $r = new \ReflectionObject($this);
  666
+            $this->rootDir = dirname($r->getFileName());
  667
+        }
  668
+
  669
+        return $this->rootDir;
  670
+    }
  671
+
  672
+    
  673
+    public function getContainer()
  674
+    {
  675
+        return $this->container;
  676
+    }
  677
+
  678
+    
  679
+    public function loadClassCache($name = 'classes', $extension = '.php')
  680
+    {
  681
+        if (!$this->booted && file_exists($this->getCacheDir().'/classes.map')) {
  682
+            ClassCollectionLoader::load(include($this->getCacheDir().'/classes.map'), $this->getCacheDir(), $name, $this->debug, false, $extension);
  683
+        }
  684
+    }
  685
+
  686
+    
  687
+    public function setClassCache(array $classes)
  688
+    {
  689
+        file_put_contents($this->getCacheDir().'/classes.map', sprintf('<?php return %s;', var_export($classes, true)));
  690
+    }
  691
+
  692
+    
  693
+    public function getStartTime()
  694
+    {
  695
+        return $this->debug ? $this->startTime : -INF;
  696
+    }
  697
+
  698
+    
  699
+    public function getCacheDir()
  700
+    {
  701
+        return $this->rootDir.'/cache/'.$this->environment;
  702
+    }
  703
+
  704
+    
  705
+    public function getLogDir()
  706
+    {
  707
+        return $this->rootDir.'/logs';
  708
+    }
  709
+
  710
+    
  711
+    protected function initializeBundles()
  712
+    {
  713
+                $this->bundles = array();
  714
+        $topMostBundles = array();
  715
+        $directChildren = array();
  716
+
  717
+        foreach ($this->registerBundles() as $bundle) {
  718
+            $name = $bundle->getName();
  719
+            if (isset($this->bundles[$name])) {
  720
+                throw new \LogicException(sprintf('Trying to register two bundles with the same name "%s"', $name));
  721
+            }
  722
+            $this->bundles[$name] = $bundle;
  723
+
  724
+            if ($parentName = $bundle->getParent()) {
  725
+                if (isset($directChildren[$parentName])) {
  726
+                    throw new \LogicException(sprintf('Bundle "%s" is directly extended by two bundles "%s" and "%s".', $parentName, $name, $directChildren[$parentName]));
  727
+                }
  728
+                if ($parentName == $name) {
  729
+                    throw new \LogicException(sprintf('Bundle "%s" can not extend itself.', $name));
  730
+                }
  731
+                $directChildren[$parentName] = $name;
  732
+            } else {
  733
+                $topMostBundles[$name] = $bundle;
  734
+            }
  735
+        }
  736
+
  737
+                if (count($diff = array_values(array_diff(array_keys($directChildren), array_keys($this->bundles))))) {
  738
+            throw new \LogicException(sprintf('Bundle "%s" extends bundle "%s", which is not registered.', $directChildren[$diff[0]], $diff[0]));
  739
+        }
  740
+
  741
+                $this->bundleMap = array();
  742
+        foreach ($topMostBundles as $name => $bundle) {
  743
+            $bundleMap = array($bundle);
  744
+            $hierarchy = array($name);
  745
+
  746
+            while (isset($directChildren[$name])) {
  747
+                $name = $directChildren[$name];
  748
+                array_unshift($bundleMap, $this->bundles[$name]);
  749
+                $hierarchy[] = $name;
  750
+            }
  751
+
  752
+            foreach ($hierarchy as $bundle) {
  753
+                $this->bundleMap[$bundle] = $bundleMap;
  754
+                array_pop($bundleMap);
  755
+            }
  756
+        }
  757
+
  758
+    }
  759
+
  760
+    
  761
+    protected function getContainerClass()
  762
+    {
  763
+        return $this->name.ucfirst($this->environment).($this->debug ? 'Debug' : '').'ProjectContainer';
  764
+    }
  765
+
  766
+    
  767
+    protected function getContainerBaseClass()
  768
+    {
  769
+        return 'Container';
  770
+    }
  771
+
  772
+    
  773
+    protected function initializeContainer()
  774
+    {
  775
+        $class = $this->getContainerClass();
  776
+        $cache = new ConfigCache($this->getCacheDir().'/'.$class.'.php', $this->debug);
  777
+        $fresh = true;
  778
+        if (!$cache->isFresh()) {
  779
+            $container = $this->buildContainer();
  780
+            $this->dumpContainer($cache, $container, $class, $this->getContainerBaseClass());
  781
+
  782
+            $fresh = false;
  783
+        }
  784
+
  785
+        require_once $cache;
  786
+
  787
+        $this->container = new $class();
  788
+        $this->container->set('kernel', $this);
  789
+
  790
+        if (!$fresh && $this->container->has('cache_warmer')) {
  791
+            $this->container->get('cache_warmer')->warmUp($this->container->getParameter('kernel.cache_dir'));
  792
+        }
  793
+    }
  794
+
  795
+    
  796
+    protected function getKernelParameters()
  797
+    {
  798
+        $bundles = array();
  799
+        foreach ($this->bundles as $name => $bundle) {
  800
+            $bundles[$name] = get_class($bundle);
  801
+        }
  802
+
  803
+        return array_merge(
  804
+            array(
  805
+                'kernel.root_dir'        => $this->rootDir,
  806
+                'kernel.environment'     => $this->environment,
  807
+                'kernel.debug'           => $this->debug,
  808
+                'kernel.name'            => $this->name,
  809
+                'kernel.cache_dir'       => $this->getCacheDir(),
  810
+                'kernel.logs_dir'        => $this->getLogDir(),
  811
+                'kernel.bundles'         => $bundles,
  812
+                'kernel.charset'         => 'UTF-8',
  813
+                'kernel.container_class' => $this->getContainerClass(),
  814
+            ),
  815
+            $this->getEnvParameters()
  816
+        );
  817
+    }
  818
+
  819
+    
  820
+    protected function getEnvParameters()
  821
+    {
  822
+        $parameters = array();
  823
+        foreach ($_SERVER as $key => $value) {
  824
+            if (0 === strpos($key, 'SYMFONY__')) {
  825
+                $parameters[strtolower(str_replace('__', '.', substr($key, 9)))] = $value;
  826
+            }
  827
+        }
  828
+
  829
+        return $parameters;
  830
+    }
  831
+
  832
+    
  833
+    protected function buildContainer()
  834
+    {
  835
+        foreach (array('cache' => $this->getCacheDir(), 'logs' => $this->getLogDir()) as $name => $dir) {
  836
+            if (!is_dir($dir)) {
  837
+                if (false === @mkdir($dir, 0777, true)) {
  838
+                    throw new \RuntimeException(sprintf("Unable to create the %s directory (%s)\n", $name, $dir));
  839
+                }
  840
+            } elseif (!is_writable($dir)) {
  841
+                throw new \RuntimeException(sprintf("Unable to write in the %s directory (%s)\n", $name, $dir));
  842
+            }
  843
+        }
  844
+
  845
+        $container = new ContainerBuilder(new ParameterBag($this->getKernelParameters()));
  846
+        $extensions = array();
  847
+        foreach ($this->bundles as $bundle) {
  848
+            $bundle->build($container);
  849
+
  850
+            if ($extension = $bundle->getContainerExtension()) {
  851
+                $container->registerExtension($extension);
  852
+                $extensions[] = $extension->getAlias();
  853
+            }
  854
+
  855
+            if ($this->debug) {
  856
+                $container->addObjectResource($bundle);
  857
+            }
  858
+        }
  859
+        $container->addObjectResource($this);
  860
+
  861
+                $container->getCompilerPassConfig()->setMergePass(new MergeExtensionConfigurationPass($extensions));
  862
+
  863
+        if (null !== $cont = $this->registerContainerConfiguration($this->getContainerLoader($container))) {
  864
+            $container->merge($cont);
  865
+        }
  866
+
  867
+        $container->addCompilerPass(new AddClassesToCachePass($this));
  868
+        $container->compile();
  869
+
  870
+        return $container;
  871
+    }
  872
+
  873
+    
  874
+    protected function dumpContainer(ConfigCache $cache, ContainerBuilder $container, $class, $baseClass)
  875
+    {
  876
+                $dumper = new PhpDumper($container);
  877
+        $content = $dumper->dump(array('class' => $class, 'base_class' => $baseClass));
  878
+        if (!$this->debug) {
  879
+            $content = self::stripComments($content);
  880
+        }
  881
+
  882
+        $cache->write($content, $container->getResources());
  883
+    }
  884
+
  885
+    
  886
+    protected function getContainerLoader(ContainerInterface $container)
  887
+    {
  888
+        $locator = new FileLocator($this);
  889
+        $resolver = new LoaderResolver(array(
  890
+            new XmlFileLoader($container, $locator),
  891
+            new YamlFileLoader($container, $locator),
  892
+            new IniFileLoader($container, $locator),
  893
+            new PhpFileLoader($container, $locator),
  894
+            new ClosureLoader($container),
  895
+        ));
  896
+
  897
+        return new DelegatingLoader($resolver);
  898
+    }
  899
+
  900
+    
  901
+    static public function stripComments($source)
  902
+    {
  903
+        if (!function_exists('token_get_all')) {
  904
+            return $source;
  905
+        }
  906
+
  907
+        $output = '';
  908
+        foreach (token_get_all($source) as $token) {
  909
+            if (is_string($token)) {
  910
+                $output .= $token;
  911
+            } elseif (!in_array($token[0], array(T_COMMENT, T_DOC_COMMENT))) {
  912
+                $output .= $token[1];
  913
+            }
  914
+        }
  915
+
  916
+                $output = preg_replace(array('/\s+$/Sm', '/\n+/S'), "\n", $output);
  917
+
  918
+        return $output;
  919
+    }
  920
+
  921
+    public function serialize()
  922
+    {
  923
+        return serialize(array($this->environment, $this->debug));
  924
+    }
  925
+
  926
+    public function unserialize($data)
  927
+    {
  928
+        list($environment, $debug) = unserialize($data);
  929
+
  930
+        $this->__construct($environment, $debug);
  931
+    }
  932
+}
  933
+}
  934
+ 
  935
+
  936
+
  937
+
  938
+namespace Symfony\Component\ClassLoader
  939
+{
  940
+
  941
+
  942
+class ClassCollectionLoader
  943
+{
  944
+    static private $loaded;
  945
+
  946
+    
  947
+    static public function load($classes, $cacheDir, $name, $autoReload, $adaptive = false, $extension = '.php')
  948
+    {
  949
+                if (isset(self::$loaded[$name])) {
  950
+            return;
  951
+        }
  952
+
  953
+        self::$loaded[$name] = true;
  954
+
  955
+        if ($adaptive) {
  956
+                        $classes = array_diff($classes, get_declared_classes(), get_declared_interfaces());
  957
+
  958
+                        $name = $name.'-'.substr(md5(implode('|', $classes)), 0, 5);
  959
+        }
  960
+
  961
+        $cache = $cacheDir.'/'.$name.$extension;
  962
+
  963
+                $reload = false;
  964
+        if ($autoReload) {
  965
+            $metadata = $cacheDir.'/'.$name.$extension.'.meta';
  966
+            if (!file_exists($metadata) || !file_exists($cache)) {
  967
+                $reload = true;
  968
+            } else {
  969
+                $time = filemtime($cache);
  970
+                $meta = unserialize(file_get_contents($metadata));
  971
+
  972
+                if ($meta[1] != $classes) {
  973
+                    $reload = true;
  974
+                } else {
  975
+                    foreach ($meta[0] as $resource) {
  976
+                        if (!file_exists($resource) || filemtime($resource) > $time) {
  977
+                            $reload = true;
  978
+
  979
+                            break;
  980
+                        }
  981
+                    }
  982
+                }
  983
+            }
  984
+        }
  985
+
  986
+        if (!$reload && file_exists($cache)) {
  987
+            require_once $cache;
  988
+
  989
+            return;
  990
+        }
  991
+
  992
+        $files = array();
  993
+        $content = '';
  994
+        foreach ($classes as $class) {
  995
+            if (!class_exists($class) && !interface_exists($class) && (!function_exists('trait_exists') || !trait_exists($class))) {
  996
+                throw new \InvalidArgumentException(sprintf('Unable to load class "%s"', $class));
  997
+            }
  998
+