Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-20524

"composer.phar dump-autoload --optimize" corrupts autoloading

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Critical Critical
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:

      Description

      By running:

      $ composer.phar dump-autoload --optimize
      

      It will generate a classmap file in vendor/composer/autoload_classmap.php that will contain the following entries:

      'eZDebug' => $baseDir . '/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/IO/Tests/LegacyTest/ezdebug.php',
      'eZDebugSetting' => $baseDir . '/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/IO/Tests/LegacyTest/ezdebugsetting.php',
      'eZExecution' => $baseDir . '/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/IO/Tests/LegacyTest/ezexecution.php',
      'eZExtension' => $baseDir . '/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/IO/Tests/LegacyTest/ezextension.php',
      'eZINI' => $baseDir . '/vendor/ezsystems/ezpublish-kernel/eZ/Publish/Core/IO/Tests/LegacyTest/ezini.php',
      

      Those are critical classes to eZ Publish Legacy part.

      My opinion is that not only those classes shouldn't be in the autoload map, but all Tests related classes which aren't useful for web-handled requests and by doing so, that would also optimize every requests by loading a smaller map.

        Activity

        Hide
        Jérôme Vieilledent (Inactive) added a comment -

        This is indeed an issue. Bertrand Dunogier, can you check if those classes/tests can be safely removed ?
        By the way, there is an open PR on Composer : https://github.com/composer/composer/pull/1607 .

        but all Tests related classes which aren't useful for web-handled requests and by doing so, that would also optimize every requests by loading a smaller map.

        Actually all *Test.php files are already ignored.

        Show
        Jérôme Vieilledent (Inactive) added a comment - This is indeed an issue. Bertrand Dunogier , can you check if those classes/tests can be safely removed ? By the way, there is an open PR on Composer : https://github.com/composer/composer/pull/1607 . but all Tests related classes which aren't useful for web-handled requests and by doing so, that would also optimize every requests by loading a smaller map. Actually all *Test.php files are already ignored.
        Hide
        Patrick Allaert (Inactive) added a comment -

        but all Tests related classes which aren't useful for web-handled requests and by doing so, that would also optimize every requests by loading a smaller map.

        Actually all *Test.php files are already ignored.

        Yes, but because of abstract tests classes not ending with "Test" and fixtures, we still do have 244 entries registered:

        $ grep /Tests/ vendor/composer/autoload_classmap.php | wc -l
        244

        Show
        Patrick Allaert (Inactive) added a comment - but all Tests related classes which aren't useful for web-handled requests and by doing so, that would also optimize every requests by loading a smaller map. Actually all *Test.php files are already ignored. Yes, but because of abstract tests classes not ending with "Test" and fixtures, we still do have 244 entries registered: $ grep /Tests/ vendor/composer/autoload_classmap.php | wc -l 244

          People

          • Assignee:
            Unassigned
            Reporter:
            Patrick Allaert (Inactive)
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: