Skip to content
This repository has been archived by the owner on Feb 24, 2023. It is now read-only.

Added classes to cache #197

Closed
wants to merge 3 commits into from
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
40 changes: 34 additions & 6 deletions DependencyInjection/SensioFrameworkExtraExtension.php
Expand Up @@ -35,28 +35,56 @@ public function load(array $configs, ContainerBuilder $container)

if ($config['router']['annotations']) {
$annotationsToLoad[] = 'routing.xml';

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extra blank line


$this->addClassesToCompile(array(
'Sensio\\Bundle\\FrameworkExtraBundle\\EventListener\\ControllerListener',
));
}

if ($config['request']['converters']) {
$annotationsToLoad[] = 'converters.xml';

$this->addClassesToCompile(array(
'Sensio\\Bundle\\FrameworkExtraBundle\\Configuration\\ParamConverter',
'Sensio\\Bundle\\FrameworkExtraBundle\\EventListener\\ParamConverterListener',
'Sensio\\Bundle\\FrameworkExtraBundle\\Request\\ParamConverter\\DateTimeParamConverter',
'Sensio\\Bundle\\FrameworkExtraBundle\\Request\\ParamConverter\\DoctrineParamConverter',
'Sensio\\Bundle\\FrameworkExtraBundle\\Request\\ParamConverter\\ParamConverterInterface',
'Sensio\\Bundle\\FrameworkExtraBundle\\Request\\ParamConverter\\ParamConverterManager',
));
}

if ($config['view']['annotations']) {
$annotationsToLoad[] = 'view.xml';

$this->addClassesToCompile(array(
'Sensio\\Bundle\\FrameworkExtraBundle\\EventListener\\TemplateListener',
));
}

if ($config['cache']['annotations']) {
$annotationsToLoad[] = 'cache.xml';

$this->addClassesToCompile(array(
'Sensio\\Bundle\\FrameworkExtraBundle\\EventListener\\CacheListener',
));
}

if (empty($annotationsToLoad)) {
return ;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you avoid the early return as it looks inconsistent with the other conditions. Thanks.

}

if ($annotationsToLoad) {
// must be first
$loader->load('annotations.xml');
// must be first
$loader->load('annotations.xml');

foreach ($annotationsToLoad as $config) {
$loader->load($config);
}
foreach ($annotationsToLoad as $config) {
$loader->load($config);
}

$this->addClassesToCompile(array(
'Sensio\\Bundle\\FrameworkExtraBundle\\Configuration\\ConfigurationAnnotation',
));
}

/**
Expand Down