Changeset 11499 for trunk/wp-admin/includes/file.php
- Timestamp:
- 05/31/2009 09:08:03 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/file.php
r11495 r11499 584 584 * @return unknown 585 585 */ 586 function WP_Filesystem( $args = false ) {586 function WP_Filesystem( $args = false, $context = false ) { 587 587 global $wp_filesystem; 588 588 589 589 require_once(ABSPATH . 'wp-admin/includes/class-wp-filesystem-base.php'); 590 590 591 $method = get_filesystem_method($args );591 $method = get_filesystem_method($args, $context); 592 592 593 593 if ( ! $method ) … … 626 626 * 627 627 * @param unknown_type $args 628 * @return unknown 629 */ 630 function get_filesystem_method($args = array()) { 628 * @param string $context Full path to the directory that is tested for being writable. 629 * @return unknown 630 */ 631 function get_filesystem_method($args = array(), $context = false) { 631 632 $method = defined('FS_METHOD') ? FS_METHOD : false; //Please ensure that this is either 'direct', 'ssh', 'ftpext' or 'ftpsockets' 632 633 633 634 if( ! $method && function_exists('getmyuid') && function_exists('fileowner') ){ 634 $temp_file_name = ABSPATH . '.' . time(); 635 if ( !$context ) 636 $context = WP_CONTENT_DIR; 637 $context = trailingslashit($context); 638 $temp_file_name = $context . '.write-test-' . time(); 635 639 $temp_handle = @fopen($temp_file_name, 'w'); 636 640 if ( $temp_handle ) { … … 658 662 * @return unknown 659 663 */ 660 function request_filesystem_credentials($form_post, $type = '', $error = false ) {661 $req_cred = apply_filters('request_filesystem_credentials', '', $form_post, $type, $error );664 function request_filesystem_credentials($form_post, $type = '', $error = false, $context = false) { 665 $req_cred = apply_filters('request_filesystem_credentials', '', $form_post, $type, $error, $context); 662 666 if ( '' !== $req_cred ) 663 667 return $req_cred; 664 668 665 669 if ( empty($type) ) 666 $type = get_filesystem_method( );670 $type = get_filesystem_method(array(), $context); 667 671 668 672 if ( 'direct' == $type )
Note: See TracChangeset
for help on using the changeset viewer.