[wp-trac] [WordPress Trac] #26840: Bug in Filesystem API

WordPress Trac noreply at wordpress.org
Wed Jan 15 12:08:42 UTC 2014


#26840: Bug in Filesystem API
--------------------------+-----------------------
 Reporter:  DzeryCZ       |       Owner:
     Type:  defect (bug)  |      Status:  reopened
 Priority:  normal        |   Milestone:
Component:  Filesystem    |     Version:  3.8
 Severity:  normal        |  Resolution:
 Keywords:  filesystem    |
--------------------------+-----------------------
Changes (by DzeryCZ):

 * status:  closed => reopened
 * resolution:  invalid =>


Comment:

 Hello,

 I'm sorry, but here is some misunderstanding.
 My files are updated (on 3.8).

 In wp-admin/includes/file.php on line 864 is called
 $wp_filesystem->connect()
 But in wp-admin/includes/class-wp-filesystem-base.php connect() method
 missing (since 3.7).

 My code is:

 {{{
 global $wp_filesystem;

 $form_url = "themes.php?page=optionsframework";
 $method = 'direct';
 $form_url = wp_nonce_url($form_url, 'filesystem_demo_screen');

 if (false === ($creds = request_filesystem_credentials($form_url, $method,
 false, null, null))) {
  var_dump('Error');
 }

 WP_Filesystem($creds); // <---- In this function is called non-exist
 connect() method

 $target_dir = $wp_filesystem->find_folder($css_path);
 $target_file = trailingslashit($target_dir).$filename;
 $FileContent = $wp_filesystem->get_contents($target_file);
 var_dump($FileContent);
 }}}




 Replying to [comment:1 dd32]:
 > [https://core.trac.wordpress.org/browser/trunk/src/wp-admin/includes
 /class-wp-filesystem-direct.php#L17 WP_Filesystem_Direct extends
 WP_Filesystem_Base] which does include the connect method:
 [https://core.trac.wordpress.org/browser/trunk/src/wp-admin/includes
 /class-wp-filesystem-base.php#L416 class-wp-filesystem-base.php#L416]
 >
 > If you're seeing a PHP error, it seems that your `wp-admin/includes
 /class-wp-filesystem-base.php` file might be out of date, you'll need to
 try uploading a new copy of that file and try again.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/26840#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list