Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Kernel initialization on random requests, using GLOB function #33990

Closed
@hurricane-voronin

Description

@hurricane-voronin

Symfony version(s) affected: 4 (dev envs)

Description
I'm not sure if it's a bug in symfony, but I've got the next behavior with
\Symfony\Component\Config\Resource\GlobResource::getIterator witch loads files using glob not it the stable sorting, e.g several files: doctrine.yml and doctrine_mongodb.yaml in config/packages folder.
On requests these files come(randomly) in a different order, which leads to reinitialization of symfony kernel in dev environment. It's a little bit annoying and takes a lot of time in a common :(

How to reproduce

  1. Create several files like doctrine.yaml and doctrine_mongodb.yaml
  2. Observe that files could be randomly fetched from directory
<?php // index.php

$files = glob('directory', GLOB_BRACE);
echo reset($files);

Possible Solution
I guess it's possible to add sorting. (Or probably use GLOB_NOSORT, as a native sorting is a little bit buggy).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions