aboutsummaryrefslogtreecommitdiffstats
path: root/includes/upload/UploadStashFile.php
Commit message (Collapse)AuthorAgeFilesLines
* Namespace all remaining files in includes/filerepoJames D. Forrester2025-03-191-0/+2
| | | | | Bug: T353458 Change-Id: I35864ad9bd48701703c51367d62f8ebde963c52d
* Replace isset() with null checksUmherirrender2024-12-191-1/+1
| | | | | | | | | isset() should only be used to suppress errors, not for null check. When the property is always defined, there is no need to use isset. Found by a new phan plugin (2efea9f989) https://www.mediawiki.org/wiki/Manual:Coding_conventions/PHP#isset Change-Id: Ib84b7d71e8308a36409f30ecfd16e9de149e97b3
* upload: Add missing documentation to class propertiesUmherirrender2024-09-041-0/+4
| | | | | | | | | | Add doc-typehints to class properties found by the PropertyDocumentation sniff to improve the documentation. Once the sniff is enabled it avoids that new code is missing type declarations. This is focused on documentation and does not change code. Change-Id: I07ce1f37d1bfb18d6e73dd008a712b3ca60a80e9
* Optimize AssembleUploadChunks to reuse SHA1 hash instead of recalcBrian Wolff2024-02-251-1/+17
| | | | | | | | | | | | AssembleUploadChunks was calculating the SHA1 hash of the same file 5 times in a row. Calculating SHA1 hashes can be somewhat expensive for multi-GB files, making the job slow, possibly to the point of a timeout. This change ensures that the SHA1 value is kept and reused when applicable so that the job will only calculate it once. Bug: T200820 Change-Id: I842814c7a2b7dc6e427e040c8dd4d43e7c7cabb4
* Namespace remaining 'specialpage' files under \MediaWiki\SpecialPageJames D. Forrester2023-09-181-0/+2
| | | | | | | SpecialPageFactory is already here, but none of the others were yet. Bug: T166010 Change-Id: I9689bf0a1ab329625e23669b99f019b96295fffd
* Use str_starts_with/str_ends_with/str_containsUmherirrender2022-12-121-1/+1
| | | | | | | Use the new function in conditions to avoid creating substrings or to search the whole string Change-Id: Ibad6b1b447a4f62cceb34359231f88ebb967a90b
* Fix various documentation related to falseUmherirrender2022-03-031-2/+2
| | | | | | | | | Some function already document "False on failure", but does not document it on the used type Found by phan strict checks Change-Id: I12eb8bbc99179833ee3e42c1a7d1dc1443682ca6
* Remove or replace usages of "sane"Reedy2021-11-221-1/+1
| | | | | Bug: T254646 Change-Id: I096b2cf738a1395a14f1d47bcbed0c2c686c2581
* Remove terminating line breaks from debug messagesTim Starling2020-06-031-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | A terminating line break has not been required in wfDebug() since 2014, however no migration was done. Some of these line breaks found their way into LoggerInterface::debug() calls, where they mess up the formatting of the debug log. So, remove terminating line breaks from wfDebug() and LoggerInterface::debug() calls. Also: * Fix the stripping of leading line breaks from the log header emitted by Setup.php. This feature, accidentally broken in 2014, allows requests to be distinguished in the log file. * Avoid using the global variable $self. * Move the logging of the client IP back to Setup.php. It was moved to WebRequest in the hopes that it would not always be needed, however $wgRequest->getIP() is now called unconditionally a few lines up in Setup.php. This means that it is put in its proper place after the "start request" message. * Wrap the log header code in a closure so that variables like $name do not leak into global scope. * In Linker.php, remove a few instances of an unnecessary second parameter to wfDebug(). Change-Id: I96651d3044a95b9d210b51cb8368edc76bebbb9e
* Add missing visibility on methods of upload related classesUmherirrender2020-05-101-1/+1
| | | | Change-Id: Idf7cbb6846b05e6eac8dddd4d160d00b9477ee10
* Move UploadStashFile to its own fileReedy2019-04-141-0/+211
Change-Id: I557bcd8369014bf2ea43c5eb8336562cb6295890