HomePropagator.php 976 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. /**
  3. * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
  4. * SPDX-FileCopyrightText: 2016 ownCloud, Inc.
  5. * SPDX-License-Identifier: AGPL-3.0-only
  6. */
  7. namespace OC\Files\Cache;
  8. use OCP\IDBConnection;
  9. class HomePropagator extends Propagator {
  10. private $ignoredBaseFolders;
  11. /**
  12. * @param \OC\Files\Storage\Storage $storage
  13. */
  14. public function __construct(\OC\Files\Storage\Storage $storage, IDBConnection $connection) {
  15. parent::__construct($storage, $connection);
  16. $this->ignoredBaseFolders = ['files_encryption'];
  17. }
  18. /**
  19. * @param string $internalPath
  20. * @param int $time
  21. * @param int $sizeDifference number of bytes the file has grown
  22. */
  23. public function propagateChange($internalPath, $time, $sizeDifference = 0) {
  24. [$baseFolder] = explode('/', $internalPath, 2);
  25. if (in_array($baseFolder, $this->ignoredBaseFolders)) {
  26. return [];
  27. } else {
  28. parent::propagateChange($internalPath, $time, $sizeDifference);
  29. }
  30. }
  31. }