Added classes to cache #158

Merged
merged 3 commits into from Jan 27, 2014

Projects

None yet

5 participants

@dlsniper

Hello,

This commit adds some used classes to Symfony2 cache.
See the talk in sensiolabs/SensioDistributionBundle#76

Let me know if it needs anything else/if I've did it against the wrong branch (it should go into 2.2 distro).

Thanks.

@mvrhov

do we really need a data collector in a cache it's dev only...

@stof stof commented on an outdated diff Feb 14, 2013
DependencyInjection/DoctrineExtension.php
@@ -50,6 +50,24 @@ public function load(array $configs, ContainerBuilder $container)
if (!empty($config['orm'])) {
$this->ormLoad($config['orm'], $container);
}
+
+ $this->addClassesToCompile(array(
+ 'Doctrine\\Common\\Annotations\\DocLexer',
+ 'Doctrine\\Common\\Annotations\\FileCacheReader',
+ 'Doctrine\\Common\\Annotations\\PhpParser',
+ 'Doctrine\\Common\\Annotations\\Reader',
+ 'Doctrine\\Common\\Lexer',
+ 'Doctrine\\Common\\Persistence\\AbstractManagerRegistry',
+ 'Doctrine\\Common\\Persistence\\ConnectionRegistry',
+ 'Doctrine\\Common\\Persistence\\ManagerRegistry',
+ 'Doctrine\\Common\\Persistence\\Proxy',
+ 'Doctrine\\Common\\Util\\ClassUtils',
+ 'Symfony\\Bridge\\Doctrine\\DataCollector\\DoctrineDataCollector',
+ 'Symfony\\Bridge\\Doctrine\\ManagerRegistry',
+ 'Symfony\\Bridge\\Doctrine\\RegistryInterface',
@stof
stof Feb 14, 2013 Doctrine member

Please simplify the list, letting the code handling the parent classes instead of hardcoding them

@dlsniper

When will this be merged?
ping @stof

@Baachi Baachi and 1 other commented on an outdated diff Feb 28, 2013
DependencyInjection/DoctrineExtension.php
@@ -50,6 +50,19 @@ public function load(array $configs, ContainerBuilder $container)
if (!empty($config['orm'])) {
$this->ormLoad($config['orm'], $container);
}
+
+ $this->addClassesToCompile(array(
+ 'Doctrine\\Common\\Annotations\\DocLexer',
+ 'Doctrine\\Common\\Annotations\\FileCacheReader',
+ 'Doctrine\\Common\\Annotations\\PhpParser',
+ 'Doctrine\\Common\\Annotations\\Reader',
+ 'Doctrine\\Common\\Lexer',
+ 'Doctrine\\Common\\Persistence\\ConnectionRegistry',
+ 'Doctrine\\Common\\Persistence\\Proxy',
+ 'Doctrine\\Common\\Util\\ClassUtils',
+ 'Doctrine\\Bundle\\DoctrineBundle\\DataCollector\\DoctrineDataCollector',
@Baachi
Baachi Feb 28, 2013

Is this class really needed?

@dlsniper
dlsniper Feb 28, 2013

Good catch, I'll remove it :)

@Baachi
Baachi commented Feb 28, 2013

Maybe add EntityManager and EntityRepository if the orm is used?

@dlsniper

I'm not sure about it. @stof any input?

@stof
Member
stof commented Feb 28, 2013

IMO, they could be added (but in ormLoad to be added only when the ORM is used). Some DBAL classes could be added as well

@guilhermeblanco
Member

Keeping this as is and merging for now... other PRs should cover ODM, ORM and DBAL specific stuff.

@guilhermeblanco guilhermeblanco merged commit 8edefaa into doctrine:master Jan 27, 2014

1 check passed

Details default The Travis build passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment