Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parametrization in setup-config.php will be useful #484

Closed
jrichardsz opened this issue Apr 10, 2020 · 7 comments
Closed

parametrization in setup-config.php will be useful #484

jrichardsz opened this issue Apr 10, 2020 · 7 comments
Labels
Request Request for image modification or feature

Comments

@jrichardsz
Copy link

Imagine that I have a pre-existent database and I need to startup my wordpress with this db.

So in the same way of parametrizations on wp-config.php, Could allow setup-config.php parametrization using env vars?

@wglambert wglambert added the Request Request for image modification or feature label Apr 10, 2020
@tianon
Copy link
Member

tianon commented Apr 10, 2020

I'm not sure I understand what you mean -- from my understanding, setup-config.php is the interactive script included with WordPress for generating config.php via a wizard?

@jrichardsz
Copy link
Author

My real goal is to start a wordpress docker with a pre-populated database skipping installation wizard. So I founded setup-config.php which contains this variables:

  • define( 'WP_INSTALLING', true );
  • define( 'WP_SETUP_CONFIG', true );

So in the same way of setup-config.php is allowed to receive values from docker run as env vars, Is is possible parametrize some useful values inside setup-config.php?

Thanks,

@benhadad
Copy link

You mean similar to how https://github.com/urre/wordpress-nginx-docker-compose does it?

@jrichardsz
Copy link
Author

I think the official docker image is a good example : https://hub.docker.com/_/wordpress/
It has a lot of configurations:

-e WORDPRESS_DB_HOST=...
-e WORDPRESS_DB_USER=...
-e WORDPRESS_DB_PASSWORD=...
-e WORDPRESS_DB_NAME=...
-e WORDPRESS_TABLE_PREFIX=...
-e ETC

it would be great to add these 2 variables

  • WP_INSTALLING
  • WP_SETUP_CONFIG

Because they are related to scenario when we have several environments for our wordpress : dev, staging, production. Default installs is good for development and companies in which the final user perform modifications direct into production wordpress. But if another team perform the required changes in development or testing environments, the final steps in production could be just update the database or some internal files(php, html, etc), so in this case the default values of WP_INSTALLING and WP_SETUP_CONFIG must be manually override, because current official image does not allow its parametrization :(

@tianon
Copy link
Member

tianon commented Aug 17, 2020

The problem is that I don't think WP_INSTALLING and WP_SETUP_CONFIG are intended to be user-serviceable variables, but if you want to mess with them I'd suggest either modifying your wp-config.php file to include something like define('WP_INSTALLING', true); or use WORDPRESS_CONFIG_EXTRA (which can be set to an arbitrary amount of PHP code to embed in the wp-config.php file).

@brandon1980 brandon1980 mentioned this issue Aug 21, 2020
@jrichardsz
Copy link
Author

One of my goals is avoid manual modifications in my docker environments. Also I think there are other similar variables which are parametrized.

If I have a pre-existent database, what happen with these vars?

define( 'WP_INSTALLING', true );
define( 'WP_SETUP_CONFIG', true );

Thanks for yout time @tianon

@tianon
Copy link
Member

tianon commented Dec 19, 2020

I honestly have no idea -- as I noted above, I'm not familiar with those variables. I'd suggest asking in a support forum that's dedicated to community support of WordPress.

As this isn't something we're going to change the image for, I'm going to close.

@tianon tianon closed this as completed Dec 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Request Request for image modification or feature
Projects
None yet
Development

No branches or pull requests

4 participants