First pass at documenting the WP_Filesystem methods. This also introduces stubs of the methods into the base class which are documented, which subclasses can override, some methods were cleaned up at the same time.

See #18476 See #23122. Props kurtpayne, bananastalktome, and, DrewAPicture 


git-svn-id: https://develop.svn.wordpress.org/trunk@25560 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dion Hulse
2013-09-22 04:43:29 +00:00
parent f32eac7a75
commit 455b8d47a9
5 changed files with 458 additions and 92 deletions

View File

@@ -1,13 +1,6 @@
<?php
/**
* WordPress SSH2 Filesystem.
*
* @package WordPress
* @subpackage Filesystem
*/
/**
* WordPress Filesystem Class for implementing SSH2.
* WordPress Filesystem Class for implementing SSH2
*
* To use this class you must follow these steps for PHP 5.2.6+
*
@@ -35,10 +28,10 @@
*
* Note: as of WordPress 2.8, This utilises the PHP5+ function 'stream_get_contents'
*
* @since 2.7
* @since 2.7.0
*
* @package WordPress
* @subpackage Filesystem
* @uses WP_Filesystem_Base Extends class
*/
class WP_Filesystem_SSH2 extends WP_Filesystem_Base {
@@ -208,7 +201,17 @@ class WP_Filesystem_SSH2 extends WP_Filesystem_Base {
return $this->run_command(sprintf('chmod -R %o %s', $mode, escapeshellarg($file)), true);
}
function chown($file, $owner, $recursive = false ) {
/**
* Change the ownership of a file / folder.
*
* @since Unknown
*
* @param string $file Path to the file.
* @param mixed $owner A user name or number.
* @param bool $recursive Optional. If set True changes file owner recursivly. Defaults to False.
* @return bool Returns true on success or false on failure.
*/
function chown( $file, $owner, $recursive = false ) {
if ( ! $this->exists($file) )
return false;
if ( ! $recursive || ! $this->is_dir($file) )