WP_CLI\Utils

get_home_dir()WP-CLI 1.0

Get the home directory.

No Hooks.

Return

String.

Usage

get_home_dir();

Код get_home_dir() WP-CLI 2.7.0-alpha

function get_home_dir() {
	$home = getenv( 'HOME' );
	if ( ! $home ) {
		// In Windows $HOME may not be defined
		$home = getenv( 'HOMEDRIVE' ) . getenv( 'HOMEPATH' );
	}

	return rtrim( $home, '/\\' );
}