Compile Error: Cannot declare class Database\Updater, because the name is already in use

Issue #4 resolved
Fritz Michael Gschwantner created an issue

In your composer.json you have defined the following:

    "autoload" : {
        "classmap" : [
            ""
        ]
    },

This autoloads any file within the extension, not just the files that actually should be loaded. This also loads the ide_compat.php, which in turn leads to the following error, at least within Contao 4.7:

Symfony\Component\Debug\Exception\FatalErrorException:
Compile Error: Cannot declare class Database\Updater, because the name is already in use

  at vendor/chrmue/cm_membergooglemaps/helper/ide_compat.php:23

Comments (4)

  1. Fritz Michael Gschwantner reporter

    Imho it’s more efficient to use

    "autoload" : {
        "classmap" : [
            "classes/",
            "models/",
            "modules/"
        ]
    },
    

    But exclude-from-classmap works too of course 🙂

  2. Christian Münster repo owner

    Danke!______Dipl.-Ing. Christian MünsterWebdesign und -realisierung Anwendungsprogrammierung Am Daubhaus 955276 OppenheimTel. +49(0)6133 926007Mobil. +49(0)170 7011294Web: http://www.christian-muenster.de

  3. Log in to comment