Anonymous avatar Anonymous committed 0f49587

Import Symfony 2.0.3

Comments (0)

Files changed (123)

+Copyright (c) 2004-2011 Fabien Potencier
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is furnished
+to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+Symfony Standard Edition
+========================
+
+Welcome to the Symfony Standard Edition - a fully-functional Symfony2
+application that you can use as the skeleton for your new app. If you want
+to learn more about the features included, see the "What's Inside?" section.
+
+This document contains information on how to download and start using Symfony.
+For a more detailed explanation, see the
+[Installation chapter](http://symfony.com/doc/current/book/installation.html)
+of the Symfony Documentation.
+
+1) Download the Standard Edition
+--------------------------------
+
+If you've already downloaded the standard edition, and unpacked it somewhere
+within your web root directory, then move on to the "Installation" section.
+
+To download the standard edition, you have two options:
+
+### Download an archive file (*recommended*)
+
+The easiest way to get started is to download an archive of the standard edition
+(http://symfony.com/download). Unpack it somewhere under your web server root
+directory and you're done. The web root is wherever your web server (e.g. Apache)
+looks when you access `http://localhost` in a browser.
+
+### Clone the git Repository
+
+We highly recommend that you download the packaged version of this distribution.
+But if you still want to use Git, you are on your own.
+
+Run the following commands:
+
+    git clone http://github.com/symfony/symfony-standard.git
+    cd symfony-standard
+    rm -rf .git
+
+2) Installation
+---------------
+
+Once you've downloaded the standard edition, installation is easy, and basically
+involves making sure your system is ready for Symfony.
+
+### a) Check your System Configuration
+
+Before you begin, make sure that your local system is properly configured
+for Symfony. To do this, execute the following:
+
+    php app/check.php
+
+If you get any warnings or recommendations, fix these now before moving on.
+
+### b) Install the Vendor Libraries
+
+If you downloaded the archive "without vendors" or installed via git, then
+you need to download all of the necessary vendor libraries. If you're not
+sure if you need to do this, check to see if you have a ``vendor/`` directory.
+If you don't, or if that directory is empty, run the following:
+
+    php bin/vendors install
+
+Note that you **must** have git installed and be able to execute the `git`
+command to execute this script. If you don't have git available, either install
+it or download Symfony with the vendor libraries already included.
+
+### c) Access the Application via the Browser
+
+Congratulations! You're now ready to use Symfony. If you've unzipped Symfony
+in the web root of your computer, then you should be able to access the
+web version of the Symfony requirements check via:
+
+    http://localhost/Symfony/web/config.php
+
+If everything looks good, click the "Bypass configuration and go to the Welcome page"
+link to load up your first Symfony page.
+
+You can also use a web-based configurator by clicking on the "Configure your
+Symfony Application online" link of the ``config.php`` page.
+
+To see a real-live Symfony page in action, access the following page:
+
+    web/app_dev.php/demo/hello/Fabien
+
+3) Learn about Symfony!
+-----------------------
+
+This distribution is meant to be the starting point for your application,
+but it also contains some sample code that you can learn from and play with.
+
+A great way to start learning Symfony is via the [Quick Tour](http://symfony.com/doc/current/quick_tour/the_big_picture.html),
+which will take you through all the basic features of Symfony2 and the test
+pages that are available in the standard edition.
+
+Once you're feeling good, you can move onto reading the official
+[Symfony2 book](http://symfony.com/doc/current/).
+
+Using this Edition as the Base of your Application
+--------------------------------------------------
+
+Since the standard edition is fully-configured and comes with some examples,
+you'll need to make a few changes before using it to build your application.
+
+The distribution is configured with the following defaults:
+
+* Twig is the only configured template engine;
+* Doctrine ORM/DBAL is configured;
+* Swiftmailer is configured;
+* Annotations for everything are enabled.
+
+A default bundle, ``AcmeDemoBundle``, shows you Symfony2 in action. After
+playing with it, you can remove it by following these steps:
+
+* delete the ``src/Acme`` directory;
+* remove the routing entries referencing AcmeBundle in ``app/config/routing_dev.yml``;
+* remove the AcmeBundle from the registered bundles in ``app/AppKernel.php``;
+
+
+What's inside?
+---------------
+The Symfony Standard Edition comes pre-configured with the following bundles:
+	
+* **FrameworkBundle** - The core Symfony framework bundle
+* **SensioFrameworkExtraBundle** - Adds several enhancements, including template
+  and routing annotation capability ([documentation](http://symfony.com/doc/current/bundles/SensioFrameworkExtraBundle/index.html))
+* **DoctrineBundle** - Adds support for the Doctrine ORM
+  ([documentation](http://symfony.com/doc/current/book/doctrine.html))
+* **TwigBundle** - Adds support for the Twig templating engine
+  ([documentation](http://symfony.com/doc/current/book/templating.html))
+* **SecurityBundle** - Adds security by integrating Symfony's security component
+  ([documentation](http://symfony.com/doc/current/book/security.html))
+* **SwiftmailerBundle** - Adds support for Swiftmailer, a library for sending emails
+  ([documentation](http://symfony.com/doc/2.0/cookbook/email.html))
+* **MonologBundle** - Adds support for Monolog, a logging library
+  ([documentation](http://symfony.com/doc/2.0/cookbook/logging/monolog.html))
+* **AsseticBundle** - Adds support for Assetic, an asset processing library
+  ([documentation](http://symfony.com/doc/2.0/cookbook/assetic/asset_management.html))
+* **JMSSecurityExtraBundle** - Allows security to be added via annotations
+  ([documentation](http://symfony.com/doc/current/bundles/JMSSecurityExtraBundle/index.html))
+* **WebProfilerBundle** (in dev/test env) - Adds profiling functionality and
+  the web debug toolbar
+* **SensioDistributionBundle** (in dev/test env) - Adds functionality for configuring
+  and working with Symfony distributions
+* **SensioGeneratorBundle** (in dev/test env) - Adds code generation capabilities
+  ([documentation](http://symfony.com/doc/current/bundles/SensioGeneratorBundle/index.html))
+* **AcmeDemoBundle** (in dev/test env) - A demo bundle with some example code
+
+Enjoy!
+deny from all
+<?php
+
+require_once __DIR__.'/AppKernel.php';
+
+use Symfony\Bundle\FrameworkBundle\HttpCache\HttpCache;
+
+class AppCache extends HttpCache
+{
+}

app/AppKernel.php

+<?php
+
+use Symfony\Component\HttpKernel\Kernel;
+use Symfony\Component\Config\Loader\LoaderInterface;
+
+class AppKernel extends Kernel
+{
+    public function registerBundles()
+    {
+        $bundles = array(
+            new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
+            new Symfony\Bundle\SecurityBundle\SecurityBundle(),
+            new Symfony\Bundle\TwigBundle\TwigBundle(),
+            new Symfony\Bundle\MonologBundle\MonologBundle(),
+            new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
+            new Symfony\Bundle\DoctrineBundle\DoctrineBundle(),
+            new Symfony\Bundle\AsseticBundle\AsseticBundle(),
+            new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
+            new JMS\SecurityExtraBundle\JMSSecurityExtraBundle(),
+        );
+
+        if (in_array($this->getEnvironment(), array('dev', 'test'))) {
+            $bundles[] = new Acme\DemoBundle\AcmeDemoBundle();
+            $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
+            $bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle();
+            $bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
+        }
+
+        return $bundles;
+    }
+
+    public function registerContainerConfiguration(LoaderInterface $loader)
+    {
+        $loader->load(__DIR__.'/config/config_'.$this->getEnvironment().'.yml');
+    }
+}

app/Resources/views/base.html.twig

+<!DOCTYPE html>
+<html>
+    <head>
+        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+        <title>{% block title %}Welcome!{% endblock %}</title>
+        {% block stylesheets %}{% endblock %}
+        <link rel="shortcut icon" href="{{ asset('favicon.ico') }}" />
+    </head>
+    <body>
+        {% block body %}{% endblock %}
+        {% block javascripts %}{% endblock %}
+    </body>
+</html>
+<?php
+
+use Symfony\Component\ClassLoader\UniversalClassLoader;
+use Doctrine\Common\Annotations\AnnotationRegistry;
+
+$loader = new UniversalClassLoader();
+$loader->registerNamespaces(array(
+    'Symfony'          => array(__DIR__.'/../vendor/symfony/src', __DIR__.'/../vendor/bundles'),
+    'Sensio'           => __DIR__.'/../vendor/bundles',
+    'JMS'              => __DIR__.'/../vendor/bundles',
+    'Doctrine\\Common' => __DIR__.'/../vendor/doctrine-common/lib',
+    'Doctrine\\DBAL'   => __DIR__.'/../vendor/doctrine-dbal/lib',
+    'Doctrine'         => __DIR__.'/../vendor/doctrine/lib',
+    'Monolog'          => __DIR__.'/../vendor/monolog/src',
+    'Assetic'          => __DIR__.'/../vendor/assetic/src',
+    'Metadata'         => __DIR__.'/../vendor/metadata/src',
+));
+$loader->registerPrefixes(array(
+    'Twig_Extensions_' => __DIR__.'/../vendor/twig-extensions/lib',
+    'Twig_'            => __DIR__.'/../vendor/twig/lib',
+));
+
+// intl
+if (!function_exists('intl_get_error_code')) {
+    require_once __DIR__.'/../vendor/symfony/src/Symfony/Component/Locale/Resources/stubs/functions.php';
+
+    $loader->registerPrefixFallbacks(array(__DIR__.'/../vendor/symfony/src/Symfony/Component/Locale/Resources/stubs'));
+}
+
+$loader->registerNamespaceFallbacks(array(
+    __DIR__.'/../src',
+));
+$loader->register();
+
+AnnotationRegistry::registerLoader(function($class) use ($loader) {
+    $loader->loadClass($class);
+    return class_exists($class, false);
+});
+AnnotationRegistry::registerFile(__DIR__.'/../vendor/doctrine/lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php');
+
+// Swiftmailer needs a special autoloader to allow
+// the lazy loading of the init file (which is expensive)
+require_once __DIR__.'/../vendor/swiftmailer/lib/classes/Swift.php';
+Swift::registerAutoload(__DIR__.'/../vendor/swiftmailer/lib/swift_init.php');
+

app/bootstrap.php.cache

+<?php
+
+namespace { require_once __DIR__.'/autoload.php'; }
+
+  
+
+
+
+namespace Symfony\Component\DependencyInjection
+{
+
+
+interface ContainerAwareInterface
+{
+    
+    function setContainer(ContainerInterface $container = null);
+}
+}
+ 
+
+
+
+namespace Symfony\Component\DependencyInjection
+{
+
+
+interface ContainerInterface
+{
+    const EXCEPTION_ON_INVALID_REFERENCE = 1;
+    const NULL_ON_INVALID_REFERENCE      = 2;
+    const IGNORE_ON_INVALID_REFERENCE    = 3;
+    const SCOPE_CONTAINER                = 'container';
+    const SCOPE_PROTOTYPE                = 'prototype';
+
+    
+    function set($id, $service, $scope = self::SCOPE_CONTAINER);
+
+    
+    function get($id, $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE);
+
+    
+    function has($id);
+
+    
+    function getParameter($name);
+
+    
+    function hasParameter($name);
+
+    
+    function setParameter($name, $value);
+
+    
+    function enterScope($name);
+
+    
+    function leaveScope($name);
+
+    
+    function addScope(ScopeInterface $scope);
+
+    
+    function hasScope($name);
+
+    
+    function isScopeActive($name);
+}
+}
+ 
+
+
+
+namespace Symfony\Component\DependencyInjection
+{
+
+use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException;
+use Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException;
+use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
+use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
+use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;
+
+
+class Container implements ContainerInterface
+{
+    protected $parameterBag;
+    protected $services;
+    protected $scopes;
+    protected $scopeChildren;
+    protected $scopedServices;
+    protected $scopeStacks;
+    protected $loading = array();
+
+    
+    public function __construct(ParameterBagInterface $parameterBag = null)
+    {
+        $this->parameterBag = null === $parameterBag ? new ParameterBag() : $parameterBag;
+
+        $this->services       = array();
+        $this->scopes         = array();
+        $this->scopeChildren  = array();
+        $this->scopedServices = array();
+        $this->scopeStacks    = array();
+
+        $this->set('service_container', $this);
+    }
+
+    
+    public function compile()
+    {
+        $this->parameterBag->resolve();
+
+        $this->parameterBag = new FrozenParameterBag($this->parameterBag->all());
+    }
+
+    
+    public function isFrozen()
+    {
+        return $this->parameterBag instanceof FrozenParameterBag;
+    }
+
+    
+    public function getParameterBag()
+    {
+        return $this->parameterBag;
+    }
+
+    
+    public function getParameter($name)
+    {
+        return $this->parameterBag->get($name);
+    }
+
+    
+    public function hasParameter($name)
+    {
+        return $this->parameterBag->has($name);
+    }
+
+    
+    public function setParameter($name, $value)
+    {
+        $this->parameterBag->set($name, $value);
+    }
+
+    
+    public function set($id, $service, $scope = self::SCOPE_CONTAINER)
+    {
+        if (self::SCOPE_PROTOTYPE === $scope) {
+            throw new \InvalidArgumentException('You cannot set services of scope "prototype".');
+        }
+
+        $id = strtolower($id);
+
+        if (self::SCOPE_CONTAINER !== $scope) {
+            if (!isset($this->scopedServices[$scope])) {
+                throw new \RuntimeException('You cannot set services of inactive scopes.');
+            }
+
+            $this->scopedServices[$scope][$id] = $service;
+        }
+
+        $this->services[$id] = $service;
+    }
+
+    
+    public function has($id)
+    {
+        $id = strtolower($id);
+
+        return isset($this->services[$id]) || method_exists($this, 'get'.strtr($id, array('_' => '', '.' => '_')).'Service');
+    }
+
+    
+    public function get($id, $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE)
+    {
+        $id = strtolower($id);
+
+        if (isset($this->services[$id])) {
+            return $this->services[$id];
+        }
+
+        if (isset($this->loading[$id])) {
+            throw new ServiceCircularReferenceException($id, array_keys($this->loading));
+        }
+
+        if (method_exists($this, $method = 'get'.strtr($id, array('_' => '', '.' => '_')).'Service')) {
+            $this->loading[$id] = true;
+
+            try {
+                $service = $this->$method();
+            } catch (\Exception $e) {
+                unset($this->loading[$id]);
+                throw $e;
+            }
+
+            unset($this->loading[$id]);
+
+            return $service;
+        }
+
+        if (self::EXCEPTION_ON_INVALID_REFERENCE === $invalidBehavior) {
+            throw new ServiceNotFoundException($id);
+        }
+    }
+
+    
+    public function getServiceIds()
+    {
+        $ids = array();
+        $r = new \ReflectionClass($this);
+        foreach ($r->getMethods() as $method) {
+            if (preg_match('/^get(.+)Service$/', $method->getName(), $match)) {
+                $ids[] = self::underscore($match[1]);
+            }
+        }
+
+        return array_unique(array_merge($ids, array_keys($this->services)));
+    }
+
+    
+    public function enterScope($name)
+    {
+        if (!isset($this->scopes[$name])) {
+            throw new \InvalidArgumentException(sprintf('The scope "%s" does not exist.', $name));
+        }
+
+        if (self::SCOPE_CONTAINER !== $this->scopes[$name] && !isset($this->scopedServices[$this->scopes[$name]])) {
+            throw new \RuntimeException(sprintf('The parent scope "%s" must be active when entering this scope.', $this->scopes[$name]));
+        }
+
+                                if (isset($this->scopedServices[$name])) {
+            $services = array($this->services, $name => $this->scopedServices[$name]);
+            unset($this->scopedServices[$name]);
+
+            foreach ($this->scopeChildren[$name] as $child) {
+                $services[$child] = $this->scopedServices[$child];
+                unset($this->scopedServices[$child]);
+            }
+
+                        $this->services = call_user_func_array('array_diff_key', $services);
+            array_shift($services);
+
+                        if (!isset($this->scopeStacks[$name])) {
+                $this->scopeStacks[$name] = new \SplStack();
+            }
+            $this->scopeStacks[$name]->push($services);
+        }
+
+        $this->scopedServices[$name] = array();
+    }
+
+    
+    public function leaveScope($name)
+    {
+        if (!isset($this->scopedServices[$name])) {
+            throw new \InvalidArgumentException(sprintf('The scope "%s" is not active.', $name));
+        }
+
+                        $services = array($this->services, $this->scopedServices[$name]);
+        unset($this->scopedServices[$name]);
+        foreach ($this->scopeChildren[$name] as $child) {
+            if (!isset($this->scopedServices[$child])) {
+                continue;
+            }
+
+            $services[] = $this->scopedServices[$child];
+            unset($this->scopedServices[$child]);
+        }
+        $this->services = call_user_func_array('array_diff_key', $services);
+
+                if (isset($this->scopeStacks[$name]) && count($this->scopeStacks[$name]) > 0) {
+            $services = $this->scopeStacks[$name]->pop();
+            $this->scopedServices += $services;
+
+            array_unshift($services, $this->services);
+            $this->services = call_user_func_array('array_merge', $services);
+        }
+    }
+
+    
+    public function addScope(ScopeInterface $scope)
+    {
+        $name = $scope->getName();
+        $parentScope = $scope->getParentName();
+
+        if (self::SCOPE_CONTAINER === $name || self::SCOPE_PROTOTYPE === $name) {
+            throw new \InvalidArgumentException(sprintf('The scope "%s" is reserved.', $name));
+        }
+        if (isset($this->scopes[$name])) {
+            throw new \InvalidArgumentException(sprintf('A scope with name "%s" already exists.', $name));
+        }
+        if (self::SCOPE_CONTAINER !== $parentScope && !isset($this->scopes[$parentScope])) {
+            throw new \InvalidArgumentException(sprintf('The parent scope "%s" does not exist, or is invalid.', $parentScope));
+        }
+
+        $this->scopes[$name] = $parentScope;
+        $this->scopeChildren[$name] = array();
+
+                while ($parentScope !== self::SCOPE_CONTAINER) {
+            $this->scopeChildren[$parentScope][] = $name;
+            $parentScope = $this->scopes[$parentScope];
+        }
+    }
+
+    
+    public function hasScope($name)
+    {
+        return isset($this->scopes[$name]);
+    }
+
+    
+    public function isScopeActive($name)
+    {
+        return isset($this->scopedServices[$name]);
+    }
+
+    
+    static public function camelize($id)
+    {
+        return preg_replace_callback('/(^|_|\.)+(.)/', function ($match) { return ('.' === $match[1] ? '_' : '').strtoupper($match[2]); }, $id);
+    }
+
+    
+    static public function underscore($id)
+    {
+        return strtolower(preg_replace(array('/([A-Z]+)([A-Z][a-z])/', '/([a-z\d])([A-Z])/'), array('\\1_\\2', '\\1_\\2'), strtr($id, '_', '.')));
+    }
+}
+}
+ 
+
+
+
+namespace Symfony\Component\HttpKernel
+{
+
+use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\HttpFoundation\Response;
+
+
+interface HttpKernelInterface
+{
+    const MASTER_REQUEST = 1;
+    const SUB_REQUEST = 2;
+
+    
+    function handle(Request $request, $type = self::MASTER_REQUEST, $catch = true);
+}
+}
+ 
+
+
+
+namespace Symfony\Component\HttpKernel
+{
+
+use Symfony\Component\DependencyInjection\ContainerInterface;
+use Symfony\Component\HttpKernel\HttpKernelInterface;
+use Symfony\Component\HttpKernel\Bundle\BundleInterface;
+use Symfony\Component\Config\Loader\LoaderInterface;
+
+
+interface KernelInterface extends HttpKernelInterface, \Serializable
+{
+    
+    function registerBundles();
+
+    
+    function registerContainerConfiguration(LoaderInterface $loader);
+
+    
+    function boot();
+
+    
+    function shutdown();
+
+    
+    function getBundles();
+
+    
+    function isClassInActiveBundle($class);
+
+    
+    function getBundle($name, $first = true);
+
+    
+    function locateResource($name, $dir = null, $first = true);
+
+    
+    function getName();
+
+    
+    function getEnvironment();
+
+    
+    function isDebug();
+
+    
+    function getRootDir();
+
+    
+    function getContainer();
+
+    
+    function getStartTime();
+
+    
+    function getCacheDir();
+
+    
+    function getLogDir();
+}
+}
+ 
+
+
+
+namespace Symfony\Component\HttpKernel
+{
+
+use Symfony\Component\DependencyInjection\ContainerInterface;
+use Symfony\Component\DependencyInjection\ContainerBuilder;
+use Symfony\Component\DependencyInjection\Dumper\PhpDumper;
+use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
+use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
+use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
+use Symfony\Component\DependencyInjection\Loader\IniFileLoader;
+use Symfony\Component\DependencyInjection\Loader\PhpFileLoader;
+use Symfony\Component\DependencyInjection\Loader\ClosureLoader;
+use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\HttpKernel\HttpKernelInterface;
+use Symfony\Component\HttpKernel\Bundle\BundleInterface;
+use Symfony\Component\HttpKernel\Config\FileLocator;
+use Symfony\Component\HttpKernel\DependencyInjection\MergeExtensionConfigurationPass;
+use Symfony\Component\HttpKernel\DependencyInjection\AddClassesToCachePass;
+use Symfony\Component\HttpKernel\DependencyInjection\Extension as DIExtension;
+use Symfony\Component\HttpKernel\Debug\ErrorHandler;
+use Symfony\Component\HttpKernel\Debug\ExceptionHandler;
+use Symfony\Component\Config\Loader\LoaderResolver;
+use Symfony\Component\Config\Loader\DelegatingLoader;
+use Symfony\Component\Config\ConfigCache;
+use Symfony\Component\ClassLoader\ClassCollectionLoader;
+use Symfony\Component\ClassLoader\DebugUniversalClassLoader;
+
+
+abstract class Kernel implements KernelInterface
+{
+    protected $bundles;
+    protected $bundleMap;
+    protected $container;
+    protected $rootDir;
+    protected $environment;
+    protected $debug;
+    protected $booted;
+    protected $name;
+    protected $startTime;
+    protected $classes;
+
+    const VERSION = '2.0.3';
+
+    
+    public function __construct($environment, $debug)
+    {
+        $this->environment = $environment;
+        $this->debug = (Boolean) $debug;
+        $this->booted = false;
+        $this->rootDir = $this->getRootDir();
+        $this->name = preg_replace('/[^a-zA-Z0-9_]+/', '', basename($this->rootDir));
+        $this->classes = array();
+
+        if ($this->debug) {
+            $this->startTime = microtime(true);
+        }
+
+        $this->init();
+    }
+
+    public function init()
+    {
+        if ($this->debug) {
+            ini_set('display_errors', 1);
+            error_reporting(-1);
+
+            DebugUniversalClassLoader::enable();
+            ErrorHandler::register();
+            if ('cli' !== php_sapi_name()) {
+                ExceptionHandler::register();
+            }
+        } else {
+            ini_set('display_errors', 0);
+        }
+    }
+
+    public function __clone()
+    {
+        if ($this->debug) {
+            $this->startTime = microtime(true);
+        }
+
+        $this->booted = false;
+        $this->container = null;
+    }
+
+    
+    public function boot()
+    {
+        if (true === $this->booted) {
+            return;
+        }
+
+                $this->initializeBundles();
+
+                $this->initializeContainer();
+
+        foreach ($this->getBundles() as $bundle) {
+            $bundle->setContainer($this->container);
+            $bundle->boot();
+        }
+
+        $this->booted = true;
+    }
+
+    
+    public function shutdown()
+    {
+        if (false === $this->booted) {
+            return;
+        }
+
+        $this->booted = false;
+
+        foreach ($this->getBundles() as $bundle) {
+            $bundle->shutdown();
+            $bundle->setContainer(null);
+        }
+
+        $this->container = null;
+    }
+
+    
+    public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true)
+    {
+        if (false === $this->booted) {
+            $this->boot();
+        }
+
+        return $this->getHttpKernel()->handle($request, $type, $catch);
+    }
+
+    
+    protected function getHttpKernel()
+    {
+        return $this->container->get('http_kernel');
+    }
+
+    
+    public function getBundles()
+    {
+        return $this->bundles;
+    }
+
+    
+    public function isClassInActiveBundle($class)
+    {
+        foreach ($this->getBundles() as $bundle) {
+            if (0 === strpos($class, $bundle->getNamespace())) {
+                return true;
+            }
+        }
+
+        return false;
+    }
+
+    
+    public function getBundle($name, $first = true)
+    {
+        if (!isset($this->bundleMap[$name])) {
+            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)));
+        }
+
+        if (true === $first) {
+            return $this->bundleMap[$name][0];
+        }
+
+        return $this->bundleMap[$name];
+    }
+
+    
+    public function locateResource($name, $dir = null, $first = true)
+    {
+        if ('@' !== $name[0]) {
+            throw new \InvalidArgumentException(sprintf('A resource name must start with @ ("%s" given).', $name));
+        }
+
+        if (false !== strpos($name, '..')) {
+            throw new \RuntimeException(sprintf('File name "%s" contains invalid characters (..).', $name));
+        }
+
+        $bundleName = substr($name, 1);
+        $path = '';
+        if (false !== strpos($bundleName, '/')) {
+            list($bundleName, $path) = explode('/', $bundleName, 2);
+        }
+
+        $isResource = 0 === strpos($path, 'Resources') && null !== $dir;
+        $overridePath = substr($path, 9);
+        $resourceBundle = null;
+        $bundles = $this->getBundle($bundleName, false);
+        $files = array();
+
+        foreach ($bundles as $bundle) {
+            if ($isResource && file_exists($file = $dir.'/'.$bundle->getName().$overridePath)) {
+                if (null !== $resourceBundle) {
+                    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.',
+                        $file,
+                        $resourceBundle,
+                        $dir.'/'.$bundles[0]->getName().$overridePath
+                    ));
+                }
+
+                if ($first) {
+                    return $file;
+                }
+                $files[] = $file;
+            }
+
+            if (file_exists($file = $bundle->getPath().'/'.$path)) {
+                if ($first && !$isResource) {
+                    return $file;
+                }
+                $files[] = $file;
+                $resourceBundle = $bundle->getName();
+            }
+        }
+
+        if (count($files) > 0) {
+            return $first && $isResource ? $files[0] : $files;
+        }
+
+        throw new \InvalidArgumentException(sprintf('Unable to find file "%s".', $name));
+    }
+
+    
+    public function getName()
+    {
+        return $this->name;
+    }
+
+    
+    public function getEnvironment()
+    {
+        return $this->environment;
+    }
+
+    
+    public function isDebug()
+    {
+        return $this->debug;
+    }
+
+    
+    public function getRootDir()
+    {
+        if (null === $this->rootDir) {
+            $r = new \ReflectionObject($this);
+            $this->rootDir = dirname($r->getFileName());
+        }
+
+        return $this->rootDir;
+    }
+
+    
+    public function getContainer()
+    {
+        return $this->container;
+    }
+
+    
+    public function loadClassCache($name = 'classes', $extension = '.php')
+    {
+        if (!$this->booted && file_exists($this->getCacheDir().'/classes.map')) {
+            ClassCollectionLoader::load(include($this->getCacheDir().'/classes.map'), $this->getCacheDir(), $name, $this->debug, false, $extension);
+        }
+    }
+
+    
+    public function setClassCache(array $classes)
+    {
+        file_put_contents($this->getCacheDir().'/classes.map', sprintf('<?php return %s;', var_export($classes, true)));
+    }
+
+    
+    public function getStartTime()
+    {
+        return $this->debug ? $this->startTime : -INF;
+    }
+
+    
+    public function getCacheDir()
+    {
+        return $this->rootDir.'/cache/'.$this->environment;
+    }
+
+    
+    public function getLogDir()
+    {
+        return $this->rootDir.'/logs';
+    }
+
+    
+    protected function initializeBundles()
+    {
+                $this->bundles = array();
+        $topMostBundles = array();
+        $directChildren = array();
+
+        foreach ($this->registerBundles() as $bundle) {
+            $name = $bundle->getName();
+            if (isset($this->bundles[$name])) {
+                throw new \LogicException(sprintf('Trying to register two bundles with the same name "%s"', $name));
+            }
+            $this->bundles[$name] = $bundle;
+
+            if ($parentName = $bundle->getParent()) {
+                if (isset($directChildren[$parentName])) {
+                    throw new \LogicException(sprintf('Bundle "%s" is directly extended by two bundles "%s" and "%s".', $parentName, $name, $directChildren[$parentName]));
+                }
+                if ($parentName == $name) {
+                    throw new \LogicException(sprintf('Bundle "%s" can not extend itself.', $name));
+                }
+                $directChildren[$parentName] = $name;
+            } else {
+                $topMostBundles[$name] = $bundle;
+            }
+        }
+
+                if (count($diff = array_values(array_diff(array_keys($directChildren), array_keys($this->bundles))))) {
+            throw new \LogicException(sprintf('Bundle "%s" extends bundle "%s", which is not registered.', $directChildren[$diff[0]], $diff[0]));
+        }
+
+                $this->bundleMap = array();
+        foreach ($topMostBundles as $name => $bundle) {
+            $bundleMap = array($bundle);
+            $hierarchy = array($name);
+
+            while (isset($directChildren[$name])) {
+                $name = $directChildren[$name];
+                array_unshift($bundleMap, $this->bundles[$name]);
+                $hierarchy[] = $name;
+            }
+
+            foreach ($hierarchy as $bundle) {
+                $this->bundleMap[$bundle] = $bundleMap;
+                array_pop($bundleMap);
+            }
+        }
+
+    }
+
+    
+    protected function getContainerClass()
+    {
+        return $this->name.ucfirst($this->environment).($this->debug ? 'Debug' : '').'ProjectContainer';
+    }
+
+    
+    protected function getContainerBaseClass()
+    {
+        return 'Container';
+    }
+
+    
+    protected function initializeContainer()
+    {
+        $class = $this->getContainerClass();
+        $cache = new ConfigCache($this->getCacheDir().'/'.$class.'.php', $this->debug);
+        $fresh = true;
+        if (!$cache->isFresh()) {
+            $container = $this->buildContainer();
+            $this->dumpContainer($cache, $container, $class, $this->getContainerBaseClass());
+
+            $fresh = false;
+        }
+
+        require_once $cache;
+
+        $this->container = new $class();
+        $this->container->set('kernel', $this);
+
+        if (!$fresh) {
+            $this->container->get('cache_warmer')->warmUp($this->container->getParameter('kernel.cache_dir'));
+        }
+    }
+
+    
+    protected function getKernelParameters()
+    {
+        $bundles = array();
+        foreach ($this->bundles as $name => $bundle) {
+            $bundles[$name] = get_class($bundle);
+        }
+
+        return array_merge(
+            array(
+                'kernel.root_dir'        => $this->rootDir,
+                'kernel.environment'     => $this->environment,
+                'kernel.debug'           => $this->debug,
+                'kernel.name'            => $this->name,
+                'kernel.cache_dir'       => $this->getCacheDir(),
+                'kernel.logs_dir'        => $this->getLogDir(),
+                'kernel.bundles'         => $bundles,
+                'kernel.charset'         => 'UTF-8',
+                'kernel.container_class' => $this->getContainerClass(),
+            ),
+            $this->getEnvParameters()
+        );
+    }
+
+    
+    protected function getEnvParameters()
+    {
+        $parameters = array();
+        foreach ($_SERVER as $key => $value) {
+            if ('SYMFONY__' === substr($key, 0, 9)) {
+                $parameters[strtolower(str_replace('__', '.', substr($key, 9)))] = $value;
+            }
+        }
+
+        return $parameters;
+    }
+
+    
+    protected function buildContainer()
+    {
+        foreach (array('cache' => $this->getCacheDir(), 'logs' => $this->getLogDir()) as $name => $dir) {
+            if (!is_dir($dir)) {
+                if (false === @mkdir($dir, 0777, true)) {
+                    throw new \RuntimeException(sprintf("Unable to create the %s directory (%s)\n", $name, dirname($dir)));
+                }
+            } elseif (!is_writable($dir)) {
+                throw new \RuntimeException(sprintf("Unable to write in the %s directory (%s)\n", $name, $dir));
+            }
+        }
+
+        $container = new ContainerBuilder(new ParameterBag($this->getKernelParameters()));
+        $extensions = array();
+        foreach ($this->bundles as $bundle) {
+            $bundle->build($container);
+
+            if ($extension = $bundle->getContainerExtension()) {
+                $container->registerExtension($extension);
+                $extensions[] = $extension->getAlias();
+            }
+
+            if ($this->debug) {
+                $container->addObjectResource($bundle);
+            }
+        }
+        $container->addObjectResource($this);
+
+                $container->getCompilerPassConfig()->setMergePass(new MergeExtensionConfigurationPass($extensions));
+
+        if (null !== $cont = $this->registerContainerConfiguration($this->getContainerLoader($container))) {
+            $container->merge($cont);
+        }
+
+        $container->addCompilerPass(new AddClassesToCachePass($this));
+        $container->compile();
+
+        return $container;
+    }
+
+    
+    protected function dumpContainer(ConfigCache $cache, ContainerBuilder $container, $class, $baseClass)
+    {
+                $dumper = new PhpDumper($container);
+        $content = $dumper->dump(array('class' => $class, 'base_class' => $baseClass));
+        if (!$this->debug) {
+            $content = self::stripComments($content);
+        }
+
+        $cache->write($content, $container->getResources());
+    }
+
+    
+    protected function getContainerLoader(ContainerInterface $container)
+    {
+        $locator = new FileLocator($this);
+        $resolver = new LoaderResolver(array(
+            new XmlFileLoader($container, $locator),
+            new YamlFileLoader($container, $locator),
+            new IniFileLoader($container, $locator),
+            new PhpFileLoader($container, $locator),
+            new ClosureLoader($container),
+        ));
+
+        return new DelegatingLoader($resolver);
+    }
+
+    
+    static public function stripComments($source)
+    {
+        if (!function_exists('token_get_all')) {
+            return $source;
+        }
+
+        $output = '';
+        foreach (token_get_all($source) as $token) {
+            if (is_string($token)) {
+                $output .= $token;
+            } elseif (!in_array($token[0], array(T_COMMENT, T_DOC_COMMENT))) {
+                $output .= $token[1];
+            }
+        }
+
+                $output = preg_replace(array('/\s+$/Sm', '/\n+/S'), "\n", $output);
+
+        return $output;
+    }
+
+    public function serialize()
+    {
+        return serialize(array($this->environment, $this->debug));
+    }
+
+    public function unserialize($data)
+    {
+        list($environment, $debug) = unserialize($data);
+
+        $this->__construct($environment, $debug);
+    }
+}
+}
+ 
+
+
+
+namespace Symfony\Component\ClassLoader
+{
+
+
+class ClassCollectionLoader
+{
+    static private $loaded;
+
+    
+    static public function load($classes, $cacheDir, $name, $autoReload, $adaptive = false, $extension = '.php')
+    {
+                if (isset(self::$loaded[$name])) {
+            return;
+        }
+
+        self::$loaded[$name] = true;
+
+        if ($adaptive) {
+                        $classes = array_diff($classes, get_declared_classes(), get_declared_interfaces());
+
+                        $name = $name.'-'.substr(md5(implode('|', $classes)), 0, 5);
+        }
+
+        $cache = $cacheDir.'/'.$name.$extension;
+
+                $reload = false;
+        if ($autoReload) {
+            $metadata = $cacheDir.'/'.$name.$extension.'.meta';
+            if (!file_exists($metadata) || !file_exists($cache)) {
+                $reload = true;
+            } else {
+                $time = filemtime($cache);
+                $meta = unserialize(file_get_contents($metadata));
+
+                if ($meta[1] != $classes) {
+                    $reload = true;
+                } else {
+                    foreach ($meta[0] as $resource) {
+                        if (!file_exists($resource) || filemtime($resource) > $time) {
+                            $reload = true;
+
+                            break;
+                        }
+                    }
+                }
+            }
+        }
+
+        if (!$reload && file_exists($cache)) {
+            require_once $cache;
+
+            return;
+        }
+
+        $files = array();
+        $content = '';
+        foreach ($classes as $class) {
+            if (!class_exists($class) && !interface_exists($class) && function_exists('trait_exists') && !trait_exists($class)) {
+                throw new \InvalidArgumentException(sprintf('Unable to load class "%s"', $class));
+            }
+
+            $r = new \ReflectionClass($class);
+            $files[] = $r->getFileName();
+
+            $c = preg_replace(array('/^\s*<\?php/', '/\?>\s*$/'), '', file_get_contents($r->getFileName()));
+
+                        if (!$r->inNamespace()) {
+                $c = "\nnamespace\n{\n".self::stripComments($c)."\n}\n";
+            } else {
+                $c = self::fixNamespaceDeclarations('<?php '.$c);
+                $c = preg_replace('/^\s*<\?php/', '', $c);
+            }
+
+            $content .= $c;
+        }
+
+                if (!is_dir(dirname($cache))) {
+            mkdir(dirname($cache), 0777, true);
+        }
+        self::writeCacheFile($cache, '<?php '.$content);
+
+        if ($autoReload) {
+                        self::writeCacheFile($metadata, serialize(array($files, $classes)));
+        }
+    }
+
+    
+    static public function fixNamespaceDeclarations($source)
+    {
+        if (!function_exists('token_get_all')) {
+            return $source;
+        }
+
+        $output = '';
+        $inNamespace = false;
+        $tokens = token_get_all($source);
+
+        for ($i = 0, $max = count($tokens); $i < $max; $i++) {
+            $token = $tokens[$i];
+            if (is_string($token)) {
+                $output .= $token;
+            } elseif (in_array($token[0], array(T_COMMENT, T_DOC_COMMENT))) {
+                                continue;
+            } elseif (T_NAMESPACE === $token[0]) {
+                if ($inNamespace) {
+                    $output .= "}\n";
+                }
+                $output .= $token[1];
+
+                                while (($t = $tokens[++$i]) && is_array($t) && in_array($t[0], array(T_WHITESPACE, T_NS_SEPARATOR, T_STRING))) {
+                    $output .= $t[1];
+                }
+                if (is_string($t) && '{' === $t) {
+                    $inNamespace = false;
+                    --$i;
+                } else {
+                    $output .= "\n{";
+                    $inNamespace = true;
+                }
+            } else {
+                $output .= $token[1];
+            }
+        }
+
+        if ($inNamespace) {
+            $output .= "}\n";
+        }
+
+        return $output;
+    }
+
+    
+    static private function writeCacheFile($file, $content)
+    {
+        $tmpFile = tempnam(dirname($file), basename($file));
+        if (false !== @file_put_contents($tmpFile, $content) && @rename($tmpFile, $file)) {
+            chmod($file, 0644);
+
+            return;
+        }
+
+        throw new \RuntimeException(sprintf('Failed to write cache file "%s".', $file));
+    }
+
+    
+    static private function stripComments($source)
+    {
+        if (!function_exists('token_get_all')) {
+            return $source;
+        }
+
+        $output = '';
+        foreach (token_get_all($source) as $token) {
+            if (is_string($token)) {
+                $output .= $token;
+            } elseif (!in_array($token[0], array(T_COMMENT, T_DOC_COMMENT))) {
+                $output .= $token[1];
+            }
+        }
+
+                $output = preg_replace(array('/\s+$/Sm', '/\n+/S'), "\n", $output);
+
+        return $output;
+    }
+}
+}
+ 
+
+
+
+namespace Symfony\Component\ClassLoader
+{
+
+
+class UniversalClassLoader
+{
+    private $namespaces = array();
+    private $prefixes = array();
+    private $namespaceFallbacks = array();
+    private $prefixFallbacks = array();
+
+    
+    public function getNamespaces()
+    {
+        return $this->namespaces;
+    }
+
+    
+    public function getPrefixes()
+    {
+        return $this->prefixes;
+    }
+
+    
+    public function getNamespaceFallbacks()
+    {
+        return $this->namespaceFallbacks;
+    }
+
+    
+    public function getPrefixFallbacks()
+    {
+        return $this->prefixFallbacks;
+    }
+
+    
+    public function registerNamespaceFallbacks(array $dirs)
+    {
+        $this->namespaceFallbacks = $dirs;
+    }
+
+    
+    public function registerPrefixFallbacks(array $dirs)
+    {
+        $this->prefixFallbacks = $dirs;
+    }
+
+    
+    public function registerNamespaces(array $namespaces)
+    {
+        foreach ($namespaces as $namespace => $locations) {
+            $this->namespaces[$namespace] = (array) $locations;
+        }
+    }
+
+    
+    public function registerNamespace($namespace, $paths)
+    {
+        $this->namespaces[$namespace] = (array) $paths;
+    }
+
+    
+    public function registerPrefixes(array $classes)
+    {
+        foreach ($classes as $prefix => $locations) {
+            $this->prefixes[$prefix] = (array) $locations;
+        }
+    }
+
+    
+    public function registerPrefix($prefix, $paths)
+    {
+        $this->prefixes[$prefix] = (array) $paths;
+    }
+
+    
+    public function register($prepend = false)
+    {
+        spl_autoload_register(array($this, 'loadClass'), true, $prepend);
+    }
+
+    
+    public function loadClass($class)
+    {
+        if ($file = $this->findFile($class)) {
+            require $file;
+        }
+    }
+
+    
+    public function findFile($class)
+    {
+        if ('\\' == $class[0]) {
+            $class = substr($class, 1);
+        }
+
+        if (false !== $pos = strrpos($class, '\\')) {
+                        $namespace = substr($class, 0, $pos);
+            foreach ($this->namespaces as $ns => $dirs) {
+                if (0 !== strpos($namespace, $ns)) {
+                    continue;
+                }
+
+                foreach ($dirs as $dir) {
+                    $className = substr($class, $pos + 1);
+                    $file = $dir.DIRECTORY_SEPARATOR.str_replace('\\', DIRECTORY_SEPARATOR, $namespace).DIRECTORY_SEPARATOR.str_replace('_', DIRECTORY_SEPARATOR, $className).'.php';
+                    if (file_exists($file)) {
+                        return $file;
+                    }
+                }
+            }
+
+            foreach ($this->namespaceFallbacks as $dir) {
+                $file = $dir.DIRECTORY_SEPARATOR.str_replace('\\', DIRECTORY_SEPARATOR, $class).'.php';
+                if (file_exists($file)) {
+                    return $file;
+                }
+            }
+        } else {
+                        foreach ($this->prefixes as $prefix => $dirs) {
+                if (0 !== strpos($class, $prefix)) {
+                    continue;
+                }
+
+                foreach ($dirs as $dir) {
+                    $file = $dir.DIRECTORY_SEPARATOR.str_replace('_', DIRECTORY_SEPARATOR, $class).'.php';
+                    if (file_exists($file)) {
+                        return $file;
+                    }
+                }
+            }
+
+            foreach ($this->prefixFallbacks as $dir) {
+                $file = $dir.DIRECTORY_SEPARATOR.str_replace('_', DIRECTORY_SEPARATOR, $class).'.php';
+                if (file_exists($file)) {
+                    return $file;
+                }
+            }
+        }
+    }
+}
+}
+ 
+
+
+
+namespace Symfony\Component\HttpKernel\Bundle
+{
+
+use Symfony\Component\DependencyInjection\ContainerAware;
+use Symfony\Component\DependencyInjection\ContainerBuilder;
+use Symfony\Component\DependencyInjection\Container;
+use Symfony\Component\Console\Application;
+use Symfony\Component\Finder\Finder;
+
+
+abstract class Bundle extends ContainerAware implements BundleInterface
+{
+    protected $name;
+    protected $reflected;
+    protected $extension;
+
+    
+    public function boot()
+    {
+    }
+
+    
+    public function shutdown()
+    {
+    }
+
+    
+    public function build(ContainerBuilder $container)
+    {
+    }
+
+    
+    public function getContainerExtension()
+    {
+        if (null === $this->extension) {
+            $basename = preg_replace('/Bundle$/', '', $this->getName());
+
+            $class = $this->getNamespace().'\\DependencyInjection\\'.$basename.'Extension';
+            if (class_exists($class)) {
+                $extension = new $class();
+
+                                $expectedAlias = Container::underscore($basename);
+                if ($expectedAlias != $extension->getAlias()) {
+                    throw new \LogicException(sprintf(
+                        'The extension alias for the default extension of a '.
+                        'bundle must be the underscored version of the '.
+                        'bundle name ("%s" instead of "%s")',
+                        $expectedAlias, $extension->getAlias()
+                    ));
+                }
+
+                $this->extension = $extension;
+            } else {
+                $this->extension = false;
+            }
+        }
+
+        if ($this->extension) {
+            return $this->extension;
+        }
+    }
+
+    
+    public function getNamespace()
+    {
+        if (null === $this->reflected) {
+            $this->reflected = new \ReflectionObject($this);
+        }
+
+        return $this->reflected->getNamespaceName();
+    }
+
+    
+    public function getPath()
+    {
+        if (null === $this->reflected) {
+            $this->reflected = new \ReflectionObject($this);
+        }
+
+        return dirname($this->reflected->getFileName());
+    }
+
+    
+    public function getParent()
+    {
+        return null;
+    }
+
+    
+    final public function getName()
+    {
+        if (null !== $this->name) {
+            return $this->name;
+        }
+
+        $name = get_class($this);
+        $pos = strrpos($name, '\\');
+
+        return $this->name = false === $pos ? $name :  substr($name, $pos + 1);
+    }
+
+    
+    public function registerCommands(Application $application)
+    {
+        if (!$dir = realpath($this->getPath().'/Command')) {
+            return;
+        }
+
+        $finder = new Finder();
+        $finder->files()->name('*Command.php')->in($dir);
+
+        $prefix = $this->getNamespace().'\\Command';
+        foreach ($finder as $file) {
+            $ns = $prefix;
+            if ($relativePath = $file->getRelativePath()) {
+                $ns .= '\\'.strtr($relativePath, '/', '\\');
+            }
+            $r = new \ReflectionClass($ns.'\\'.$file->getBasename('.php'));
+            if ($r->isSubclassOf('Symfony\\Component\\Console\\Command\\Command') && !$r->isAbstract()) {
+                $application->add($r->newInstance());
+            }
+        }
+    }
+}
+}
+ 
+
+
+
+namespace Symfony\Component\HttpKernel\Bundle
+{
+
+use Symfony\Component\DependencyInjection\ContainerBuilder;
+
+
+interface BundleInterface
+{
+    
+    function boot();
+
+    
+    function shutdown();
+
+    
+    function build(ContainerBuilder $container);
+
+    
+    function getContainerExtension();
+
+    
+    function getParent();
+
+    
+    function getName();
+
+    
+    function getNamespace();
+
+    
+    function getPath();
+}
+}
+ 
+
+
+
+namespace Symfony\Component\Config
+{
+
+
+class ConfigCache
+{
+    private $debug;
+    private $file;
+
+    
+    public function __construct($file, $debug)
+    {
+        $this->file = $file;
+        $this->debug = (Boolean) $debug;
+    }
+
+    
+    public function __toString()
+    {
+        return $this->file;
+    }
+
+    
+    public function isFresh()
+    {
+        if (!file_exists($this->file)) {
+            return false;
+        }
+
+        if (!$this->debug) {
+            return true;
+        }
+
+        $metadata = $this->file.'.meta';
+        if (!file_exists($metadata)) {
+            return false;
+        }
+
+        $time = filemtime($this->file);
+        $meta = unserialize(file_get_contents($metadata));
+        foreach ($meta as $resource) {
+            if (!$resource->isFresh($time)) {
+                return false;
+            }
+        }
+
+        return true;
+    }
+
+    
+    public function write($content, array $metadata = null)
+    {
+        $dir = dirname($this->file);
+        if (!is_dir($dir)) {
+            if (false === @mkdir($dir, 0777, true)) {
+                throw new \RuntimeException(sprintf('Unable to create the %s directory', $dir));
+            }
+        } elseif (!is_writable($dir)) {
+            throw new \RuntimeException(sprintf('Unable to write in the %s directory', $dir));
+        }
+
+        $tmpFile = tempnam(dirname($this->file), basename($this->file));
+        if (false !== @file_put_contents($tmpFile, $content) && @rename($tmpFile, $this->file)) {
+            chmod($this->file, 0666);
+        } else {
+            throw new \RuntimeException(sprintf('Failed to write cache file "%s".', $this->file));
+        }
+
+        if (null !== $metadata && true === $this->debug) {
+            $file = $this->file.'.meta';
+            $tmpFile = tempnam(dirname($file), basename($file));
+            if (false !== @file_put_contents($tmpFile, serialize($metadata)) && @rename($tmpFile, $file)) {
+                chmod($file, 0666);
+            }
+        }
+    }
+}
+}
+<?php
+
+if (!$iniPath = get_cfg_var('cfg_file_path')) {
+    $iniPath = 'WARNING: not using a php.ini file';
+}
+
+echo "********************************\n";
+echo "*                              *\n";
+echo "*  Symfony requirements check  *\n";
+echo "*                              *\n";
+echo "********************************\n\n";
+echo sprintf("php.ini used by PHP: %s\n\n", $iniPath);
+
+echo "** WARNING **\n";
+echo "*  The PHP CLI can use a different php.ini file\n";
+echo "*  than the one used with your web server.\n";
+if ('\\' == DIRECTORY_SEPARATOR) {
+    echo "*  (especially on the Windows platform)\n";
+}
+echo "*  If this is the case, please ALSO launch this\n";
+echo "*  utility from your web server.\n";
+echo "** WARNING **\n";
+
+// mandatory
+echo_title("Mandatory requirements");
+check(version_compare(phpversion(), '5.3.2', '>='), sprintf('Checking that PHP version is at least 5.3.2 (%s installed)', phpversion()), 'Install PHP 5.3.2 or newer (current version is '.phpversion(), true);
+check(ini_get('date.timezone'), 'Checking that the "date.timezone" setting is set', 'Set the "date.timezone" setting in php.ini (like Europe/Paris)', true);
+check(is_writable(__DIR__.'/../app/cache'), sprintf('Checking that app/cache/ directory is writable'), 'Change the permissions of the app/cache/ directory so that the web server can write in it', true);
+check(is_writable(__DIR__.'/../app/logs'), sprintf('Checking that the app/logs/ directory is writable'), 'Change the permissions of the app/logs/ directory so that the web server can write in it', true);
+check(function_exists('json_encode'), 'Checking that the json_encode() is available', 'Install and enable the json extension', true);
+check(class_exists('SQLite3') || in_array('sqlite', PDO::getAvailableDrivers()), 'Checking that the SQLite3 or PDO_SQLite extension is available', 'Install and enable the SQLite3 or PDO_SQLite extension.', true);
+check(function_exists('session_start'), 'Checking that the session_start() is available', 'Install and enable the session extension', true);
+check(function_exists('ctype_alpha'), 'Checking that the ctype_alpha() is available', 'Install and enable the ctype extension', true);
+check(function_exists('token_get_all'), 'Checking that the token_get_all() is available', 'Install and enable the tokenizer extension', true);
+check(!(function_exists('apc_store') && ini_get('apc.enabled')) || version_compare(phpversion('apc'), '3.0.17', '>='), 'Checking that the APC version is at least 3.0.17', 'Upgrade your APC extension (3.0.17+)', true);
+
+// warnings
+echo_title("Optional checks");
+check(class_exists('DomDocument'), 'Checking that the PHP-XML module is installed', 'Install and enable the php-xml module', false);
+check(defined('LIBXML_COMPACT'), 'Checking that the libxml version is at least 2.6.21', 'Upgrade your php-xml module with a newer libxml', false);
+check(function_exists('token_get_all'), 'Checking that the token_get_all() function is available', 'Install and enable the Tokenizer extension (highly recommended)', false);
+check(function_exists('mb_strlen'), 'Checking that the mb_strlen() function is available', 'Install and enable the mbstring extension', false);
+check(function_exists('iconv'), 'Checking that the iconv() function is available', 'Install and enable the iconv extension', false);
+check(function_exists('utf8_decode'), 'Checking that the utf8_decode() is available', 'Install and enable the XML extension', false);
+if (PHP_OS != 'WINNT') {
+    check(function_exists('posix_isatty'), 'Checking that the posix_isatty() is available', 'Install and enable the php_posix extension (used to colorized the CLI output)', false);
+}
+check(class_exists('Locale'), 'Checking that the intl extension is available', 'Install and enable the intl extension (used for validators)', false);
+if (class_exists('Locale')) {
+    $version = '';
+
+    if (defined('INTL_ICU_VERSION')) {
+        $version =  INTL_ICU_VERSION;
+    } else {
+        $reflector = new \ReflectionExtension('intl');
+
+        ob_start();
+        $reflector->info();
+        $output = strip_tags(ob_get_clean());
+
+        preg_match('/^ICU version +(?:=> )?(.*)$/m', $output, $matches);
+        $version = $matches[1];
+    }
+
+    check(version_compare($version, '4.0', '>='), 'Checking that the intl ICU version is at least 4+', 'Upgrade your intl extension with a newer ICU version (4+)', false);
+}
+
+$accelerator = 
+    (function_exists('apc_store') && ini_get('apc.enabled'))
+    ||
+    function_exists('eaccelerator_put') && ini_get('eaccelerator.enable')
+    ||
+    function_exists('xcache_set')
+;
+check($accelerator, 'Checking that a PHP accelerator is installed', 'Install a PHP accelerator like APC (highly recommended)', false);
+
+check(!ini_get('short_open_tag'), 'Checking that php.ini has short_open_tag set to off', 'Set short_open_tag to off in php.ini', false);
+check(!ini_get('magic_quotes_gpc'), 'Checking that php.ini has magic_quotes_gpc set to off', 'Set magic_quotes_gpc to off in php.ini', false);
+check(!ini_get('register_globals'), 'Checking that php.ini has register_globals set to off', 'Set register_globals to off in php.ini', false);
+check(!ini_get('session.auto_start'), 'Checking that php.ini has session.auto_start set to off', 'Set session.auto_start to off in php.ini', false);
+
+echo_title("Optional checks (Doctrine)");
+
+check(class_exists('PDO'), 'Checking that PDO is installed', 'Install PDO (mandatory for Doctrine)', false);
+if (class_exists('PDO')) {
+    $drivers = PDO::getAvailableDrivers();
+    check(count($drivers), 'Checking that PDO has some drivers installed: '.implode(', ', $drivers), 'Install PDO drivers (mandatory for Doctrine)');
+}
+
+/**
+ * Checks a configuration.
+ */
+function check($boolean, $message, $help = '', $fatal = false)
+{
+    echo $boolean ? "  OK        " : sprintf("\n\n[[%s]] ", $fatal ? ' ERROR ' : 'WARNING');
+    echo sprintf("$message%s\n", $boolean ? '' : ': FAILED');
+
+    if (!$boolean) {
+        echo "            *** $help ***\n";
+        if ($fatal) {
+            exit("You must fix this problem before resuming the check.\n");
+        }
+    }
+}
+
+function echo_title($title)
+{
+    echo "\n** $title **\n\n";
+}

app/config/config.yml

+imports:
+    - { resource: parameters.ini }
+    - { resource: security.yml }
+
+framework:
+    #esi:             ~
+    #translator:      { fallback: %locale% }
+    secret:          %secret%
+    charset:         UTF-8
+    router:          { resource: "%kernel.root_dir%/config/routing.yml" }
+    form:            true
+    csrf_protection: true
+    validation:      { enable_annotations: true }
+    templating:      { engines: ['twig'] } #assets_version: SomeVersionScheme
+    session:
+        default_locale: %locale%
+        auto_start:     true
+
+# Twig Configuration
+twig:
+    debug:            %kernel.debug%
+    strict_variables: %kernel.debug%
+
+# Assetic Configuration
+assetic:
+    debug:          %kernel.debug%
+    use_controller: false
+    filters:
+        cssrewrite: ~
+        # closure:
+        #     jar: %kernel.root_dir%/java/compiler.jar
+        # yui_css:
+        #     jar: %kernel.root_dir%/java/yuicompressor-2.4.2.jar
+
+# Doctrine Configuration
+doctrine:
+    dbal:
+        driver:   %database_driver%
+        host:     %database_host%
+        port:     %database_port%
+        dbname:   %database_name%
+        user:     %database_user%
+        password: %database_password%
+        charset:  UTF8
+
+    orm:
+        auto_generate_proxy_classes: %kernel.debug%
+        auto_mapping: true
+
+# Swiftmailer Configuration
+swiftmailer:
+    transport: %mailer_transport%
+    host:      %mailer_host%
+    username:  %mailer_user%
+    password:  %mailer_password%
+
+jms_security_extra:
+    secure_controllers:  true
+    secure_all_services: false

app/config/config_dev.yml

+imports:
+    - { resource: config.yml }
+
+framework:
+    router:   { resource: "%kernel.root_dir%/config/routing_dev.yml" }
+    profiler: { only_exceptions: false }
+
+web_profiler:
+    toolbar: true
+    intercept_redirects: false
+
+monolog:
+    handlers:
+        main:
+            type:  stream
+            path:  %kernel.logs_dir%/%kernel.environment%.log
+            level: debug
+        firephp:
+            type:  firephp
+            level: info
+
+assetic:
+    use_controller: true

app/config/config_prod.yml

+imports:
+    - { resource: config.yml }
+
+#doctrine:
+#    orm:
+#        metadata_cache_driver: apc
+#        result_cache_driver: apc
+#        query_cache_driver: apc
+
+monolog:
+    handlers:
+        main:
+            type:         fingers_crossed
+            action_level: error
+            handler:      nested
+        nested:
+            type:  stream
+            path:  %kernel.logs_dir%/%kernel.environment%.log
+            level: debug

app/config/config_test.yml

+imports:
+    - { resource: config_dev.yml }
+
+framework:
+    test: ~
+    session:
+        storage_id: session.storage.filesystem
+
+web_profiler:
+    toolbar: false
+    intercept_redirects: false
+
+swiftmailer:
+    disable_delivery: true

app/config/parameters.ini

+; These parameters can be imported into other config files
+; by enclosing the key with % (like %database_user%)
+; Comments start with ';', as in php.ini
+[parameters]
+    database_driver   = pdo_mysql
+    database_host     = localhost
+    database_port     =
+    database_name     = symfony
+    database_user     = root
+    database_password =
+
+    mailer_transport  = smtp
+    mailer_host       = localhost
+    mailer_user       =
+    mailer_password   =
+
+    locale            = en
+
+    secret            = ThisTokenIsNotSoSecretChangeIt

app/config/parameters.yml

+# These parameters can be imported into other config files
+# by enclosing the key with % (like %database_user%)
+# Comments start with '#'
+parameters:
+    database_driver:   pdo_mysql
+    database_host:     localhost
+    database_port:     
+    database_name:     symfony
+    database_user:     root
+    database_password: 
+
+    mailer_transport:  smtp
+    mailer_host:       localhost
+    mailer_user:       
+    mailer_password:   
+
+    locale:            en
+
+    secret:            ThisTokenIsNotSoSecretChangeIt

app/config/routing.yml

+# Internal routing configuration to handle ESI
+#_internal:
+#   resource: "@FrameworkBundle/Resources/config/routing/internal.xml"
+#   prefix:   /_internal

app/config/routing_dev.yml

+_welcome:
+    pattern:  /
+    defaults: { _controller: AcmeDemoBundle:Welcome:index }
+
+_demo_secured:
+    resource: "@AcmeDemoBundle/Controller/SecuredController.php"
+    type:     annotation
+
+_demo:
+    resource: "@AcmeDemoBundle/Controller/DemoController.php"
+    type:     annotation
+    prefix:   /demo
+
+_assetic:
+    resource: .
+    type:     assetic
+
+_wdt:
+    resource: "@WebProfilerBundle/Resources/config/routing/wdt.xml"
+    prefix:   /_wdt
+
+_profiler:
+    resource: "@WebProfilerBundle/Resources/config/routing/profiler.xml"