doctrine-extensions / DoctrineExtensions

Doctrine2 behavioral extensions, Translatable, Sluggable, Tree-NestedSet, Timestampable, Loggable, Sortable
MIT License
4k stars 1.26k forks source link

Gedmo\Tool\ORM\Walker\SqlWalkerCompat does not comply with psr-4 autoloading standard? #2824

Closed ovgray closed 5 days ago

ovgray commented 6 days ago

When I upgraded from v3.15.0 to v3.16.0 and ran

composer install --no-dev --optimize-autoloader

I got the following:

Generating optimized autoload files Class Gedmo\Tool\ORM\Walker\SqlWalkerCompat located in ./vendor/gedmo/doctrine-extensions/src/Tool/ORM/Walker/orm-2.php does not comply with psr-4 autoloading standard. Skipping. Class Gedmo\Tool\ORM\Walker\SqlWalkerCompat located in ./vendor/gedmo/doctrine-extensions/src/Tool/ORM/Walker/orm-3.php does not comply with psr-4 autoloading standard. Skipping.

Is this a problem?

mbabker commented 6 days ago

It shouldn't be as those files are conditionally included from the correct PSR-4 file here as part of the ORM compat layer.

Short of putting those files outside an autoloaded path, I don't think this is easily fixed with the way Composer crawls the filesystem to generate the optimized autoloader.

wokenlex commented 6 days ago

I've got It too, it's destroyed the production build on the basic "composer u".

I mean, if it's supposed to do that, it should have some major version, or so.

Chris53897 commented 6 days ago

@wokenlex composer u ? What exactly is not working?

mbabker commented 6 days ago

Please explain how it has "destroyed the production build". To my knowledge, these are just warnings that Composer will print when generating an optimized autoloader and would not actually fail any kind of update.

wokenlex commented 6 days ago
        composer install --no-dev --optimize-autoloader
        composer dump-autoload --no-dev --classmap-authoritative


Fatal Error: Trait "Gedmo\Tool\ORM\Walker\SqlWalkerCompat" not found

{
    "class": "Symfony\\Component\\ErrorHandler\\Error\\FatalError",
    "message": "Error: Trait \"Gedmo\\Tool\\ORM\\Walker\\SqlWalkerCompat\" not found",
    "code": 0,
    "file": "/web/project/application/vendor/gedmo/doctrine-extensions/src/Translatable/Query/TreeWalker/TranslationWalker.php:57"
}
mbabker commented 6 days ago

Huh, well TIL a couple of things about PHP and Composer's optimized autoloader. #2830 looks like it should fix that.

wokenlex commented 6 days ago

That's… was in the first page of the Symfony documentation about "how to publish on production" last 5 years, at least :-)

mbabker commented 6 days ago

I didn't realize traits could use traits, which is why the file that was supposed to be the right PSR-4 trait just had a couple of require statements originally, or that Composer would skip that specific file when dumping the optimized autoloader because of that. Just a bunch of small little things that I admittedly didn't think to test when coming up with that all 😅

ovgray commented 5 days ago

I’m grateful for all the work that you have done. I’m sure the others are too. On Jun 25, 2024, at 10:15 AM, Michael Babker @.***> wrote: I didn't realize traits could use traits, which is why the file that was supposed to be the right PSR-4 trait just had a couple of require statements originally, or that Composer would skip that specific file when dumping the optimized autoloader because of that. Just a bunch of small little things that I admittedly didn't think to test when coming up with that all 😅

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>