<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[30678] trunk/src/wp-admin/includes: Improve various `@param` docs for `src/wp-admin/includes/class-wp-filesystem-*.php`.</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="https://core.trac.wordpress.org/changeset/30678">30678</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"https://core.trac.wordpress.org/changeset/30678","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>wonderboymusic</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2014-12-01 00:12:05 +0000 (Mon, 01 Dec 2014)</dd>
</dl>
<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Improve various `@param` docs for `src/wp-admin/includes/class-wp-filesystem-*.php`.
See <a href="https://core.trac.wordpress.org/ticket/30224">#30224</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpadminincludesclasswpfilesystembasephp">trunk/src/wp-admin/includes/class-wp-filesystem-base.php</a></li>
<li><a href="#trunksrcwpadminincludesclasswpfilesystemdirectphp">trunk/src/wp-admin/includes/class-wp-filesystem-direct.php</a></li>
<li><a href="#trunksrcwpadminincludesclasswpfilesystemftpextphp">trunk/src/wp-admin/includes/class-wp-filesystem-ftpext.php</a></li>
<li><a href="#trunksrcwpadminincludesclasswpfilesystemftpsocketsphp">trunk/src/wp-admin/includes/class-wp-filesystem-ftpsockets.php</a></li>
<li><a href="#trunksrcwpadminincludesclasswpfilesystemssh2php">trunk/src/wp-admin/includes/class-wp-filesystem-ssh2.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpadminincludesclasswpfilesystembasephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/class-wp-filesystem-base.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/class-wp-filesystem-base.php 2014-12-01 00:02:55 UTC (rev 30677)
+++ trunk/src/wp-admin/includes/class-wp-filesystem-base.php 2014-12-01 00:12:05 UTC (rev 30678)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -469,7 +469,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Connect filesystem.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.5.0
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- *
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @abstract
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return bool True on success or false on failure (always true for WP_Filesystem_Direct).
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function connect() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -480,9 +480,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Read entire file into a string.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.5.0
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- *
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @abstract
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $file Name of the file to read.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return string|bool Returns the read data or false on failure.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return mixed|bool Returns the read data or false on failure.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function get_contents( $file ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -492,7 +492,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Read entire file into an array.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.5.0
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- *
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @abstract
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $file Path to the file.
</span><span class="cx" style="display: block; padding: 0 10px"> * @return array|bool the file contents in an array or false on failure.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -504,7 +504,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Write a string to a file.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.5.0
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- *
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @abstract
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $file Remote path to the file where to write the data.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $contents The data to write.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $mode Optional. The file permissions as octal number, usually 0644.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -518,7 +518,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Get the current working directory.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.5.0
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- *
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @abstract
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return string|bool The current working directory on success, or false on failure.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function cwd() {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -529,7 +529,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Change current directory.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.5.0
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- *
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @abstract
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $dir The new current directory.
</span><span class="cx" style="display: block; padding: 0 10px"> * @return bool Returns true on success or false on failure.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -541,7 +541,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Change the file group.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.5.0
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- *
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @abstract
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $file Path to the file.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param mixed $group A group name or number.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param bool $recursive Optional. If set True changes file group recursively. Defaults to False.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -555,7 +555,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Change filesystem permissions.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.5.0
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- *
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @abstract
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $file Path to the file.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $mode Optional. The permissions as octal number, usually 0644 for files, 0755 for dirs.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param bool $recursive Optional. If set True changes file group recursively. Defaults to False.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -569,7 +569,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Get the file owner.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.5.0
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- *
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @abstract
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $file Path to the file.
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string|bool Username of the user or false on error.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -581,7 +581,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Get the file's group.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.5.0
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- *
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @abstract
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $file Path to the file.
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string|bool The group or false on error.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -593,7 +593,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Copy a file.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.5.0
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- *
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @abstract
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $source Path to the source file.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $destination Path to the destination file.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param bool $overwrite Optional. Whether to overwrite the destination file if it exists.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -610,7 +610,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Move a file.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.5.0
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- *
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @abstract
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $source Path to the source file.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $destination Path to the destination file.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param bool $overwrite Optional. Whether to overwrite the destination file if it exists.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -625,7 +625,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Delete a file or directory.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.5.0
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- *
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @abstract
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $file Path to the file.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param bool $recursive Optional. If set True changes file group recursively. Defaults to False.
</span><span class="cx" style="display: block; padding: 0 10px"> * Default false.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -641,7 +641,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Check if a file or directory exists.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.5.0
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- *
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @abstract
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $file Path to file/directory.
</span><span class="cx" style="display: block; padding: 0 10px"> * @return bool Whether $file exists or not.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -653,7 +653,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Check if resource is a file.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.5.0
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- *
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @abstract
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $file File path.
</span><span class="cx" style="display: block; padding: 0 10px"> * @return bool Whether $file is a file.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -665,7 +665,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Check if resource is a directory.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.5.0
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- *
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @abstract
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $path Directory path.
</span><span class="cx" style="display: block; padding: 0 10px"> * @return bool Whether $path is a directory.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -677,7 +677,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Check if a file is readable.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.5.0
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- *
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @abstract
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $file Path to file.
</span><span class="cx" style="display: block; padding: 0 10px"> * @return bool Whether $file is readable.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -689,8 +689,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Check if a file or directory is writable.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.5.0
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- *
- * @param string $path Path to file/directory.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @abstract
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return bool Whether $file is writable.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function is_writable( $file ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -701,9 +700,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Gets the file's last access time.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.5.0
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- *
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @abstract
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $file Path to file.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return int Unix timestamp representing last access time.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return int|bool Unix timestamp representing last access time.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function atime( $file ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -713,9 +712,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Gets the file modification time.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.5.0
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- *
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @abstract
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $file Path to file.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return int Unix timestamp representing modification time.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return int|bool Unix timestamp representing modification time.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function mtime( $file ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -725,9 +724,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Gets the file size (in bytes).
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.5.0
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- *
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @abstract
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $file Path to file.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @return int Size of the file in bytes.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @return int|bool Size of the file in bytes.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function size( $file ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -739,7 +738,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Note: If $file doesn't exist, it will be created.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.5.0
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- *
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @abstract
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $file Path to file.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $time Optional. Modified time to set for file.
</span><span class="cx" style="display: block; padding: 0 10px"> * Default 0.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -755,7 +754,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Create a directory.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.5.0
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- *
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @abstract
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $path Path for new directory.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param mixed $chmod Optional. The permissions as octal number, (or False to skip chmod)
</span><span class="cx" style="display: block; padding: 0 10px"> * Default false.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -773,7 +772,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Delete a directory.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.5.0
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- *
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @abstract
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $path Path to directory.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param bool $recursive Optional. Whether to recursively remove files/directories.
</span><span class="cx" style="display: block; padding: 0 10px"> * Default false.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -787,7 +786,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Get details for files in a directory or a specific file.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.5.0
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- *
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @abstract
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $path Path to directory or file.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param bool $include_hidden Optional. Whether to include details of hidden ("." prefixed) files.
</span><span class="cx" style="display: block; padding: 0 10px"> * Default true.
</span></span></pre></div>
<a id="trunksrcwpadminincludesclasswpfilesystemdirectphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/class-wp-filesystem-direct.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/class-wp-filesystem-direct.php 2014-12-01 00:02:55 UTC (rev 30677)
+++ trunk/src/wp-admin/includes/class-wp-filesystem-direct.php 2014-12-01 00:12:05 UTC (rev 30678)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -200,6 +200,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return substr( decoct( @fileperms( $file ) ), -3 );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $file
+ * @return string
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function group($file) {
</span><span class="cx" style="display: block; padding: 0 10px"> $gid = @filegroup($file);
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $gid )
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -210,6 +214,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return $grouparray['name'];
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $source
+ * @param string $destination
+ * @param bool $overwrite
+ * @param int $mode
+ * @return bool
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function copy($source, $destination, $overwrite = false, $mode = false) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $overwrite && $this->exists($destination) )
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -220,6 +231,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return $rtval;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $source
+ * @param string $destination
+ * @param bool $overwrite
+ * @return bool
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function move($source, $destination, $overwrite = false) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $overwrite && $this->exists($destination) )
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -236,6 +253,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $file
+ * @param bool $recursive
+ * @param string $type
+ * @return bool
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function delete($file, $recursive = false, $type = false) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( empty( $file ) ) // Some filesystems report this as /, which can cause non-expected recursive deletion of all files in the filesystem.
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -263,39 +286,74 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> return $retval;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $file
+ * @return bool
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function exists($file) {
</span><span class="cx" style="display: block; padding: 0 10px"> return @file_exists($file);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $file
+ * @return bool
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function is_file($file) {
</span><span class="cx" style="display: block; padding: 0 10px"> return @is_file($file);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $path
+ * @return bool
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function is_dir($path) {
</span><span class="cx" style="display: block; padding: 0 10px"> return @is_dir($path);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $file
+ * @return bool
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function is_readable($file) {
</span><span class="cx" style="display: block; padding: 0 10px"> return @is_readable($file);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $file
+ * @return bool
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function is_writable($file) {
</span><span class="cx" style="display: block; padding: 0 10px"> return @is_writable($file);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $file
+ * @return int
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function atime($file) {
</span><span class="cx" style="display: block; padding: 0 10px"> return @fileatime($file);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $file
+ * @return int
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function mtime($file) {
</span><span class="cx" style="display: block; padding: 0 10px"> return @filemtime($file);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $file
+ * @return int
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function size($file) {
</span><span class="cx" style="display: block; padding: 0 10px"> return @filesize($file);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $file
+ * @param int $time
+ * @param int $atime
+ * @return bool
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function touch($file, $time = 0, $atime = 0) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ($time == 0)
</span><span class="cx" style="display: block; padding: 0 10px"> $time = time();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -304,6 +362,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return @touch($file, $time, $atime);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $path
+ * @param mixed $chmod
+ * @param mixed $chown
+ * @param mixed $chgrp
+ * @return bool
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function mkdir($path, $chmod = false, $chown = false, $chgrp = false) {
</span><span class="cx" style="display: block; padding: 0 10px"> // Safe mode fails with a trailing slash under certain PHP versions.
</span><span class="cx" style="display: block; padding: 0 10px"> $path = untrailingslashit($path);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -323,10 +388,21 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return true;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $path
+ * @param bool $recursive
+ * @return type
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function rmdir($path, $recursive = false) {
</span><span class="cx" style="display: block; padding: 0 10px"> return $this->delete($path, $recursive);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $path
+ * @param bool $include_hidden
+ * @param bool $recursive
+ * @return bool|array
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function dirlist($path, $include_hidden = true, $recursive = false) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $this->is_file($path) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $limit_file = basename($path);
</span></span></pre></div>
<a id="trunksrcwpadminincludesclasswpfilesystemftpextphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/class-wp-filesystem-ftpext.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/class-wp-filesystem-ftpext.php 2014-12-01 00:02:55 UTC (rev 30677)
+++ trunk/src/wp-admin/includes/class-wp-filesystem-ftpext.php 2014-12-01 00:12:05 UTC (rev 30678)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -87,6 +87,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return true;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $file
+ * @return bool|string
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function get_contents( $file ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $tempfile = wp_tempnam($file);
</span><span class="cx" style="display: block; padding: 0 10px"> $temp = fopen($tempfile, 'w+');
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -108,10 +112,20 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return $contents;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $file
+ * @return array
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function get_contents_array($file) {
</span><span class="cx" style="display: block; padding: 0 10px"> return explode("\n", $this->get_contents($file));
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $file
+ * @param string $contents
+ * @param bool|string $mode
+ * @return bool
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function put_contents($file, $contents, $mode = false ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $tempfile = wp_tempnam($file);
</span><span class="cx" style="display: block; padding: 0 10px"> $temp = fopen( $tempfile, 'wb+' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -143,6 +157,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return $ret;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @return string
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function cwd() {
</span><span class="cx" style="display: block; padding: 0 10px"> $cwd = @ftp_pwd($this->link);
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $cwd )
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -150,14 +167,29 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return $cwd;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $dir
+ * @return bool
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function chdir($dir) {
</span><span class="cx" style="display: block; padding: 0 10px"> return @ftp_chdir($this->link, $dir);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $file
+ * @param bool $group
+ * @param bool $recursive
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function chgrp($file, $group, $recursive = false ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $file
+ * @param int $mode
+ * @param bool $recursive
+ * @return bool
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function chmod($file, $mode = false, $recursive = false) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $mode ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $this->is_file($file) )
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -181,21 +213,39 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return (bool)@ftp_chmod($this->link, $mode, $file);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $file
+ * @return string
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function owner($file) {
</span><span class="cx" style="display: block; padding: 0 10px"> $dir = $this->dirlist($file);
</span><span class="cx" style="display: block; padding: 0 10px"> return $dir[$file]['owner'];
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $file
+ * @return string
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function getchmod($file) {
</span><span class="cx" style="display: block; padding: 0 10px"> $dir = $this->dirlist($file);
</span><span class="cx" style="display: block; padding: 0 10px"> return $dir[$file]['permsn'];
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $file
+ * @return string
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function group($file) {
</span><span class="cx" style="display: block; padding: 0 10px"> $dir = $this->dirlist($file);
</span><span class="cx" style="display: block; padding: 0 10px"> return $dir[$file]['group'];
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ *
+ * @param string $source
+ * @param string $destination
+ * @param bool $overwrite
+ * @param string|bool $mode
+ * @return bool
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function copy($source, $destination, $overwrite = false, $mode = false) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $overwrite && $this->exists($destination) )
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -204,11 +254,21 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px"> return $this->put_contents($destination, $content, $mode);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $source
+ * @param string $destination
+ * @param bool $overwrite
+ * @return bool
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function move($source, $destination, $overwrite = false) {
</span><span class="cx" style="display: block; padding: 0 10px"> return ftp_rename($this->link, $source, $destination);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $file
+ * @param bool $recursive
+ * @param string $type
+ * @return bool
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function delete($file, $recursive = false, $type = false) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( empty($file) )
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -223,16 +283,25 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->delete( trailingslashit($file) . $delete_file['name'], $recursive, $delete_file['type'] );
</span><span class="cx" style="display: block; padding: 0 10px"> return @ftp_rmdir($this->link, $file);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $file
+ * @return bool
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function exists($file) {
</span><span class="cx" style="display: block; padding: 0 10px"> $list = @ftp_nlist($this->link, $file);
</span><span class="cx" style="display: block; padding: 0 10px"> return !empty($list); //empty list = no file, so invert.
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $file
+ * @return bool
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function is_file($file) {
</span><span class="cx" style="display: block; padding: 0 10px"> return $this->exists($file) && !$this->is_dir($file);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $path
+ * @return bool
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function is_dir($path) {
</span><span class="cx" style="display: block; padding: 0 10px"> $cwd = $this->cwd();
</span><span class="cx" style="display: block; padding: 0 10px"> $result = @ftp_chdir($this->link, trailingslashit($path) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -243,30 +312,56 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $file
+ * @return bool
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function is_readable($file) {
</span><span class="cx" style="display: block; padding: 0 10px"> return true;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $file
+ * @return bool
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function is_writable($file) {
</span><span class="cx" style="display: block; padding: 0 10px"> return true;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $file
+ * @return bool
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function atime($file) {
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $file
+ * @return int
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function mtime($file) {
</span><span class="cx" style="display: block; padding: 0 10px"> return ftp_mdtm($this->link, $file);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $file
+ * @return int
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function size($file) {
</span><span class="cx" style="display: block; padding: 0 10px"> return ftp_size($this->link, $file);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $file
+ * @return bool
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function touch($file, $time = 0, $atime = 0) {
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $path
+ * @param mixed $chmod
+ * @param mixed $chown
+ * @param mixed $chgrp
+ * @return bool
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function mkdir($path, $chmod = false, $chown = false, $chgrp = false) {
</span><span class="cx" style="display: block; padding: 0 10px"> $path = untrailingslashit($path);
</span><span class="cx" style="display: block; padding: 0 10px"> if ( empty($path) )
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -282,10 +377,20 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return true;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $path
+ * @param bool $recursive
+ * @return bool
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function rmdir($path, $recursive = false) {
</span><span class="cx" style="display: block; padding: 0 10px"> return $this->delete($path, $recursive);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @staticvar bool $is_windows
+ * @param string $line
+ * @return string
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function parselisting($line) {
</span><span class="cx" style="display: block; padding: 0 10px"> static $is_windows;
</span><span class="cx" style="display: block; padding: 0 10px"> if ( is_null($is_windows) )
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -359,6 +464,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return $b;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $path
+ * @param bool $include_hidden
+ * @param bool $recursive
+ * @return bool|array
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function dirlist($path = '.', $include_hidden = true, $recursive = false) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $this->is_file($path) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $limit_file = basename($path);
</span></span></pre></div>
<a id="trunksrcwpadminincludesclasswpfilesystemftpsocketsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/class-wp-filesystem-ftpsockets.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/class-wp-filesystem-ftpsockets.php 2014-12-01 00:02:55 UTC (rev 30677)
+++ trunk/src/wp-admin/includes/class-wp-filesystem-ftpsockets.php 2014-12-01 00:12:05 UTC (rev 30678)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -81,6 +81,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return true;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $file
+ * @return bool|string
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function get_contents( $file ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $this->exists($file) )
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -113,11 +117,20 @@
</span><span class="cx" style="display: block; padding: 0 10px"> unlink($temp);
</span><span class="cx" style="display: block; padding: 0 10px"> return $contents;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $file
+ * @return array
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function get_contents_array($file) {
</span><span class="cx" style="display: block; padding: 0 10px"> return explode("\n", $this->get_contents($file) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $file
+ * @param string $contents
+ * @param int|bool $mode
+ * @return bool
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function put_contents($file, $contents, $mode = false ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $temp = wp_tempnam( $file );
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $temphandle = @fopen($temp, 'w+') ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -163,10 +176,21 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return $this->ftp->chdir($file);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $file
+ * @param bool $group
+ * @param bool $recursive
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function chgrp($file, $group, $recursive = false ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $file
+ * @param int|bool $mode
+ * @param bool $recursive
+ * @return bool
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function chmod($file, $mode = false, $recursive = false ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $mode ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $this->is_file($file) )
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -188,21 +212,37 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return $this->ftp->chmod($file, $mode);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $file
+ * @return string
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function owner($file) {
</span><span class="cx" style="display: block; padding: 0 10px"> $dir = $this->dirlist($file);
</span><span class="cx" style="display: block; padding: 0 10px"> return $dir[$file]['owner'];
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $file
+ * @return string
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function getchmod($file) {
</span><span class="cx" style="display: block; padding: 0 10px"> $dir = $this->dirlist($file);
</span><span class="cx" style="display: block; padding: 0 10px"> return $dir[$file]['permsn'];
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $file
+ * @return string
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function group($file) {
</span><span class="cx" style="display: block; padding: 0 10px"> $dir = $this->dirlist($file);
</span><span class="cx" style="display: block; padding: 0 10px"> return $dir[$file]['group'];
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $source
+ * @param string $destination
+ * @param bool $overwrite
+ * @param int|bool $mode
+ * @return bool
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function copy($source, $destination, $overwrite = false, $mode = false) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $overwrite && $this->exists($destination) )
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -213,11 +253,21 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> return $this->put_contents($destination, $content, $mode);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $source
+ * @param string $destination
+ * @param bool $overwrite
+ * @return bool
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function move($source, $destination, $overwrite = false ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return $this->ftp->rename($source, $destination);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $file
+ * @param bool $recursive
+ * @param string $type
+ * @return bool
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function delete($file, $recursive = false, $type = false) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( empty($file) )
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -229,12 +279,20 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return $this->ftp->mdel($file);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $file
+ * @return bool
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function exists( $file ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $list = $this->ftp->nlist( $file );
</span><span class="cx" style="display: block; padding: 0 10px"> return !empty( $list ); //empty list = no file, so invert.
</span><span class="cx" style="display: block; padding: 0 10px"> // Return $this->ftp->is_exists($file); has issues with ABOR+426 responses on the ncFTPd server.
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $file
+ * @return bool
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function is_file($file) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $this->is_dir($file) )
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -243,6 +301,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $path
+ * @return bool
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function is_dir($path) {
</span><span class="cx" style="display: block; padding: 0 10px"> $cwd = $this->cwd();
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $this->chdir($path) ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -252,30 +314,62 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $file
+ * @return bool
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function is_readable($file) {
</span><span class="cx" style="display: block; padding: 0 10px"> return true;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $file
+ * @return bool
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function is_writable($file) {
</span><span class="cx" style="display: block; padding: 0 10px"> return true;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $file
+ * @return bool
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function atime($file) {
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $file
+ * @return int
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function mtime($file) {
</span><span class="cx" style="display: block; padding: 0 10px"> return $this->ftp->mdtm($file);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $file
+ * @return int
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function size($file) {
</span><span class="cx" style="display: block; padding: 0 10px"> return $this->ftp->filesize($file);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $file
+ * @param int $time
+ * @param int $atime
+ * @return bool
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function touch($file, $time = 0, $atime = 0 ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $path
+ * @param mixed $chmod
+ * @param mixed $chown
+ * @param mixed $chgrp
+ * @return bool
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function mkdir($path, $chmod = false, $chown = false, $chgrp = false ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $path = untrailingslashit($path);
</span><span class="cx" style="display: block; padding: 0 10px"> if ( empty($path) )
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -293,10 +387,20 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return true;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param sting $path
+ * @param bool $recursive
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function rmdir($path, $recursive = false ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->delete($path, $recursive);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $path
+ * @param bool $include_hidden
+ * @param bool $recursive
+ * @return bool|array
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function dirlist($path = '.', $include_hidden = true, $recursive = false ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $this->is_file($path) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $limit_file = basename($path);
</span></span></pre></div>
<a id="trunksrcwpadminincludesclasswpfilesystemssh2php"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/class-wp-filesystem-ssh2.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/class-wp-filesystem-ssh2.php 2014-12-01 00:02:55 UTC (rev 30677)
+++ trunk/src/wp-admin/includes/class-wp-filesystem-ssh2.php 2014-12-01 00:12:05 UTC (rev 30678)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -123,6 +123,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return true;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $command
+ * @param bool $returnbool
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function run_command( $command, $returnbool = false) {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $this->link )
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -144,16 +148,30 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $file
+ * @return string|false
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function get_contents( $file ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $file = ltrim($file, '/');
</span><span class="cx" style="display: block; padding: 0 10px"> return file_get_contents('ssh2.sftp://' . $this->sftp_link . '/' . $file);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $file
+ * @return array
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function get_contents_array($file) {
</span><span class="cx" style="display: block; padding: 0 10px"> $file = ltrim($file, '/');
</span><span class="cx" style="display: block; padding: 0 10px"> return file('ssh2.sftp://' . $this->sftp_link . '/' . $file);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $file
+ * @param string $contents
+ * @param int $mode
+ * @return bool
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function put_contents($file, $contents, $mode = false ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $ret = file_put_contents( 'ssh2.sftp://' . $this->sftp_link . '/' . ltrim( $file, '/' ), $contents );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -172,10 +190,19 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return $cwd;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $dir
+ * @return bool
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function chdir($dir) {
</span><span class="cx" style="display: block; padding: 0 10px"> return $this->run_command('cd ' . $dir, true);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $file
+ * @param bool $group
+ * @param bool $recursive
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function chgrp($file, $group, $recursive = false ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $this->exists($file) )
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -184,6 +211,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return $this->run_command(sprintf('chgrp -R %s %s', escapeshellarg($group), escapeshellarg($file)), true);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $file
+ * @param int $mode
+ * @param bool $recursive
+ * @return bool
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function chmod($file, $mode = false, $recursive = false) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $this->exists($file) )
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -208,9 +241,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since Unknown
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $file Path to the file.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @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.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param bool $owner A user name or number.
+ * @param bool $recursive Optional. If set True changes file owner recursivly. Defaults to False.
+ * @return bool|string Returns true on success or false on failure.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function chown( $file, $owner, $recursive = false ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $this->exists($file) )
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -220,6 +253,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return $this->run_command(sprintf('chown -R %s %s', escapeshellarg($owner), escapeshellarg($file)), true);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $file
+ * @return string|false
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function owner($file) {
</span><span class="cx" style="display: block; padding: 0 10px"> $owneruid = @fileowner('ssh2.sftp://' . $this->sftp_link . '/' . ltrim($file, '/'));
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $owneruid )
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -229,11 +266,18 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $ownerarray = posix_getpwuid($owneruid);
</span><span class="cx" style="display: block; padding: 0 10px"> return $ownerarray['name'];
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $file
+ * @return string
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function getchmod($file) {
</span><span class="cx" style="display: block; padding: 0 10px"> return substr( decoct( @fileperms( 'ssh2.sftp://' . $this->sftp_link . '/' . ltrim( $file, '/' ) ) ), -3 );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $file
+ * @return string|false
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function group($file) {
</span><span class="cx" style="display: block; padding: 0 10px"> $gid = @filegroup('ssh2.sftp://' . $this->sftp_link . '/' . ltrim($file, '/'));
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $gid )
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -244,6 +288,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return $grouparray['name'];
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $source
+ * @param string $destination
+ * @param bool $overwrite
+ * @param int|bool $mode
+ * @return bool
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function copy($source, $destination, $overwrite = false, $mode = false) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $overwrite && $this->exists($destination) )
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -253,10 +304,22 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return $this->put_contents($destination, $content, $mode);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $source
+ * @param string $destination
+ * @param bool $overwrite
+ * @return bool
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function move($source, $destination, $overwrite = false) {
</span><span class="cx" style="display: block; padding: 0 10px"> return @ssh2_sftp_rename( $this->sftp_link, $source, $destination );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $file
+ * @param bool $recursive
+ * @param string|bool $type
+ * @return bool
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function delete($file, $recursive = false, $type = false) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( 'f' == $type || $this->is_file($file) )
</span><span class="cx" style="display: block; padding: 0 10px"> return ssh2_sftp_unlink($this->sftp_link, $file);
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -271,50 +334,89 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return ssh2_sftp_rmdir($this->sftp_link, $file);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $file
+ * @return bool
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function exists($file) {
</span><span class="cx" style="display: block; padding: 0 10px"> $file = ltrim($file, '/');
</span><span class="cx" style="display: block; padding: 0 10px"> return file_exists('ssh2.sftp://' . $this->sftp_link . '/' . $file);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $file
+ * @return bool
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function is_file($file) {
</span><span class="cx" style="display: block; padding: 0 10px"> $file = ltrim($file, '/');
</span><span class="cx" style="display: block; padding: 0 10px"> return is_file('ssh2.sftp://' . $this->sftp_link . '/' . $file);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $path
+ * @return bool
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function is_dir($path) {
</span><span class="cx" style="display: block; padding: 0 10px"> $path = ltrim($path, '/');
</span><span class="cx" style="display: block; padding: 0 10px"> return is_dir('ssh2.sftp://' . $this->sftp_link . '/' . $path);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $file
+ * @return bool
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function is_readable($file) {
</span><span class="cx" style="display: block; padding: 0 10px"> $file = ltrim($file, '/');
</span><span class="cx" style="display: block; padding: 0 10px"> return is_readable('ssh2.sftp://' . $this->sftp_link . '/' . $file);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $file
+ * @return bool
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function is_writable($file) {
</span><span class="cx" style="display: block; padding: 0 10px"> $file = ltrim($file, '/');
</span><span class="cx" style="display: block; padding: 0 10px"> return is_writable('ssh2.sftp://' . $this->sftp_link . '/' . $file);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $file
+ * @return int
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function atime($file) {
</span><span class="cx" style="display: block; padding: 0 10px"> $file = ltrim($file, '/');
</span><span class="cx" style="display: block; padding: 0 10px"> return fileatime('ssh2.sftp://' . $this->sftp_link . '/' . $file);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $file
+ * @return int
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function mtime($file) {
</span><span class="cx" style="display: block; padding: 0 10px"> $file = ltrim($file, '/');
</span><span class="cx" style="display: block; padding: 0 10px"> return filemtime('ssh2.sftp://' . $this->sftp_link . '/' . $file);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $file
+ * @return int
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function size($file) {
</span><span class="cx" style="display: block; padding: 0 10px"> $file = ltrim($file, '/');
</span><span class="cx" style="display: block; padding: 0 10px"> return filesize('ssh2.sftp://' . $this->sftp_link . '/' . $file);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $file
+ * @param int $time
+ * @param int $atime
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function touch($file, $time = 0, $atime = 0) {
</span><span class="cx" style="display: block; padding: 0 10px"> //Not implemented.
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $path
+ * @param mixed $chmod
+ * @param mixed $chown
+ * @param mixed $chgrp
+ * @return bool
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function mkdir($path, $chmod = false, $chown = false, $chgrp = false) {
</span><span class="cx" style="display: block; padding: 0 10px"> $path = untrailingslashit($path);
</span><span class="cx" style="display: block; padding: 0 10px"> if ( empty($path) )
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -331,10 +433,21 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return true;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $path
+ * @param bool $recursive
+ * @return bool
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function rmdir($path, $recursive = false) {
</span><span class="cx" style="display: block; padding: 0 10px"> return $this->delete($path, $recursive);
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * @param string $path
+ * @param bool $include_hidden
+ * @param bool $recursive
+ * @return bool|array
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> public function dirlist($path, $include_hidden = true, $recursive = false) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $this->is_file($path) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $limit_file = basename($path);
</span></span></pre>
</div>
</div>
</body>
</html>