Merge branch '4.4' into 5.2
* 4.4: Allow psr/cache v3 but on symfony/cache [DI] fix tracking of changes to vendor/ dirs Remove EOLed 5.1 branch from PR template [HttpKernel] [Kernel] Silence deprecations logs writes Update PULL_REQUEST_TEMPLATE.md [Mailer][Mime] Update inline part names with newly generated ContentId Fixed updating catalogue metadata from intl domain [HttpFoundation] Setting `REQUEST_TIME_FLOAT` when constructing a Request object
This commit is contained in:
commit
382b10fc7c
3
.github/PULL_REQUEST_TEMPLATE.md
vendored
3
.github/PULL_REQUEST_TEMPLATE.md
vendored
@ -1,6 +1,6 @@
|
||||
| Q | A
|
||||
| ------------- | ---
|
||||
| Branch? | 5.x for features / 4.4, 5.1 or 5.2 for bug fixes <!-- see below -->
|
||||
| Branch? | 5.x for features / 4.4 or 5.2 for bug fixes <!-- see below -->
|
||||
| Bug fix? | yes/no
|
||||
| New feature? | yes/no <!-- please update src/**/CHANGELOG.md files -->
|
||||
| Deprecations? | yes/no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
|
||||
@ -17,4 +17,5 @@ Additionally (see https://symfony.com/releases):
|
||||
- Bug fixes must be submitted against the lowest maintained branch where they apply
|
||||
(lowest branches are regularly merged to upper ones so they get the fixes too.)
|
||||
- Features and deprecations must be submitted against branch 5.x.
|
||||
- Changelog entry should follow https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry
|
||||
-->
|
||||
|
@ -333,6 +333,11 @@ EOF
|
||||
foreach ($catalogue->getResources() as $resource) {
|
||||
$filteredCatalogue->addResource($resource);
|
||||
}
|
||||
if ($metadata = $catalogue->getMetadata('', $intlDomain)) {
|
||||
foreach ($metadata as $k => $v) {
|
||||
$filteredCatalogue->setMetadata($k, $v, $intlDomain);
|
||||
}
|
||||
}
|
||||
if ($metadata = $catalogue->getMetadata('', $domain)) {
|
||||
foreach ($metadata as $k => $v) {
|
||||
$filteredCatalogue->setMetadata($k, $v, $domain);
|
||||
|
@ -1599,14 +1599,14 @@ class ContainerBuilder extends Container implements TaggedContainerInterface
|
||||
private function inVendors(string $path): bool
|
||||
{
|
||||
if (null === $this->vendors) {
|
||||
$resource = new ComposerResource();
|
||||
$this->vendors = $resource->getVendors();
|
||||
$this->addResource($resource);
|
||||
$this->vendors = (new ComposerResource())->getVendors();
|
||||
}
|
||||
$path = realpath($path) ?: $path;
|
||||
|
||||
foreach ($this->vendors as $vendor) {
|
||||
if (0 === strpos($path, $vendor) && false !== strpbrk(substr($path, \strlen($vendor), 1), '/'.\DIRECTORY_SEPARATOR)) {
|
||||
$this->addResource(new FileResource($vendor.'/composer/installed.json'));
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -18,7 +18,6 @@ require_once __DIR__.'/Fixtures/includes/ProjectExtension.php';
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Psr\Container\ContainerInterface as PsrContainerInterface;
|
||||
use Symfony\Bridge\PhpUnit\ExpectDeprecationTrait;
|
||||
use Symfony\Component\Config\Resource\ComposerResource;
|
||||
use Symfony\Component\Config\Resource\DirectoryResource;
|
||||
use Symfony\Component\Config\Resource\FileResource;
|
||||
use Symfony\Component\Config\Resource\ResourceInterface;
|
||||
@ -952,7 +951,7 @@ class ContainerBuilderTest extends TestCase
|
||||
|
||||
$resources = $container->getResources();
|
||||
|
||||
$this->assertCount(2, $resources, '2 resources were registered');
|
||||
$this->assertCount(1, $resources);
|
||||
|
||||
/* @var $resource \Symfony\Component\Config\Resource\FileResource */
|
||||
$resource = end($resources);
|
||||
@ -981,9 +980,9 @@ class ContainerBuilderTest extends TestCase
|
||||
|
||||
$resources = $container->getResources();
|
||||
|
||||
$this->assertCount(3, $resources, '3 resources were registered');
|
||||
$this->assertCount(2, $resources);
|
||||
|
||||
$this->assertSame('reflection.BarClass', (string) $resources[1]);
|
||||
$this->assertSame('reflection.BarClass', (string) $resources[0]);
|
||||
$this->assertSame('BarMissingClass', (string) end($resources));
|
||||
}
|
||||
|
||||
@ -1044,7 +1043,6 @@ class ContainerBuilderTest extends TestCase
|
||||
public function testFileExists()
|
||||
{
|
||||
$container = new ContainerBuilder();
|
||||
$A = new ComposerResource();
|
||||
$a = new FileResource(__DIR__.'/Fixtures/xml/services1.xml');
|
||||
$b = new FileResource(__DIR__.'/Fixtures/xml/services2.xml');
|
||||
$c = new DirectoryResource($dir = \dirname($b));
|
||||
@ -1058,7 +1056,7 @@ class ContainerBuilderTest extends TestCase
|
||||
}
|
||||
}
|
||||
|
||||
$this->assertEquals([$A, $a, $b, $c], $resources, '->getResources() returns an array of resources read for the current configuration');
|
||||
$this->assertEquals([$a, $b, $c], $resources, '->getResources() returns an array of resources read for the current configuration');
|
||||
}
|
||||
|
||||
public function testExtension()
|
||||
|
@ -32,7 +32,7 @@ class GlobFileLoaderTest extends TestCase
|
||||
$loader = new GlobFileLoaderWithoutImport($container = new ContainerBuilder(), new FileLocator());
|
||||
$loader->load(__DIR__.'/../Fixtures/config/*');
|
||||
|
||||
$this->assertEquals(new GlobResource(__DIR__.'/../Fixtures/config', '/*', false), $container->getResources()[1]);
|
||||
$this->assertEquals(new GlobResource(__DIR__.'/../Fixtures/config', '/*', false), $container->getResources()[0]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -347,6 +347,7 @@ class Request
|
||||
'SCRIPT_FILENAME' => '',
|
||||
'SERVER_PROTOCOL' => 'HTTP/1.1',
|
||||
'REQUEST_TIME' => time(),
|
||||
'REQUEST_TIME_FLOAT' => microtime(true),
|
||||
], $server);
|
||||
|
||||
$server['PATH_INFO'] = '';
|
||||
|
@ -28,7 +28,7 @@ class MarshallingSessionHandler implements \SessionHandlerInterface, \SessionUpd
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
* @return bool
|
||||
*/
|
||||
public function open($savePath, $name)
|
||||
{
|
||||
@ -36,7 +36,7 @@ class MarshallingSessionHandler implements \SessionHandlerInterface, \SessionUpd
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
* @return bool
|
||||
*/
|
||||
public function close()
|
||||
{
|
||||
@ -44,7 +44,7 @@ class MarshallingSessionHandler implements \SessionHandlerInterface, \SessionUpd
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
* @return bool
|
||||
*/
|
||||
public function destroy($sessionId)
|
||||
{
|
||||
@ -52,7 +52,7 @@ class MarshallingSessionHandler implements \SessionHandlerInterface, \SessionUpd
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
* @return bool
|
||||
*/
|
||||
public function gc($maxlifetime)
|
||||
{
|
||||
@ -60,7 +60,7 @@ class MarshallingSessionHandler implements \SessionHandlerInterface, \SessionUpd
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
* @return string
|
||||
*/
|
||||
public function read($sessionId)
|
||||
{
|
||||
@ -68,7 +68,7 @@ class MarshallingSessionHandler implements \SessionHandlerInterface, \SessionUpd
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
* @return bool
|
||||
*/
|
||||
public function write($sessionId, $data)
|
||||
{
|
||||
@ -83,7 +83,7 @@ class MarshallingSessionHandler implements \SessionHandlerInterface, \SessionUpd
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
* @return bool
|
||||
*/
|
||||
public function validateId($sessionId)
|
||||
{
|
||||
@ -91,7 +91,7 @@ class MarshallingSessionHandler implements \SessionHandlerInterface, \SessionUpd
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
* @return bool
|
||||
*/
|
||||
public function updateTimestamp($sessionId, $data)
|
||||
{
|
||||
|
@ -543,8 +543,8 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
|
||||
if ($collectDeprecations) {
|
||||
restore_error_handler();
|
||||
|
||||
file_put_contents($buildDir.'/'.$class.'Deprecations.log', serialize(array_values($collectedLogs)));
|
||||
file_put_contents($buildDir.'/'.$class.'Compiler.log', null !== $container ? implode("\n", $container->getCompiler()->getLog()) : '');
|
||||
@file_put_contents($buildDir.'/'.$class.'Deprecations.log', serialize(array_values($collectedLogs)));
|
||||
@file_put_contents($buildDir.'/'.$class.'Compiler.log', null !== $container ? implode("\n", $container->getCompiler()->getLog()) : '');
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -41,7 +41,7 @@
|
||||
"symfony/stopwatch": "^4.4|^5.0",
|
||||
"symfony/translation": "^4.4|^5.0",
|
||||
"symfony/translation-contracts": "^1.1|^2",
|
||||
"psr/cache": "^1.0|^2.0",
|
||||
"psr/cache": "^1.0|^2.0|^3.0",
|
||||
"twig/twig": "^2.13|^3.0.4"
|
||||
},
|
||||
"provide": {
|
||||
|
@ -17,6 +17,8 @@ use Symfony\Component\Lock\Store\RetryTillSaveStore;
|
||||
|
||||
/**
|
||||
* @author Jérémy Derussé <jeremy@derusse.com>
|
||||
*
|
||||
* @group legacy
|
||||
*/
|
||||
class RetryTillSaveStoreTest extends AbstractStoreTest
|
||||
{
|
||||
|
@ -25,7 +25,7 @@
|
||||
"symfony/redis-messenger": "^5.1"
|
||||
},
|
||||
"require-dev": {
|
||||
"psr/cache": "^1.0|^2.0",
|
||||
"psr/cache": "^1.0|^2.0|^3.0",
|
||||
"symfony/console": "^4.4|^5.0",
|
||||
"symfony/dependency-injection": "^4.4|^5.0",
|
||||
"symfony/event-dispatcher": "^4.4|^5.0",
|
||||
|
@ -485,6 +485,7 @@ class Email extends Message
|
||||
$attachment['inline'] = true;
|
||||
$inlineParts[$name] = $part = $this->createDataPart($attachment);
|
||||
$html = str_replace('cid:'.$name, 'cid:'.$part->getContentId(), $html);
|
||||
$part->setName($part->getContentId());
|
||||
continue 2;
|
||||
}
|
||||
$attachmentParts[] = $this->createDataPart($attachment);
|
||||
|
@ -21,7 +21,7 @@
|
||||
"symfony/options-resolver": "^5.1"
|
||||
},
|
||||
"require-dev": {
|
||||
"psr/cache": "^1.0|^2.0"
|
||||
"psr/cache": "^1.0|^2.0|^3.0"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": { "Symfony\\Component\\RateLimiter\\": "" },
|
||||
|
@ -94,11 +94,17 @@ class NullToken implements TokenInterface
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function serialize()
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function unserialize($serialized)
|
||||
{
|
||||
}
|
||||
|
@ -38,9 +38,10 @@ class MergeOperation extends AbstractOperation
|
||||
|
||||
foreach ($this->source->all($domain) as $id => $message) {
|
||||
$this->messages[$domain]['all'][$id] = $message;
|
||||
$this->result->add([$id => $message], $this->source->defines($id, $intlDomain) ? $intlDomain : $domain);
|
||||
if (null !== $keyMetadata = $this->source->getMetadata($id, $domain)) {
|
||||
$this->result->setMetadata($id, $keyMetadata, $domain);
|
||||
$d = $this->source->defines($id, $intlDomain) ? $intlDomain : $domain;
|
||||
$this->result->add([$id => $message], $d);
|
||||
if (null !== $keyMetadata = $this->source->getMetadata($id, $d)) {
|
||||
$this->result->setMetadata($id, $keyMetadata, $d);
|
||||
}
|
||||
}
|
||||
|
||||
@ -48,9 +49,10 @@ class MergeOperation extends AbstractOperation
|
||||
if (!$this->source->has($id, $domain)) {
|
||||
$this->messages[$domain]['all'][$id] = $message;
|
||||
$this->messages[$domain]['new'][$id] = $message;
|
||||
$this->result->add([$id => $message], $this->target->defines($id, $intlDomain) ? $intlDomain : $domain);
|
||||
if (null !== $keyMetadata = $this->target->getMetadata($id, $domain)) {
|
||||
$this->result->setMetadata($id, $keyMetadata, $domain);
|
||||
$d = $this->target->defines($id, $intlDomain) ? $intlDomain : $domain;
|
||||
$this->result->add([$id => $message], $d);
|
||||
if (null !== $keyMetadata = $this->target->getMetadata($id, $d)) {
|
||||
$this->result->setMetadata($id, $keyMetadata, $d);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -49,9 +49,10 @@ class TargetOperation extends AbstractOperation
|
||||
foreach ($this->source->all($domain) as $id => $message) {
|
||||
if ($this->target->has($id, $domain)) {
|
||||
$this->messages[$domain]['all'][$id] = $message;
|
||||
$this->result->add([$id => $message], $this->target->defines($id, $intlDomain) ? $intlDomain : $domain);
|
||||
if (null !== $keyMetadata = $this->source->getMetadata($id, $domain)) {
|
||||
$this->result->setMetadata($id, $keyMetadata, $domain);
|
||||
$d = $this->target->defines($id, $intlDomain) ? $intlDomain : $domain;
|
||||
$this->result->add([$id => $message], $d);
|
||||
if (null !== $keyMetadata = $this->source->getMetadata($id, $d)) {
|
||||
$this->result->setMetadata($id, $keyMetadata, $d);
|
||||
}
|
||||
} else {
|
||||
$this->messages[$domain]['obsolete'][$id] = $message;
|
||||
@ -62,9 +63,10 @@ class TargetOperation extends AbstractOperation
|
||||
if (!$this->source->has($id, $domain)) {
|
||||
$this->messages[$domain]['all'][$id] = $message;
|
||||
$this->messages[$domain]['new'][$id] = $message;
|
||||
$this->result->add([$id => $message], $this->target->defines($id, $intlDomain) ? $intlDomain : $domain);
|
||||
if (null !== $keyMetadata = $this->target->getMetadata($id, $domain)) {
|
||||
$this->result->setMetadata($id, $keyMetadata, $domain);
|
||||
$d = $this->target->defines($id, $intlDomain) ? $intlDomain : $domain;
|
||||
$this->result->add([$id => $message], $d);
|
||||
if (null !== $keyMetadata = $this->target->getMetadata($id, $d)) {
|
||||
$this->result->setMetadata($id, $keyMetadata, $d);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -90,6 +90,29 @@ class MergeOperationTest extends AbstractOperationTest
|
||||
);
|
||||
}
|
||||
|
||||
public function testGetResultWithMetadataFromIntlDomain()
|
||||
{
|
||||
$leftCatalogue = new MessageCatalogue('en', ['messages+intl-icu' => ['a' => 'old_a', 'b' => 'old_b']]);
|
||||
$leftCatalogue->setMetadata('a', 'foo', 'messages+intl-icu');
|
||||
$leftCatalogue->setMetadata('b', 'bar', 'messages+intl-icu');
|
||||
$rightCatalogue = new MessageCatalogue('en', ['messages+intl-icu' => ['b' => 'new_b', 'c' => 'new_c']]);
|
||||
$rightCatalogue->setMetadata('b', 'baz', 'messages+intl-icu');
|
||||
$rightCatalogue->setMetadata('c', 'qux', 'messages+intl-icu');
|
||||
|
||||
$mergedCatalogue = new MessageCatalogue('en', ['messages+intl-icu' => ['a' => 'old_a', 'b' => 'old_b', 'c' => 'new_c']]);
|
||||
$mergedCatalogue->setMetadata('a', 'foo', 'messages+intl-icu');
|
||||
$mergedCatalogue->setMetadata('b', 'bar', 'messages+intl-icu');
|
||||
$mergedCatalogue->setMetadata('c', 'qux', 'messages+intl-icu');
|
||||
|
||||
$this->assertEquals(
|
||||
$mergedCatalogue,
|
||||
$this->createOperation(
|
||||
$leftCatalogue,
|
||||
$rightCatalogue
|
||||
)->getResult()
|
||||
);
|
||||
}
|
||||
|
||||
protected function createOperation(MessageCatalogueInterface $source, MessageCatalogueInterface $target)
|
||||
{
|
||||
return new MergeOperation($source, $target);
|
||||
|
@ -102,6 +102,28 @@ class TargetOperationTest extends AbstractOperationTest
|
||||
);
|
||||
}
|
||||
|
||||
public function testGetResultWithMetadataFromIntlDomain()
|
||||
{
|
||||
$leftCatalogue = new MessageCatalogue('en', ['messages+intl-icu' => ['a' => 'old_a', 'b' => 'old_b']]);
|
||||
$leftCatalogue->setMetadata('a', 'foo', 'messages+intl-icu');
|
||||
$leftCatalogue->setMetadata('b', 'bar', 'messages+intl-icu');
|
||||
$rightCatalogue = new MessageCatalogue('en', ['messages+intl-icu' => ['b' => 'new_b', 'c' => 'new_c']]);
|
||||
$rightCatalogue->setMetadata('b', 'baz', 'messages+intl-icu');
|
||||
$rightCatalogue->setMetadata('c', 'qux', 'messages+intl-icu');
|
||||
|
||||
$diffCatalogue = new MessageCatalogue('en', ['messages+intl-icu' => ['b' => 'old_b', 'c' => 'new_c']]);
|
||||
$diffCatalogue->setMetadata('b', 'bar', 'messages+intl-icu');
|
||||
$diffCatalogue->setMetadata('c', 'qux', 'messages+intl-icu');
|
||||
|
||||
$this->assertEquals(
|
||||
$diffCatalogue,
|
||||
$this->createOperation(
|
||||
$leftCatalogue,
|
||||
$rightCatalogue
|
||||
)->getResult()
|
||||
);
|
||||
}
|
||||
|
||||
protected function createOperation(MessageCatalogueInterface $source, MessageCatalogueInterface $target)
|
||||
{
|
||||
return new TargetOperation($source, $target);
|
||||
|
@ -17,7 +17,7 @@
|
||||
],
|
||||
"require": {
|
||||
"php": ">=7.2.5",
|
||||
"psr/cache": "^1.0|^2.0"
|
||||
"psr/cache": "^1.0|^2.0|^3.0"
|
||||
},
|
||||
"suggest": {
|
||||
"symfony/cache-implementation": ""
|
||||
|
@ -17,7 +17,7 @@
|
||||
],
|
||||
"require": {
|
||||
"php": ">=7.2.5",
|
||||
"psr/cache": "^1.0|^2.0",
|
||||
"psr/cache": "^1.0|^2.0|^3.0",
|
||||
"psr/container": "^1.0",
|
||||
"psr/event-dispatcher": "^1.0"
|
||||
},
|
||||
|
Reference in New Issue
Block a user