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