Skip to content

Commit 131f4e8

Browse files
Merge branch '6.4' into 7.0
* 6.4: Revert "bug #57520 [SecurityBundle] Remove unused memory users’ `name` attribute from the XSD (MatTheCat)" [HttpKernel] Enable optional cache-warmers when cache-dir != build-dir [Filesystem] Fix Filesystem::remove() on Windows [DoctrineBridge] Fix compat with DI >= 6.4 [String] Fix *String::snake methods
2 parents 3550977 + cdb8354 commit 131f4e8

File tree

7 files changed

+19
-7
lines changed

7 files changed

+19
-7
lines changed

src/Symfony/Bridge/Doctrine/ManagerRegistry.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ function (&$wrappedInstance, LazyLoadingInterface $manager) use ($name) {
5858
}
5959
if (isset($this->fileMap[$name])) {
6060
$wrappedInstance = $this->load($this->fileMap[$name], false);
61+
} elseif ((new \ReflectionMethod($this, $this->methodMap[$name]))->isStatic()) {
62+
$wrappedInstance = $this->{$this->methodMap[$name]}($this, false);
6163
} else {
6264
$wrappedInstance = $this->{$this->methodMap[$name]}(false);
6365
}

src/Symfony/Bundle/SecurityBundle/Resources/config/schema/security-1.0.xsd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@
112112

113113
<xsd:complexType name="user">
114114
<xsd:attribute name="identifier" type="xsd:string" />
115+
<xsd:attribute name="name" type="xsd:string" />
115116
<xsd:attribute name="password" type="xsd:string" />
116117
<xsd:attribute name="roles" type="xsd:string" />
117118
</xsd:complexType>

src/Symfony/Component/Filesystem/Filesystem.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ private static function doRemove(array $files, bool $isRecursive): void
164164
}
165165
} elseif (is_dir($file)) {
166166
if (!$isRecursive) {
167-
$tmpName = \dirname(realpath($file)).'/.'.strrev(strtr(base64_encode(random_bytes(2)), '/=', '-_'));
167+
$tmpName = \dirname(realpath($file)).'/.!'.strrev(strtr(base64_encode(random_bytes(2)), '/=', '-!'));
168168

169169
if (file_exists($tmpName)) {
170170
try {

src/Symfony/Component/HttpKernel/Kernel.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -521,10 +521,17 @@ protected function initializeContainer(): void
521521
touch($oldContainerDir.'.legacy');
522522
}
523523

524-
$preload = $this instanceof WarmableInterface ? (array) $this->warmUp($this->container->getParameter('kernel.cache_dir'), $buildDir) : [];
524+
$cacheDir = $this->container->getParameter('kernel.cache_dir');
525+
$preload = $this instanceof WarmableInterface ? (array) $this->warmUp($cacheDir, $buildDir) : [];
525526

526527
if ($this->container->has('cache_warmer')) {
527-
$preload = array_merge($preload, (array) $this->container->get('cache_warmer')->warmUp($this->container->getParameter('kernel.cache_dir'), $buildDir));
528+
$cacheWarmer = $this->container->get('cache_warmer');
529+
530+
if ($cacheDir !== $buildDir) {
531+
$cacheWarmer->enableOptionalWarmers();
532+
}
533+
534+
$preload = array_merge($preload, (array) $cacheWarmer->warmUp($cacheDir, $buildDir));
528535
}
529536

530537
if ($preload && file_exists($preloadFile = $buildDir.'/'.$class.'.preload.php')) {

src/Symfony/Component/String/AbstractUnicodeString.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,8 +346,8 @@ public function reverse(): static
346346

347347
public function snake(): static
348348
{
349-
$str = $this->camel();
350-
$str->string = mb_strtolower(preg_replace(['/(\p{Lu}+)(\p{Lu}\p{Ll})/u', '/([\p{Ll}0-9])(\p{Lu})/u'], '\1_\2', $str->string), 'UTF-8');
349+
$str = clone $this;
350+
$str->string = str_replace(' ', '_', mb_strtolower(preg_replace(['/(\p{Lu}+)(\p{Lu}\p{Ll})/u', '/([\p{Ll}0-9])(\p{Lu})/u'], '\1 \2', $str->string), 'UTF-8'));
351351

352352
return $str;
353353
}

src/Symfony/Component/String/ByteString.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,8 +342,8 @@ public function slice(int $start = 0, ?int $length = null): static
342342

343343
public function snake(): static
344344
{
345-
$str = $this->camel();
346-
$str->string = strtolower(preg_replace(['/([A-Z]+)([A-Z][a-z])/', '/([a-z\d])([A-Z])/'], '\1_\2', $str->string));
345+
$str = clone $this;
346+
$str->string = str_replace(' ', '_', strtolower(preg_replace(['/([A-Z]+)([A-Z][a-z])/', '/([a-z\d])([A-Z])/'], '\1 \2', $str->string)));
347347

348348
return $str;
349349
}

src/Symfony/Component/String/Tests/AbstractAsciiTestCase.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1075,6 +1075,8 @@ public static function provideSnake()
10751075
['symfony_is_great', 'symfonyIsGREAT'],
10761076
['symfony_is_really_great', 'symfonyIsREALLYGreat'],
10771077
['symfony', 'SYMFONY'],
1078+
['symfony_is_great', 'SYMFONY IS GREAT'],
1079+
['symfony_is_great', 'SYMFONY_IS_GREAT'],
10781080
];
10791081
}
10801082

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy