[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

/wp-admin/includes/ -> class-wp-filesystem-base.php (summary)

Base WordPress Filesystem

File Size: 830 lines (23 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

WP_Filesystem_Base:: (39 methods):
  abspath()
  wp_content_dir()
  wp_plugins_dir()
  wp_themes_dir()
  wp_lang_dir()
  find_base_dir()
  get_base_dir()
  find_folder()
  search_for_folder()
  gethchmod()
  getchmod()
  getnumchmodfromh()
  is_binary()
  chown()
  connect()
  get_contents()
  get_contents_array()
  put_contents()
  cwd()
  chdir()
  chgrp()
  chmod()
  owner()
  group()
  copy()
  move()
  delete()
  exists()
  is_file()
  is_dir()
  is_readable()
  is_writable()
  atime()
  mtime()
  size()
  touch()
  mkdir()
  rmdir()
  dirlist()


Class: WP_Filesystem_Base  - X-Ref

Base WordPress Filesystem class which Filesystem implementations extend.

abspath()   X-Ref
Returns the path on the remote filesystem of ABSPATH.

since: 2.7.0
return: string The location of the remote path.

wp_content_dir()   X-Ref
Returns the path on the remote filesystem of WP_CONTENT_DIR.

since: 2.7.0
return: string The location of the remote path.

wp_plugins_dir()   X-Ref
Returns the path on the remote filesystem of WP_PLUGIN_DIR.

since: 2.7.0
return: string The location of the remote path.

wp_themes_dir( $theme = false )   X-Ref
Returns the path on the remote filesystem of the Themes Directory.

since: 2.7.0
return: string The location of the remote path.
param: string|false $theme Optional. The theme stylesheet or template for the directory.

wp_lang_dir()   X-Ref
Returns the path on the remote filesystem of WP_LANG_DIR.

since: 3.2.0
return: string The location of the remote path.

find_base_dir( $base = '.', $echo = false )   X-Ref
Locates a folder on the remote filesystem.

since: 2.5.0
return: string The location of the remote path.
param: string $base The folder to start searching from.
param: bool   $echo True to display debug information.

get_base_dir( $base = '.', $echo = false )   X-Ref
Locates a folder on the remote filesystem.

since: 2.5.0
return: string The location of the remote path.
param: string $base The folder to start searching from.
param: bool   $echo True to display debug information.

find_folder( $folder )   X-Ref
Locates a folder on the remote filesystem.

Assumes that on Windows systems, Stripping off the Drive
letter is OK Sanitizes \\ to / in Windows filepaths.

since: 2.7.0
return: string|false The location of the remote path, false on failure.
param: string $folder the folder to locate.

search_for_folder( $folder, $base = '.', $loop = false )   X-Ref
Locates a folder on the remote filesystem.

Expects Windows sanitized path.

since: 2.7.0
return: string|false The location of the remote path, false to cease looping.
param: string $folder The folder to locate.
param: string $base   The folder to start searching from.
param: bool   $loop   If the function has recursed, Internal use only.

gethchmod( $file )   X-Ref
Returns the *nix-style file permissions for a file.

From the PHP documentation page for fileperms().

since: 2.5.0
return: string The *nix-style representation of permissions.
param: string $file String filename.

getchmod( $file )   X-Ref
Gets the permissions of the specified file or filepath in their octal format.

since: 2.5.0
return: string Mode of the file (the last 3 digits).
param: string $file Path to the file.

getnumchmodfromh( $mode )   X-Ref
Converts *nix-style file permissions to a octal number.

Converts '-rw-r--r--' to 0644
From "info at rvgate dot nl"'s comment on the PHP documentation for chmod()

since: 2.5.0
return: int octal representation
param: string $mode string The *nix-style file permission.

is_binary( $text )   X-Ref
Determines if the string provided contains binary characters.

since: 2.7.0
return: bool True if string is binary, false otherwise.
param: string $text String to test against.

chown( $file, $owner, $recursive = false )   X-Ref
Changes the owner of a file or directory.

Default behavior is to do nothing, override this in your subclass, if desired.

since: 2.5.0
return: bool True on success, false on failure.
param: string     $file      Path to the file or directory.
param: string|int $owner     A user name or number.
param: bool       $recursive Optional. If set to true, changes file owner recursively.

connect()   X-Ref
Connects filesystem.

since: 2.5.0
return: bool True on success, false on failure (always true for WP_Filesystem_Direct).

get_contents( $file )   X-Ref
Reads entire file into a string.

since: 2.5.0
return: string|false Read data on success, false on failure.
param: string $file Name of the file to read.

get_contents_array( $file )   X-Ref
Reads entire file into an array.

since: 2.5.0
return: array|false File contents in an array on success, false on failure.
param: string $file Path to the file.

put_contents( $file, $contents, $mode = false )   X-Ref
Writes a string to a file.

since: 2.5.0
return: bool True on success, false on failure.
param: string    $file     Remote path to the file where to write the data.
param: string    $contents The data to write.
param: int|false $mode     Optional. The file permissions as octal number, usually 0644.

cwd()   X-Ref
Gets the current working directory.

since: 2.5.0
return: string|false The current working directory on success, false on failure.

chdir( $dir )   X-Ref
Changes current directory.

since: 2.5.0
return: bool True on success, false on failure.
param: string $dir The new current directory.

chgrp( $file, $group, $recursive = false )   X-Ref
Changes the file group.

since: 2.5.0
return: bool True on success, false on failure.
param: string     $file      Path to the file.
param: string|int $group     A group name or number.
param: bool       $recursive Optional. If set to true, changes file group recursively.

chmod( $file, $mode = false, $recursive = false )   X-Ref
Changes filesystem permissions.

since: 2.5.0
return: bool True on success, false on failure.
param: string    $file      Path to the file.
param: int|false $mode      Optional. The permissions as octal number, usually 0644 for files,
param: bool      $recursive Optional. If set to true, changes file group recursively.

owner( $file )   X-Ref
Gets the file owner.

since: 2.5.0
return: string|false Username of the owner on success, false on failure.
param: string $file Path to the file.

group( $file )   X-Ref
Gets the file's group.

since: 2.5.0
return: string|false The group on success, false on failure.
param: string $file Path to the file.

copy( $source, $destination, $overwrite = false, $mode = false )   X-Ref
Copies a file.

since: 2.5.0
return: bool True on success, false on failure.
param: string    $source      Path to the source file.
param: string    $destination Path to the destination file.
param: bool      $overwrite   Optional. Whether to overwrite the destination file if it exists.
param: int|false $mode        Optional. The permissions as octal number, usually 0644 for files,

move( $source, $destination, $overwrite = false )   X-Ref
Moves a file.

since: 2.5.0
return: bool True on success, false on failure.
param: string $source      Path to the source file.
param: string $destination Path to the destination file.
param: bool   $overwrite   Optional. Whether to overwrite the destination file if it exists.

delete( $file, $recursive = false, $type = false )   X-Ref
Deletes a file or directory.

since: 2.5.0
return: bool True on success, false on failure.
param: string       $file      Path to the file or directory.
param: bool         $recursive Optional. If set to true, changes file group recursively.
param: string|false $type      Type of resource. 'f' for file, 'd' for directory.

exists( $file )   X-Ref
Checks if a file or directory exists.

since: 2.5.0
return: bool Whether $file exists or not.
param: string $file Path to file or directory.

is_file( $file )   X-Ref
Checks if resource is a file.

since: 2.5.0
return: bool Whether $file is a file.
param: string $file File path.

is_dir( $path )   X-Ref
Checks if resource is a directory.

since: 2.5.0
return: bool Whether $path is a directory.
param: string $path Directory path.

is_readable( $file )   X-Ref
Checks if a file is readable.

since: 2.5.0
return: bool Whether $file is readable.
param: string $file Path to file.

is_writable( $file )   X-Ref
Checks if a file or directory is writable.

since: 2.5.0
return: bool Whether $file is writable.
param: string $file Path to file or directory.

atime( $file )   X-Ref
Gets the file's last access time.

since: 2.5.0
return: int|false Unix timestamp representing last access time, false on failure.
param: string $file Path to file.

mtime( $file )   X-Ref
Gets the file modification time.

since: 2.5.0
return: int|false Unix timestamp representing modification time, false on failure.
param: string $file Path to file.

size( $file )   X-Ref
Gets the file size (in bytes).

since: 2.5.0
return: int|false Size of the file in bytes on success, false on failure.
param: string $file Path to file.

touch( $file, $time = 0, $atime = 0 )   X-Ref
Sets the access and modification times of a file.

Note: If $file doesn't exist, it will be created.

since: 2.5.0
return: bool True on success, false on failure.
param: string $file  Path to file.
param: int    $time  Optional. Modified time to set for file.
param: int    $atime Optional. Access time to set for file.

mkdir( $path, $chmod = false, $chown = false, $chgrp = false )   X-Ref
Creates a directory.

since: 2.5.0
return: bool True on success, false on failure.
param: string     $path  Path for new directory.
param: int|false  $chmod Optional. The permissions as octal number (or false to skip chmod).
param: string|int $chown Optional. A user name or number (or false to skip chown).
param: string|int $chgrp Optional. A group name or number (or false to skip chgrp).

rmdir( $path, $recursive = false )   X-Ref
Deletes a directory.

since: 2.5.0
return: bool True on success, false on failure.
param: string $path      Path to directory.
param: bool   $recursive Optional. Whether to recursively remove files/directories.

dirlist( $path, $include_hidden = true, $recursive = false )   X-Ref
Gets details for files in a directory or a specific file.

since: 2.5.0
return: array|false {
param: string $path           Path to directory or file.
param: bool   $include_hidden Optional. Whether to include details of hidden ("." prefixed) files.
param: bool   $recursive      Optional. Whether to recursively include file details in nested directories.



Generated: Sun Sep 22 01:00:03 2019 Cross-referenced by PHPXref 0.7.1