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

Autoload fails block usage of application

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Critical Critical
    • QA tracked issues
    • 1.11.1
    • Composer
    • None
    • PHP 5.6.03

    Description

      On a master (not happening on 1.11.0), when creating a bundle, I am confronted with the following error:

      > Checking that the bundle is autoloaded
      FAILED
      > Enabling the bundle inside app/AppKernel.php
        updated ./app/AppKernel.php
      OK
      > Importing the bundle's routes from the app/config/routing.yml file
        updated ./app/config/routing.yml
      OK
      > Importing the bundle's services.yml from the app/config/config.yml file
        updated ./app/config/config.yml
      OK
      

      but the bundle is correctly registered on AppKernel.php, routing.yml and config.yml.
      There seems to be a problem with autoload configuration since afterwards, when I try to run any command such as:

      php app/console cache:clear
      

      I always get:

      PHP Fatal error:  Class 'EzSystems\MyBundle\EzSystemsMyBundle' not found in /var/www/html/ezpmaster/app/AppKernel.php on line 55
      

      but the path matches correctly.
      I solved the problem manually by editing my composer.json and altering:

      "autoload": {
              "psr-4": {
                  "AppBundle\\": "src/AppBundle/"
              },
              "classmap": [ "app/AppKernel.php", "app/AppCache.php" ]
          },
      

      to:

      "autoload": {
              "psr-4": {
                  "": "src/"
              },
              "classmap": [ "app/AppKernel.php", "app/AppCache.php" ]
          },
      

      and running:

      composer dumpautoload
      

      After this it all works correctly.
      It seems to be quite recent since, as previously stated, this does not happen on a 11.1.0.

      Attachments

        Activity

          People

            Unassigned Unassigned
            rui.silva-obsolete@ez.no Rui Silva (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: