ITempManager.php 1015 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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 OCP;
  8. /**
  9. * Interface ITempManager
  10. *
  11. * @since 8.0.0
  12. */
  13. interface ITempManager {
  14. /**
  15. * Create a temporary file and return the path
  16. *
  17. * @param string $postFix
  18. * @return string
  19. * @since 8.0.0
  20. */
  21. public function getTemporaryFile($postFix = '');
  22. /**
  23. * Create a temporary folder and return the path
  24. *
  25. * @param string $postFix
  26. * @return string
  27. * @since 8.0.0
  28. */
  29. public function getTemporaryFolder($postFix = '');
  30. /**
  31. * Remove the temporary files and folders generated during this request
  32. * @since 8.0.0
  33. */
  34. public function clean();
  35. /**
  36. * Remove old temporary files and folders that were failed to be cleaned
  37. * @since 8.0.0
  38. */
  39. public function cleanOld();
  40. /**
  41. * Get the temporary base directory
  42. *
  43. * @return string
  44. * @since 8.2.0
  45. */
  46. public function getTempBaseDir();
  47. }