Code Monkey home page Code Monkey logo

Comments (7)

RichForever avatar RichForever commented on June 14, 2024

@simonrjones any updates on this?

from wordpress-multi-env-config.

simonrjones avatar simonrjones commented on June 14, 2024

hi - sorry for the delayed reply. This is a good idea & I will update the codebase to support this. This may be a breaking change, if so this will be released as 3.0

I am considering removing support for setting the environment dynamically based on the current hostname in wp-config.env.php. This should also resolve any issues with multiple hostnames (see #29 and #32).

Using environment variables, or using a local .env file, seems best practise to me so if I'm adding a breaking change encouraging this seems a good idea.

Any feedback appreciated.

from wordpress-multi-env-config.

bluestarstudios avatar bluestarstudios commented on June 14, 2024

@simonrjones thanks for looking into it.
You actually already have a suggested Pull request that will fix the multiple hostname issue #32.

If you were to remove the ability to dynamically set the environment, how would the environment have to be set? Via a 'define()'? And if that's the case, then how would this differ from the default standard wp-config.php?

from wordpress-multi-env-config.

simonrjones avatar simonrjones commented on June 14, 2024

Thanks, I am about to test & merge that PR.

The core purpose for this repo is to load different config settings based on the current environments. A secondary purpose is setting the environment automatically based on hostname. It sounds like this secondary use case is really useful to you, is that correct?

I'm just taking this opportunity to review if that still makes sense or whether there are better practice ways this is done on WP projects. It may make sense to remain backward compatible and continue to support this.

I'm going to check with my team too on current usage & get feedback.

from wordpress-multi-env-config.

newtlabs avatar newtlabs commented on June 14, 2024

Hi Simon, I'm using this on around 50 sites and it seems to work perfectly so if you want any feedback I'll be happy to help. I'm using the wp-config.env.php to set the hostname and I also add the .env file for live/staging..

from wordpress-multi-env-config.

bluestarstudios avatar bluestarstudios commented on June 14, 2024

@simonrjones You're spot on. The primary purpose of the repo works like a charm and is the core reason I (and probably most of us) use it. But the secondary purpose (of automatically setting the environment based on the hostname) works extremely effectively, so I'm a huge fan of keeping it (as it seems @newtlabs is as well). I'm curious to hear what the team suggested in terms of future plans. Keep us posted!

from wordpress-multi-env-config.

simonrjones avatar simonrjones commented on June 14, 2024

I'm testing the v3 release of this package, which includes support for WP_ENVIRONMENT_TYPE and some improved documentation.

from wordpress-multi-env-config.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.