Changeset 42776
- Timestamp:
- 03/04/2018 09:42:12 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/file.php
r42775 r42776 1040 1040 * @since 3.7.0 1041 1041 * 1042 * @param string $filename The filename to check the MD5 of. 1043 * @param string $expected_md5 The expected MD5 of the file, either a base64 encoded raw md5, or a hex-encoded md5 1044 * @return bool|object WP_Error on failure, true on success, false when the MD5 format is unknown/unexpected 1042 * @param string $filename The filename to check the MD5 of. 1043 * @param string $expected_md5 The expected MD5 of the file, either a base64-encoded raw md5, 1044 * or a hex-encoded md5. 1045 * @return bool|WP_Error True on success, false when the MD5 format is unknown/unexpected, 1046 * WP_Error on failure. 1045 1047 */ 1046 1048 function verify_file_md5( $filename, $expected_md5 ) { … … 1063 1065 1064 1066 /** 1065 * Unzips a specified ZIP file to a location on the Filesystem via the WordPress Filesystem Abstraction. 1066 * Assumes that WP_Filesystem() has already been called and set up. Does not extract a root-level __MACOSX directory, if present. 1067 * 1068 * Attempts to increase the PHP Memory limit to 256M before uncompressing, 1069 * However, The most memory required shouldn't be much larger than the Archive itself. 1067 * Unzips a specified ZIP file to a location on the filesystem via the WordPress 1068 * Filesystem Abstraction. 1069 * 1070 * Assumes that WP_Filesystem() has already been called and set up. Does not extract 1071 * a root-level __MACOSX directory, if present. 1072 * 1073 * Attempts to increase the PHP memory limit to 256M before uncompressing. However, 1074 * the most memory required shouldn't be much larger than the archive itself. 1070 1075 * 1071 1076 * @since 2.5.0 1072 1077 * 1073 * @global WP_Filesystem_Base $wp_filesystem Subclass1074 * 1075 * @param string $file Full path and filename of zip archive1076 * @param string $to Full path on the filesystem to extract archive to1077 * @return mixed WP_Error on failure, True on success1078 * @global WP_Filesystem_Base $wp_filesystem subclass. 1079 * 1080 * @param string $file Full path and filename of ZIP archive. 1081 * @param string $to Full path on the filesystem to extract archive to. 1082 * @return true|WP_Error True on success, WP_Error on failure. 1078 1083 */ 1079 1084 function unzip_file( $file, $to ) { … … 1133 1138 1134 1139 /** 1135 * This function should not be called directly, use unzip_file instead. Attempts to unzip an archive using the ZipArchive class. 1140 * Attempts to unzip an archive using the ZipArchive class. 1141 * 1142 * This function should not be called directly, use `unzip_file()` instead. 1143 * 1136 1144 * Assumes that WP_Filesystem() has already been called and set up. 1137 1145 * 1138 1146 * @since 3.0.0 1139 * @see unzip_file 1147 * @see unzip_file() 1140 1148 * @access private 1141 1149 * 1142 * @global WP_Filesystem_Base $wp_filesystem Subclass1143 * 1144 * @param string $file Full path and filename of zip archive1145 * @param string $to Full path on the filesystem to extract archive to1150 * @global WP_Filesystem_Base $wp_filesystem subclass. 1151 * 1152 * @param string $file Full path and filename of ZIP archive. 1153 * @param string $to Full path on the filesystem to extract archive to. 1146 1154 * @param array $needed_dirs A partial list of required folders needed to be created. 1147 * @return mixed WP_Error on failure, True on success1155 * @return true|WP_Error True on success, WP_Error on failure. 1148 1156 */ 1149 1157 function _unzip_file_ziparchive( $file, $to, $needed_dirs = array() ) { … … 1257 1265 1258 1266 /** 1259 * This function should not be called directly, use unzip_file instead. Attempts to unzip an archive using the PclZip library. 1267 * Attempts to unzip an archive using the PclZip library. 1268 * 1269 * This function should not be called directly, use `unzip_file()` instead. 1270 * 1260 1271 * Assumes that WP_Filesystem() has already been called and set up. 1261 1272 * 1262 1273 * @since 3.0.0 1263 * @see unzip_file 1274 * @see unzip_file() 1264 1275 * @access private 1265 1276 * 1266 * @global WP_Filesystem_Base $wp_filesystem Subclass1267 * 1268 * @param string $file Full path and filename of zip archive1269 * @param string $to Full path on the filesystem to extract archive to1277 * @global WP_Filesystem_Base $wp_filesystem subclass. 1278 * 1279 * @param string $file Full path and filename of ZIP archive. 1280 * @param string $to Full path on the filesystem to extract archive to. 1270 1281 * @param array $needed_dirs A partial list of required folders needed to be created. 1271 * @return mixed WP_Error on failure, True on success1282 * @return true|WP_Error True on success, WP_Error on failure. 1272 1283 */ 1273 1284 function _unzip_file_pclzip( $file, $to, $needed_dirs = array() ) { … … 1368 1379 1369 1380 /** 1370 * Copies a directory from one location to another via the WordPress Filesystem Abstraction. 1381 * Copies a directory from one location to another via the WordPress Filesystem 1382 * Abstraction. 1383 * 1371 1384 * Assumes that WP_Filesystem() has already been called and setup. 1372 1385 * 1373 1386 * @since 2.5.0 1374 1387 * 1375 * @global WP_Filesystem_Base $wp_filesystem Subclass1376 * 1377 * @param string $from source directory1378 * @param string $to destination directory1379 * @param array $skip_list a list of files/folders to skip copying1380 * @return mixed WP_Error on failure, True on success.1388 * @global WP_Filesystem_Base $wp_filesystem subclass. 1389 * 1390 * @param string $from Source directory. 1391 * @param string $to Destination directory. 1392 * @param array $skip_list A list of files/folders to skip copying. 1393 * @return true|WP_Error True on success, WP_Error on failure. 1381 1394 */ 1382 1395 function copy_dir( $from, $to, $skip_list = array() ) { … … 1427 1440 /** 1428 1441 * Initialises and connects the WordPress Filesystem Abstraction classes. 1442 * 1429 1443 * This function will include the chosen transport and attempt connecting. 1430 1444 * … … 1434 1448 * @since 2.5.0 1435 1449 * 1436 * @global WP_Filesystem_Base $wp_filesystem Subclass1450 * @global WP_Filesystem_Base $wp_filesystem subclass. 1437 1451 * 1438 1452 * @param array|false $args Optional. Connection args, These are passed directly to … … 1440 1454 * @param string|false $context Optional. Context for get_filesystem_method(). Default false. 1441 1455 * @param bool $allow_relaxed_file_ownership Optional. Whether to allow Group/World writable. Default false. 1442 * @return null|bool false on failure, true on success.1456 * @return bool|null True on success, false on failure, null if the filesystem method class file does not exist. 1443 1457 */ 1444 1458 function WP_Filesystem( $args = false, $context = false, $allow_relaxed_file_ownership = false ) { … … 1623 1637 * @param bool $allow_relaxed_file_ownership Optional. Whether to allow Group/World writable. Default false. 1624 1638 * 1625 * @return bool False on failure, true on success.1639 * @return bool True on success, false on failure. 1626 1640 */ 1627 1641 function request_filesystem_credentials( $form_post, $type = '', $error = false, $context = '', $extra_fields = null, $allow_relaxed_file_ownership = false ) {
Note: See TracChangeset
for help on using the changeset viewer.