noopscanner.php 2.0 KB

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