src/Rewrite_Command.php
private static function apache_modules() {
		$mods = WP_CLI::get_config( 'apache_modules' );
		if ( ! empty( $mods ) && ! function_exists( 'apache_get_modules' ) ) {
			global $is_apache;
			// phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited
			$is_apache = true;

			// needed for get_home_path() and .htaccess location
			$_SERVER['SCRIPT_FILENAME'] = ABSPATH;

			function apache_get_modules() {
				return WP_CLI::get_config( 'apache_modules' );
			}
		}
	}
private static function apache_modules() {
		$mods = WP_CLI::get_config( 'apache_modules' );
		if ( ! empty( $mods ) && ! function_exists( 'apache_get_modules' ) ) {
			global $is_apache;
			// phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited
			$is_apache = true;

			// needed for get_home_path() and .htaccess location
			$_SERVER['SCRIPT_FILENAME'] = ABSPATH;

			function apache_get_modules() {
				return WP_CLI::get_config( 'apache_modules' );
			}
		}
	}
Exposes apache modules if present in config

Implementation Notes: This function exposes a global function
apache_get_modules and also sets the $is_apache global variable.

This is so that flush_rewrite_rules will actually write out the
.htaccess file for apache WordPress installations. There is a check
to see:

1. if the $is_apache variable is set.
2. if the mod_rewrite module is returned from the apache_get_modules
function.

To get this to work with wp-cli you'll need to add the mod_rewrite module
to your config.yml. For example

```
apache_modules:
- mod_rewrite
```

If this isn't done then the .htaccess rewrite rules won't be flushed out
to disk.