[wp-trac] [WordPress Trac] #10889: filesystem's put_content() methods have inconsistent arguments -- causes .maintenance file to not be created

WordPress Trac wp-trac at lists.automattic.com
Fri Oct 2 08:25:18 UTC 2009


#10889: filesystem's put_content() methods have inconsistent arguments -- causes
.maintenance file to not be created
-------------------------------+--------------------------------------------
 Reporter:  Denis-de-Bernardy  |       Owner:  dd32       
     Type:  defect (bug)       |      Status:  new        
 Priority:  normal             |   Milestone:  2.9        
Component:  Filesystem         |     Version:  2.8.4      
 Severity:  normal             |    Keywords:  needs-patch
-------------------------------+--------------------------------------------
Changes (by dd32):

  * keywords:  has-patch needs-testing => needs-patch


Comment:

 IMO, The items should be changed to the same signature as the Direct
 class.. Ie. ($file, $contents, $chmod = null, $filetype = null)


 ----


 As for that additional code you've added, I think its because you're using
 the class in a way that isnt expected.

 you do NOT pass a local path to the filesystem classes, You pass a remote
 path.

 ie. ABSPATH = /home/blah/wordpress/ Root in FTP = /wordpress/ All content
 should be referred to as  /wordpress/blahblahblah

 Use {{{$wp_filesystem->abspath()}}} and
 {{{$wp_filesystem->wp_content_dir()}}} instead, As the code in WordPress
 should already be using.

 The additional folder lookups are not worth it, Its incredibly IO/FTP
 hungry using that function, It should be avoided as much as possible, FTP
 isnt the most efficient protocol for lots of lookups.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/10889#comment:5>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list