Skip to content

Commit

Permalink
using array cache for annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
Janos Szurovecz committed Nov 8, 2014
1 parent a53175f commit ae82873
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"php": ">=5.4",
"precore/precore": "~1.8",
"doctrine/annotations": "~1.1",
"doctrine/cache": "~1.0",
"lf4php/lf4php": "~4.2",
"trf4php/trf4php": "~1.1"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@

use Doctrine\Common\Annotations\AnnotationReader;
use Doctrine\Common\Annotations\AnnotationRegistry;
use Doctrine\Common\Annotations\CachedReader;
use Doctrine\Common\Annotations\Reader;
use Doctrine\Common\Cache\ArrayCache;
use precore\lang\ObjectClass;
use predaddy\messagehandling\FunctionDescriptor;
use predaddy\messagehandling\FunctionDescriptorFactory;
Expand Down Expand Up @@ -56,7 +58,7 @@ class AnnotatedMessageHandlerDescriptor implements MessageHandlerDescriptor

public static function init()
{
self::$reader = new AnnotationReader();
self::$reader = new CachedReader(new AnnotationReader(), new ArrayCache());
}

/**
Expand Down
6 changes: 0 additions & 6 deletions tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,3 @@
$loader->add('predaddy', __DIR__ . '/src');
}
Logger::configure(__DIR__ . '/src/resources/log4php.xml');
\predaddy\messagehandling\annotation\AnnotatedMessageHandlerDescriptor::setReader(
new \Doctrine\Common\Annotations\CachedReader(
new \Doctrine\Common\Annotations\AnnotationReader(),
new \Doctrine\Common\Cache\ArrayCache()
)
);

0 comments on commit ae82873

Please sign in to comment.