[wp-trac] [WordPress Trac] #10913: optimizations are much needed in the FTP filesystem

WordPress Trac wp-trac at lists.automattic.com
Tue Oct 6 12:46:48 UTC 2009


#10913: optimizations are much needed in the FTP filesystem
-------------------------------+--------------------------------------------
 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:       
-------------------------------+--------------------------------------------

Comment(by dd32):

 Heres some code i use for debugging things (PHP5 only), requires you to
 rename the class you're debugging (dont forget the construct) but works
 nicely.

 {{{
 class WP_Filesystem_FTPext {
         var $a;
         var $handle;
         function __construct($args) {
                 $this->a = new _WP_Filesystem_FTPext($args);
                 $this->handle = fopen(ABSPATH . 'debug.txt', 'w+');
         }
         function __call($name, $args) {
                 fwrite($this->handle, 'Calling ' . $name . '(' .
 implode(', ', $args) . ') = ');
                 $res = call_user_func_array( array(&$this->a, $name),
 $args);
                 if ( is_bool($res) )
                         $hres = '(bool)' . ($res ? '1' : '0');
                 else
                         $hres = $res;
                 fwrite($this->handle, '<pre>' .
 htmlentities(print_r($hres, true)) . "\r\n\r\n\r\n</pre>");
                 return $res;
         }
         function __get($name) {
                 return $this->a->$name;
         }
         function __set($name, $value) {
                 return ($this->a->$name = $value);
         }
 }
 }}}

 You're right, some of the methods could definately use a cache, But
 sometimes the cache needs to be erased.

 I'd also suggest you try using trunk, i think theres been a few
 optimizations to certain parts..

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


More information about the wp-trac mailing list