Skip to content
Advertisement

How to disable “always include” class in Composer autoload_static.php

Composer in autoload_static.php use class that I don’t need them in every app request.

JavaScript

How to remove them from this autoload file? I can delete/comment them manually but every Composer update this file is re-generated.

I try to add in my main composer.json: “exclude-from-classmap”: [“vendor/rospdf/pdf-php/src/”] & run composer dump-autoload bo those class are still in there.

Advertisement

Answer

You can trick the autoloader of composer and let him think those are already loaded:

JavaScript

But this needs to happen before the vendor/autoload.php is included.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement