wplib-box icon indicating copy to clipboard operation
wplib-box copied to clipboard

Enable reading `project.json`/`.project` from within PHP/WordPress

Open mikeschinkel opened this issue 7 years ago • 0 comments

I have a use-case where I want to be able to read the project.json and change the topbar color based on which is the current host. As you can see, this is something at least two people want in from their localdev/test/stage/production servers.

I tried but unfortunately the box does not allow reading from the parent directory.

On option would be to load the entire JSON into an $_ENV variable, but I assume that would cause a performance problem or might exceed the space available for $_ENV.

Another option is to include the path to project.json and/or the .project directory in $_ENV and then make it readable by the web server. This is probably the best option, but I am open to others.

mikeschinkel avatar Sep 09 '18 07:09 mikeschinkel