]> scripts.mit.edu Git - autoinstalls/wordpress.git/blob - wp-admin/includes/class-wp-filesystem-base.php
WordPress 4.3.1-scripts
[autoinstalls/wordpress.git] / wp-admin / includes / class-wp-filesystem-base.php
1 <?php
2 /**
3  * Base WordPress Filesystem
4  *
5  * @package WordPress
6  * @subpackage Filesystem
7  */
8
9 /**
10  * Base WordPress Filesystem class for which Filesystem implementations extend
11  *
12  * @since 2.5.0
13  */
14 class WP_Filesystem_Base {
15         /**
16          * Whether to display debug data for the connection.
17          *
18          * @access public
19          * @since 2.5.0
20          * @var bool
21          */
22         public $verbose = false;
23
24         /**
25          * Cached list of local filepaths to mapped remote filepaths.
26          *
27          * @since 2.7.0
28          * @var array
29          */
30         public $cache = array();
31
32         /**
33          * The Access method of the current connection, Set automatically.
34          *
35          * @access public
36          * @since 2.5.0
37          * @var string
38          */
39         public $method = '';
40
41         public $errors = null;
42
43         public $options = array();
44
45         /**
46          * Return the path on the remote filesystem of ABSPATH.
47          *
48          * @access public
49          * @since 2.7.0
50          *
51          * @return string The location of the remote path.
52          */
53         public function abspath() {
54                 $folder = $this->find_folder(ABSPATH);
55                 // Perhaps the FTP folder is rooted at the WordPress install, Check for wp-includes folder in root, Could have some false positives, but rare.
56                 if ( ! $folder && $this->is_dir( '/' . WPINC ) )
57                         $folder = '/';
58                 return $folder;
59         }
60
61         /**
62          * Return the path on the remote filesystem of WP_CONTENT_DIR.
63          *
64          * @access public
65          * @since 2.7.0
66          *
67          * @return string The location of the remote path.
68          */
69         public function wp_content_dir() {
70                 return $this->find_folder(WP_CONTENT_DIR);
71         }
72
73         /**
74          * Return the path on the remote filesystem of WP_PLUGIN_DIR.
75          *
76          * @access public
77          * @since 2.7.0
78          *
79          * @return string The location of the remote path.
80          */
81         public function wp_plugins_dir() {
82                 return $this->find_folder(WP_PLUGIN_DIR);
83         }
84
85         /**
86          * Return the path on the remote filesystem of the Themes Directory.
87          *
88          * @access public
89          * @since 2.7.0
90          *
91          * @param string $theme The Theme stylesheet or template for the directory.
92          * @return string The location of the remote path.
93          */
94         public function wp_themes_dir( $theme = false ) {
95                 $theme_root = get_theme_root( $theme );
96
97                 // Account for relative theme roots
98                 if ( '/themes' == $theme_root || ! is_dir( $theme_root ) )
99                         $theme_root = WP_CONTENT_DIR . $theme_root;
100
101                 return $this->find_folder( $theme_root );
102         }
103
104         /**
105          * Return the path on the remote filesystem of WP_LANG_DIR.
106          *
107          * @access public
108          * @since 3.2.0
109          *
110          * @return string The location of the remote path.
111          */
112         public function wp_lang_dir() {
113                 return $this->find_folder(WP_LANG_DIR);
114         }
115
116         /**
117          * Locate a folder on the remote filesystem.
118          *
119          * @access public
120          * @since 2.5.0
121          * @deprecated 2.7.0 use WP_Filesystem::abspath() or WP_Filesystem::wp_*_dir() instead.
122          * @see WP_Filesystem::abspath()
123          * @see WP_Filesystem::wp_content_dir()
124          * @see WP_Filesystem::wp_plugins_dir()
125          * @see WP_Filesystem::wp_themes_dir()
126          * @see WP_Filesystem::wp_lang_dir()
127          *
128          * @param string $base The folder to start searching from.
129          * @param bool   $echo True to display debug information.
130          *                     Default false.
131          * @return string The location of the remote path.
132          */
133         public function find_base_dir( $base = '.', $echo = false ) {
134                 _deprecated_function(__FUNCTION__, '2.7', 'WP_Filesystem::abspath() or WP_Filesystem::wp_*_dir()' );
135                 $this->verbose = $echo;
136                 return $this->abspath();
137         }
138
139         /**
140          * Locate a folder on the remote filesystem.
141          *
142          * @access public
143          * @since 2.5.0
144          * @deprecated 2.7.0 use WP_Filesystem::abspath() or WP_Filesystem::wp_*_dir() methods instead.
145          * @see WP_Filesystem::abspath()
146          * @see WP_Filesystem::wp_content_dir()
147          * @see WP_Filesystem::wp_plugins_dir()
148          * @see WP_Filesystem::wp_themes_dir()
149          * @see WP_Filesystem::wp_lang_dir()
150          *
151          * @param string $base The folder to start searching from.
152          * @param bool   $echo True to display debug information.
153          * @return string The location of the remote path.
154          */
155         public function get_base_dir( $base = '.', $echo = false ) {
156                 _deprecated_function(__FUNCTION__, '2.7', 'WP_Filesystem::abspath() or WP_Filesystem::wp_*_dir()' );
157                 $this->verbose = $echo;
158                 return $this->abspath();
159         }
160
161         /**
162          * Locate a folder on the remote filesystem.
163          *
164          * Assumes that on Windows systems, Stripping off the Drive
165          * letter is OK Sanitizes \\ to / in windows filepaths.
166          *
167          * @access public
168          * @since 2.7.0
169          *
170          * @param string $folder the folder to locate.
171          * @return string|false The location of the remote path, false on failure.
172          */
173         public function find_folder( $folder ) {
174                 if ( isset( $this->cache[ $folder ] ) )
175                         return $this->cache[ $folder ];
176
177                 if ( stripos($this->method, 'ftp') !== false ) {
178                         $constant_overrides = array(
179                                 'FTP_BASE' => ABSPATH,
180                                 'FTP_CONTENT_DIR' => WP_CONTENT_DIR,
181                                 'FTP_PLUGIN_DIR' => WP_PLUGIN_DIR,
182                                 'FTP_LANG_DIR' => WP_LANG_DIR
183                         );
184
185                         // Direct matches ( folder = CONSTANT/ )
186                         foreach ( $constant_overrides as $constant => $dir ) {
187                                 if ( ! defined( $constant ) )
188                                         continue;
189                                 if ( $folder === $dir )
190                                         return trailingslashit( constant( $constant ) );
191                         }
192
193                         // Prefix Matches ( folder = CONSTANT/subdir )
194                         foreach ( $constant_overrides as $constant => $dir ) {
195                                 if ( ! defined( $constant ) )
196                                         continue;
197                                 if ( 0 === stripos( $folder, $dir ) ) { // $folder starts with $dir
198                                         $potential_folder = preg_replace( '#^' . preg_quote( $dir, '#' ) . '/#i', trailingslashit( constant( $constant ) ), $folder );
199                                         $potential_folder = trailingslashit( $potential_folder );
200
201                                         if ( $this->is_dir( $potential_folder ) ) {
202                                                 $this->cache[ $folder ] = $potential_folder;
203                                                 return $potential_folder;
204                                         }
205                                 }
206                         }
207                 } elseif ( 'direct' == $this->method ) {
208                         $folder = str_replace('\\', '/', $folder); // Windows path sanitisation
209                         return trailingslashit($folder);
210                 }
211
212                 $folder = preg_replace('|^([a-z]{1}):|i', '', $folder); // Strip out windows drive letter if it's there.
213                 $folder = str_replace('\\', '/', $folder); // Windows path sanitisation
214
215                 if ( isset($this->cache[ $folder ] ) )
216                         return $this->cache[ $folder ];
217
218                 if ( $this->exists($folder) ) { // Folder exists at that absolute path.
219                         $folder = trailingslashit($folder);
220                         $this->cache[ $folder ] = $folder;
221                         return $folder;
222                 }
223                 if ( $return = $this->search_for_folder($folder) )
224                         $this->cache[ $folder ] = $return;
225                 return $return;
226         }
227
228         /**
229          * Locate a folder on the remote filesystem.
230          *
231          * Expects Windows sanitized path.
232          *
233          * @since 2.7.0
234          *
235          * @param string $folder The folder to locate.
236          * @param string $base   The folder to start searching from.
237          * @param bool   $loop   If the function has recursed, Internal use only.
238          * @return string|false The location of the remote path, false to cease looping.
239          */
240         public function search_for_folder( $folder, $base = '.', $loop = false ) {
241                 if ( empty( $base ) || '.' == $base )
242                         $base = trailingslashit($this->cwd());
243
244                 $folder = untrailingslashit($folder);
245
246                 if ( $this->verbose )
247                         printf( "\n" . __('Looking for %1$s in %2$s') . "<br/>\n", $folder, $base );
248
249                 $folder_parts = explode('/', $folder);
250                 $folder_part_keys = array_keys( $folder_parts );
251                 $last_index = array_pop( $folder_part_keys );
252                 $last_path = $folder_parts[ $last_index ];
253
254                 $files = $this->dirlist( $base );
255
256                 foreach ( $folder_parts as $index => $key ) {
257                         if ( $index == $last_index )
258                                 continue; // We want this to be caught by the next code block.
259
260                         /*
261                          * Working from /home/ to /user/ to /wordpress/ see if that file exists within
262                          * the current folder, If it's found, change into it and follow through looking
263                          * for it. If it cant find WordPress down that route, it'll continue onto the next
264                          * folder level, and see if that matches, and so on. If it reaches the end, and still
265                          * cant find it, it'll return false for the entire function.
266                          */
267                         if ( isset($files[ $key ]) ){
268
269                                 // Let's try that folder:
270                                 $newdir = trailingslashit(path_join($base, $key));
271                                 if ( $this->verbose )
272                                         printf( "\n" . __('Changing to %s') . "<br/>\n", $newdir );
273
274                                 // Only search for the remaining path tokens in the directory, not the full path again.
275                                 $newfolder = implode( '/', array_slice( $folder_parts, $index + 1 ) );
276                                 if ( $ret = $this->search_for_folder( $newfolder, $newdir, $loop) )
277                                         return $ret;
278                         }
279                 }
280
281                 // Only check this as a last resort, to prevent locating the incorrect install. All above procedures will fail quickly if this is the right branch to take.
282                 if (isset( $files[ $last_path ] ) ) {
283                         if ( $this->verbose )
284                                 printf( "\n" . __('Found %s') . "<br/>\n",  $base . $last_path );
285                         return trailingslashit($base . $last_path);
286                 }
287
288                 // Prevent this function from looping again.
289                 // No need to proceed if we've just searched in /
290                 if ( $loop || '/' == $base )
291                         return false;
292
293                 // As an extra last resort, Change back to / if the folder wasn't found.
294                 // This comes into effect when the CWD is /home/user/ but WP is at /var/www/....
295                 return $this->search_for_folder( $folder, '/', true );
296
297         }
298
299         /**
300          * Return the *nix-style file permissions for a file.
301          *
302          * From the PHP documentation page for fileperms().
303          *
304          * @link http://docs.php.net/fileperms
305          *
306          * @access public
307          * @since 2.5.0
308          *
309          * @param string $file String filename.
310          * @return string The *nix-style representation of permissions.
311          */
312         public function gethchmod( $file ){
313                 $perms = intval( $this->getchmod( $file ), 8 );
314                 if (($perms & 0xC000) == 0xC000) // Socket
315                         $info = 's';
316                 elseif (($perms & 0xA000) == 0xA000) // Symbolic Link
317                         $info = 'l';
318                 elseif (($perms & 0x8000) == 0x8000) // Regular
319                         $info = '-';
320                 elseif (($perms & 0x6000) == 0x6000) // Block special
321                         $info = 'b';
322                 elseif (($perms & 0x4000) == 0x4000) // Directory
323                         $info = 'd';
324                 elseif (($perms & 0x2000) == 0x2000) // Character special
325                         $info = 'c';
326                 elseif (($perms & 0x1000) == 0x1000) // FIFO pipe
327                         $info = 'p';
328                 else // Unknown
329                         $info = 'u';
330
331                 // Owner
332                 $info .= (($perms & 0x0100) ? 'r' : '-');
333                 $info .= (($perms & 0x0080) ? 'w' : '-');
334                 $info .= (($perms & 0x0040) ?
335                                         (($perms & 0x0800) ? 's' : 'x' ) :
336                                         (($perms & 0x0800) ? 'S' : '-'));
337
338                 // Group
339                 $info .= (($perms & 0x0020) ? 'r' : '-');
340                 $info .= (($perms & 0x0010) ? 'w' : '-');
341                 $info .= (($perms & 0x0008) ?
342                                         (($perms & 0x0400) ? 's' : 'x' ) :
343                                         (($perms & 0x0400) ? 'S' : '-'));
344
345                 // World
346                 $info .= (($perms & 0x0004) ? 'r' : '-');
347                 $info .= (($perms & 0x0002) ? 'w' : '-');
348                 $info .= (($perms & 0x0001) ?
349                                         (($perms & 0x0200) ? 't' : 'x' ) :
350                                         (($perms & 0x0200) ? 'T' : '-'));
351                 return $info;
352         }
353
354         /**
355          * Gets the permissions of the specified file or filepath in their octal format
356          *
357          * @since 2.5.0
358          * @param string $file
359          * @return string the last 3 characters of the octal number
360          */
361         public function getchmod( $file ) {
362                 return '777';
363         }
364
365         /**
366          * Convert *nix-style file permissions to a octal number.
367          *
368          * Converts '-rw-r--r--' to 0644
369          * From "info at rvgate dot nl"'s comment on the PHP documentation for chmod()
370          *
371          * @link http://docs.php.net/manual/en/function.chmod.php#49614
372          *
373          * @access public
374          * @since 2.5.0
375          *
376          * @param string $mode string The *nix-style file permission.
377          * @return int octal representation
378          */
379         public function getnumchmodfromh( $mode ) {
380                 $realmode = '';
381                 $legal =  array('', 'w', 'r', 'x', '-');
382                 $attarray = preg_split('//', $mode);
383
384                 for ( $i = 0, $c = count( $attarray ); $i < $c; $i++ ) {
385                    if ($key = array_search($attarray[$i], $legal)) {
386                            $realmode .= $legal[$key];
387                    }
388                 }
389
390                 $mode = str_pad($realmode, 10, '-', STR_PAD_LEFT);
391                 $trans = array('-'=>'0', 'r'=>'4', 'w'=>'2', 'x'=>'1');
392                 $mode = strtr($mode,$trans);
393
394                 $newmode = $mode[0];
395                 $newmode .= $mode[1] + $mode[2] + $mode[3];
396                 $newmode .= $mode[4] + $mode[5] + $mode[6];
397                 $newmode .= $mode[7] + $mode[8] + $mode[9];
398                 return $newmode;
399         }
400
401         /**
402          * Determine if the string provided contains binary characters.
403          *
404          * @since 2.7.0
405          *
406          * @param string $text String to test against.
407          * @return bool true if string is binary, false otherwise.
408          */
409         public function is_binary( $text ) {
410                 return (bool) preg_match( '|[^\x20-\x7E]|', $text ); // chr(32)..chr(127)
411         }
412
413         /**
414          * Change the ownership of a file / folder.
415          *
416          * Default behavior is to do nothing, override this in your subclass, if desired.
417          *
418          * @since 2.5.0
419          *
420          * @param string $file      Path to the file.
421          * @param mixed  $owner     A user name or number.
422          * @param bool   $recursive Optional. If set True changes file owner recursivly. Defaults to False.
423          * @return bool Returns true on success or false on failure.
424          */
425         public function chown( $file, $owner, $recursive = false ) {
426                 return false;
427         }
428
429         /**
430          * Connect filesystem.
431          *
432          * @since 2.5.0
433          * @abstract
434          * @return bool True on success or false on failure (always true for WP_Filesystem_Direct).
435          */
436         public function connect() {
437                 return true;
438         }
439
440         /**
441          * Read entire file into a string.
442          *
443          * @since 2.5.0
444          * @abstract
445          * @param string $file Name of the file to read.
446          * @return mixed|bool Returns the read data or false on failure.
447          */
448         public function get_contents( $file ) {
449                 return false;
450         }
451
452         /**
453          * Read entire file into an array.
454          *
455          * @since 2.5.0
456          * @abstract
457          * @param string $file Path to the file.
458          * @return array|bool the file contents in an array or false on failure.
459          */
460         public function get_contents_array( $file ) {
461                 return false;
462         }
463
464         /**
465          * Write a string to a file.
466          *
467          * @since 2.5.0
468          * @abstract
469          * @param string $file     Remote path to the file where to write the data.
470          * @param string $contents The data to write.
471          * @param int    $mode     Optional. The file permissions as octal number, usually 0644.
472          * @return bool False on failure.
473          */
474         public function put_contents( $file, $contents, $mode = false ) {
475                 return false;
476         }
477
478         /**
479          * Get the current working directory.
480          *
481          * @since 2.5.0
482          * @abstract
483          * @return string|bool The current working directory on success, or false on failure.
484          */
485         public function cwd() {
486                 return false;
487         }
488
489         /**
490          * Change current directory.
491          *
492          * @since 2.5.0
493          * @abstract
494          * @param string $dir The new current directory.
495          * @return bool|string
496          */
497         public function chdir( $dir ) {
498                 return false;
499         }
500
501         /**
502          * Change the file group.
503          *
504          * @since 2.5.0
505          * @abstract
506          * @param string $file      Path to the file.
507          * @param mixed  $group     A group name or number.
508          * @param bool   $recursive Optional. If set True changes file group recursively. Defaults to False.
509          * @return bool|string
510          */
511         public function chgrp( $file, $group, $recursive = false ) {
512                 return false;
513         }
514
515         /**
516          * Change filesystem permissions.
517          *
518          * @since 2.5.0
519          * @abstract
520          * @param string $file      Path to the file.
521          * @param int    $mode      Optional. The permissions as octal number, usually 0644 for files, 0755 for dirs.
522          * @param bool   $recursive Optional. If set True changes file group recursively. Defaults to False.
523          * @return bool|string
524          */
525         public function chmod( $file, $mode = false, $recursive = false ) {
526                 return false;
527         }
528
529         /**
530          * Get the file owner.
531          *
532          * @since 2.5.0
533          * @abstract
534          * @param string $file Path to the file.
535          * @return string|bool Username of the user or false on error.
536          */
537         public function owner( $file ) {
538                 return false;
539         }
540
541         /**
542          * Get the file's group.
543          *
544          * @since 2.5.0
545          * @abstract
546          * @param string $file Path to the file.
547          * @return string|bool The group or false on error.
548          */
549         public function group( $file ) {
550                 return false;
551         }
552
553         /**
554          * Copy a file.
555          *
556          * @since 2.5.0
557          * @abstract
558          * @param string $source      Path to the source file.
559          * @param string $destination Path to the destination file.
560          * @param bool   $overwrite   Optional. Whether to overwrite the destination file if it exists.
561          *                            Default false.
562          * @param int    $mode        Optional. The permissions as octal number, usually 0644 for files, 0755 for dirs.
563          *                            Default false.
564          * @return bool True if file copied successfully, False otherwise.
565          */
566         public function copy( $source, $destination, $overwrite = false, $mode = false ) {
567                 return false;
568         }
569
570         /**
571          * Move a file.
572          *
573          * @since 2.5.0
574          * @abstract
575          * @param string $source      Path to the source file.
576          * @param string $destination Path to the destination file.
577          * @param bool   $overwrite   Optional. Whether to overwrite the destination file if it exists.
578          *                            Default false.
579          * @return bool True if file copied successfully, False otherwise.
580          */
581         public function move( $source, $destination, $overwrite = false ) {
582                 return false;
583         }
584
585         /**
586          * Delete a file or directory.
587          *
588          * @since 2.5.0
589          * @abstract
590          * @param string $file      Path to the file.
591          * @param bool   $recursive Optional. If set True changes file group recursively. Defaults to False.
592          *                          Default false.
593          * @param bool   $type      Type of resource. 'f' for file, 'd' for directory.
594          *                          Default false.
595          * @return bool True if the file or directory was deleted, false on failure.
596          */
597         public function delete( $file, $recursive = false, $type = false ) {
598                 return false;
599         }
600
601         /**
602          * Check if a file or directory exists.
603          *
604          * @since 2.5.0
605          * @abstract
606          * @param string $file Path to file/directory.
607          * @return bool Whether $file exists or not.
608          */
609         public function exists( $file ) {
610                 return false;
611         }
612
613         /**
614          * Check if resource is a file.
615          *
616          * @since 2.5.0
617          * @abstract
618          * @param string $file File path.
619          * @return bool Whether $file is a file.
620          */
621         public function is_file( $file ) {
622                 return false;
623         }
624
625         /**
626          * Check if resource is a directory.
627          *
628          * @since 2.5.0
629          * @abstract
630          * @param string $path Directory path.
631          * @return bool Whether $path is a directory.
632          */
633         public function is_dir( $path ) {
634                 return false;
635         }
636
637         /**
638          * Check if a file is readable.
639          *
640          * @since 2.5.0
641          * @abstract
642          * @param string $file Path to file.
643          * @return bool Whether $file is readable.
644          */
645         public function is_readable( $file ) {
646                 return false;
647         }
648
649         /**
650          * Check if a file or directory is writable.
651          *
652          * @since 2.5.0
653          * @abstract
654          * @return bool Whether $file is writable.
655          */
656         public function is_writable( $file ) {
657                 return false;
658         }
659
660         /**
661          * Gets the file's last access time.
662          *
663          * @since 2.5.0
664          * @abstract
665          * @param string $file Path to file.
666          * @return int|bool Unix timestamp representing last access time.
667          */
668         public function atime( $file ) {
669                 return false;
670         }
671
672         /**
673          * Gets the file modification time.
674          *
675          * @since 2.5.0
676          * @abstract
677          * @param string $file Path to file.
678          * @return int|bool Unix timestamp representing modification time.
679          */
680         public function mtime( $file ) {
681                 return false;
682         }
683
684         /**
685          * Gets the file size (in bytes).
686          *
687          * @since 2.5.0
688          * @abstract
689          * @param string $file Path to file.
690          * @return int|bool Size of the file in bytes.
691          */
692         public function size( $file ) {
693                 return false;
694         }
695
696         /**
697          * Set the access and modification times of a file.
698          *
699          * Note: If $file doesn't exist, it will be created.
700          *
701          * @since 2.5.0
702          * @abstract
703          * @param string $file  Path to file.
704          * @param int    $time  Optional. Modified time to set for file.
705          *                      Default 0.
706          * @param int    $atime Optional. Access time to set for file.
707          *                      Default 0.
708          * @return bool Whether operation was successful or not.
709          */
710         public function touch( $file, $time = 0, $atime = 0 ) {
711                 return false;
712         }
713
714         /**
715          * Create a directory.
716          *
717          * @since 2.5.0
718          * @abstract
719          * @param string $path  Path for new directory.
720          * @param mixed  $chmod Optional. The permissions as octal number, (or False to skip chmod)
721          *                      Default false.
722          * @param mixed  $chown Optional. A user name or number (or False to skip chown)
723          *                      Default false.
724          * @param mixed  $chgrp Optional. A group name or number (or False to skip chgrp).
725          *                      Default false.
726          * @return bool False if directory cannot be created, true otherwise.
727          */
728         public function mkdir( $path, $chmod = false, $chown = false, $chgrp = false ) {
729                 return false;
730         }
731
732         /**
733          * Delete a directory.
734          *
735          * @since 2.5.0
736          * @abstract
737          * @param string $path      Path to directory.
738          * @param bool   $recursive Optional. Whether to recursively remove files/directories.
739          *                          Default false.
740          * @return bool Whether directory is deleted successfully or not.
741          */
742         public function rmdir( $path, $recursive = false ) {
743                 return false;
744         }
745
746         /**
747          * Get details for files in a directory or a specific file.
748          *
749          * @since 2.5.0
750          * @abstract
751          *
752          * @param string $path           Path to directory or file.
753          * @param bool   $include_hidden Optional. Whether to include details of hidden ("." prefixed) files.
754          *                               Default true.
755          * @param bool   $recursive      Optional. Whether to recursively include file details in nested directories.
756          *                               Default false.
757          * @return array|bool {
758          *     Array of files. False if unable to list directory contents.
759          *
760          *     @type string $name        Name of the file/directory.
761          *     @type string $perms       *nix representation of permissions.
762          *     @type int    $permsn      Octal representation of permissions.
763          *     @type string $owner       Owner name or ID.
764          *     @type int    $size        Size of file in bytes.
765          *     @type int    $lastmodunix Last modified unix timestamp.
766          *     @type mixed  $lastmod     Last modified month (3 letter) and day (without leading 0).
767          *     @type int    $time        Last modified time.
768          *     @type string $type        Type of resource. 'f' for file, 'd' for directory.
769          *     @type mixed  $files       If a directory and $recursive is true, contains another array of files.
770          * }
771          */
772         public function dirlist( $path, $include_hidden = true, $recursive = false ) {
773                 return false;
774         }
775
776 } // WP_Filesystem_Base