IOutput.php 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2016, ownCloud, Inc.
  4. *
  5. * @author Bernhard Posselt <dev@bernhard-posselt.com>
  6. * @author Lukas Reschke <lukas@statuscode.ch>
  7. * @author Morris Jobke <hey@morrisjobke.de>
  8. * @author Robin Appelman <robin@icewind.nl>
  9. * @author Roeland Jago Douma <roeland@famdouma.nl>
  10. * @author Stefan Weil <sw@weilnetz.de>
  11. *
  12. * @license AGPL-3.0
  13. *
  14. * This code is free software: you can redistribute it and/or modify
  15. * it under the terms of the GNU Affero General Public License, version 3,
  16. * as published by the Free Software Foundation.
  17. *
  18. * This program is distributed in the hope that it will be useful,
  19. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  20. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  21. * GNU Affero General Public License for more details.
  22. *
  23. * You should have received a copy of the GNU Affero General Public License, version 3,
  24. * along with this program. If not, see <http://www.gnu.org/licenses/>
  25. *
  26. */
  27. namespace OCP\AppFramework\Http;
  28. /**
  29. * Very thin wrapper class to make output testable
  30. * @since 8.1.0
  31. */
  32. interface IOutput {
  33. /**
  34. * @param string $out
  35. * @since 8.1.0
  36. */
  37. public function setOutput($out);
  38. /**
  39. * @param string|resource $path or file handle
  40. *
  41. * @return bool false if an error occurred
  42. * @since 8.1.0
  43. */
  44. public function setReadfile($path);
  45. /**
  46. * @param string $header
  47. * @since 8.1.0
  48. */
  49. public function setHeader($header);
  50. /**
  51. * @return int returns the current http response code
  52. * @since 8.1.0
  53. */
  54. public function getHttpResponseCode();
  55. /**
  56. * @param int $code sets the http status code
  57. * @since 8.1.0
  58. */
  59. public function setHttpResponseCode($code);
  60. /**
  61. * @param string $name
  62. * @param string $value
  63. * @param int $expire
  64. * @param string $path
  65. * @param string $domain
  66. * @param bool $secure
  67. * @param bool $httpOnly
  68. * @param string $sameSite (added in 20)
  69. * @since 8.1.0
  70. */
  71. public function setCookie($name, $value, $expire, $path, $domain, $secure, $httpOnly, $sameSite = 'Lax');
  72. }