Merge branch '3.4' into 4.0
* 3.4: [Lock] use 'r+' for fopen (fixes issue on Solaris) [HttpKernel] fix test compat with PHP 5.3 fix handling of nested Error instances fix file lock on SunOS [Cache] more granular handling of exceptions in AbstractTrait::clear() change `evaluate()` docblock return type from string to mixed Set serialize_precision explicitly to avoid fancy float rounding
This commit is contained in:
commit
26535bbe87
@ -105,7 +105,6 @@ trait AbstractTrait
|
||||
public function clear()
|
||||
{
|
||||
$this->deferred = array();
|
||||
try {
|
||||
if ($cleared = $this->versioningIsEnabled) {
|
||||
$namespaceVersion = 2;
|
||||
try {
|
||||
@ -115,12 +114,17 @@ trait AbstractTrait
|
||||
} catch (\Exception $e) {
|
||||
}
|
||||
$namespaceVersion .= ':';
|
||||
try {
|
||||
$cleared = $this->doSave(array('@'.$this->namespace => $namespaceVersion), 0);
|
||||
} catch (\Exception $e) {
|
||||
$cleared = false;
|
||||
}
|
||||
if ($cleared = true === $cleared || array() === $cleared) {
|
||||
$this->namespaceVersion = $namespaceVersion;
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
return $this->doClear($this->namespace) || $cleared;
|
||||
} catch (\Exception $e) {
|
||||
CacheItem::log($this->logger, 'Failed to clear the cache', array('exception' => $e));
|
||||
|
@ -60,7 +60,7 @@ class ExpressionLanguage
|
||||
* @param Expression|string $expression The expression to compile
|
||||
* @param array $values An array of values
|
||||
*
|
||||
* @return string The result of the evaluation of the expression
|
||||
* @return mixed The result of the evaluation of the expression
|
||||
*/
|
||||
public function evaluate($expression, $values = array())
|
||||
{
|
||||
|
@ -64,7 +64,7 @@ class ExceptionListener implements EventSubscriberInterface
|
||||
}
|
||||
}
|
||||
|
||||
$prev = new \ReflectionProperty('Exception', 'previous');
|
||||
$prev = new \ReflectionProperty($wrapper instanceof \Exception ? \Exception::class : \Error::class, 'previous');
|
||||
$prev->setAccessible(true);
|
||||
$prev->setValue($wrapper, $exception);
|
||||
|
||||
|
@ -79,12 +79,12 @@ class FlockStore implements StoreInterface
|
||||
|
||||
// Silence error reporting
|
||||
set_error_handler(function ($type, $msg) use (&$error) { $error = $msg; });
|
||||
if (!$handle = fopen($fileName, 'r')) {
|
||||
if (!$handle = fopen($fileName, 'r+') ?: fopen($fileName, 'r')) {
|
||||
if ($handle = fopen($fileName, 'x')) {
|
||||
chmod($fileName, 0444);
|
||||
} elseif (!$handle = fopen($fileName, 'r')) {
|
||||
} elseif (!$handle = fopen($fileName, 'r+') ?: fopen($fileName, 'r')) {
|
||||
usleep(100); // Give some time for chmod() to complete
|
||||
$handle = fopen($fileName, 'r');
|
||||
$handle = fopen($fileName, 'r+') ?: fopen($fileName, 'r');
|
||||
}
|
||||
}
|
||||
restore_error_handler();
|
||||
|
Reference in New Issue
Block a user