heimrichhannot / contao-haste_plus

GNU Lesser General Public License v3.0
0 stars 4 forks source link

Fix wrong autoloading #16

Closed fritzmg closed 3 years ago

fritzmg commented 3 years ago

This PR fixes the wrong autoloading definition in the composer.json. Since you already use a physical Haste subfolder, you must not add it to the root namespace. Alternatively you could also move all folders/files within library/Haste/ one folder up instead (i.e. getting rid of the Haste/ subfolder in library/).

Deprecation Notice: Class HeimrichHannot\Haste\Database\Contao3MysqliHelper located in ./vendor/heimrichhannot/contao-haste_plus/library/Haste/Database/QueryHelper.php does not comply with psr-0 autoloading standard. It will not autoload anymore in Composer v2.0.

The autoloading will not work with the new Contao Manager anymore, which is due to be released soon, since it uses Composer 2.x.

koertho commented 3 years ago

We didn't noticed any errors so far with composer 2.0, but I don't see any problem with this change. There is also a classes folder, I think it should be added to the array as well.

koertho commented 3 years ago

Ok, forget my last comment, now I'm getting what you're PR want to do. I think we can mege it, @Defcon0 ?

fritzmg commented 3 years ago

You are right though, the problem is actually something else. The class name does not match the file name. My PR would only be relevant for PSR-4, but you are using PSR-0.

fritzmg commented 3 years ago

Also the class not being able to load in Composer 2.x can be ignored, since the class is only relevant for Contao 3 anyway.

koertho commented 3 years ago

@fritzmg Thanks for reporting back. We're working on getting rid of this extension anyway someday :crossed_fingers: :pray: :wink: