public static function getDefaultPath()
    {
        // use static path for all Unix-based systems
        if (DIRECTORY_SEPARATOR !== '\\') {
            return '/etc/hosts';
        }

        // Windows actually stores the path in the registry under
        // \HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\DataBasePath
        $path = '%SystemRoot%\\system32\drivers\etc\hosts';

        $base = getenv('SystemRoot');
        if ($base === false) {
            $base = 'C:\\Windows';
        }

        return str_replace('%SystemRoot%', $base, $path);
    }
public static function getDefaultPath()
    {
        // use static path for all Unix-based systems
        if (DIRECTORY_SEPARATOR !== '\\') {
            return '/etc/hosts';
        }

        // Windows actually stores the path in the registry under
        // \HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\DataBasePath
        $path = '%SystemRoot%\\system32\drivers\etc\hosts';

        $base = getenv('SystemRoot');
        if ($base === false) {
            $base = 'C:\\Windows';
        }

        return str_replace('%SystemRoot%', $base, $path);
    }
public static function getDefaultPath ( ) { // use static path for all Unix-based systems if ( DIRECTORY_SEPARATOR !== '\\' ) { return '/etc/hosts' ; } // Windows actually stores the path in the registry under // \HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\DataBasePath $ path = '%SystemRoot%\\system32\drivers\etc\hosts' ; $ base = getenv ( 'SystemRoot' ) ; if ( $ base === false ) { $ base = 'C:\\Windows' ; } return str_replace ( '%SystemRoot%' , $ base , $ path ) ; }
Returns the default path for the hosts file on this system

@return string
@codeCoverageIgnore
Returns the default path for the hosts file on this system