Comments (5)
From my point of view, Bedrock should include by default only one way to load env variables; and it should be as simple and general as possible.
You could load env files by looking at a server variable for example HTTP_HOST
(.env.example.org
); others may prefer to look at the environment (.env.production
), others may have a completely different use case as valid as the previous two.
As you can see, this could scale indefinitely and in the long run it will be impossible to handle every use case.
In addition every piece of code that is added to the default boilerplate must be maintained and tested to avoid breakages between releases.
Probably niche but more elegant than any other solution when it comes to handling multiple databases under the same WP instance.
Handle multiple databases under the same WP instance to me seems like a particular use case where manually editing the boilerplate could make sense. If you think about it also in WP if you want to handle multiple databases under the same instance you must customize the wp-config.php
by adding some logic before the database settings section.
from bedrock.
config/env_loader.php
). It's a catch 22 because the location of the loader couldn't be set in the .env
On the other hand, this is probably fairly niche (since it hasn't come up in ~8 years+) and since Bedrock is designed as a boilerplate to be edited, I'm tempted to do nothing and the proper solution is to modify the core file.
If you want to open a PR with a proposed solution it would help evaluate it, but no promises on it being merged.
from bedrock.
Probably niche but more elegant than any other solution when it comes to handling multiple databases under the same WP instance. if (file_exists('xxx')) { require('xxx'); } else { /* regular loading */ }
would be fine for me as long as xxx
is part of the .gitignore
I know about the designed as a boilerplate to be edited
but I don't like this : We always need to update sooner or later and keeping the original .git/
is handy when this happens (and minimally touching upstream files is always a good practice anyway)
from bedrock.
under the same instance you must customize the wp-config.php
No need for this. Just:
- The above tweak to the
application.php
loader - One Apache alias regarding the filesystem, eg:
Alias /app/uploads /srv/www/foo/web/app/uploads-bis
- ... which goes together with
wp option upload_path
set to<abspath>/web/app/uploads-bis
The last bit I'm trying to workaround is the custom WP_ENV (let's say db2
) I need at config/environments/db2.php
.
mu-plugins/disallow-indexing.php
is triggered because the environment's name is not called production
(even if it's used in production).
The goes down to whether only one environment is dedicated to production or if this is an arbitrary limitation which must be removed (I tend to think so).
At least something like strpos(WP_ENV, "production") === false
so that WP_ENV=production-bis
wouldn't get indexation inhibited?
from bedrock.
Related Issues (20)
- Plugin activation / desactivation depending on environment HOT 2
- Your site could not complete a loopback request HOT 4
- Gutenberg block react dom not fully loaded (maybe) HOT 1
- wp-sqlite-db does not work HOT 6
- Maybe use a var for "web" HOT 1
- Maybe use a var for $webroot_dir HOT 3
- Automatically translate WP and extensions HOT 2
- production.php missing? HOT 1
- .env.local failed to open stream php error when WP_ENV='development' and .env.local does not exist. HOT 5
- Installation request for roave/security-advisories (locked at dev-master, required as dev-latest) HOT 2
- Wordpress update HOT 1
- Bug: Site Editor not working on Bedrock installs HOT 4
- Bug: Openlitespeed Wordpress pretty permalinks broken HOT 1
- Bug: htaccess not blocking /app request HOT 4
- Dependency Dashboard
- Bug: wordpress-no-content ignores wordpress-install-dir HOT 1
- Bug: Multisite not working HOT 1
- Bug: WP_ENVIRONMENT_TYPE set doesn't check if constant is already defined HOT 6
- ADD: Local environment in application.php HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bedrock.