SCA: minor code tweaks
This commit is contained in:
parent
47a87849c0
commit
32ea449679
@ -260,11 +260,11 @@ abstract class AbstractDoctrineExtension extends Extension
|
|||||||
$configPath = $this->getMappingResourceConfigDirectory();
|
$configPath = $this->getMappingResourceConfigDirectory();
|
||||||
$extension = $this->getMappingResourceExtension();
|
$extension = $this->getMappingResourceExtension();
|
||||||
|
|
||||||
if (glob($dir.'/'.$configPath.'/*.'.$extension.'.xml')) {
|
if (glob($dir.'/'.$configPath.'/*.'.$extension.'.xml', GLOB_NOSORT)) {
|
||||||
$driver = 'xml';
|
$driver = 'xml';
|
||||||
} elseif (glob($dir.'/'.$configPath.'/*.'.$extension.'.yml')) {
|
} elseif (glob($dir.'/'.$configPath.'/*.'.$extension.'.yml', GLOB_NOSORT)) {
|
||||||
$driver = 'yml';
|
$driver = 'yml';
|
||||||
} elseif (glob($dir.'/'.$configPath.'/*.'.$extension.'.php')) {
|
} elseif (glob($dir.'/'.$configPath.'/*.'.$extension.'.php', GLOB_NOSORT)) {
|
||||||
$driver = 'php';
|
$driver = 'php';
|
||||||
} else {
|
} else {
|
||||||
// add the closest existing directory as a resource
|
// add the closest existing directory as a resource
|
||||||
|
@ -1098,8 +1098,7 @@ class Application
|
|||||||
*/
|
*/
|
||||||
public function extractNamespace($name, $limit = null)
|
public function extractNamespace($name, $limit = null)
|
||||||
{
|
{
|
||||||
$parts = explode(':', $name);
|
$parts = explode(':', $name, -1);
|
||||||
array_pop($parts);
|
|
||||||
|
|
||||||
return implode(':', null === $limit ? $parts : \array_slice($parts, 0, $limit));
|
return implode(':', null === $limit ? $parts : \array_slice($parts, 0, $limit));
|
||||||
}
|
}
|
||||||
|
@ -673,7 +673,7 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
|
|||||||
static $legacyContainers = [];
|
static $legacyContainers = [];
|
||||||
$oldContainerDir = \dirname($oldContainer->getFileName());
|
$oldContainerDir = \dirname($oldContainer->getFileName());
|
||||||
$legacyContainers[$oldContainerDir.'.legacy'] = true;
|
$legacyContainers[$oldContainerDir.'.legacy'] = true;
|
||||||
foreach (glob(\dirname($oldContainerDir).\DIRECTORY_SEPARATOR.'*.legacy') as $legacyContainer) {
|
foreach (glob(\dirname($oldContainerDir).\DIRECTORY_SEPARATOR.'*.legacy', GLOB_NOSORT) as $legacyContainer) {
|
||||||
if (!isset($legacyContainers[$legacyContainer]) && @unlink($legacyContainer)) {
|
if (!isset($legacyContainers[$legacyContainer]) && @unlink($legacyContainer)) {
|
||||||
(new Filesystem())->remove(substr($legacyContainer, 0, -7));
|
(new Filesystem())->remove(substr($legacyContainer, 0, -7));
|
||||||
}
|
}
|
||||||
|
@ -42,7 +42,7 @@ class LocaleScanner
|
|||||||
*/
|
*/
|
||||||
public function scanLocales($sourceDir)
|
public function scanLocales($sourceDir)
|
||||||
{
|
{
|
||||||
$locales = glob($sourceDir.'/*.txt');
|
$locales = glob($sourceDir.'/*.txt', GLOB_NOSORT);
|
||||||
|
|
||||||
// Remove file extension and sort
|
// Remove file extension and sort
|
||||||
array_walk($locales, function (&$locale) { $locale = basename($locale, '.txt'); });
|
array_walk($locales, function (&$locale) { $locale = basename($locale, '.txt'); });
|
||||||
|
Reference in New Issue
Block a user