1
0
mirror of synced 2025-02-09 08:49:26 +03:00

Merge pull request #6905 from Majkl578/setup-cache-7.1-compat

Setup: Switch Apc -> Apcu and Memcache -> Memcached
This commit is contained in:
Luís Cobucci 2017-12-19 08:21:02 +01:00 committed by GitHub
commit b210c1e364
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 16 additions and 12 deletions

View File

@ -77,6 +77,7 @@ jobs:
env: DB=none STATIC_ANALYSIS env: DB=none STATIC_ANALYSIS
install: travis_retry composer update --prefer-dist --prefer-stable install: travis_retry composer update --prefer-dist --prefer-stable
before_script: before_script:
- echo "extension=memcached.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- echo "extension=redis.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini - echo "extension=redis.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- travis_retry composer require --dev --prefer-dist --prefer-stable phpstan/phpstan:^0.9 - travis_retry composer require --dev --prefer-dist --prefer-stable phpstan/phpstan:^0.9
script: vendor/bin/phpstan analyse -l 1 -c phpstan.neon lib script: vendor/bin/phpstan analyse -l 1 -c phpstan.neon lib

View File

@ -21,6 +21,15 @@ Method `Doctrine\ORM\Query\Parser#overwriteInternalDQLFunctionNotAllowed()` was
removed because of the choice to allow users to overwrite internal functions, ie removed because of the choice to allow users to overwrite internal functions, ie
`AVG`, `SUM`, `COUNT`, `MIN` and `MAX`. [#6500](https://github.com/doctrine/doctrine2/pull/6500) `AVG`, `SUM`, `COUNT`, `MIN` and `MAX`. [#6500](https://github.com/doctrine/doctrine2/pull/6500)
## PHP 7.1 is now required
Doctrine 2.6 now requires PHP 7.1 or newer.
As a consequence, automatic cache setup in Doctrine\ORM\Tools\Setup::create*Configuration() was changed:
- APCu extension (ext-apcu) will now be used instead of abandoned APC (ext-apc).
- Memcached extension (ext-memcached) will be used instead of obsolete Memcache (ext-memcache).
- XCache support was dropped as it doesn't work with PHP 7.
# Upgrade to 2.5 # Upgrade to 2.5
## Minor BC BREAK: removed `Doctrine\ORM\Query\SqlWalker#walkCaseExpression()` ## Minor BC BREAK: removed `Doctrine\ORM\Query\SqlWalker#walkCaseExpression()`

View File

@ -165,19 +165,16 @@ class Setup
return new ArrayCache(); return new ArrayCache();
} }
if (extension_loaded('apc')) { if (extension_loaded('apcu')) {
return new \Doctrine\Common\Cache\ApcCache(); return new \Doctrine\Common\Cache\ApcuCache();
} }
if (ini_get('xcache.cacher')) {
return new \Doctrine\Common\Cache\XcacheCache();
}
if (extension_loaded('memcache')) { if (extension_loaded('memcached')) {
$memcache = new \Memcache(); $memcache = new \Memcached();
$memcache->connect('127.0.0.1'); $memcache->addServer('127.0.0.1', 11211);
$cache = new \Doctrine\Common\Cache\MemcacheCache(); $cache = new \Doctrine\Common\Cache\MemcachedCache();
$cache->setMemcache($memcache); $cache->setMemcache($memcache);
return $cache; return $cache;

View File

@ -2,6 +2,3 @@ parameters:
earlyTerminatingMethodCalls: earlyTerminatingMethodCalls:
Doctrine\ORM\Query\Parser: Doctrine\ORM\Query\Parser:
- syntaxError - syntaxError
ignoreErrors:
# Memcache does not exist on PHP 7
- '#Instantiated class Memcache not found#'