0

When I create a docker entrypoint script for my project I run:

php /bin/composer install --no-dev

But thhat throws an exception that is:

Fatal error: Uncaught Symfony\Component\Debug\Exception\ClassNotFoundException: Attempted to load class "AjglBreakpointTwigExtensionBundle" from namespace "Ajgl\Twig\Extension\SymfonyBundle".

The code over the AppKernel.php that initializes the bundle is:

public function registerBundles()
 {
        //Other Bundle initialization
        if (in_array($this->getEnvironment(), ['dev', 'test'], true)) {
            $bundles[] = new Ajgl\Twig\Extension\SymfonyBundle\AjglBreakpointTwigExtensionBundle();

       }

       return $bundles;
 }

This bundle I use int on dev and test environments where it has use. The container I build is for production use.

Therefore I want somehow to let the ScriptHandlers that when composer executes, theese run over a prod environment and not a dev one in order to supress the error message?

1 Answer 1

2

I suppose this is a duplicate of this issue.

Just set the SYMFONY_ENV var to prod and use composer install then: SYMFONY_ENV=prod php /bin/composer install --no-dev

Sign up to request clarification or add additional context in comments.

1 Comment

No is not duplicate because the whole point is how to supress a Symfony - related error. Even the answer is not the same. or close to solve the problem in the link you provided

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.