Class WP_Filesystem_Direct

Description

WordPress Filesystem Class for direct PHP file and folder manipulation.

  • since: 2.5
  • uses: WP_Filesystem_Base - Extends class

Located in /ptests/samples/class-wp-filesystem-direct.php (line 18)

WP_Filesystem_Base
   |
   --WP_Filesystem_Direct
Variable Summary
 mixed $errors
Method Summary
 WP_Filesystem_Direct __construct (mixed $arg)
 void atime ( $file)
 bool chdir (string $dir)
 bool chgrp (string $file, mixed $group, [bool $recursive = false])
 bool chmod (string $file, [int $mode = false], [bool $recursive = false])
 bool chown (string $file, mixed $owner, [bool $recursive = false])
 bool connect ()
 void copy ( $source,  $destination, [ $overwrite = false], [ $mode = false])
 string|bool cwd ()
 void delete ( $file, [ $recursive = false], [ $type = false])
 void dirlist ( $path, [ $include_hidden = true], [ $recursive = false])
 void exists ( $file)
 string getchmod (string $file)
 string|bool get_contents (string $file)
 array|bool get_contents_array (string $file)
 void group ( $file)
 void is_dir ( $path)
 void is_file ( $file)
 void is_readable ( $file)
 void is_writable ( $file)
 void mkdir ( $path, [ $chmod = false], [ $chown = false], [ $chgrp = false])
 void move ( $source,  $destination, [ $overwrite = false])
 void mtime ( $file)
 string owner (string $file)
 bool put_contents (string $file, string $contents, [int $mode = false])
 void rmdir ( $path, [ $recursive = false])
 void size ( $file)
 void touch ( $file, [ $time = 0], [ $atime = 0])
Variables
mixed $errors = null (line 19)
Methods
Constructor __construct (line 25)

constructor

WP_Filesystem_Direct __construct (mixed $arg)
  • mixed $arg: ignored argument
atime (line 270)
void atime ( $file)
  • $file
chdir (line 87)

Change directory

  • return: Returns true on success or false on failure.
bool chdir (string $dir)
  • string $dir: The new current directory.
chgrp (line 98)

Changes file group

  • return: Returns true on success or false on failure.
bool chgrp (string $file, mixed $group, [bool $recursive = false])
  • string $file: Path to the file.
  • mixed $group: A group name or number.
  • bool $recursive: (optional) If set True changes file group recursivly. Defaults to False.
chmod (line 121)

Changes filesystem permissions

  • return: Returns true on success or false on failure.
bool chmod (string $file, [int $mode = false], [bool $recursive = false])
  • string $file: Path to the file.
  • int $mode: (optional) The permissions as octal number, usually 0644 for files, 0755 for dirs.
  • bool $recursive: (optional) If set True changes file group recursivly. Defaults to False.
chown (line 149)

Changes file owner

  • return: Returns true on success or false on failure.
bool chown (string $file, mixed $owner, [bool $recursive = false])
  • string $file: Path to the file.
  • mixed $owner: A user name or number.
  • bool $recursive: (optional) If set True changes file owner recursivly. Defaults to False.
connect (line 35)

connect filesystem.

  • return: Returns true on success or false on failure (always true for WP_Filesystem_Direct).
bool connect ()
copy (line 199)
void copy ( $source,  $destination, [ $overwrite = false], [ $mode = false])
  • $source
  • $destination
  • $overwrite
  • $mode
cwd (line 78)

Gets the current working directory

  • return: the current working directory on success, or false on failure.
string|bool cwd ()
delete (line 225)
void delete ( $file, [ $recursive = false], [ $type = false])
  • $file
  • $recursive
  • $type
dirlist (line 313)
void dirlist ( $path, [ $include_hidden = true], [ $recursive = false])
  • $path
  • $include_hidden
  • $recursive
exists (line 250)
void exists ( $file)
  • $file
getchmod (line 186)

Gets file permissions

FIXME does not handle errors in fileperms()

  • return: Mode of the file (last 4 digits).
string getchmod (string $file)
  • string $file: Path to the file.
get_contents (line 45)

Reads entire file into a string

  • return: The function returns the read data or false on failure.
string|bool get_contents (string $file)
  • string $file: Name of the file to read.
get_contents_array (line 54)

Reads entire file into an array

  • return: the file contents in an array or false on failure.
array|bool get_contents_array (string $file)
  • string $file: Path to the file.
group (line 189)
void group ( $file)
  • $file
is_dir (line 258)
void is_dir ( $path)
  • $path
is_file (line 254)
void is_file ( $file)
  • $file
is_readable (line 262)
void is_readable ( $file)
  • $file
is_writable (line 266)
void is_writable ( $file)
  • $file
mkdir (line 289)
void mkdir ( $path, [ $chmod = false], [ $chown = false], [ $chgrp = false])
  • $path
  • $chmod
  • $chown
  • $chgrp
move (line 209)
void move ( $source,  $destination, [ $overwrite = false])
  • $source
  • $destination
  • $overwrite
mtime (line 274)
void mtime ( $file)
  • $file
owner (line 169)

Gets file owner

  • return: Username of the user.
string owner (string $file)
  • string $file: Path to the file.
put_contents (line 65)

Write a string to a file

  • return: False upon failure.
bool put_contents (string $file, string $contents, [int $mode = false])
  • string $file: Remote path to the file where to write the data.
  • string $contents: The data to write.
  • int $mode: (optional) The file permissions as octal number, usually 0644.
rmdir (line 308)
void rmdir ( $path, [ $recursive = false])
  • $path
  • $recursive
size (line 277)
void size ( $file)
  • $file
touch (line 281)
void touch ( $file, [ $time = 0], [ $atime = 0])
  • $file
  • $time
  • $atime

Documentation generated on Thu, 29 Sep 2011 01:44:44 +0530 by phpDocumentor 1.4.3