Commit Graph

117 Commits

Author SHA1 Message Date
John Blackbourn
bd393654cc Filesystem API: Correct and improve the return type documentation for the dirlist() method in WP_Filesystem_Base and its extending classes.
Props mat-lipe, szepeviktor, costdev, audrasjb, johnbillion

Fixes #58229
See #57840

Built from https://develop.svn.wordpress.org/trunk@55714


git-svn-id: http://core.svn.wordpress.org/trunk@55226 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-05-03 21:30:19 +00:00
Sergey Biryukov
07b35de70a Filesystem API: Return false for empty paths in FTP ::exists() methods.
When `ftp_nlist()` receives an empty path, it checks the current working directory and may return `true`.

This affects:
* `WP_Filesystem_FTPext::exists()`
* `WP_Filesystem_ftpsockets::exists()`

As the purpose of the API is to provide a consistent interface for various filesystem implementations, this commit updates the affected methods to returns `false` when an empty path is provided, bringing consistency with the other filesystem abstraction classes, specifically `WP_Filesystem_Direct` and `WP_Filesystem_SSH2`.

Follow-up to [6779], [11821], [25274], [31815].

Props mkox, costdev, Zdrobau, dd32, pbiron, azaozz, mukesh27, SergeyBiryukov.
Fixes #33058.
Built from https://develop.svn.wordpress.org/trunk@55556


git-svn-id: http://core.svn.wordpress.org/trunk@55068 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-03-16 16:14:22 +00:00
Andrew Ozz
e3d1a1291f Filesystem API: Use trailingslashit( $path ) instead of $path . '/'. Fixes a warning when $path already ends with a slash.
Props: costdev, afragen, mukesh27.
Fixes: #57516.
Built from https://develop.svn.wordpress.org/trunk@55354


git-svn-id: http://core.svn.wordpress.org/trunk@54887 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-16 22:13:28 +00:00
Andrew Ozz
d5f8d02445 Docs: Document directory support in FTP/SSH2 filesystem ::move() methods.
Props: costdev, flixos90, audrasjb.
Fixes: #57604.
Built from https://develop.svn.wordpress.org/trunk@55205


git-svn-id: http://core.svn.wordpress.org/trunk@54738 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-03 01:59:15 +00:00
desrosj
4e492ffe61 Filesystem: Return FTP/FTP Sockets exists() methods to a previous state.
This partially reverts [53860] and [53862], which refactored the `exists()` method to rely on `ftp_rawlist()` instead of `ftp_nlist()`.

[53860] makes a similar attempt to the ones made in [33648] and [34733] (which were also reverted in [35944]). Being compliant with the specifications while continuing to work without issue for all FTP servers continues seem impossible. These little ghosts are the ones we’re scared of the most.

Props jsh4, afragen, costdev, pkolenbr, SergeyBiryukov, dd32, peterwilsoncc, gamecreature, desrosj.
Fixes #56966.
See #51170, #28013.
Built from https://develop.svn.wordpress.org/trunk@54815


git-svn-id: http://core.svn.wordpress.org/trunk@54367 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-11-11 15:55:13 +00:00
Sergey Biryukov
f8c9068b79 Upgrade/Install: Make WP_Filesystem_FTPext::size() return false on failure.
While `WP_Filesystem_Base::size()` is documented to return `false` on failure, `ftp_size()` returns -1, and the method documentation was recently updated to reflect that.

This commit restores the previous `@return` tag and corrects the actual return value instead, to bring consistency with all the other `WP_Filesystem_*::size()` methods:
* `WP_Filesystem_Base::size()`
* `WP_Filesystem_Direct::size()`
* `WP_Filesystem_ftpsockets::size()`
* `WP_Filesystem_SSH2::size()`
{{{
@return int|false Size of the file in bytes on success, false on failure.
}}}

This better matches the purpose of the API to provide a consistent interface for various filesystem implementations.

Follow-up to [6779], [30678], [45226], [53860], [53862].

Fixes #51170.
Built from https://develop.svn.wordpress.org/trunk@53898


