Commit graph

22 commits

Author SHA1 Message Date
Reedy
9a913a1d21 Remove Windows PHP < 7.1 edgecase from FSFileBackend::getFeatures()
Change-Id: Ic849384ebd2195f8fc5ed58333374653d972f68c
2019-10-12 22:42:58 +01:00
Umherirrender
6c64f01c23 Fix spaces in doc comments
Change-Id: Ic404324003d40569d0ddb697c8b1bcf95f28e2ec
2019-09-12 21:45:18 +02:00
Aaron Schulz
e021adabb9 filebackend: remove unneeded is_dir() call in FSFileBackend::doCleanInternal()
Change-Id: Ia630e2052edd31f0d9b6ed7068497dc4ae66d917
2019-09-10 03:13:34 +00:00
jenkins-bot
cd898eb4ed Merge "filebackend: use self:: instead of FileBackend:: for some constant uses" 2019-09-08 14:38:17 +00:00
Aaron Schulz
e390198c4e filebackend: use self:: instead of FileBackend:: for some constant uses
Change-Id: Iae82a074ef9da3c36b34713d31ec65407d2a90b7
2019-09-08 14:15:19 +00:00
Aaron Schulz
417dea8e95 filebackend: optimize 'move' in FSFileBackend to avoid is_file() calls
Also, remove clearstatcache() call that is redundant with moveInternal()

Change-Id: I56e6c3d91427e7d0b49011f884b77daa5eb0b61c
2019-09-07 15:18:43 -07:00
Aaron Schulz
00e4420020 filebackend: optimize 'delete' for FSFileBackend to avoid is_file() calls
This also should reduce the chance of warnings due to race conditions

Change-Id: I06b6bcc5e0f009bb3d5135591d13ff098710a5b3
2019-09-07 15:06:28 -07:00
Aaron Schulz
28a23740d8 filebackend: optimize the chmod() calls in FSFileBackend
Bypass the calls in Windows to avoid the stat overhead. The file system
will almost always be NTFS, in which case it can't do anything since the
ACL model is totally different than that of Unix.

Add chmod calls to the existing command in FSFileOpHandle rather than
doing them all serially afterwards.

Use AtEase class for more simple error suppression cases.

Change-Id: Ib4fae9a1bf64c1a9dfde8debe724556633a5532c
2019-09-07 22:02:10 +00:00
Aaron Schulz
903f1810c8 filebackend: improve internal use of FileBackend constants
Add more result constants and split up FileBackend::UNKNOWN for
clarity. This follows up 5719815f3b, which added that constant.

Make internal FileBackendStore::doGet* methods distinguish I/O errors
from missing files; the return types of public FileBackend methods are
unchanged. Avoid process caching any mtime/size/sha1 values in the
case of I/O errors. Use error constants consistently for stat methods
when given invalid paths.

Also:
* Factor out FileBackendStore::processCacheAndPersistStatEntries() method
  to reduce significant code duplication.
* Consolidate duplicated isPathUsable() checks in FileOp subclasses to
  FileOp::precheck().
* Remove null process cache value check from FileBackend::getFileStat()
  as null values are never stored in the process cache to begin with.
* Reformat some oddly wrapped lines to look cleaner.

Change-Id: Id0e4b0da0bb2ed3184847b35142d587c7f3d953d
2019-09-03 19:31:17 -07:00
Aaron Schulz
5719815f3b filebackend: add idiom constant to FileBackend for null results
Change-Id: I65f043e87d82192c13d3627fb45ef222f0290bf8
2019-08-29 01:19:33 -07:00
Timo Tijhof
bebb26eb26 filebackend: Remove private handleWarning in favour of local closure
This is a pattern from before PHP 5.3, which we no longer need.

Change-Id: I886d1ded25ffe1ee12b6a3f8d48c04aa7dd2ef51
2019-08-23 20:37:45 +00:00
Aryeh Gregor
a83b33582a TempFSFileFactory service
This replaces TempFSFile::factory(), which is now deprecated.

Change-Id: I9e65c3867e26c16687560dccc7d9f3e195a8bdd6
2019-08-21 16:26:05 +03:00
Reedy
7f04a47d68 Split filebackend files to class per file
Change-Id: Idf9f4177fb9a523ce41227bda2af923bf418396b
2019-04-14 23:02:13 +01:00
Fomafix
9cbb8f104d Use https://www.php.net/ instead of https://secure.php.net/
Change-Id: I0acca592c6909e91b28b904da49dcbd6a43cd2a5
2019-04-12 06:44:48 +02:00
Kunal Mehta
cc5d9a92a2 build: Updating mediawiki/mediawiki-codesniffer to 24.0.0
Change-Id: I66b1775b7c1d36076d9ca78cbeb42787a743f2aa
2019-02-07 18:39:42 +00:00
Bartosz Dziewoński
485f66f174 Use PHP 7 '??' operator instead of '?:' with 'isset()' where convenient
Find: /isset\(\s*([^()]+?)\s*\)\s*\?\s*\1\s*:\s*/
Replace with: '\1 ?? '

(Everywhere except includes/PHPVersionCheck.php)
(Then, manually fix some line length and indentation issues)

Then manually reviewed the replacements for cases where confusing
operator precedence would result in incorrect results
(fixing those in I478db046a1cc162c6767003ce45c9b56270f3372).

Change-Id: I33b421c8cb11cdd4ce896488c9ff5313f03a38cf
2018-05-30 18:06:13 -07:00
Fomafix
d65ac78277 Replace HTTP by HTTPS
* https://www.unicode.org/ instead of http://www.unicode.org/ or
  http://unicode.org/
* https://secure.php.net/ instead of http://www.php.net/ or
  http://php.net/
* https://hhvm.com/ instead of http://hhvm.com/
* https://www.iis.net/ instead of http://www.iis.net/

Change-Id: I84d818a7e0ced5ffb9485ec89a75efb28a77c1e0
2018-05-22 12:14:14 +02:00
Brion Vibber
1b04c8a106 Support uploads with UTF-8 names on Windows
On PHP 7.1 and later, filesystem functions on Windows
use the Unicode system functions, which makes our file
handling work for non-ASCII file names.

Previously this was blacklisted for Windows on all PHP
versions. Versions before 7.1 will still reject Unicode
filenames with non-ASCII chars.

Bug: T3780
Change-Id: I94377faa5185f133be2dfb7b9b6aeacbd582834f
2017-10-03 23:13:33 +00:00
Aaron Schulz
82e2c924e4 Remove "@author Aaron Schulz" annotations
Bug: T139301
Change-Id: Ib5248e8e27d60611c7373bce4b29dd5e85aa3489
2017-06-27 15:24:14 -07:00
Kunal Mehta
a57b64436c Use wikimedia/timestamp
Bug: T100924
Depends-On: I0a067367cda6885fa45631ed7c18799d653dc9bf
Change-Id: I69ba64e364df8af089c1c918cdf32f99454e693a
2017-02-28 21:15:38 -08:00
Aaron Schulz
58f1016063 Fix IDEA warning in FSFileBackend
Change-Id: Ia46bffabde91fb22df11cf953c0199995a41cb91
2016-09-24 03:34:14 -07:00
Aaron Schulz
1bf0390fbd Move FSFilebackend and MemoryFileBackend to /libs
Change-Id: Id38a2ef9e0e22537d0267b536f8a4dfd60c5b41d
2016-09-24 00:10:27 +00:00
Renamed from includes/filebackend/FSFileBackend.php (Browse further)