Uploaded image for project: 'phpBB3'
  1. phpBB3
  2. PHPBB3-12480

\phpbb\extension\finder is finding too many routing files

    Details

    • Type: Bug
    • Status: Unverified Fix
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.1.0-b2
    • Fix Version/s: 3.1.0-b3
    • Component/s: Extensions
    • Labels:
      None

      Description

      Our extension makes use of some symfony bundles, those bundles include some routing.yml files which are used for testing and other purposes that should not be automatically found and loaded.

      Currently the \phpbb\extension\finder is too general by scanning for all config/routing.yml files, finding all kinds of files that have no reason to be included.

      The easiest solution would be to limit the depth of the finder. /ext/vendor/extension/config/ + 1 should be sufficient.

      Another possible solution would be to exclude the vendor directory completely. Any routing files in those paths would need to be included from within the main routing.yml file.

        Activity

        Hide
        naderman Nils Adermann added a comment -

        I'm confused, wouldn't the symfony bundles you make use of be in the vendor/ directory? Why are they inside of your extension?

        Show
        naderman Nils Adermann added a comment - I'm confused, wouldn't the symfony bundles you make use of be in the vendor/ directory? Why are they inside of your extension?
        Hide
        naderman Nils Adermann added a comment -

        Regardless the finder should simply be using /config for the search to make sure it only searches on each extensions top level

        Show
        naderman Nils Adermann added a comment - Regardless the finder should simply be using /config for the search to make sure it only searches on each extensions top level
        Hide
        nickvergessen Joas Schilling added a comment -

        rfdy can you test this patch?

        Show
        nickvergessen Joas Schilling added a comment - rfdy can you test this patch?
        Hide
        rfdy rfdy added a comment -

        That patch wouldn't work. I'm not sure why you guys want to load every single config/routing.yml file you come across. Wouldn't the one in phpbb/ext/myvendor/extensionname/config/routing.yml be enough? Surely if someone wants anything extra they can import those files through their main routing file (using a relative path).

        The offending routing file is found deep inside phpbb/ext/myvendor/extensionname/vendor/...Tests\Functional\Bundle\TestBundle\Resources\config\routing.yml

        Limiting the depth to the extension folder plus one, or loading just the single main routing file for the extension is the best solution.

        Show
        rfdy rfdy added a comment - That patch wouldn't work. I'm not sure why you guys want to load every single config/routing.yml file you come across. Wouldn't the one in phpbb/ext/myvendor/extensionname/config/routing.yml be enough? Surely if someone wants anything extra they can import those files through their main routing file (using a relative path). The offending routing file is found deep inside phpbb/ext/myvendor/extensionname/vendor/...Tests\Functional\Bundle\TestBundle\Resources\config\routing.yml Limiting the depth to the extension folder plus one, or loading just the single main routing file for the extension is the best solution.
        Hide
        nickvergessen Joas Schilling added a comment -

        This is just what the patch does? Did you even try to apply it?

        Show
        nickvergessen Joas Schilling added a comment - This is just what the patch does? Did you even try to apply it?
        Hide
        rfdy rfdy added a comment -

        That fix seems to work now. Thanks!

        Show
        rfdy rfdy added a comment - That fix seems to work now. Thanks!

          People

          • Assignee:
            nickvergessen Joas Schilling
            Reporter:
            rfdy rfdy
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development