Ticket #30245: 30245.stats.diff
File 30245.stats.diff, 3.4 KB (added by , 10 years ago) |
---|
-
src/wp-admin/includes/class-wp-upgrader.php
2064 2142 } 2065 2143 } 2066 2144 2067 2145 /** This action is documented in wp-admin/includes/class-wp-upgrader.php */ 2068 2146 do_action( 'upgrader_process_complete', $this, array( 'action' => 'update', 'type' => 'core' ) ); 2069 2147 2070 2148 // Clear the current updates 2071 2149 delete_site_transient( 'update_core' ); 2072 2150 2073 2151 if ( ! $parsed_args['do_rollback'] ) { 2074 2152 $stats = array( 2075 2153 'update_type' => $current->response, 2076 2154 'success' => true, 2077 2155 'fs_method' => $wp_filesystem->method, 2078 2156 'fs_method_forced' => defined( 'FS_METHOD' ) || has_filter( 'filesystem_method' ), 2157 'fs_method_direct' => !empty( $GLOBALS['_wp_filesystem_direct_method'] ) ? $GLOBALS['_wp_filesystem_direct_method'] : '', 2079 2158 'time_taken' => time() - $start_time, 2080 2159 'reported' => $wp_version, 2081 2160 'attempted' => $current->version, 2082 2161 ); 2083 2162 2084 2163 if ( is_wp_error( $result ) ) { 2085 2164 $stats['success'] = false; 2086 2165 // Did a rollback occur? 2087 2166 if ( ! empty( $try_rollback ) ) { 2088 2167 $stats['error_code'] = $original_result->get_error_code(); 2089 2168 $stats['error_data'] = $original_result->get_error_data(); 2090 2169 // Was the rollback successful? If not, collect its error too. 2091 2170 $stats['rollback'] = ! is_wp_error( $rollback_result ); 2092 2171 if ( is_wp_error( $rollback_result ) ) { 2093 2172 $stats['rollback_code'] = $rollback_result->get_error_code(); -
src/wp-admin/includes/file.php
916 916 $temp_file_name = $context . 'temp-write-test-' . time(); 917 917 $temp_handle = @fopen($temp_file_name, 'w'); 918 918 if ( $temp_handle ) { 919 919 920 920 // Attempt to determine the file owner of the WordPress files, and that of newly created files 921 921 $wp_file_owner = $temp_file_owner = false; 922 922 if ( function_exists('fileowner') ) { 923 923 $wp_file_owner = @fileowner( __FILE__ ); 924 924 $temp_file_owner = @fileowner( $temp_file_name ); 925 925 } 926 926 927 927 if ( $wp_file_owner !== false && $wp_file_owner === $temp_file_owner ) { 928 928 // WordPress is creating files as the same owner as the WordPress files, 929 929 // this means it's safe to modify & create new files via PHP. 930 930 $method = 'direct'; 931 $GLOBALS['_wp_filesystem_direct_method'] = 'file_owner'; 931 932 } else if ( $allow_relaxed_file_ownership ) { 932 933 // The $context directory is writable, and $allow_relaxed_file_ownership is set, this means we can modify files 933 934 // safely in this directory. This mode doesn't create new files, only alter existing ones. 934 935 $method = 'direct'; 936 $GLOBALS['_wp_filesystem_direct_method'] = 'relaxed_ownership'; 935 937 } 936 938 937 939 @fclose($temp_handle); 938 940 @unlink($temp_file_name); 939 941 } 940 942 } 941 943 942 944 if ( ! $method && isset($args['connection_type']) && 'ssh' == $args['connection_type'] && extension_loaded('ssh2') && function_exists('stream_get_contents') ) $method = 'ssh2'; 943 945 if ( ! $method && extension_loaded('ftp') ) $method = 'ftpext'; 944 946 if ( ! $method && ( extension_loaded('sockets') || function_exists('fsockopen') ) ) $method = 'ftpsockets'; //Sockets: Socket extension; PHP Mode: FSockopen / fwrite / fread 945 947 946 948 /** 947 949 * Filter the filesystem method to use. 948 950 * 949 951 * @since 2.6.0