aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Files/Cache/Scanner.php
Commit message (Collapse)AuthorAgeFilesLines
* fix: Harden files scanner for invalid null accessFerdinand Thiessen2025-01-281-129/+117
| | | | | | Co-authored-by: Ferdinand Thiessen <opensource@fthiessen.de> Co-authored-by: Kate <26026535+provokateurin@users.noreply.github.com> Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
* chore(deps): Update nextcloud/coding-standard to v1.3.1provokateurin2024-09-191-1/+1
| | | | Signed-off-by: provokateurin <kate@provokateurin.de>
* chore: Fix psalm issues, put back private versions of getter in private ↵Côme Chilliet2024-09-161-6/+7
| | | | | | Storage interface Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Merge pull request #45172 from nextcloud/test-scanner-no-transactionsRobin Appelman2024-06-131-1/+5
|\ | | | | feat: add option to disable scanner transactions
| * feat: add option to disable scanner transactionsRobin Appelman2024-05-031-1/+5
| | | | | | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* | chore: Add SPDX headerAndy Scherzinger2024-05-241-32/+4
| | | | | | | | Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
* | fix(Files): Change how scanner diffs for changed metadataJosh2024-05-081-2/+47
|/ | | | | Fixes #43408 Signed-off-by: Josh <josh.t.richards@gmail.com>
* Refactor `OC\Server::getLockingProvider`Andrew Summers2024-03-151-1/+1
| | | | Signed-off-by: Andrew Summers <18727110+summersab@users.noreply.github.com>
* also updated parent etags when a changed etag is detected during scanningRobin Appelman2024-01-311-6/+29
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* dont reuse etag for folders marked explicitly unscannedRobin Appelman2024-01-311-1/+2
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* chore: apply changes from Nextcloud coding standards 1.1.1Joas Schilling2023-11-231-2/+2
| | | | | Signed-off-by: Joas Schilling <coding@schilljs.com> Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
* Convert isset ternary to null coalescing operatorHamid Dehnavi2023-09-281-2/+2
| | | | Signed-off-by: Hamid Dehnavi <hamid.dev.pro@gmail.com>
* Store size in int|float for 32bit supportCôme Chilliet2023-09-191-3/+6
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Merge pull request #38860 from nextcloud/scanner-change-summaryRobin Appelman2023-07-201-1/+1
|\ | | | | add summary of detected changes to files:scan output
| * add summary of detected changes to files:scan outputRobin Appelman2023-06-161-1/+1
| | | | | | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* | file scanner performance improvementsRobin Appelman2023-06-161-13/+9
|/ | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* Merge pull request #38261 from fsamapoor/replace_strpos_calls_in_lib_privateRobin Appelman2023-06-011-1/+1
|\ | | | | Refactors "strpos" calls in lib/private to improve code readability.
| * Refactors "strpos" calls in lib/private to improve code readability.Faraz Samapoor2023-05-151-1/+1
| | | | | | | | Signed-off-by: Faraz Samapoor <fsamapoor@gmail.com>
* | Fix return types in phpdocCôme Chilliet2023-05-151-1/+1
|/ | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* repair -1 folder sizes for object store background scanRobin Appelman2023-05-101-7/+10
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* Merge pull request #36857 from nextcloud/scan-repair-unencrypted-sizeRobin Appelman2023-04-241-2/+18
|\ | | | | fix unencrypted_size for folders when scanning the filesystem with encryption enabled
| * fix unencrypted_size for files when scanningRobin Appelman2023-04-041-0/+8
| | | | | | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
| * fix unencrypted_size for folders when scanning the filesystem with ↵Robin Appelman2023-04-041-3/+11
| | | | | | | | | | | | encryption enabled Signed-off-by: Robin Appelman <robin@icewind.nl>
* | Merge branch 'master' into enh/type-iconfig-getter-callsCôme Chilliet2023-04-201-4/+10
|\ \ | | | | | | Signed-off-by: Côme Chilliet <91878298+come-nc@users.noreply.github.com>
| * | improve handling of files we can't access in the scannerRobin Appelman2023-04-051-5/+11
| |/ | | | | | | | | | | | | | | instead of erroring, remove the items from the cache. this situation can be triggered if a user has access to a file but looses it afterwards Signed-off-by: Robin Appelman <robin@icewind.nl>
* / Use typed version of IConfig::getSystemValue as much as possibleCôme Chilliet2023-04-051-2/+2
|/ | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* composer run cs:fixCôme Chilliet2023-01-201-2/+0
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* Switch logical operatorsGit'Fellow2023-01-111-18/+11
| | | Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
* don't update the folder size if we know it hasn't changedRobin Appelman2022-08-161-3/+10
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* Migrate more classes of lib/private to LoggerInterfaceCôme Chilliet2022-04-261-9/+8
| | | | Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
* don't overwrite the etag from storage backends that already provide "good" etagsRobin Appelman2022-04-041-1/+2
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* some file scanner performance improvementsRobin Appelman2022-03-171-3/+2
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* background scan the source storage when a background scan on a storage jail ↵Robin Appelman2021-12-021-12/+25
| | | | | | is triggered Signed-off-by: Robin Appelman <robin@icewind.nl>
* Normalize directory entries in Encoding wrapperVincent Petry2021-11-171-1/+4
| | | | | | | | | | | | Directory entry file names are now normalized in getMetaData(), getDirectoryContents() and opendir(). This makes the scanner work properly as it assumes pre-normalized names. In case the names were not normalized, the scanner will now skip the entries and display a warning when applicable. Signed-off-by: Vincent Petry <vincent@nextcloud.com>
* Move storage encoding compatibility warning logicVincent Petry2021-11-171-2/+8
| | | | | | | | | | | The encoding check for file names is now happening the Scanner, and an event will be emitted only if the storage doesn't contain the encoding compatibility wrapper. The event is listened to by the occ scan command to be able to display a warning in case of file name mismatches when they have NFD encoding. Signed-off-by: Vincent Petry <vincent@nextcloud.com>
* Normalize file name before existence check in scannerVincent Petry2021-11-171-0/+1
| | | | | | | | | | | | The scanner would not find a NFD-encoded file name in an existing file list that is normalized. This normalizes the file name before scanning. Fixes issues where scanning repeatedly would make NFD files flicker in and out of existence in the file cache. Signed-off-by: Vincent Petry <vincent@nextcloud.com>
* Update php licensesJohn Molakvoæ (skjnldsv)2021-06-041-1/+0
| | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* catch notfound and forbidden exception in smb::getmetadataRobin Appelman2021-03-041-3/+3
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* Bump doctrine/dbal from 2.12.0 to 3.0.0Christoph Wurst2021-01-081-1/+2
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* ignore files that have no read permissions during scanningRobin Appelman2021-01-061-0/+4
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* Update all license headers for Nextcloud 21Christoph Wurst2020-12-161-1/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Add method to storage backends to get directory content with metadataRobin Appelman2020-04-201-27/+10
| | | | | | | | | | | | | | | | | Currently you need to use `opendir` and then call `getMetadata` for every file, which adds overhead because most storage backends already get the metadata when doing the `opendir`. While storagebackends can (and do) use caching to relief this problem, this adds cache invalidation dificulties and only a limited number of items are generally cached (to prevent memory usage exploding when scanning large storages) With this new methods storage backends can use the child metadata they got from listing the folder to return metadata without having to keep seperate caches. Signed-off-by: Robin Appelman <robin@icewind.nl>
* Format control structures, classes, methods and functionChristoph Wurst2020-04-101-1/+0
| | | | | | | | | | | | | | | To continue this formatting madness, here's a tiny patch that adds unified formatting for control structures like if and loops as well as classes, their methods and anonymous functions. This basically forces the constructs to start on the same line. This is not exactly what PSR2 wants, but I think we can have a few exceptions with "our" style. The starting of braces on the same line is pracrically standard for our code. This also removes and empty lines from method/function bodies at the beginning and end. Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Use elseif instead of else ifChristoph Wurst2020-04-101-4/+4
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* call cache->insert directly instead of going trough cache->put first when ↵Robin Appelman2020-04-011-1/+1
| | | | | | scanning Signed-off-by: Robin Appelman <robin@icewind.nl>
* dont try to get existing cache data during scanning if we already know its a ↵Robin Appelman2020-04-011-4/+4
| | | | | | new file Signed-off-by: Robin Appelman <robin@icewind.nl>
* reuse known parentId when inserting cache entries in scannerRobin Appelman2020-04-011-0/+1
| | | | Signed-off-by: Robin Appelman <robin@icewind.nl>
* Update the license headers for Nextcloud 19Christoph Wurst2020-03-311-0/+1
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Use the short array syntax, everywhereChristoph Wurst2020-03-261-16/+16
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
* Update license headersChristoph Wurst2019-12-051-1/+2
| | | | Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>