• Resolved esauvisky

    (@esauvisky)


    We have a containerized setup, using docker, and we need a way to pass our CDN’s secrets (ID, key, etc.) via environment variables to master.php, so that only our production environment will have the caching enabled.

    Basically, I need to be able to set the credentials like this:

    “cdn.cf2.key”: “‘$ENV[‘CF2KEY’]'”,
    “cdn.cf2.secret”: “‘$ENV[‘CF2SECRET’]'”,
    “cdn.cf2.id”: “‘$ENV[‘CF2ID’]'”,

    It seems that in the past, master.php was just a return array(), however now it begins with <?php exit; ?> followed by an array, which I assume it’s causing W3TC to overwrite the file each time the container is started.

    Is there any way to get this behavior without major edits on the plugin itself?

Viewing 1 replies (of 1 total)
  • Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @esauvisky,

    You can change to database config instead of the file, so you can have separate configs for production and development

    I don’t think it’ll be possible to use variables in the master file like that.

Viewing 1 replies (of 1 total)

The topic ‘master.php with environment variables’ is closed to new replies.