1
0

NoopScanner.php 2.4 KB

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