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

Add the ability to set WP_HOME #92

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,10 @@ This will set up one or more installations of Wordpress 4.8.1 on Debian and Redh
Specifies the port to use with the proxy host. Default: ''

* `wp_site_url`<br />
If your WordPress server is behind a proxy, you might need to set the WP_SITEURL with this parameter. Default: 'undef'
If your WordPress server is behind a proxy, you wish to override the value in the wp_options table or reduce the number of database calls when loading, you might need to set the WP_SITEURL with this parameter. Default: 'undef'

* `wp_home`<br />
If you wish to override the value in the wp_options table or reduce the number of database calls when loading, you might need to set the WP_HOME with this parameter. Default: 'undef'

* `wp_multisite`<br />
Specifies whether to enable the multisite feature. Requires `wp_site_domain` to also be passed. Default: `false`
Expand Down
2 changes: 2 additions & 0 deletions manifests/app.pp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
$wp_proxy_host,
$wp_proxy_port,
$wp_site_url,
$wp_home,
$wp_multisite,
$wp_site_domain,
$wp_debug,
Expand Down Expand Up @@ -53,6 +54,7 @@
wp_proxy_host => $wp_proxy_host,
wp_proxy_port => $wp_proxy_port,
wp_site_url => $wp_site_url,
wp_home => $wp_home,
wp_multisite => $wp_multisite,
wp_site_domain => $wp_site_domain,
wp_debug => $wp_debug,
Expand Down
7 changes: 6 additions & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@
# Specifies the port to use with the proxy host. Default: ''
#
# [*wp_site_url*]
# If your WordPress server is behind a proxy, you might need to set the WP_SITEURL with this parameter. Default: `undef`
# If your WordPress server is behind a proxy, you wish to override the value in the wp_options table or reduce the number of database calls when loading, you might need to set the WP_SITEURL with this parameter. Default: `undef`
#
# [*wp_home*]
# If you wish to override the value in the wp_options table or reduce the number of database calls when loading, you might need to set the WP_HOME with this parameter. Default: `undef`
#
# [*wp_multisite*]
# Specifies whether to enable the multisite feature. Requires `wp_site_domain` to also be passed. Default: `false`
Expand Down Expand Up @@ -134,6 +137,7 @@
$wp_proxy_host = '',
$wp_proxy_port = '',
$wp_site_url = undef,
$wp_home = undef,
$wp_multisite = false,
$wp_site_domain = '',
$wp_debug = false,
Expand Down Expand Up @@ -171,6 +175,7 @@
wp_proxy_host => $wp_proxy_host,
wp_proxy_port => $wp_proxy_port,
wp_site_url => $wp_site_url,
wp_home => $wp_home,
wp_multisite => $wp_multisite,
wp_site_domain => $wp_site_domain,
wp_debug => $wp_debug,
Expand Down
7 changes: 6 additions & 1 deletion manifests/instance.pp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,10 @@
# Specifies the port to use with the proxy host. Default: ''
#
# [*wp_site_url*]
# If your WordPress server is behind a proxy, you might need to set the WP_SITEURL with this parameter. Default: `undef`
# If your WordPress server is behind a proxy, you wish to override the value in the wp_options table or reduce the number of database calls when loading, you might need to set the WP_SITEURL with this parameter. Default: `undef`
#
# [*wp_home*]
# If you wish to override the value in the wp_options table or reduce the number of database calls when loading, you might need to set the WP_HOME with this parameter. Default: `undef`
#
# [*wp_multisite*]
# Specifies whether to enable the multisite feature. Requires `wp_site_domain` to also be passed. Default: `false`
Expand Down Expand Up @@ -123,6 +126,7 @@
$wp_proxy_host = '',
$wp_proxy_port = '',
$wp_site_url = undef,
$wp_home = undef,
$wp_multisite = false,
$wp_site_domain = '',
$wp_debug = false,
Expand Down Expand Up @@ -158,6 +162,7 @@
wp_proxy_host => $wp_proxy_host,
wp_proxy_port => $wp_proxy_port,
wp_site_url => $wp_site_url,
wp_home => $wp_home,
wp_multisite => $wp_multisite,
wp_site_domain => $wp_site_domain,
wp_debug => $wp_debug,
Expand Down
2 changes: 2 additions & 0 deletions manifests/instance/app.pp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
String $wp_proxy_host,
String $wp_proxy_port,
Optional[String] $wp_site_url,
Optional[String] $wp_home,
Boolean $wp_multisite,
String $wp_site_domain,
Boolean $wp_debug,
Expand Down Expand Up @@ -154,6 +155,7 @@
# - $wp_proxy_host
# - $wp_proxy_port
# - $wp_site_url
# - $wp_home
# - $wp_multisite
# - $wp_site_domain
# - $wp_additional_config
Expand Down
8 changes: 5 additions & 3 deletions templates/wp-config.php.erb
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,12 @@ define('WP_PROXY_PORT', '<%= @wp_proxy_port %>');
<% end %>
<% end %>

<% if @wp_site_url %>
<% if @wp_site_url -%>
define('WP_SITEURL', '<%= @wp_site_url %>');
<% end %>
<% end -%>
<% if @wp_home -%>
define('WP_HOME', '<%= @wp_home %>');
<% end -%>

<% if @wp_multisite %>
/* Multisite */
Expand All @@ -111,4 +114,3 @@ if ( !defined('ABSPATH') )

/** Sets up WordPress vars and included files. */
require_once(ABSPATH . 'wp-settings.php');