Skip to content

Commit

Permalink
[COOK-4192] Add attribute to control WordPress multisite features
Browse files Browse the repository at this point in the history
Signed-off-by: Sean OMeara <[email protected]>
  • Loading branch information
reidab authored and Sean OMeara committed Feb 28, 2014
1 parent a582604 commit 80aa49b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ Attributes
* `node['wordpress']['db']['user']` - Name of the WordPress MySQL user.
* `node['wordpress']['db']['pass']` - Password of the WordPress MySQL user. By default, generated using openssl cookbook.
* `node['wordpress']['db']['prefix']` - Prefix of all MySQL tables created by WordPress.
* `node['wordpress']['allow_multisite']` - Enable [multisite](http://codex.wordpress.org/Create_A_Network) features (default: false).

Usage
=====
Expand Down
2 changes: 2 additions & 0 deletions attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
default['wordpress']['db']['prefix'] = 'wp_'
default['wordpress']['db']['host'] = 'localhost'

default['wordpress']['allow_multisite'] = false

default['wordpress']['server_aliases'] = [node['fqdn']]

# Languages
Expand Down
3 changes: 2 additions & 1 deletion recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@
:secure_auth_salt => node['wordpress']['salt']['secure_auth'],
:logged_in_salt => node['wordpress']['salt']['logged_in'],
:nonce_salt => node['wordpress']['salt']['nonce'],
:lang => node['wordpress']['languages']['lang']
:lang => node['wordpress']['languages']['lang'],
:allow_multisite => node['wordpress']['allow_multisite']
)
action :create
end
Expand Down
5 changes: 5 additions & 0 deletions templates/default/wp-config.php.erb
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@ define('WPLANG', '<%= @lang %>');
*/
define('WP_DEBUG', false);

<% if @allow_multisite %>
/* Multisite */
define( 'WP_ALLOW_MULTISITE', true );
<% end %>

/* That's all, stop editing! Happy blogging. */

/** Absolute path to the WordPress directory. */
Expand Down

0 comments on commit 80aa49b

Please sign in to comment.