wp-cli/wp-cli — pull request #563 by eugeneware (2013-06-26 06:46:21+00:00)
Title: Make wp rewrite (flush|structure) generate .htaccess files properly for Apache

Currently the following commands fail to update `.htaccess` for Apache:

```
$ wp --path=my_wordpress_install rewrite flush --soft
$ wp --path=my_wordpress_install rewrite structure /%postname%/
```

The root cause is twofold:
1. When running wp-cli because you're in the CLI the apache modules do not get detected.
2. When running wp-cli because you're in the CLI the $is_apache variable doesn't get set.

This PR creates a new variable in the config file called `apache_modules`. Eg:

``` yaml
apache_modules:
- mod_rewrite
- mod_blah
```

This allows us to tell wp-cli which apache modules are loaded so that the `rewrite` command can detect the module if it's loaded and also sets `$is_apache` to true.

I've put this code in a new function called `apache_modules` in the `rewrite` command file, but it should probably live at a higher level so that any other commands can benefit from it.

The `--soft` parameter was also quite confusing, so I've renamed it `--hard` for clarity's sake.

This PR addresses issue: https://github.com/wp-cli/wp-cli/issues/345
though the diagnosis of the root cause was only half correct.

I've implemented the suggested solution in the issue by making this a new config variable.