You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a WordPress theme which uses Timber via Composer. Timber has a dependency of a version of Twig that has the following autoloader in their composer.json.
When I attempt to run vendor\bin\mozart compose, I get an error, File already exists at path: lib/Dependencies/Twig/Extension/InitRuntimeInterface.php. I understand why this error happens, because in the twig package they have the same set of files in different directories to support both psr-0 and psr-4 and mozart is trying to process it twice.
I attempted to override this autoloader behavior in the mozart configuration, but I don't think I'm doing it right. I tried the following:
When compose ran, it copied my dependent namespace on every line of the processed files. I also tried having psr-0 with empty curly braces and got the same behavior. I am using mozart version 0.7.1.
Am I going about this the wrong way?
The text was updated successfully, but these errors were encountered:
I ran into the same error and figured out that the twig/cache-extension package is the reason why you end up with a bunch of gibberish namespaces on every line of your processed files.
I got it working the following configuration for extra:
In the override_autoload config, I overwrite the twig/twig autoload configuration to prevent the File already exists at path error.
And then I pass a custom autoload configuration for twig/cache-extension as well. Because that package will be loaded into the same dependency folder as all other files from the Twig package, we need to add use lib/Twig/ instead of lib/ only.
I ignored the upstatement/routes package, because it has some weird autoloading from the main package directory. And I don’t use that anyway, so I should be fine.
I have a WordPress theme which uses Timber via Composer. Timber has a dependency of a version of Twig that has the following autoloader in their composer.json.
When I attempt to run
vendor\bin\mozart compose
, I get an error,File already exists at path: lib/Dependencies/Twig/Extension/InitRuntimeInterface.php
. I understand why this error happens, because in the twig package they have the same set of files in different directories to support both psr-0 and psr-4 and mozart is trying to process it twice.I attempted to override this autoloader behavior in the mozart configuration, but I don't think I'm doing it right. I tried the following:
When compose ran, it copied my dependent namespace on every line of the processed files. I also tried having psr-0 with empty curly braces and got the same behavior. I am using mozart version 0.7.1.
Am I going about this the wrong way?
The text was updated successfully, but these errors were encountered: