1
0

IOutput.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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\AppFramework\Http;
  8. /**
  9. * Very thin wrapper class to make output testable
  10. * @since 8.1.0
  11. */
  12. interface IOutput {
  13. /**
  14. * @param string $out
  15. * @since 8.1.0
  16. */
  17. public function setOutput($out);
  18. /**
  19. * @param string|resource $path or file handle
  20. *
  21. * @return bool false if an error occurred
  22. * @since 8.1.0
  23. */
  24. public function setReadfile($path);
  25. /**
  26. * @param string $header
  27. * @since 8.1.0
  28. */
  29. public function setHeader($header);
  30. /**
  31. * @return int returns the current http response code
  32. * @since 8.1.0
  33. */
  34. public function getHttpResponseCode();
  35. /**
  36. * @param int $code sets the http status code
  37. * @since 8.1.0
  38. */
  39. public function setHttpResponseCode($code);
  40. /**
  41. * @param string $name
  42. * @param string $value
  43. * @param int $expire
  44. * @param string $path
  45. * @param string $domain
  46. * @param bool $secure
  47. * @param bool $httpOnly
  48. * @param string $sameSite (added in 20)
  49. * @since 8.1.0
  50. */
  51. public function setCookie($name, $value, $expire, $path, $domain, $secure, $httpOnly, $sameSite = 'Lax');
  52. }