git-svn-id: http://core.svn.wordpress.org/trunk@53457 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-08-16 13:41:14 +00:00
Sergey Biryukov
c3783c9f3a Coding Standards: Rename the $file parameter to $path in some WP_Filesystem_* methods.
This aims to bring more clarity to the code, and applies to methods where the path can be a file or a directory:

* `WP_Filesystem_*::exists()`
* `WP_Filesystem_*::is_writable()`

Follow-up to [6779], [25560].

See #55647.
Built from https://develop.svn.wordpress.org/trunk@53872


git-svn-id: http://core.svn.wordpress.org/trunk@53431 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-08-09 11:33:10 +00:00
Sergey Biryukov
7f0fc452b1 Docs: Improve @since notes for some WP_Filesystem_* methods:
* `WP_Filesystem_FTPext::exists()`
* `WP_Filesystem_FTPext::size()`
* `WP_Filesystem_ftpsockets::exists()`

The `::exists()` methods were previously using the FTP `NLST` command, which works for directories, but is not intended to be applied to a file. This only worked most of the time due to many FTP servers being permissive and allowing to execute `NLST` on files, which cannot be guaranteed and appears to not be the case in newer versions of Pure-FTPd (1.0.48 or later).

With a recent change in [53860], both methods were updated for compatibility with RFC 959:

* Both methods check if the path is a directory that can be changed into (and therefore exists).
* `WP_Filesystem_FTPext` uses `ftp_rawlist()` (FTP `LIST` command) to check for file existence.
* `WP_Filesystem_ftpsockets` uses file size to check for file existence.

