soberwp / controller

Composer package to enable a controller when using Blade with Sage 9
MIT License
368 stars 43 forks source link

Controller files not updated when using docker #112

Closed campaignupgrade closed 5 years ago

campaignupgrade commented 5 years ago

We recently switched workflows and now run our local environment using docker — specifically using lando's wrapper on docker. My partner moved from vagrant, I moved from MAMP, where this project worked great (so we know it's not our SoberWP config that's the issue).

Now, strangely, any updates in app/Controllers/ are not reflected in the rendered page.

If in App.php there's an object hellobar with a key value pair of 'foo' => "foobar", and we change that to 'foo' => "barfoo", then @dump( $hellobar ) will still show the old value of public $foo => string(3) "foobar".

I am able to ssh into the container and see that App.php is correctly updated, and I am able to clear the sage cache, but nothing seems to be able to force that variable to update. Well, one thing — lando rebuild or stopping and restarting the container will then show the correct public $foo => string(3) "barfoo"

We're super perplexed. Variables in blade templates update fine, but it's like the Controller variables are cached. FYI the lando container has only MySQL, Nginx, and PHP, no caching.

Here's lando:

name: truthout4

recipe: wordpress

config:

  php: '7.0'

  via: nginx

  database: mysql:5.7

  xdebug: true

  conf:

    server: ./dev_assets/wordpress-dev-ngnix.conf

services:

  database:

    portforward: 33060

events:

    #  Installs blade generate plugin for WP-CLI
    post-start:
      - appserver: cd $LANDO_WEBROOT &&  wp package install git@github.com:alwaysblank/blade-generate.git
campaignupgrade commented 5 years ago

Update:

Solved by upgrading roots/sage-lib 9.0.0-beta.4 to latest, and soberwp/controller from 2.0.1 to 2.1.0.