2010-02-17 13:55:05 +00:00
|
|
|
<?php
|
|
|
|
|
2011-01-15 13:29:43 +00:00
|
|
|
/*
|
|
|
|
* This file is part of the Symfony package.
|
|
|
|
*
|
|
|
|
* (c) Fabien Potencier <fabien.potencier@symfony-project.com>
|
|
|
|
*
|
|
|
|
* For the full copyright and license information, please view the LICENSE
|
|
|
|
* file that was distributed with this source code.
|
|
|
|
*/
|
|
|
|
|
2010-07-09 09:05:26 +01:00
|
|
|
namespace Symfony\Bundle\FrameworkBundle\DependencyInjection;
|
2010-02-17 13:55:05 +00:00
|
|
|
|
2010-08-20 22:09:55 +01:00
|
|
|
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
|
|
|
use Symfony\Component\DependencyInjection\Definition;
|
2010-11-07 10:31:59 +00:00
|
|
|
use Symfony\Component\DependencyInjection\Parameter;
|
2011-01-24 19:50:31 +00:00
|
|
|
use Symfony\Component\DependencyInjection\Reference;
|
|
|
|
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
|
|
|
|
use Symfony\Component\DependencyInjection\Resource\FileResource;
|
2010-09-27 08:46:15 +01:00
|
|
|
use Symfony\Component\Finder\Finder;
|
2010-10-19 12:06:43 +01:00
|
|
|
use Symfony\Component\HttpFoundation\RequestMatcher;
|
2011-01-16 09:17:38 +00:00
|
|
|
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
|
2010-02-17 13:55:05 +00:00
|
|
|
|
|
|
|
/**
|
2010-09-20 20:01:41 +01:00
|
|
|
* FrameworkExtension.
|
2010-02-17 13:55:05 +00:00
|
|
|
*
|
2010-10-17 12:45:15 +01:00
|
|
|
* @author Fabien Potencier <fabien.potencier@symfony-project.com>
|
2011-01-24 19:50:31 +00:00
|
|
|
* @author Jeremy Mikola <jmikola@gmail.com>
|
2010-02-17 13:55:05 +00:00
|
|
|
*/
|
2010-09-20 20:01:41 +01:00
|
|
|
class FrameworkExtension extends Extension
|
2010-02-17 13:55:05 +00:00
|
|
|
{
|
2010-06-07 08:08:35 +01:00
|
|
|
/**
|
2011-01-24 19:50:31 +00:00
|
|
|
* Responds to the app.config configuration parameter.
|
2010-06-07 08:08:35 +01:00
|
|
|
*
|
2011-01-24 19:50:31 +00:00
|
|
|
* @param array $configs
|
|
|
|
* @param ContainerBuilder $container
|
2010-06-07 08:08:35 +01:00
|
|
|
*/
|
2011-01-24 19:50:31 +00:00
|
|
|
public function configLoad(array $configs, ContainerBuilder $container)
|
2010-02-24 14:42:04 +00:00
|
|
|
{
|
2010-07-17 16:40:38 +01:00
|
|
|
$loader = new XmlFileLoader($container, __DIR__.'/../Resources/config');
|
|
|
|
|
2011-01-24 19:50:31 +00:00
|
|
|
$loader->load('web.xml');
|
|
|
|
$loader->load('form.xml');
|
|
|
|
$loader->load('services.xml');
|
2010-10-25 15:55:20 +01:00
|
|
|
|
2011-01-24 19:50:31 +00:00
|
|
|
if ($container->getParameter('kernel.debug')) {
|
|
|
|
$loader->load('debug.xml');
|
|
|
|
$container->setDefinition('event_dispatcher', $container->findDefinition('debug.event_dispatcher'));
|
|
|
|
$container->setAlias('debug.event_dispatcher', 'event_dispatcher');
|
2011-01-18 19:18:28 +00:00
|
|
|
}
|
|
|
|
|
2011-01-24 19:50:31 +00:00
|
|
|
$config = $this->mergeConfigs($configs);
|
2010-09-15 19:49:16 +01:00
|
|
|
|
2011-01-24 19:50:31 +00:00
|
|
|
$warmer = isset($config['cache_warmer']) ? $config['cache_warmer'] : !$container->getParameter('kernel.debug');
|
|
|
|
$container->setParameter('kernel.cache_warmup', $warmer);
|
2010-09-15 19:49:16 +01:00
|
|
|
|
|
|
|
if (isset($config['charset'])) {
|
|
|
|
$container->setParameter('kernel.charset', $config['charset']);
|
|
|
|
}
|
|
|
|
|
2011-01-24 19:50:31 +00:00
|
|
|
if (isset($config['document_root'])) {
|
|
|
|
$container->setParameter('document_root', $config['document_root']);
|
2010-09-15 19:49:16 +01:00
|
|
|
}
|
|
|
|
|
2011-01-24 19:50:31 +00:00
|
|
|
if (isset($config['error_handler'])) {
|
|
|
|
if (false === $config['error_handler']) {
|
|
|
|
$container->getDefinition('error_handler')->setMethodCalls(array());
|
|
|
|
} else {
|
|
|
|
$container->getDefinition('error_handler')->addMethodCall('register', array());
|
|
|
|
$container->setParameter('error_handler.level', $config['error_handler']);
|
|
|
|
}
|
2011-01-17 16:44:23 +00:00
|
|
|
}
|
2010-09-20 20:01:41 +01:00
|
|
|
|
2011-01-24 19:50:31 +00:00
|
|
|
if (isset($config['ide'])) {
|
|
|
|
$patterns = array(
|
|
|
|
'textmate' => 'txmt://open?url=file://%%f&line=%%l',
|
|
|
|
'macvim' => 'mvim://open?url=file://%%f&line=%%l',
|
|
|
|
);
|
|
|
|
$pattern = isset($patterns[$config['ide']]) ? $patterns[$config['ide']] : $config['ide'];
|
|
|
|
$container->setParameter('debug.file_link_format', $pattern);
|
2011-01-17 15:21:46 +00:00
|
|
|
}
|
|
|
|
|
2011-01-24 19:50:31 +00:00
|
|
|
if ($config['test']) {
|
|
|
|
$loader->load('test.xml');
|
|
|
|
$config['session']['storage_id'] = 'array';
|
2011-01-24 10:16:22 +00:00
|
|
|
}
|
|
|
|
|
2011-01-24 19:50:31 +00:00
|
|
|
$this->registerCsrfProtectionConfiguration($config['csrf_protection'], $container);
|
|
|
|
$this->registerEsiConfiguration($config['esi'], $loader);
|
|
|
|
$this->registerProfilerConfiguration($config['profiler'], $container, $loader);
|
|
|
|
$this->registerRouterConfiguration($config['router'], $container, $loader);
|
|
|
|
$this->registerSessionConfiguration($config['session'], $container, $loader);
|
|
|
|
$this->registerTemplatingConfiguration($config['templating'], $container, $loader);
|
|
|
|
$this->registerTranslatorConfiguration($config['translator'], $container, $loader);
|
|
|
|
$this->registerValidationConfiguration($config['validation'], $container, $loader);
|
2011-01-24 10:16:22 +00:00
|
|
|
|
2011-01-16 09:17:38 +00:00
|
|
|
$this->addClassesToCompile(array(
|
2010-08-20 22:09:55 +01:00
|
|
|
'Symfony\\Component\\HttpFoundation\\ParameterBag',
|
|
|
|
'Symfony\\Component\\HttpFoundation\\HeaderBag',
|
|
|
|
'Symfony\\Component\\HttpFoundation\\Request',
|
|
|
|
'Symfony\\Component\\HttpFoundation\\Response',
|
2010-11-27 14:14:58 +00:00
|
|
|
'Symfony\\Component\\HttpFoundation\\ResponseHeaderBag',
|
2010-08-18 12:43:32 +01:00
|
|
|
|
2010-08-20 22:09:55 +01:00
|
|
|
'Symfony\\Component\\HttpKernel\\HttpKernel',
|
|
|
|
'Symfony\\Component\\HttpKernel\\ResponseListener',
|
|
|
|
'Symfony\\Component\\HttpKernel\\Controller\\ControllerResolver',
|
2010-11-25 08:04:24 +00:00
|
|
|
'Symfony\\Component\\HttpKernel\\Controller\\ControllerResolverInterface',
|
2010-08-10 20:44:04 +01:00
|
|
|
|
|
|
|
'Symfony\\Bundle\\FrameworkBundle\\RequestListener',
|
refactored bundle management
Before I explain the changes, let's talk about the current state.
Before this patch, the registerBundleDirs() method returned an ordered (for
resource overloading) list of namespace prefixes and the path to their
location. Here are some problems with this approach:
* The paths set by this method and the paths configured for the autoloader
can be disconnected (leading to unexpected behaviors);
* A bundle outside these paths worked, but unexpected behavior can occur;
* Choosing a bundle namespace was limited to the registered namespace
prefixes, and their number should stay low enough (for performance reasons)
-- moreover the current Bundle\ and Application\ top namespaces does not
respect the standard rules for namespaces (first segment should be the
vendor name);
* Developers must understand the concept of "namespace prefixes" to
understand the overloading mechanism, which is one more thing to learn,
which is Symfony specific;
* Each time you want to get a resource that can be overloaded (a template for
instance), Symfony would have tried all namespace prefixes one after the
other until if finds a matching file. But that can be computed in advance
to reduce the overhead.
Another topic which was not really well addressed is how you can reference a
file/resource from a bundle (and take into account the possibility of
overloading). For instance, in the routing, you can import a file from a
bundle like this:
<import resource="FrameworkBundle/Resources/config/internal.xml" />
Again, this works only because we have a limited number of possible namespace
prefixes.
This patch addresses these problems and some more.
First, the registerBundleDirs() method has been removed. It means that you are
now free to use any namespace for your bundles. No need to have specific
prefixes anymore. You are also free to store them anywhere, in as many
directories as you want. You just need to be sure that they are autoloaded
correctly.
The bundle "name" is now always the short name of the bundle class (like
FrameworkBundle or SensioCasBundle). As the best practice is to prefix the
bundle name with the vendor name, it's up to the vendor to ensure that each
bundle name is unique. I insist that a bundle name must be unique. This was
the opposite before as two bundles with the same name was how Symfony2 found
inheritance.
A new getParent() method has been added to BundleInterface. It returns the
bundle name that the bundle overrides (this is optional of course). That way,
there is no ordering problem anymore as the inheritance tree is explicitely
defined by the bundle themselves.
So, with this system, we can easily have an inheritance tree like the
following:
FooBundle < MyFooBundle < MyCustomFooBundle
MyCustomFooBundle returns MyFooBundle for the getParent() method, and
MyFooBundle returns FooBundle.
If two bundles override the same bundle, an exception is thrown.
Based on the bundle name, you can now reference any resource with this
notation:
@FooBundle/Resources/config/routing.xml
@FooBundle/Controller/FooController.php
This notation is the input of the Kernel::locateResource() method, which
returns the location of the file (and of course it takes into account
overloading).
So, in the routing, you can now use the following:
<import resource="@FrameworkBundle/Resources/config/internal.xml" />
The template loading mechanism also use this method under the hood.
As a bonus, all the code that converts from internal notations to file names
(controller names: ControllerNameParser, template names: TemplateNameParser,
resource paths, ...) is now contained in several well-defined classes. The
same goes for the code that look for templates (TemplateLocator), routing
files (FileLocator), ...
As a side note, it is really easy to also support multiple-inheritance for a
bundle (for instance if a bundle returns an array of bundle names it extends).
However, this is not implemented in this patch as I'm not sure we want to
support that.
How to upgrade:
* Each bundle must now implement two new mandatory methods: getPath() and
getNamespace(), and optionally the getParent() method if the bundle extends
another one. Here is a common implementation for these methods:
/**
* {@inheritdoc}
*/
public function getParent()
{
return 'MyFrameworkBundle';
}
/**
* {@inheritdoc}
*/
public function getNamespace()
{
return __NAMESPACE__;
}
/**
* {@inheritdoc}
*/
public function getPath()
{
return strtr(__DIR__, '\\', '/');
}
* The registerBundleDirs() can be removed from your Kernel class;
* If your code relies on getBundleDirs() or the kernel.bundle_dirs parameter,
it should be upgraded to use the new interface (see Doctrine commands for
many example of such a change);
* When referencing a bundle, you must now always use its name (no more \ or /
in bundle names) -- this transition was already done for most things
before, and now applies to the routing as well;
* Imports in routing files must be changed:
Before: <import resource="Sensio/CasBundle/Resources/config/internal.xml" />
After: <import resource="@SensioCasBundle/Resources/config/internal.xml" />
2011-01-18 09:23:49 +00:00
|
|
|
'Symfony\\Bundle\\FrameworkBundle\\Controller\\ControllerNameParser',
|
2010-08-18 12:43:32 +01:00
|
|
|
'Symfony\\Bundle\\FrameworkBundle\\Controller\\ControllerResolver',
|
2010-11-27 14:14:58 +00:00
|
|
|
'Symfony\\Bundle\\FrameworkBundle\\Controller\\Controller',
|
2010-08-18 12:43:32 +01:00
|
|
|
|
2011-01-25 13:23:23 +00:00
|
|
|
'Symfony\\Component\\EventDispatcher\\EventInterface',
|
2010-08-20 22:09:55 +01:00
|
|
|
'Symfony\\Component\\EventDispatcher\\Event',
|
2011-01-25 13:23:23 +00:00
|
|
|
'Symfony\\Component\\EventDispatcher\\EventDispatcherInterface',
|
2010-11-25 08:04:24 +00:00
|
|
|
'Symfony\\Component\\EventDispatcher\\EventDispatcher',
|
|
|
|
'Symfony\\Bundle\\FrameworkBundle\\EventDispatcher',
|
2010-08-18 12:43:32 +01:00
|
|
|
));
|
2010-02-17 13:55:05 +00:00
|
|
|
}
|
|
|
|
|
2010-05-06 12:25:53 +01:00
|
|
|
/**
|
2011-01-24 19:50:31 +00:00
|
|
|
* Merges a set of configuration arrays and returns the result.
|
2010-05-06 12:25:53 +01:00
|
|
|
*
|
2011-01-24 19:50:31 +00:00
|
|
|
* This method internally specifies the available options and their
|
|
|
|
* default values. Given an array of configuration arrays, this method
|
|
|
|
* intelligently merges those configuration values and returns the final,
|
|
|
|
* flattened product.
|
|
|
|
*
|
|
|
|
* @param array $configs An array of configuration arrays to merge
|
|
|
|
* @return array The merged configuration array
|
2010-05-06 12:25:53 +01:00
|
|
|
*/
|
2011-01-24 19:50:31 +00:00
|
|
|
protected function mergeConfigs(array $configs)
|
2010-02-17 13:55:05 +00:00
|
|
|
{
|
2011-01-24 19:50:31 +00:00
|
|
|
$defaultOptions = array(
|
|
|
|
'cache_warmer' => null,
|
|
|
|
'charset' => null,
|
|
|
|
'csrf_protection' => array(
|
|
|
|
'enabled' => null,
|
|
|
|
'field_name' => null,
|
|
|
|
'secret' => null,
|
|
|
|
),
|
|
|
|
'document_root' => null,
|
|
|
|
'error_handler' => null,
|
|
|
|
// TODO: consolidate into a scalar unless future options are planned
|
|
|
|
'esi' => array(
|
|
|
|
'enabled' => null,
|
|
|
|
),
|
|
|
|
'ide' => null,
|
|
|
|
'profiler' => array(
|
|
|
|
'enabled' => true,
|
|
|
|
'only_exceptions' => null,
|
|
|
|
'matcher' => array(
|
|
|
|
'ip' => null,
|
|
|
|
'path' => null,
|
|
|
|
'service' => null,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
'router' => array(
|
|
|
|
'cache_warmer' => null,
|
|
|
|
'resource' => null,
|
|
|
|
),
|
|
|
|
'session' => array(
|
|
|
|
'auto_start' => null,
|
|
|
|
'class' => null,
|
|
|
|
'default_locale' => null,
|
|
|
|
'storage_id' => 'native',
|
|
|
|
// NativeSessionStorage options
|
|
|
|
'name' => null,
|
|
|
|
'lifetime' => null,
|
|
|
|
'path' => null,
|
|
|
|
'domain' => null,
|
|
|
|
'secure' => null,
|
|
|
|
'httponly' => null,
|
|
|
|
// PdoSessionStorage options
|
|
|
|
'pdo.db_table' => null,
|
|
|
|
'pdo.db_id_col' => null,
|
|
|
|
'pdo.db_data_col' => null,
|
|
|
|
'pdo.db_time_col' => null,
|
|
|
|
),
|
|
|
|
'templating' => array(
|
|
|
|
'assets_version' => null,
|
|
|
|
'assets_base_urls' => null,
|
|
|
|
'cache' => null,
|
|
|
|
'cache_warmer' => null,
|
|
|
|
'engines' => array(),
|
|
|
|
'loaders' => array(),
|
|
|
|
),
|
|
|
|
'test' => null,
|
|
|
|
'translator' => array(
|
|
|
|
'enabled' => null,
|
|
|
|
'fallback' => null,
|
|
|
|
),
|
|
|
|
'validation' => array(
|
|
|
|
'enabled' => null,
|
|
|
|
'annotations' => null,
|
|
|
|
'namespaces' => array(),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
|
|
|
|
$mergedConfig = $defaultOptions;
|
2010-09-20 20:01:41 +01:00
|
|
|
|
2011-01-24 19:50:31 +00:00
|
|
|
foreach ($configs as $config) {
|
|
|
|
$config = $this->normalizeKeys($config);
|
2010-08-10 14:38:01 +01:00
|
|
|
|
2011-01-24 19:50:31 +00:00
|
|
|
if (isset($config['templating']) && is_array($config['templating'])) {
|
|
|
|
$config['templating']['engines'] = $this->normalizeConfig($config['templating'], 'engine');
|
|
|
|
$config['templating']['loaders'] = $this->normalizeConfig($config['templating'], 'loader');
|
|
|
|
unset($config['templating']['engine'], $config['templating']['loader']);
|
2010-08-10 14:38:01 +01:00
|
|
|
}
|
2010-05-06 12:25:53 +01:00
|
|
|
|
2011-01-24 19:50:31 +00:00
|
|
|
if (isset($config['validation']) && is_array($config['validation'])) {
|
|
|
|
$config['validation']['namespaces'] = $this->normalizeConfig($config['validation'], 'namespace');
|
|
|
|
unset($config['validation']['namespace']);
|
2010-05-06 12:25:53 +01:00
|
|
|
}
|
|
|
|
|
2011-01-24 19:50:31 +00:00
|
|
|
$mergedConfig = $this->mergeOptions($mergedConfig, $config, $defaultOptions);
|
2011-01-24 10:27:07 +00:00
|
|
|
}
|
|
|
|
|
2011-01-24 19:50:31 +00:00
|
|
|
return $mergedConfig;
|
|
|
|
}
|
2011-01-24 10:27:07 +00:00
|
|
|
|
2011-01-24 19:50:31 +00:00
|
|
|
/**
|
|
|
|
* Merges a single level of configuration options.
|
|
|
|
*
|
|
|
|
* @param array $current The value of the options before merging
|
|
|
|
* @param array $new The new values to be merged
|
|
|
|
* @param array $default The corresponding default values for the option level
|
|
|
|
* @param string $basePath Base property path for the option level
|
|
|
|
* @return array The merged options
|
|
|
|
* @throws InvalidArgumentException When an unsupported is found
|
|
|
|
*/
|
|
|
|
protected function mergeOptions(array $current, array $new, array $default, $basePath = null)
|
|
|
|
{
|
|
|
|
if ($unsupportedOptions = array_diff_key($new, $default)) {
|
|
|
|
throw new \InvalidArgumentException('The following options are not supported: '.implode(', ', array_keys($unsupportedOptions)));
|
2011-01-23 14:41:31 +00:00
|
|
|
}
|
|
|
|
|
2011-01-24 19:50:31 +00:00
|
|
|
foreach ($default as $key => $defaultValue) {
|
|
|
|
if (array_key_exists($key, $new)) {
|
|
|
|
$optionPath = $basePath ? $basePath.'.'.$key : $key;
|
|
|
|
$current[$key] = $this->mergeOptionValue($current[$key], $new[$key], $defaultValue, $optionPath);
|
2011-01-30 13:37:22 +00:00
|
|
|
}
|
2011-01-23 14:41:31 +00:00
|
|
|
}
|
|
|
|
|
2011-01-24 19:50:31 +00:00
|
|
|
return $current;
|
|
|
|
}
|
2011-01-23 14:41:31 +00:00
|
|
|
|
2011-01-24 19:50:31 +00:00
|
|
|
/**
|
|
|
|
* Merges an option value.
|
|
|
|
*
|
|
|
|
* @param mixed $current The value of the option before merging
|
|
|
|
* @param mixed $new The new value to be merged
|
|
|
|
* @param mixed $default The corresponding default value for the option
|
|
|
|
* @param string $optionPath Property path for the option
|
|
|
|
* @return mixed The merged value
|
|
|
|
* @throws InvalidArgumentException When an invalid option is found
|
|
|
|
*/
|
|
|
|
protected function mergeOptionValue($current, $new, $defaultValue, $optionPath)
|
|
|
|
{
|
|
|
|
// Allow profiler.matcher array to be overridden with any value. This
|
|
|
|
// option requires no merge logic and would not benefit from the type
|
|
|
|
// validation below.
|
|
|
|
if ('profiler.matcher' === $optionPath) {
|
|
|
|
return $new;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Ensure that the new value's type is an array if expected
|
|
|
|
if (is_array($defaultValue) && !is_array($new)) {
|
|
|
|
throw new \InvalidArgumentException(sprintf('Expected array type for option "%s", %s given', $optionPath, gettype($new)));
|
|
|
|
}
|
|
|
|
|
|
|
|
switch ($optionPath) {
|
|
|
|
// Engine options are arrays of strings, although XML configurations
|
|
|
|
// store the engine ID in an attribute. Dedupe after merging.
|
|
|
|
case 'templating.engines':
|
|
|
|
$new = array_map(function($engine) { return is_array($engine) ? $engine['id'] : $engine; }, $new);
|
|
|
|
return array_unique(array_merge($current, $new));
|
|
|
|
|
|
|
|
// Loader options are arrays of strings, so dedupe after merging
|
|
|
|
case 'templating.loaders':
|
|
|
|
return array_unique(array_merge($current, $new));
|
|
|
|
|
|
|
|
// The namespace options' keys are used for the annotation prefix
|
|
|
|
// and are significant, so do not dedupe array values. Be mindful
|
|
|
|
// of XML configurations, which store the prefix in an attribute.
|
|
|
|
case 'validation.namespaces':
|
|
|
|
foreach ($new as $prefix => $namespace) {
|
|
|
|
if (is_array($namespace)) {
|
|
|
|
$new[$namespace['prefix']] = $namespace['namespace'];
|
|
|
|
unset($new[$prefix]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return array_merge($current, $new);
|
2011-01-23 14:41:31 +00:00
|
|
|
}
|
2011-01-24 19:50:31 +00:00
|
|
|
|
|
|
|
return is_array($defaultValue) ? $this->mergeOptions($current, $new, $defaultValue, $optionPath) : $new;
|
2010-08-18 12:43:32 +01:00
|
|
|
}
|
|
|
|
|
2010-09-15 19:49:16 +01:00
|
|
|
/**
|
2011-01-24 19:50:31 +00:00
|
|
|
* Loads the CSRF protection configuration.
|
2010-09-15 19:49:16 +01:00
|
|
|
*
|
2011-01-24 19:50:31 +00:00
|
|
|
* @param array $config A CSRF protection configuration array
|
2010-09-15 19:49:16 +01:00
|
|
|
* @param ContainerBuilder $container A ContainerBuilder instance
|
|
|
|
*/
|
2011-01-24 19:50:31 +00:00
|
|
|
protected function registerCsrfProtectionConfiguration(array $config, ContainerBuilder $container)
|
2010-09-15 19:49:16 +01:00
|
|
|
{
|
2011-01-24 19:50:31 +00:00
|
|
|
foreach (array('enabled', 'field_name', 'secret') as $key) {
|
|
|
|
if (isset($config[$key])) {
|
|
|
|
$container->setParameter('form.csrf_protection.'.$key, $config[$key]);
|
|
|
|
}
|
|
|
|
}
|
2010-09-15 19:49:16 +01:00
|
|
|
}
|
|
|
|
|
2011-01-17 15:21:46 +00:00
|
|
|
/**
|
|
|
|
* Loads the ESI configuration.
|
|
|
|
*
|
2011-01-24 19:50:31 +00:00
|
|
|
* @param array $config An ESI configuration array
|
|
|
|
* @param XmlFileLoader $loader An XmlFileLoader instance
|
2011-01-17 15:21:46 +00:00
|
|
|
*/
|
2011-01-24 19:50:31 +00:00
|
|
|
protected function registerEsiConfiguration(array $config, XmlFileLoader $loader)
|
2011-01-17 15:21:46 +00:00
|
|
|
{
|
2011-01-24 19:50:31 +00:00
|
|
|
if ($config['enabled']) {
|
|
|
|
$loader->load('esi.xml');
|
2011-01-17 15:21:46 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-09-27 08:46:15 +01:00
|
|
|
/**
|
2011-01-24 19:50:31 +00:00
|
|
|
* Loads the profiler configuration.
|
2010-09-27 08:46:15 +01:00
|
|
|
*
|
2011-01-24 19:50:31 +00:00
|
|
|
* @param array $config A profiler configuration array
|
2010-09-27 08:46:15 +01:00
|
|
|
* @param ContainerBuilder $container A ContainerBuilder instance
|
2011-01-24 19:50:31 +00:00
|
|
|
* @param XmlFileLoader $loader An XmlFileLoader instance
|
2010-09-27 08:46:15 +01:00
|
|
|
*/
|
2011-01-24 19:50:31 +00:00
|
|
|
protected function registerProfilerConfiguration(array $config, ContainerBuilder $container, XmlFileLoader $loader)
|
2010-09-27 08:46:15 +01:00
|
|
|
{
|
2011-01-24 19:50:31 +00:00
|
|
|
if ($config['enabled']) {
|
|
|
|
$loader->load('profiling.xml');
|
|
|
|
$loader->load('collectors.xml');
|
2010-09-27 15:53:23 +01:00
|
|
|
|
2011-01-24 19:50:31 +00:00
|
|
|
if (isset($config['only_exceptions'])) {
|
|
|
|
$container->setParameter('profiler_listener.only_exceptions', $config['only_exceptions']);
|
|
|
|
}
|
2010-09-27 08:46:15 +01:00
|
|
|
|
2011-01-24 19:50:31 +00:00
|
|
|
if ($config['matcher']) {
|
|
|
|
if (isset($config['matcher']['service'])) {
|
|
|
|
$container->setAlias('profiler.request_matcher', $config['matcher']['service']);
|
|
|
|
} elseif (isset($config['matcher']['ip']) || isset($config['matcher']['path'])) {
|
|
|
|
$definition = $container->register('profiler.request_matcher', 'Symfony\\Component\\HttpFoundation\\RequestMatcher');
|
|
|
|
$definition->setPublic(false);
|
2010-09-27 15:53:23 +01:00
|
|
|
|
2011-01-24 19:50:31 +00:00
|
|
|
if (isset($config['matcher']['ip'])) {
|
|
|
|
$definition->addMethodCall('matchIp', array($config['matcher']['ip']));
|
2010-09-27 15:53:23 +01:00
|
|
|
}
|
2010-09-27 08:46:15 +01:00
|
|
|
|
2011-01-24 19:50:31 +00:00
|
|
|
if (isset($config['matcher']['path'])) {
|
|
|
|
$definition->addMethodCall('matchPath', array($config['matcher']['path']));
|
2010-09-27 15:53:23 +01:00
|
|
|
}
|
2010-09-27 08:46:15 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-09-15 19:49:16 +01:00
|
|
|
/**
|
2011-01-24 19:50:31 +00:00
|
|
|
* Loads the router configuration.
|
2010-09-15 19:49:16 +01:00
|
|
|
*
|
2011-01-24 19:50:31 +00:00
|
|
|
* @param array $config A router configuration array
|
2010-09-15 19:49:16 +01:00
|
|
|
* @param ContainerBuilder $container A ContainerBuilder instance
|
2011-01-24 19:50:31 +00:00
|
|
|
* @param XmlFileLoader $loader An XmlFileLoader instance
|
2010-09-15 19:49:16 +01:00
|
|
|
*/
|
2011-01-24 19:50:31 +00:00
|
|
|
protected function registerRouterConfiguration(array $config, ContainerBuilder $container, XmlFileLoader $loader)
|
2010-09-15 19:49:16 +01:00
|
|
|
{
|
2011-01-24 19:50:31 +00:00
|
|
|
$loader->load('routing.xml');
|
|
|
|
|
|
|
|
if (!isset($config['resource'])) {
|
|
|
|
throw new \InvalidArgumentException('Router configuration requires a resource option.');
|
2010-09-15 19:49:16 +01:00
|
|
|
}
|
|
|
|
|
2011-01-24 19:50:31 +00:00
|
|
|
$container->setParameter('routing.resource', $config['resource']);
|
2010-11-12 18:35:21 +00:00
|
|
|
|
2011-01-24 19:50:31 +00:00
|
|
|
if ($config['cache_warmer']) {
|
|
|
|
$container->getDefinition('router.cache_warmer')->addTag('kernel.cache_warmer');
|
|
|
|
$container->setAlias('router', 'router.cached');
|
2010-09-15 19:49:16 +01:00
|
|
|
}
|
|
|
|
|
2011-01-24 19:50:31 +00:00
|
|
|
$this->addClassesToCompile(array(
|
|
|
|
'Symfony\\Component\\Routing\\RouterInterface',
|
|
|
|
'Symfony\\Component\\Routing\\Matcher\\UrlMatcherInterface',
|
|
|
|
'Symfony\\Component\\Routing\\Matcher\\UrlMatcher',
|
|
|
|
'Symfony\\Component\\Routing\\Generator\\UrlGeneratorInterface',
|
|
|
|
'Symfony\\Component\\Routing\\Generator\\UrlGenerator',
|
|
|
|
$container->findDefinition('router')->getClass()
|
|
|
|
));
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Loads the session configuration.
|
|
|
|
*
|
|
|
|
* @param array $config A session configuration array
|
|
|
|
* @param ContainerBuilder $container A ContainerBuilder instance
|
|
|
|
* @param XmlFileLoader $loader An XmlFileLoader instance
|
|
|
|
*/
|
|
|
|
protected function registerSessionConfiguration(array $config, ContainerBuilder $container, XmlFileLoader $loader)
|
|
|
|
{
|
|
|
|
$loader->load('session.xml');
|
2011-01-23 07:36:19 +00:00
|
|
|
|
2011-01-24 19:50:31 +00:00
|
|
|
if ($config['auto_start']) {
|
2010-11-25 18:07:25 +00:00
|
|
|
$container->getDefinition('session')->addMethodCall('start');
|
|
|
|
}
|
|
|
|
|
2010-09-15 19:49:16 +01:00
|
|
|
if (isset($config['class'])) {
|
|
|
|
$container->setParameter('session.class', $config['class']);
|
|
|
|
}
|
|
|
|
|
2011-01-24 19:50:31 +00:00
|
|
|
if (isset($config['default_locale'])) {
|
|
|
|
$container->setParameter('session.default_locale', $config['default_locale']);
|
2010-09-15 19:49:16 +01:00
|
|
|
}
|
|
|
|
|
2011-01-24 19:50:31 +00:00
|
|
|
$container->setAlias('session.storage', 'session.storage.'.$config['storage_id']);
|
2010-12-14 14:51:10 +00:00
|
|
|
|
2011-01-24 19:50:31 +00:00
|
|
|
$options = $container->getParameter('session.storage.'.$config['storage_id'].'.options');
|
|
|
|
foreach (array('name', 'lifetime', 'path', 'domain', 'secure', 'httponly', 'pdo.db_table', 'pdo.db_id_col', 'pdo.db_data_col', 'pdo.db_time_col') as $key) {
|
|
|
|
if (isset($config[$key])) {
|
|
|
|
$options[str_replace('pdo.', '', $key)] = $config[$key];
|
2010-12-14 14:51:10 +00:00
|
|
|
}
|
2010-09-15 19:49:16 +01:00
|
|
|
}
|
2011-01-24 19:50:31 +00:00
|
|
|
$container->setParameter('session.storage.'.$config['storage_id'].'.options', $options);
|
2010-11-25 08:04:24 +00:00
|
|
|
|
2011-01-16 09:17:38 +00:00
|
|
|
$this->addClassesToCompile(array(
|
2010-11-25 08:04:24 +00:00
|
|
|
'Symfony\\Component\\HttpFoundation\\Session',
|
|
|
|
'Symfony\\Component\\HttpFoundation\\SessionStorage\\SessionStorageInterface',
|
2011-01-17 15:34:43 +00:00
|
|
|
$container->getParameter('session.class'),
|
2010-11-25 08:04:24 +00:00
|
|
|
));
|
2010-09-15 19:49:16 +01:00
|
|
|
}
|
|
|
|
|
2011-01-11 15:58:07 +00:00
|
|
|
/**
|
2011-01-24 19:50:31 +00:00
|
|
|
* Loads the templating configuration.
|
2011-01-11 15:58:07 +00:00
|
|
|
*
|
2011-01-24 19:50:31 +00:00
|
|
|
* @param array $config A templating configuration array
|
2011-01-11 15:58:07 +00:00
|
|
|
* @param ContainerBuilder $container A ContainerBuilder instance
|
2011-01-24 19:50:31 +00:00
|
|
|
* @param XmlFileLoader $loader An XmlFileLoader instance
|
2011-01-11 15:58:07 +00:00
|
|
|
*/
|
2011-01-24 19:50:31 +00:00
|
|
|
protected function registerTemplatingConfiguration(array $config, ContainerBuilder $container, XmlFileLoader $loader)
|
2010-09-20 20:01:41 +01:00
|
|
|
{
|
2011-01-24 19:50:31 +00:00
|
|
|
$loader->load('templating.xml');
|
|
|
|
$loader->load('templating_php.xml');
|
|
|
|
|
|
|
|
if ($container->getParameter('kernel.debug')) {
|
|
|
|
$loader->load('templating_debug.xml');
|
2010-09-20 20:01:41 +01:00
|
|
|
}
|
|
|
|
|
2011-01-24 19:50:31 +00:00
|
|
|
if (isset($config['assets_version'])) {
|
|
|
|
$container->setParameter('templating.assets.version', $config['assets_version']);
|
|
|
|
}
|
2010-09-20 20:01:41 +01:00
|
|
|
|
2011-01-24 19:50:31 +00:00
|
|
|
if (isset($config['assets_base_urls'])) {
|
|
|
|
$container->setParameter('templating.assets.base_urls', $config['assets_base_urls']);
|
2011-01-24 13:05:37 +00:00
|
|
|
}
|
|
|
|
|
2011-01-24 19:50:31 +00:00
|
|
|
if ($config['loaders']) {
|
|
|
|
$loaders = array_map(function($loader) { return new Reference($loader); }, $config['loaders']);
|
|
|
|
|
|
|
|
// Use a deligation unless only a single loader was registered
|
|
|
|
if (1 === count($loaders)) {
|
|
|
|
$container->setAlias('templating.loader', (string) reset($loaders));
|
|
|
|
} else {
|
|
|
|
$container->getDefinition('templating.loader.chain')->addArgument($loaders);
|
|
|
|
$container->setAlias('templating.loader', 'templating.loader.chain');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($config['cache']) {
|
|
|
|
// Wrap the existing loader with cache (must happen after loaders are registered)
|
|
|
|
$container->setDefinition('templating.loader.wrapped', $container->findDefinition('templating.loader'));
|
|
|
|
$container->setDefinition('templating.loader', $container->getDefinition('templating.loader.cache'));
|
|
|
|
$container->setParameter('templating.loader.cache.path', $config['cache']);
|
|
|
|
} else {
|
|
|
|
$container->setParameter('templating.loader.cache.path', null);
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($config['cache_warmer']) {
|
|
|
|
$container->getDefinition('templating.cache_warmer.template_paths')->addTag('kernel.cache_warmer');
|
|
|
|
$container->setAlias('templating.locator', 'templating.locator.cached');
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!$config['engines']) {
|
|
|
|
throw new \LogicException('You must register at least one templating engine.');
|
2011-01-24 13:05:37 +00:00
|
|
|
}
|
|
|
|
|
2011-01-16 09:17:38 +00:00
|
|
|
$this->addClassesToCompile(array(
|
2011-01-24 19:50:31 +00:00
|
|
|
'Symfony\\Bundle\\FrameworkBundle\\Templating\\EngineInterface',
|
|
|
|
'Symfony\\Component\\Templating\\EngineInterface',
|
|
|
|
'Symfony\\Bundle\\FrameworkBundle\\Templating\\Loader\\TemplateLocatorInterface',
|
|
|
|
$container->findDefinition('templating.locator')->getClass(),
|
2010-09-20 20:01:41 +01:00
|
|
|
));
|
2011-01-24 19:50:31 +00:00
|
|
|
|
|
|
|
if (in_array('php', $config['engines'], true)) {
|
|
|
|
$this->addClassesToCompile(array(
|
|
|
|
'Symfony\\Component\\Templating\\PhpEngine',
|
|
|
|
'Symfony\\Component\\Templating\\TemplateNameParserInterface',
|
|
|
|
'Symfony\\Component\\Templating\\TemplateNameParser',
|
|
|
|
'Symfony\\Component\\Templating\\Loader\\LoaderInterface',
|
|
|
|
'Symfony\\Component\\Templating\\Storage\\Storage',
|
|
|
|
'Symfony\\Component\\Templating\\Storage\\FileStorage',
|
|
|
|
'Symfony\\Bundle\\FrameworkBundle\\Templating\\PhpEngine',
|
|
|
|
'Symfony\\Bundle\\FrameworkBundle\\Templating\\TemplateNameParser',
|
|
|
|
'Symfony\\Bundle\\FrameworkBundle\\Templating\\Loader\\FilesystemLoader',
|
|
|
|
));
|
|
|
|
}
|
|
|
|
|
|
|
|
$engines = array_map(function($engine) { return new Reference('templating.engine.'.$engine); }, $config['engines']);
|
|
|
|
|
|
|
|
// Use a deligation unless only a single engine was registered
|
|
|
|
if (1 === count($engines)) {
|
|
|
|
$container->setAlias('templating', (string) reset($engines));
|
|
|
|
} else {
|
|
|
|
$container->getDefinition('templating.engine.delegating')->setArgument(1, $engines);
|
|
|
|
$container->setAlias('templating', 'templating.engine.delegating');
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-09-20 20:01:41 +01:00
|
|
|
}
|
|
|
|
|
2011-01-11 15:58:07 +00:00
|
|
|
/**
|
2011-01-24 19:50:31 +00:00
|
|
|
* Loads the translator configuration.
|
2011-01-11 15:58:07 +00:00
|
|
|
*
|
2011-01-24 19:50:31 +00:00
|
|
|
* A translator must always be registered (as support is included by default
|
|
|
|
* in the forms component). If disabled, an identity translator will be
|
|
|
|
* used and everything will still work as expected.
|
2011-01-11 15:58:07 +00:00
|
|
|
*
|
2011-01-24 19:50:31 +00:00
|
|
|
* @param array $config A translator configuration array
|
2011-01-11 15:58:07 +00:00
|
|
|
* @param ContainerBuilder $container A ContainerBuilder instance
|
2011-01-24 19:50:31 +00:00
|
|
|
* @param XmlFileLoader $loader An XmlFileLoader instance
|
2011-01-11 15:58:07 +00:00
|
|
|
*/
|
2011-01-24 19:50:31 +00:00
|
|
|
protected function registerTranslatorConfiguration(array $config, ContainerBuilder $container, XmlFileLoader $loader)
|
2010-09-02 12:54:32 +01:00
|
|
|
{
|
2011-01-24 19:50:31 +00:00
|
|
|
$loader->load('translation.xml');
|
2010-09-02 12:54:32 +01:00
|
|
|
|
2011-01-24 19:50:31 +00:00
|
|
|
if ($config['enabled']) {
|
|
|
|
// Use the "real" translator instead of the identity default
|
|
|
|
$container->setDefinition('translator', $container->findDefinition('translator.real'));
|
2010-09-02 12:54:32 +01:00
|
|
|
|
2011-01-24 19:50:31 +00:00
|
|
|
// Discover translation directories
|
|
|
|
$dirs = array();
|
|
|
|
foreach ($container->getParameter('kernel.bundles') as $bundle) {
|
|
|
|
$reflection = new \ReflectionClass($bundle);
|
|
|
|
if (is_dir($dir = dirname($reflection->getFilename()).'/Resources/translations')) {
|
|
|
|
$dirs[] = $dir;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (is_dir($dir = $container->getParameter('kernel.root_dir').'/translations')) {
|
|
|
|
$dirs[] = $dir;
|
|
|
|
}
|
2010-09-02 12:54:32 +01:00
|
|
|
|
2011-01-24 19:50:31 +00:00
|
|
|
// Register translation resources
|
|
|
|
$resources = array();
|
|
|
|
if ($dirs) {
|
|
|
|
$finder = new Finder();
|
|
|
|
$finder->files()->filter(function (\SplFileInfo $file) { return 2 === substr_count($file->getBasename(), '.'); })->in($dirs);
|
|
|
|
foreach ($finder as $file) {
|
|
|
|
// filename is domain.locale.format
|
|
|
|
list($domain, $locale, $format) = explode('.', $file->getBasename());
|
2010-09-02 12:54:32 +01:00
|
|
|
|
2011-01-24 19:50:31 +00:00
|
|
|
$resources[] = array($format, (string) $file, $locale, $domain);
|
2010-09-02 12:54:32 +01:00
|
|
|
}
|
|
|
|
}
|
2011-01-24 19:50:31 +00:00
|
|
|
$container->setParameter('translation.resources', $resources);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (isset($config['fallback'])) {
|
|
|
|
$container->setParameter('translator.fallback_locale', $config['fallback']);
|
2010-09-02 12:54:32 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-01-11 15:58:07 +00:00
|
|
|
/**
|
|
|
|
* Loads the validator configuration.
|
|
|
|
*
|
2011-01-24 19:50:31 +00:00
|
|
|
* @param array $config A validation configuration array
|
2011-01-11 15:58:07 +00:00
|
|
|
* @param ContainerBuilder $container A ContainerBuilder instance
|
2011-01-24 19:50:31 +00:00
|
|
|
* @param XmlFileLoader $loader An XmlFileLoader instance
|
2011-01-11 15:58:07 +00:00
|
|
|
*/
|
2011-01-24 19:50:31 +00:00
|
|
|
protected function registerValidationConfiguration(array $config, ContainerBuilder $container, XmlFileLoader $loader)
|
2010-08-18 13:44:35 +01:00
|
|
|
{
|
2011-01-24 19:50:31 +00:00
|
|
|
if ($config['enabled']) {
|
|
|
|
$loader->load('validator.xml');
|
2010-08-18 13:44:35 +01:00
|
|
|
|
|
|
|
$xmlMappingFiles = array();
|
|
|
|
$yamlMappingFiles = array();
|
|
|
|
|
2011-01-24 19:50:31 +00:00
|
|
|
// Include default entries from the framework
|
2010-08-20 22:09:55 +01:00
|
|
|
$xmlMappingFiles[] = __DIR__.'/../../../Component/Form/Resources/config/validation.xml';
|
2010-08-18 13:44:35 +01:00
|
|
|
|
2011-01-10 21:16:24 +00:00
|
|
|
foreach ($container->getParameter('kernel.bundles') as $bundle) {
|
|
|
|
$reflection = new \ReflectionClass($bundle);
|
|
|
|
if (file_exists($file = dirname($reflection->getFilename()).'/Resources/config/validation.xml')) {
|
|
|
|
$xmlMappingFiles[] = realpath($file);
|
|
|
|
}
|
|
|
|
if (file_exists($file = dirname($reflection->getFilename()).'/Resources/config/validation.yml')) {
|
|
|
|
$yamlMappingFiles[] = realpath($file);
|
2010-08-18 13:44:35 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-01-24 19:50:31 +00:00
|
|
|
$xmlFilesLoader = new Definition('%validator.mapping.loader.xml_files_loader.class%', array($xmlMappingFiles));
|
2011-01-05 11:38:41 +00:00
|
|
|
$xmlFilesLoader->setPublic(false);
|
2010-08-18 13:44:35 +01:00
|
|
|
|
2011-01-24 19:50:31 +00:00
|
|
|
$yamlFilesLoader = new Definition('%validator.mapping.loader.yaml_files_loader.class%', array($yamlMappingFiles));
|
2011-01-05 11:38:41 +00:00
|
|
|
$yamlFilesLoader->setPublic(false);
|
2010-08-18 13:44:35 +01:00
|
|
|
|
|
|
|
$container->setDefinition('validator.mapping.loader.xml_files_loader', $xmlFilesLoader);
|
|
|
|
$container->setDefinition('validator.mapping.loader.yaml_files_loader', $yamlFilesLoader);
|
|
|
|
|
|
|
|
foreach ($xmlMappingFiles as $file) {
|
|
|
|
$container->addResource(new FileResource($file));
|
|
|
|
}
|
|
|
|
|
|
|
|
foreach ($yamlMappingFiles as $file) {
|
|
|
|
$container->addResource(new FileResource($file));
|
|
|
|
}
|
|
|
|
|
2011-01-24 19:50:31 +00:00
|
|
|
if ($config['annotations']) {
|
|
|
|
// Register prefixes for constraint namespaces
|
|
|
|
if ($namespaces = $config['namespaces']) {
|
2010-11-07 10:31:59 +00:00
|
|
|
$container->setParameter('validator.annotations.namespaces', array_merge(
|
|
|
|
$container->getParameter('validator.annotations.namespaces'),
|
2011-01-24 19:50:31 +00:00
|
|
|
$namespaces
|
2010-11-07 10:31:59 +00:00
|
|
|
));
|
|
|
|
}
|
|
|
|
|
2011-01-24 19:50:31 +00:00
|
|
|
// Register annotation loader
|
|
|
|
$annotationLoader = new Definition('%validator.mapping.loader.annotation_loader.class%');
|
2011-01-05 11:38:41 +00:00
|
|
|
$annotationLoader->setPublic(false);
|
2010-11-07 10:31:59 +00:00
|
|
|
$annotationLoader->addArgument(new Parameter('validator.annotations.namespaces'));
|
2011-01-05 11:38:41 +00:00
|
|
|
|
2010-08-18 13:44:35 +01:00
|
|
|
$container->setDefinition('validator.mapping.loader.annotation_loader', $annotationLoader);
|
|
|
|
|
2011-01-24 19:50:31 +00:00
|
|
|
$loaderChain = $container->getDefinition('validator.mapping.loader.loader_chain');
|
|
|
|
$arguments = $loaderChain->getArguments();
|
2010-08-18 13:44:35 +01:00
|
|
|
array_unshift($arguments[0], new Reference('validator.mapping.loader.annotation_loader'));
|
2011-01-24 19:50:31 +00:00
|
|
|
$loaderChain->setArguments($arguments);
|
2010-08-18 13:44:35 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-05-06 12:25:53 +01:00
|
|
|
/**
|
|
|
|
* Returns the base path for the XSD files.
|
|
|
|
*
|
|
|
|
* @return string The XSD base path
|
|
|
|
*/
|
|
|
|
public function getXsdValidationBasePath()
|
2010-02-17 13:55:05 +00:00
|
|
|
{
|
2010-06-27 17:54:03 +01:00
|
|
|
return __DIR__.'/../Resources/config/schema';
|
2010-02-17 13:55:05 +00:00
|
|
|
}
|
|
|
|
|
2010-05-06 12:25:53 +01:00
|
|
|
public function getNamespace()
|
2010-02-17 13:55:05 +00:00
|
|
|
{
|
2010-05-06 12:25:53 +01:00
|
|
|
return 'http://www.symfony-project.org/schema/dic/symfony';
|
2010-02-17 13:55:05 +00:00
|
|
|
}
|
|
|
|
|
2010-05-06 12:25:53 +01:00
|
|
|
public function getAlias()
|
2010-02-17 13:55:05 +00:00
|
|
|
{
|
2010-09-20 20:01:41 +01:00
|
|
|
return 'app';
|
2010-02-17 13:55:05 +00:00
|
|
|
}
|
|
|
|
}
|