您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

NoopScanner.php 2.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2016, ownCloud, Inc.
  4. *
  5. * @author Christoph Wurst <christoph@winzerhof-wurst.at>
  6. * @author Joas Schilling <coding@schilljs.com>
  7. * @author Jörn Friedrich Dreyer <jfd@butonic.de>
  8. * @author Morris Jobke <hey@morrisjobke.de>
  9. * @author Robin Appelman <robin@icewind.nl>
  10. * @author Roeland Jago Douma <roeland@famdouma.nl>
  11. *
  12. * @license AGPL-3.0
  13. *
  14. * This code is free software: you can redistribute it and/or modify
  15. * it under the terms of the GNU Affero General Public License, version 3,
  16. * as published by the Free Software Foundation.
  17. *
  18. * This program is distributed in the hope that it will be useful,
  19. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  20. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  21. * GNU Affero General Public License for more details.
  22. *
  23. * You should have received a copy of the GNU Affero General Public License, version 3,
  24. * along with this program. If not, see <http://www.gnu.org/licenses/>
  25. *
  26. */
  27. namespace OC\Files\ObjectStore;
  28. use OC\Files\Cache\Scanner;
  29. use OC\Files\Storage\Storage;
  30. class NoopScanner extends Scanner {
  31. public function __construct(Storage $storage) {
  32. // we don't need the storage, so do nothing here
  33. }
  34. /**
  35. * scan a single file and store it in the cache
  36. *
  37. * @param string $file
  38. * @param int $reuseExisting
  39. * @param int $parentId
  40. * @param array|null $cacheData existing data in the cache for the file to be scanned
  41. * @return array an array of metadata of the scanned file
  42. */
  43. public function scanFile($file, $reuseExisting = 0, $parentId = -1, $cacheData = null, $lock = true, $data = null) {
  44. return [];
  45. }
  46. /**
  47. * scan a folder and all it's children
  48. *
  49. * @param string $path
  50. * @param bool $recursive
  51. * @param int $reuse
  52. * @return array with the meta data of the scanned file or folder
  53. */
  54. public function scan($path, $recursive = self::SCAN_RECURSIVE, $reuse = -1, $lock = true) {
  55. return [];
  56. }
  57. /**
  58. * scan all the files and folders in a folder
  59. *
  60. * @param string $path
  61. * @param bool $recursive
  62. * @param int $reuse
  63. * @param array $folderData existing cache data for the folder to be scanned
  64. * @return int the size of the scanned folder or -1 if the size is unknown at this stage
  65. */
  66. protected function scanChildren($path, $recursive = self::SCAN_RECURSIVE, $reuse = -1, $folderId = null, $lock = true) {
  67. return 0;
  68. }
  69. /**
  70. * walk over any folders that are not fully scanned yet and scan them
  71. */
  72. public function backgroundScan() {
  73. //noop
  74. }
  75. }