Skip to content

APP_ENV=dev is nor working - tag 5.0.4 #82

@pawel-holik-droptica

Description

@pawel-holik-droptica

I have tried to run Mautic (mautic/recommended-project) in Symfony dev mode with debug toolbar and without caching but it is not working.

At first, I found out that I was missing the whole require-dev section in composer.json so I copied it from mautic/mautic projects composer (same tag) - link

After installing the required packages I was struggling with IpRestrictMiddleware which restricts the APP_ENV=dev to only local IPs but it checks simply using in_array so when using docker I cannot provide the exact IP (it changes) and I cannot use mask or wildcard or anything like this with MAUTIC_CUSTOM_DEV_HOSTS env.
Fortunately, there is DDEV_TLD env that is allowing me to skip this but can it respect 0.0.0.0 and addresses with * like 10.10.10.*?

Then there was a problem loading assets in APP_ENV=dev from node_modules as this folder is above the document root (docroot).
I have "fixed" this by mounting node_modules inside docroot in docker but this is a hack. Something like

  apache:
    ...
    volumes:
      - ../mautic:/var/www/web
      - ../mautic/node_modules:/var/www/web/docroot/node_modules # fix for node_modules when APP_ENV=dev
    environment:
      - APACHE_DOCUMENT_ROOT=/var/www/web/docroot

Now the APP_ENV=dev sort of works but often throws an error similar to the one below.

Twig\Error\RuntimeError: An exception has been thrown during the rendering of a template ("PHP Warning - filemtime(): stat failed for /var/www/web/var/cache/de_/AppKernelDevDebugContainer.php"). - in file /app/bundles/CoreBundle/Resources/views/Default/script.html.twig - at line 5

With APP_ENV=dev working like this I am forced to use APP_ENV=prod and basically rm the cache folder whenever I write something and want to check the site.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions