Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Added classes to cache #158

Merged
merged 3 commits into from

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...

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 Collaborator
stof added a note

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@dlsniper

When will this be merged?
ping @stof

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 added a note

Is this class really needed?

Good catch, I'll remove it :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@Baachi

Maybe add EntityManager and EntityRepository if the orm is used?

@dlsniper

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

@stof
Collaborator

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

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

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
Commits on Feb 13, 2013
  1. @dlsniper

    Added classes to cache

    dlsniper authored
Commits on Feb 14, 2013
  1. @dlsniper

    Removed unneeded items

    dlsniper authored
Commits on Feb 28, 2013
  1. @dlsniper
This page is out of date. Refresh to see the latest.
Showing with 12 additions and 0 deletions.
  1. +12 −0 DependencyInjection/DoctrineExtension.php
View
12 DependencyInjection/DoctrineExtension.php
@@ -50,6 +50,18 @@ 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\\Registry',
+ ));
}
/**
Something went wrong with that request. Please try again.