Merge branch '3.1'
* 3.1: fixed bad merge Fix PHP 7.1 related failures [VarDumper] Fix for 7.1 fixed CS Added class existence check if is_subclass_of() fails in compiler passes Fix the DBAL session handler version check for Postgresql
This commit is contained in:
commit
a5a03aab9e
@ -26,8 +26,9 @@ matrix:
|
|||||||
group: edge
|
group: edge
|
||||||
- php: 5.5
|
- php: 5.5
|
||||||
- php: 5.6
|
- php: 5.6
|
||||||
env: deps=high
|
|
||||||
- php: 7.0
|
- php: 7.0
|
||||||
|
env: deps=high
|
||||||
|
- php: 7.1
|
||||||
env: deps=low
|
env: deps=low
|
||||||
fast_finish: true
|
fast_finish: true
|
||||||
|
|
||||||
@ -55,13 +56,13 @@ before_install:
|
|||||||
- if [[ ! $skip ]]; then echo opcache.enable_cli = 1 >> $INI_FILE; fi
|
- if [[ ! $skip ]]; then echo opcache.enable_cli = 1 >> $INI_FILE; fi
|
||||||
- if [[ ! $skip && $PHP = 5.* ]]; then echo extension = mongo.so >> $INI_FILE; fi
|
- if [[ ! $skip && $PHP = 5.* ]]; then echo extension = mongo.so >> $INI_FILE; fi
|
||||||
- if [[ ! $skip && $PHP = 5.* ]]; then echo extension = memcache.so >> $INI_FILE; fi
|
- if [[ ! $skip && $PHP = 5.* ]]; then echo extension = memcache.so >> $INI_FILE; fi
|
||||||
- if [[ ! $skip && $PHP = 5.* ]]; then (echo yes | pecl install -f apcu-4.0.10 && echo apc.enable_cli = 1 >> $INI_FILE); fi
|
- if [[ ! $skip && $PHP = 5.* ]]; then (echo yes | pecl install -f apcu-4.0.11 && echo apc.enable_cli = 1 >> $INI_FILE); fi
|
||||||
- if [[ ! $skip && $PHP = 7.* ]]; then (echo yes | pecl install -f apcu-5.1.2 && echo apc.enable_cli = 1 >> $INI_FILE); fi
|
- if [[ ! $skip && $PHP = 7.0 ]]; then (echo yes | pecl install -f apcu-5.1.5 && echo apc.enable_cli = 1 >> $INI_FILE); fi
|
||||||
- if [[ ! $deps && $PHP = 5.* ]]; then (cd src/Symfony/Component/Debug/Resources/ext && phpize && ./configure && make && echo extension = $(pwd)/modules/symfony_debug.so >> $INI_FILE); fi
|
- if [[ ! $deps && $PHP = 5.* ]]; then (cd src/Symfony/Component/Debug/Resources/ext && phpize && ./configure && make && echo extension = $(pwd)/modules/symfony_debug.so >> $INI_FILE); fi
|
||||||
- if [[ ! $skip && $PHP = 5.* ]]; then pecl install -f memcached-2.1.0; fi
|
- if [[ ! $skip && $PHP = 5.* ]]; then pecl install -f memcached-2.1.0; fi
|
||||||
- if [[ ! $skip && ! $PHP = hhvm* ]]; then echo extension = ldap.so >> $INI_FILE; fi
|
- if [[ ! $skip && ! $PHP = hhvm* ]]; then echo extension = ldap.so >> $INI_FILE; fi
|
||||||
- if [[ ! $skip && ! $PHP = hhvm* ]]; then echo extension = redis.so >> $INI_FILE; fi;
|
- if [[ ! $skip && ! $PHP = hhvm* ]]; then echo extension = redis.so >> $INI_FILE; fi;
|
||||||
- if [[ ! $skip && ! $PHP = hhvm* ]]; then phpenv config-rm xdebug.ini; fi
|
- if [[ ! $skip && ! $PHP = hhvm* ]]; then phpenv config-rm xdebug.ini || echo "xdebug not available"; fi
|
||||||
- if [[ ! $skip ]]; then composer self-update --stable; fi
|
- if [[ ! $skip ]]; then composer self-update --stable; fi
|
||||||
- if [[ ! $skip ]]; then cp .composer/* ~/.composer/; fi
|
- if [[ ! $skip ]]; then cp .composer/* ~/.composer/; fi
|
||||||
- if [[ ! $skip ]]; then ./phpunit install; fi
|
- if [[ ! $skip ]]; then ./phpunit install; fi
|
||||||
|
@ -13,6 +13,7 @@ namespace Symfony\Bridge\Doctrine\HttpFoundation;
|
|||||||
|
|
||||||
use Doctrine\DBAL\Connection;
|
use Doctrine\DBAL\Connection;
|
||||||
use Doctrine\DBAL\Driver\DriverException;
|
use Doctrine\DBAL\Driver\DriverException;
|
||||||
|
use Doctrine\DBAL\Driver\ServerInfoAwareConnection;
|
||||||
use Doctrine\DBAL\Platforms\SQLServer2008Platform;
|
use Doctrine\DBAL\Platforms\SQLServer2008Platform;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -241,9 +242,33 @@ class DbalSessionHandler implements \SessionHandlerInterface
|
|||||||
"WHEN MATCHED THEN UPDATE SET $this->dataCol = :data, $this->timeCol = :time;";
|
"WHEN MATCHED THEN UPDATE SET $this->dataCol = :data, $this->timeCol = :time;";
|
||||||
case 'sqlite' === $platform:
|
case 'sqlite' === $platform:
|
||||||
return "INSERT OR REPLACE INTO $this->table ($this->idCol, $this->dataCol, $this->timeCol) VALUES (:id, :data, :time)";
|
return "INSERT OR REPLACE INTO $this->table ($this->idCol, $this->dataCol, $this->timeCol) VALUES (:id, :data, :time)";
|
||||||
case 'postgresql' === $platform && version_compare($this->con->getServerVersion(), '9.5', '>='):
|
case 'postgresql' === $platform && version_compare($this->getServerVersion(), '9.5', '>='):
|
||||||
return "INSERT INTO $this->table ($this->idCol, $this->dataCol, $this->timeCol) VALUES (:id, :data, :time) ".
|
return "INSERT INTO $this->table ($this->idCol, $this->dataCol, $this->timeCol) VALUES (:id, :data, :time) ".
|
||||||
"ON CONFLICT ($this->idCol) DO UPDATE SET ($this->dataCol, $this->timeCol) = (EXCLUDED.$this->dataCol, EXCLUDED.$this->timeCol)";
|
"ON CONFLICT ($this->idCol) DO UPDATE SET ($this->dataCol, $this->timeCol) = (EXCLUDED.$this->dataCol, EXCLUDED.$this->timeCol)";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function getServerVersion()
|
||||||
|
{
|
||||||
|
$params = $this->con->getParams();
|
||||||
|
|
||||||
|
// Explicit platform version requested (supersedes auto-detection), so we respect it.
|
||||||
|
if (isset($params['serverVersion'])) {
|
||||||
|
return $params['serverVersion'];
|
||||||
|
}
|
||||||
|
|
||||||
|
$wrappedConnection = $this->con->getWrappedConnection();
|
||||||
|
|
||||||
|
if ($wrappedConnection instanceof ServerInfoAwareConnection) {
|
||||||
|
return $wrappedConnection->getServerVersion();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Support DBAL 2.4 by accessing it directly when using PDO PgSQL
|
||||||
|
if ($wrappedConnection instanceof \PDO) {
|
||||||
|
return $wrappedConnection->getAttribute(\PDO::ATTR_SERVER_VERSION);
|
||||||
|
}
|
||||||
|
|
||||||
|
// If we cannot guess the version, the empty string will mean we won't use the code for newer versions when doing version checks.
|
||||||
|
return '';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -22,5 +22,5 @@ class ProjectServiceContainer extends Container
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class stdClass_%s extends \stdClass implements \ProxyManager\%s
|
class stdClass_%s extends %SstdClass implements \ProxyManager\%s
|
||||||
{%a}%A
|
{%a}%A
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
"symfony/security-acl": "~2.8|~3.0",
|
"symfony/security-acl": "~2.8|~3.0",
|
||||||
"symfony/stopwatch": "~2.8|~3.0",
|
"symfony/stopwatch": "~2.8|~3.0",
|
||||||
"symfony/console": "~2.8|~3.0",
|
"symfony/console": "~2.8|~3.0",
|
||||||
"symfony/var-dumper": "~2.8|~3.0",
|
"symfony/var-dumper": "~2.8.9|~3.0.9|~3.1.3|~3.2",
|
||||||
"symfony/expression-language": "~2.8|~3.0"
|
"symfony/expression-language": "~2.8|~3.0"
|
||||||
},
|
},
|
||||||
"suggest": {
|
"suggest": {
|
||||||
|
@ -487,7 +487,7 @@ class Table
|
|||||||
}
|
}
|
||||||
|
|
||||||
// create a two dimensional array (rowspan x colspan)
|
// create a two dimensional array (rowspan x colspan)
|
||||||
$unmergedRows = array_replace_recursive(array_fill($line + 1, $nbLines, ''), $unmergedRows);
|
$unmergedRows = array_replace_recursive(array_fill($line + 1, $nbLines, array()), $unmergedRows);
|
||||||
foreach ($unmergedRows as $unmergedRowKey => $unmergedRow) {
|
foreach ($unmergedRows as $unmergedRowKey => $unmergedRow) {
|
||||||
$value = isset($lines[$unmergedRowKey - $line]) ? $lines[$unmergedRowKey - $line] : '';
|
$value = isset($lines[$unmergedRowKey - $line]) ? $lines[$unmergedRowKey - $line] : '';
|
||||||
$unmergedRows[$unmergedRowKey][$column] = new TableCell($value, array('colspan' => $cell->getColspan()));
|
$unmergedRows[$unmergedRowKey][$column] = new TableCell($value, array('colspan' => $cell->getColspan()));
|
||||||
|
@ -34,7 +34,7 @@ class CrossCheckTest extends \PHPUnit_Framework_TestCase
|
|||||||
$loaderClass = 'Symfony\\Component\\DependencyInjection\\Loader\\'.ucfirst($type).'FileLoader';
|
$loaderClass = 'Symfony\\Component\\DependencyInjection\\Loader\\'.ucfirst($type).'FileLoader';
|
||||||
$dumperClass = 'Symfony\\Component\\DependencyInjection\\Dumper\\'.ucfirst($type).'Dumper';
|
$dumperClass = 'Symfony\\Component\\DependencyInjection\\Dumper\\'.ucfirst($type).'Dumper';
|
||||||
|
|
||||||
$tmp = tempnam('sf_service_container', 'sf');
|
$tmp = tempnam(sys_get_temp_dir(), 'sf');
|
||||||
|
|
||||||
file_put_contents($tmp, file_get_contents(self::$fixturesPath.'/'.$type.'/'.$fixture));
|
file_put_contents($tmp, file_get_contents(self::$fixturesPath.'/'.$type.'/'.$fixture));
|
||||||
|
|
||||||
|
@ -97,9 +97,13 @@ class RegisterListenersPass implements CompilerPassInterface
|
|||||||
|
|
||||||
// We must assume that the class value has been correctly filled, even if the service is created by a factory
|
// We must assume that the class value has been correctly filled, even if the service is created by a factory
|
||||||
$class = $container->getParameterBag()->resolveValue($def->getClass());
|
$class = $container->getParameterBag()->resolveValue($def->getClass());
|
||||||
|
|
||||||
$interface = 'Symfony\Component\EventDispatcher\EventSubscriberInterface';
|
$interface = 'Symfony\Component\EventDispatcher\EventSubscriberInterface';
|
||||||
|
|
||||||
if (!is_subclass_of($class, $interface)) {
|
if (!is_subclass_of($class, $interface)) {
|
||||||
|
if (!class_exists($class, false)) {
|
||||||
|
throw new \InvalidArgumentException(sprintf('Class "%s" used for service "%s" cannot be found.', $class, $id));
|
||||||
|
}
|
||||||
|
|
||||||
throw new \InvalidArgumentException(sprintf('Service "%s" must implement interface "%s".', $id, $interface));
|
throw new \InvalidArgumentException(sprintf('Service "%s" must implement interface "%s".', $id, $interface));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -130,7 +130,7 @@ class OrderedHashMap implements \ArrayAccess, \IteratorAggregate, \Countable
|
|||||||
? 0
|
? 0
|
||||||
// Imitate PHP's behavior of generating a key that equals
|
// Imitate PHP's behavior of generating a key that equals
|
||||||
// the highest existing integer key + 1
|
// the highest existing integer key + 1
|
||||||
: max($this->orderedKeys) + 1;
|
: 1 + (int) max($this->orderedKeys);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->orderedKeys[] = $key;
|
$this->orderedKeys[] = $key;
|
||||||
|
@ -20,7 +20,7 @@ abstract class CacheWarmer implements CacheWarmerInterface
|
|||||||
{
|
{
|
||||||
protected function writeCacheFile($file, $content)
|
protected function writeCacheFile($file, $content)
|
||||||
{
|
{
|
||||||
$tmpFile = tempnam(dirname($file), basename($file));
|
$tmpFile = @tempnam(dirname($file), basename($file));
|
||||||
if (false !== @file_put_contents($tmpFile, $content) && @rename($tmpFile, $file)) {
|
if (false !== @file_put_contents($tmpFile, $content) && @rename($tmpFile, $file)) {
|
||||||
@chmod($file, 0666 & ~umask());
|
@chmod($file, 0666 & ~umask());
|
||||||
|
|
||||||
|
@ -53,7 +53,12 @@ class FragmentRendererPass implements CompilerPassInterface
|
|||||||
|
|
||||||
$class = $container->getParameterBag()->resolveValue($def->getClass());
|
$class = $container->getParameterBag()->resolveValue($def->getClass());
|
||||||
$interface = 'Symfony\Component\HttpKernel\Fragment\FragmentRendererInterface';
|
$interface = 'Symfony\Component\HttpKernel\Fragment\FragmentRendererInterface';
|
||||||
|
|
||||||
if (!is_subclass_of($class, $interface)) {
|
if (!is_subclass_of($class, $interface)) {
|
||||||
|
if (!class_exists($class, false)) {
|
||||||
|
throw new \InvalidArgumentException(sprintf('Class "%s" used for service "%s" cannot be found.', $class, $id));
|
||||||
|
}
|
||||||
|
|
||||||
throw new \InvalidArgumentException(sprintf('Service "%s" must implement interface "%s".', $id, $interface));
|
throw new \InvalidArgumentException(sprintf('Service "%s" must implement interface "%s".', $id, $interface));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -88,20 +88,22 @@ class File extends Constraint
|
|||||||
|
|
||||||
private function normalizeBinaryFormat($maxSize)
|
private function normalizeBinaryFormat($maxSize)
|
||||||
{
|
{
|
||||||
|
$sizeInt = (int) $maxSize;
|
||||||
|
|
||||||
if (ctype_digit((string) $maxSize)) {
|
if (ctype_digit((string) $maxSize)) {
|
||||||
$this->maxSize = (int) $maxSize;
|
$this->maxSize = $sizeInt;
|
||||||
$this->binaryFormat = null === $this->binaryFormat ? false : $this->binaryFormat;
|
$this->binaryFormat = null === $this->binaryFormat ? false : $this->binaryFormat;
|
||||||
} elseif (preg_match('/^\d++k$/i', $maxSize)) {
|
} elseif (preg_match('/^\d++k$/i', $maxSize)) {
|
||||||
$this->maxSize = $maxSize * 1000;
|
$this->maxSize = $sizeInt * 1000;
|
||||||
$this->binaryFormat = null === $this->binaryFormat ? false : $this->binaryFormat;
|
$this->binaryFormat = null === $this->binaryFormat ? false : $this->binaryFormat;
|
||||||
} elseif (preg_match('/^\d++M$/i', $maxSize)) {
|
} elseif (preg_match('/^\d++M$/i', $maxSize)) {
|
||||||
$this->maxSize = $maxSize * 1000000;
|
$this->maxSize = $sizeInt * 1000000;
|
||||||
$this->binaryFormat = null === $this->binaryFormat ? false : $this->binaryFormat;
|
$this->binaryFormat = null === $this->binaryFormat ? false : $this->binaryFormat;
|
||||||
} elseif (preg_match('/^\d++Ki$/i', $maxSize)) {
|
} elseif (preg_match('/^\d++Ki$/i', $maxSize)) {
|
||||||
$this->maxSize = $maxSize << 10;
|
$this->maxSize = $sizeInt << 10;
|
||||||
$this->binaryFormat = null === $this->binaryFormat ? true : $this->binaryFormat;
|
$this->binaryFormat = null === $this->binaryFormat ? true : $this->binaryFormat;
|
||||||
} elseif (preg_match('/^\d++Mi$/i', $maxSize)) {
|
} elseif (preg_match('/^\d++Mi$/i', $maxSize)) {
|
||||||
$this->maxSize = $maxSize << 20;
|
$this->maxSize = $sizeInt << 20;
|
||||||
$this->binaryFormat = null === $this->binaryFormat ? true : $this->binaryFormat;
|
$this->binaryFormat = null === $this->binaryFormat ? true : $this->binaryFormat;
|
||||||
} else {
|
} else {
|
||||||
throw new ConstraintDefinitionException(sprintf('"%s" is not a valid maximum size', $this->maxSize));
|
throw new ConstraintDefinitionException(sprintf('"%s" is not a valid maximum size', $this->maxSize));
|
||||||
|
@ -315,7 +315,7 @@ class VarCloner extends AbstractCloner
|
|||||||
if (!empty($frame['line'])) {
|
if (!empty($frame['line'])) {
|
||||||
ob_start();
|
ob_start();
|
||||||
debug_zval_dump($obj);
|
debug_zval_dump($obj);
|
||||||
self::$hashMask = substr(ob_get_clean(), 17);
|
self::$hashMask = (int) substr(ob_get_clean(), 17);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user