Update doctrine packages and fix metadata cache
[MAILPOET-3658]
This commit is contained in:
committed by
Veljko V
parent
b6d420b19c
commit
c9603b76dc
@@ -7,7 +7,7 @@ use MailPoetVendor\Doctrine\Common\Cache\ArrayCache;
|
|||||||
use MailPoetVendor\Doctrine\Common\Proxy\AbstractProxyFactory;
|
use MailPoetVendor\Doctrine\Common\Proxy\AbstractProxyFactory;
|
||||||
use MailPoetVendor\Doctrine\ORM\Configuration;
|
use MailPoetVendor\Doctrine\ORM\Configuration;
|
||||||
use MailPoetVendor\Doctrine\ORM\Mapping\Driver\AnnotationDriver;
|
use MailPoetVendor\Doctrine\ORM\Mapping\Driver\AnnotationDriver;
|
||||||
use MailPoetVendor\Doctrine\ORM\Mapping\Driver\PHPDriver;
|
use MailPoetVendor\Doctrine\Persistence\Mapping\Driver\PHPDriver;
|
||||||
use MailPoetVendor\Doctrine\ORM\Mapping\UnderscoreNamingStrategy;
|
use MailPoetVendor\Doctrine\ORM\Mapping\UnderscoreNamingStrategy;
|
||||||
|
|
||||||
class ConfigurationFactory {
|
class ConfigurationFactory {
|
||||||
@@ -51,8 +51,8 @@ class ConfigurationFactory {
|
|||||||
|
|
||||||
// metadata cache (for production cache is pre-generated at build time)
|
// metadata cache (for production cache is pre-generated at build time)
|
||||||
$isReadOnly = !$annotationReader;
|
$isReadOnly = !$annotationReader;
|
||||||
$metadataStorage = new MetadataCache(self::METADATA_DIR, $isReadOnly);
|
$metadataStorage = new PSRMetadataCache(self::METADATA_DIR, $isReadOnly);
|
||||||
$configuration->setMetadataCacheImpl($metadataStorage);
|
$configuration->setMetadataCache($metadataStorage);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function configureProxies(Configuration $configuration) {
|
private function configureProxies(Configuration $configuration) {
|
||||||
|
@@ -60,7 +60,6 @@ class PDOStatement implements \IteratorAggregate, Statement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function bindParam($param, &$variable, $type = ParameterType::STRING, $length = null, $driverOptions = null) {
|
public function bindParam($param, &$variable, $type = ParameterType::STRING, $length = null, $driverOptions = null) {
|
||||||
if (is_null($type)) $type = ParameterType::STRING;
|
|
||||||
$type = $this->convertParamType($type);
|
$type = $this->convertParamType($type);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@@ -32,7 +32,8 @@ class TablePrefixMetadataFactory extends ClassMetadataFactory {
|
|||||||
|
|
||||||
// prefix tables only after they are saved to cache so the prefix does not get included in cache
|
// prefix tables only after they are saved to cache so the prefix does not get included in cache
|
||||||
// (getMetadataFor can call itself recursively but it saves to cache only after the recursive calls)
|
// (getMetadataFor can call itself recursively but it saves to cache only after the recursive calls)
|
||||||
$isCached = ($cache = $this->getCacheDriver()) ? $cache->contains($classMetadata->getName() . $this->cacheSalt) : false;
|
$cacheKey = $this->getCacheKey($classMetadata->getName());
|
||||||
|
$isCached = ($cache = $this->getCache()) ? $cache->hasItem($cacheKey) : false;
|
||||||
if ($classMetadata instanceof ClassMetadata && $isCached) {
|
if ($classMetadata instanceof ClassMetadata && $isCached) {
|
||||||
$this->addPrefix($classMetadata);
|
$this->addPrefix($classMetadata);
|
||||||
$this->prefixedMap[$classMetadata->getName()] = true;
|
$this->prefixedMap[$classMetadata->getName()] = true;
|
||||||
|
@@ -2,9 +2,9 @@
|
|||||||
"require": {
|
"require": {
|
||||||
"php": ">=7.1",
|
"php": ">=7.1",
|
||||||
"cerdic/css-tidy": "^1.7",
|
"cerdic/css-tidy": "^1.7",
|
||||||
"doctrine/common": "3.0.2",
|
"doctrine/common": "3.1.2",
|
||||||
"doctrine/dbal": "2.9.3",
|
"doctrine/dbal": "2.13.1",
|
||||||
"doctrine/orm": "2.7.4",
|
"doctrine/orm": "2.9.3",
|
||||||
"gregwar/captcha": "^1.1",
|
"gregwar/captcha": "^1.1",
|
||||||
"monolog/monolog": "^1.23",
|
"monolog/monolog": "^1.23",
|
||||||
"nesbot/carbon": "2.41.3",
|
"nesbot/carbon": "2.41.3",
|
||||||
|
844
prefixer/composer.lock
generated
844
prefixer/composer.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -5,6 +5,7 @@ namespace MailPoet\Test\Config;
|
|||||||
use MailPoet\Doctrine\Annotations\AnnotationReaderProvider;
|
use MailPoet\Doctrine\Annotations\AnnotationReaderProvider;
|
||||||
use MailPoet\Doctrine\ConfigurationFactory;
|
use MailPoet\Doctrine\ConfigurationFactory;
|
||||||
use MailPoet\Doctrine\MetadataCache;
|
use MailPoet\Doctrine\MetadataCache;
|
||||||
|
use MailPoet\Doctrine\PSRMetadataCache;
|
||||||
use MailPoet\Doctrine\TablePrefixMetadataFactory;
|
use MailPoet\Doctrine\TablePrefixMetadataFactory;
|
||||||
use MailPoetVendor\Doctrine\Common\Cache\ArrayCache;
|
use MailPoetVendor\Doctrine\Common\Cache\ArrayCache;
|
||||||
use MailPoetVendor\Doctrine\Common\Proxy\AbstractProxyFactory;
|
use MailPoetVendor\Doctrine\Common\Proxy\AbstractProxyFactory;
|
||||||
@@ -22,7 +23,7 @@ class ConfigurationFactoryTest extends \MailPoetTest {
|
|||||||
|
|
||||||
// metadata
|
// metadata
|
||||||
expect($configuration->getClassMetadataFactoryName())->equals(TablePrefixMetadataFactory::class);
|
expect($configuration->getClassMetadataFactoryName())->equals(TablePrefixMetadataFactory::class);
|
||||||
expect($configuration->getMetadataCacheImpl())->isInstanceOf(MetadataCache::class);
|
expect($configuration->getMetadataCache())->isInstanceOf(PSRMetadataCache::class);
|
||||||
expect($configuration->getMetadataDriverImpl())->isInstanceOf(AnnotationDriver::class);
|
expect($configuration->getMetadataDriverImpl())->isInstanceOf(AnnotationDriver::class);
|
||||||
|
|
||||||
// cache
|
// cache
|
||||||
|
Reference in New Issue
Block a user