Reference: [https://www.ietf.org/rfc/rfc959.txt RFC 959: File Transfer Protocol (FTP)]

Follow-up to [6779], [11821], [25274], [33648], [34733], [35944], [35946], [53860].

See #51170.
Built from https://develop.svn.wordpress.org/trunk@53862


git-svn-id: http://core.svn.wordpress.org/trunk@53421 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-08-08 17:14:13 +00:00
audrasjb
6a5506304e Filesystem: Rewrite FTP/FTP Sockets exists() methods to implement a more stable check.
WordPress FTP file checking was previously based upon `ftp_nlist()`. This function can be problematic at scale with a directory containing a large number of files. The same issue occurred using it with ftpsockets.

This changeset rewrites the FTP `exists()` functions to utilize a more efficient and stable check.

Props giox069, desrosj, mkox, afragen, costdev, pbiron, peterwilsoncc.
Fixes #51170.
See #53318, #39781.

Built from https://develop.svn.wordpress.org/trunk@53860


git-svn-id: http://core.svn.wordpress.org/trunk@53419 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-08-08 12:41:13 +00:00
Sergey Biryukov
4e0b801910 Coding Standards: Use MINUTE_IN_SECONDS where appropriate.
This aims to clarify the time units for some timeout or expiration values.

Follow-up to [11823], [13177], [21996], [37747].

See #55647.
Built from https://develop.svn.wordpress.org/trunk@53714


git-svn-id: http://core.svn.wordpress.org/trunk@53273 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-07-17 02:18:09 +00:00
John Blackbourn
39bff93b6b Docs: Various inline documentation corrections and improvements.
See #53399

Built from https://develop.svn.wordpress.org/trunk@52332


git-svn-id: http://core.svn.wordpress.org/trunk@51924 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-12-07 12:20:02 +00:00
Sergey Biryukov
e86e6f8771 Docs: Correct @return type for WP_Filesystem_Base::getnumchmodfromh().
Follow-up to [9117].

Props ankitmaru, johnbillion.
Fixes #53793.
Built from https://develop.svn.wordpress.org/trunk@51494


git-svn-id: http://core.svn.wordpress.org/trunk@51105 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-07-27 09:29:01 +00:00
Sergey Biryukov
a338f84f32 Coding Standards: Use strict comparison in wp-admin/includes/class-wp-filesystem-*.php.
See #52627.
Built from https://develop.svn.wordpress.org/trunk@50657


git-svn-id: http://core.svn.wordpress.org/trunk@50269 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-04-05 10:38:07 +00:00
John Blackbourn
b59c0f307b Docs: Corrections and improvements to types used in various docblocks.
See #51800, #52217

Built from https://develop.svn.wordpress.org/trunk@49936


git-svn-id: http://core.svn.wordpress.org/trunk@49635 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-01-05 17:16:11 +00:00
Sergey Biryukov
a5edb2a8a1 Filesystem API: Use correct variable when closing the file handle in WP_Filesystem_FTPext::get_contents().
Props gothick@gothick.org.uk.
Fixes #51029.
Built from https://develop.svn.wordpress.org/trunk@48797


git-svn-id: http://core.svn.wordpress.org/trunk@48559 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-08-15 20:56:02 +00:00
Sergey Biryukov
b16368c268 Docs: Remove @staticvar tags from core.
The tag was supported in phpDocumentor 1.x, but is no longer supported in 2.x and 3.x.

Usage of static variables is considered an internal implementation detail and has no information value for someone reading the docs.

Props alishanvr, jrf.
Fixes #50426.
Built from https://develop.svn.wordpress.org/trunk@48109


git-svn-id: http://core.svn.wordpress.org/trunk@47878 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-06-20 12:40:12 +00:00
Sergey Biryukov
527696af3b Coding Standards: Add some space around control structures in WP_Filesystem_* classes for consistency and better readability.
Additionally, synchronize `$tempfile` and `$temphandle` variable names in `WP_Filesystem_FTPext` and `WP_Filesystem_ftpsockets`.

See #49542.
Built from https://develop.svn.wordpress.org/trunk@48089


git-svn-id: http://core.svn.wordpress.org/trunk@47856 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-06-19 10:36:12 +00:00
Sergey Biryukov
7932193708 Coding Standards: Use strict comparison where static strings are involved.
This reduces the number of `WordPress.PHP.StrictComparisons.LooseComparison` issues in half, from 1897 to 890.

Includes minor code layout fixes for better readability.

See #49542.
Built from https://develop.svn.wordpress.org/trunk@47808


git-svn-id: http://core.svn.wordpress.org/trunk@47584 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-05-16 18:42:12 +00:00
Sergey Biryukov
641c632b0c Coding Standards: Use Yoda conditions where appropriate.
See #49222.
Built from https://develop.svn.wordpress.org/trunk@47219


git-svn-id: http://core.svn.wordpress.org/trunk@47019 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-02-09 16:55:09 +00:00
Sergey Biryukov
001ffe81fb Docs: Improve inline comments per the documentation standards.
Includes minor code layout fixes for better readability.

See #48303.
Built from https://develop.svn.wordpress.org/trunk@47122


git-svn-id: http://core.svn.wordpress.org/trunk@46922 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-01-29 00:45:18 +00:00
Sergey Biryukov
15a4289c8d Docs: Correct description for $recursive parameter of ::chmod() and ::delete() methods in WP_Filesystem implementations.
Props skithund.
Fixes #48422.
Built from https://develop.svn.wordpress.org/trunk@46679


git-svn-id: http://core.svn.wordpress.org/trunk@46479 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-11-08 22:56:02 +00:00
Sergey Biryukov
e199663322 I18N: Capitalize translator comments consistently, add trailing punctuation.
Includes minor code layout fixes.

See #44360.
Built from https://develop.svn.wordpress.org/trunk@45932


git-svn-id: http://core.svn.wordpress.org/trunk@45743 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-03 00:41:05 +00:00
Sergey Biryukov
16b8d91baa I18N: Improve translator comments.
* Add missing translator comments.
* Fix placement of some translator comments. Translator comments should be on the line directly above the line containing the translation function call for optimal compatibility with various `.pot` file generation tools. The CS auto-fixing, which changed some inconsistent function calls to multi-line function calls, is part of the reason why this was no longer the case for a select group of translator comments.

Includes minor code layout fixes.

Polyglots, rejoice! All WordPress core files now have translator comments for all strings with placeholders!

Props jrf, subrataemfluence, GaryJ, webdados, Dency, swissspidy, alvarogois, marcomartins, mihaiiceyro, vladwtz, niq1982, flipkeijzer, michielatyoast, chandrapatel, thrijith, joshuanoyce, FesoVik, tessak22, bhaktirajdev, cleancoded, dhavalkasvala, garrett-eclipse, bibliofille, socalchristina, priyankkpatel, 5hel2l2y, adamsilverstein, JeffPaul, pierlo, SergeyBiryukov.
Fixes #44360.
Built from https://develop.svn.wordpress.org/trunk@45926


git-svn-id: http://core.svn.wordpress.org/trunk@45737 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-09-01 17:13:59 +00:00
Aaron Jorbin
c377191858 PHP 7.4 compatibility fix / accessing arrays/string using curly brace syntax
PHP used to allow both square brackets and curly braces to be used interchangeably for accessing array elements and string offsets. The curly bracket syntax is only allowed in a limited set of cases and can be confusing for people not used to it.
PHP 7.4 will deprecate the curly brace syntax for accessing array elements and string offsets and it is expected that support will be completely removed in PHP 8.0.
Ref: https://wiki.php.net/rfc/deprecate_curly_braces_array_access

See #47751.
Props jrf.


Built from https://develop.svn.wordpress.org/trunk@45730


git-svn-id: http://core.svn.wordpress.org/trunk@45541 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-08-03 20:21:55 +00:00
Gary Pendergast
abcbee954f Coding Standards: Fix instances of WordPress.PHP.NoSilencedErrors.Discouraged.
Noteable changes:
- The `magic_quotes_runtime` and `magic_quotes_sybase` settings were removed in PHP 5.4, so no longer need to be set.
- Some functions that use external libraries can generate errors that can't be tested for, so are globally allowed to silence errors.
- Quite a few functions would cause errors if `safe_mode` was set. This setting was removed in PHP 5.4.
- Only a handful of `header()` calls needed corresponding `headers_sent()` checks for unit tests to pass, but more may need to be added as the nightlies builds are tested.

See #46732.

Built from https://develop.svn.wordpress.org/trunk@45611


git-svn-id: http://core.svn.wordpress.org/trunk@45422 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-07-09 05:45:58 +00:00
Gary Pendergast
cf3fa9f7c8 Coding Standards: Fix the Squiz.PHP.DisallowMultipleAssignments violations in wp-admin.
See #47632.


Built from https://develop.svn.wordpress.org/trunk@45583


git-svn-id: http://core.svn.wordpress.org/trunk@45394 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-07-01 12:52:01 +00:00
Sergey Biryukov
c77e771c84 Date/Time: Replace all instances of date() with gmdate().
Use of `date()` in core depends on PHP timezone set to UTC and not changed by third party code (which cannot be guaranteed).

`gmdate()` is functionally equivalent, but is not affected by PHP timezone setting: it's always UTC, which is the exact behavior the core needs.

Props nielsdeblaauw, Rarst.
Fixes #46438. See #44491.
Built from https://develop.svn.wordpress.org/trunk@45424


git-svn-id: http://core.svn.wordpress.org/trunk@45235 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-05-26 00:12:54 +00:00
Sergey Biryukov
74e9c3d20d Docs: Improve documentation for various WP_Filesystem_Base methods and extending classes.
Props jaydeep-rami, man4toman, SaeedFard, mukesh27, mohadeseghasemi, ebrahimzadeh, juiiee8487, SergeyBiryukov.
Fixes #42227, #46806, #46840. See #46543.
Built from https://develop.svn.wordpress.org/trunk@45226


git-svn-id: http://core.svn.wordpress.org/trunk@45035 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-04-17 04:13:51 +00:00
Gary Pendergast
aaf99e6913 Code is Poetry.
WordPress' code just... wasn't.
This is now dealt with.

Props jrf, pento, netweb, GaryJ, jdgrimes, westonruter, Greg Sherwood from PHPCS, and everyone who's ever contributed to WPCS and PHPCS.
Fixes #41057.


Built from https://develop.svn.wordpress.org/trunk@42343


git-svn-id: http://core.svn.wordpress.org/trunk@42172 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-11-30 23:11:00 +00:00
Drew Jaynes
1a28ec87e1 Docs: Remove @access notations from method DocBlocks in wp-admin/* classes.
Prior to about 2013, many class methods lacked even access modifiers which made the `@access` notations that much more useful. Now that we've gotten to a point where the codebase is more mature from a maintenance perspective and we can finally remove these notations. Notable exceptions to this change include standalone functions notated as private as well as some classes still considered to represent "private" APIs.

See #41452.

Built from https://develop.svn.wordpress.org/trunk@41161


git-svn-id: http://core.svn.wordpress.org/trunk@41001 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-27 00:40:43 +00:00
Drew Jaynes
1d95dcfa2c Docs: Remove superfluous @package WordPress and @subpackage notations used outside of file headers in a variety of core files.
Per the inline documentation standards for PHP, there should only be one `@package` and/or `@subpackage` notation per file, and only in the file header.

See #41017.

Built from https://develop.svn.wordpress.org/trunk@40988


git-svn-id: http://core.svn.wordpress.org/trunk@40838 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-07-01 16:58:42 +00:00
Dominik Schilling
d59bcc98df Filesystem API: Cleanup temporary file when the temporary file couldn't be opened.
Props ruud@joyo.
See #34772.
Fixes #36942, #36943.
Built from https://develop.svn.wordpress.org/trunk@38094


git-svn-id: http://core.svn.wordpress.org/trunk@38035 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-07-18 19:43:30 +00:00
Dion Hulse
bda1b2ace9 Filesystem: Revert [33648] and [34733] unfortunately these have caused issues for some servers, while fixing it for others.
See #28013

Fixes #34976 for trunk
Fixes #34976 for trunk

Built from https://develop.svn.wordpress.org/trunk@35944


git-svn-id: http://core.svn.wordpress.org/trunk@35908 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-12-15 02:36:28 +00:00
Dion Hulse
70e9f5b543 Upgrader: FTP: Cleanup temporary files during FTP download failures.
Props ruud@joyo
Fixes #34772

Built from https://develop.svn.wordpress.org/trunk@35777


git-svn-id: http://core.svn.wordpress.org/trunk@35741 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-12-06 17:07:25 +00:00
Sergey Biryukov
a7c5161db1 I18N: Add translator comments for strings in wp-admin/includes/class-wp-filesystem-ftpext.php.
See #34684.
Built from https://develop.svn.wordpress.org/trunk@35663


git-svn-id: http://core.svn.wordpress.org/trunk@35627 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-11-18 17:22:27 +00:00
Scott Taylor
e4a2e0c4a9 Filesystem: in WP_Filesystem_FTPext::parselisting(), check for the existence of $b['islink'] before using it.
Props jesin.
Fixes #27975.

Built from https://develop.svn.wordpress.org/trunk@35476


git-svn-id: http://core.svn.wordpress.org/trunk@35440 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-31 20:17:24 +00:00
Dion Hulse
731b51ee7f Updates: Try a more compatible method to detect if a file exists when using the FTP Extension.
This change causes it to list the parent directories files, and assets that the node exists within the returned listing, this is a little more compatible than relying upon the FTP server to correctly filter the returned resultset to the specific file/node being requested.
Fixes #28013

Built from https://develop.svn.wordpress.org/trunk@34733


git-svn-id: http://core.svn.wordpress.org/trunk@34697 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-10-01 05:09:25 +00:00
Drew Jaynes
fbb6ef1922 Docs: Add a summary, version, and parameter and return descriptions to the DocBlock for WP_Filesystem_FTPext::get_contents().
Also reverses the return types as `string` is expected, `false` is the outlier.

See [30978].

See #30989. See #32246.

Built from https://develop.svn.wordpress.org/trunk@34493


git-svn-id: http://core.svn.wordpress.org/trunk@34457 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-24 14:11:26 +00:00
Scott Taylor
b8c37073d8 Add @access docs to class-wp-filesystem-* files.
Props wenthemes.
Fixes #33725.

Built from https://develop.svn.wordpress.org/trunk@33984


git-svn-id: http://core.svn.wordpress.org/trunk@33953 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-09-10 01:21:24 +00:00
Dion Hulse
a32d83586e Upgrades: When upgrading via FTP, use LIST -a to detect if a file exists.
`LIST` & `NLST` by default on some servers require the `-a` flag to view hidden files (ie. `.maintenance`)
Although we could simply pass the `-a` flag to `NLST`, opting to use `LIST` which we use elsewhere should mean less chance of server incompatibilities.

Props jcroucher.
Fixes #28013.

Built from https://develop.svn.wordpress.org/trunk@33648


git-svn-id: http://core.svn.wordpress.org/trunk@33615 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-08-19 12:38:25 +00:00
Dion Hulse
8f47efe7dc WP Filesystem: Correctly parse the permissions field in the directory listings, and actually set it in FTP environments
Props mnelson4 for initial patch.
Fixes #29548

Built from https://develop.svn.wordpress.org/trunk@32923


git-svn-id: http://core.svn.wordpress.org/trunk@32894 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-06-24 04:49:25 +00:00
Scott Taylor
6a08b00632 Add @access annotations to methods that have no doc block in wp-admin/includes/*.
Makes it easier to search for no doc blocks via `}[\n\t\r ]+(protected|private|public)`.

See #32444.

Built from https://develop.svn.wordpress.org/trunk@32656


git-svn-id: http://core.svn.wordpress.org/trunk@32626 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-05-29 21:32:24 +00:00
Scott Taylor
c6a4512b1b Add missing doc blocks to wp-admin/includes/*.
Fix some egregious uses of tabbing.
Some functions can simply return `apply_filters(...)` instead of setting a variable that is immediately returned.

See #32444.

Built from https://develop.svn.wordpress.org/trunk@32654


git-svn-id: http://core.svn.wordpress.org/trunk@32624 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-05-29 20:17:26 +00:00
Scott Taylor
19a3aacc94 Add @static* annotations where they are missing.
Initialize all static vars that are not, most to `null`.

See #32444.

Built from https://develop.svn.wordpress.org/trunk@32650


git-svn-id: http://core.svn.wordpress.org/trunk@32620 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-05-29 15:43:29 +00:00
Dominik Schilling
9b79c36713 WP_Filesystem: Change WP_Filesystem_FTPext::exists() and WP_Filesystem_ftpsockets::exists() to return true for empty directories.
Both methods are using *nlist() which returns a list of files in a given directory or the file itself for a given file. If the result was an empty list we assumed that the file doesn't exists. This includes also cases where $file is actually an empty directory. To prevent this we now check if $file is a directory before returning the result of an empty list.
Other filesystem methods are using `file_exists()` which already checks whether a file or directory exists.

fixes #30815.
Built from https://develop.svn.wordpress.org/trunk@31815


git-svn-id: http://core.svn.wordpress.org/trunk@31797 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-03-18 19:22:27 +00:00
Scott Taylor
6fa7021d62 Calling ->chown() and ->chgrp() in WP_Filesystem_FTPext produces no side-effects. Remove the calls. ->chgrp() is defined in the super class, and does nothing, can be removed from the child class.
See #30799.

Built from https://develop.svn.wordpress.org/trunk@31215


git-svn-id: http://core.svn.wordpress.org/trunk@31196 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-16 21:07:24 +00:00
Scott Taylor
895794f74d In WP_Filesystem_Base subclasses that set $wp_base, remove this dead code.
Unused since [8009] - "Make WP_Filesystem work with new directory constants"

There is currently no declared field and no `@property` annotation.

See #30799.

Built from https://develop.svn.wordpress.org/trunk@31209


git-svn-id: http://core.svn.wordpress.org/trunk@31190 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-16 17:23:22 +00:00
Scott Taylor
b29a20b90a WP_Filesystem_Base should declare $errors and $options as fields for use by subclasses.
See #30799.

Built from https://develop.svn.wordpress.org/trunk@31208


git-svn-id: http://core.svn.wordpress.org/trunk@31189 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-16 17:10:43 +00:00
Scott Taylor
da99d29a59 Adding a @return annotation to constructors is generally not recommended as a constructor does not have a meaningful return value - anything that is returned is discarded.
See #30799.

Built from https://develop.svn.wordpress.org/trunk@31125


git-svn-id: http://core.svn.wordpress.org/trunk@31106 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2015-01-10 06:13:22 +00:00
Scott Taylor
574fabf2bc Improve some wp-admin/includes/class-wp-filesystem-*.php docs for @param.
See #30799.

Built from https://develop.svn.wordpress.org/trunk@30978


git-svn-id: http://core.svn.wordpress.org/trunk@30964 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-12-20 20:40:23 +00:00