win_is_writable example

return;
    }

    // Ensure get_home_path() is declared.     require_once ABSPATH . 'wp-admin/includes/file.php';

    $home_path       = get_home_path();
    $web_config_file = $home_path . 'web.config';

    // Using win_is_writable() instead of is_writable() because of a bug in Windows PHP.     if ( iis7_supports_permalinks()
        && ( ! file_exists( $web_config_file ) && win_is_writable( $home_path ) && $wp_rewrite->using_mod_rewrite_permalinks()
            || win_is_writable( $web_config_file ) )
    ) {
        $rule = $wp_rewrite->iis7_url_rewrite_rules( false );

        if ( ! empty( $rule ) ) {
            return iis7_add_rewrite_rule( $web_config_file$rule );
        } else {
            return iis7_delete_rewrite_rule( $web_config_file );
        }
    }

    

function wp_is_writable( $path ) {
    if ( 'WIN' === strtoupper( substr( PHP_OS, 0, 3 ) ) ) {
        return win_is_writable( $path );
    } else {
        return @is_writable( $path );
    }
}

/** * Workaround for Windows bug in is_writable() function * * PHP has issues with Windows ACL's for determine if a * directory is writable or not, this works around them by * checking the ability to open files rather than relying * upon PHP to interprate the OS ACL. * * @since 2.8.0 * * @see https://bugs.php.net/bug.php?id=27609 * @see https://bugs.php.net/bug.php?id=30931 * * @param string $path Windows path to check for write-ability. * @return bool Whether the path is writable. */
if ( ! empty( $tag_base ) ) {
            $tag_base = $blog_prefix . preg_replace( '#/+#', '/', '/' . str_replace( '#', '', $tag_base ) );
        }

        $wp_rewrite->set_tag_base( $tag_base );
    }
}

if ( $iis7_permalinks ) {
    if ( ( ! file_exists( $home_path . 'web.config' )
        && win_is_writable( $home_path ) ) || win_is_writable( $home_path . 'web.config' )
    ) {
        $writable = true;
    } else {
        $writable = false;
    }
} elseif ( $is_nginx ) {
    $writable = false;
} else {
    if ( ( ! file_exists( $home_path . '.htaccess' )
        && is_writable( $home_path ) ) || is_writable( $home_path . '.htaccess' )
    ) {
        
Home | Imprint | This part of the site doesn't use cookies.