IOutput.php 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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 Stefan Weil <sw@weilnetz.de>
  9. *
  10. * @license AGPL-3.0
  11. *
  12. * This code is free software: you can redistribute it and/or modify
  13. * it under the terms of the GNU Affero General Public License, version 3,
  14. * as published by the Free Software Foundation.
  15. *
  16. * This program is distributed in the hope that it will be useful,
  17. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. * GNU Affero General Public License for more details.
  20. *
  21. * You should have received a copy of the GNU Affero General Public License, version 3,
  22. * along with this program. If not, see <http://www.gnu.org/licenses/>
  23. *
  24. */
  25. namespace OCP\AppFramework\Http;
  26. /**
  27. * Very thin wrapper class to make output testable
  28. * @since 8.1.0
  29. */
  30. interface IOutput {
  31. /**
  32. * @param string $out
  33. * @since 8.1.0
  34. */
  35. public function setOutput($out);
  36. /**
  37. * @param string|resource $path or file handle
  38. *
  39. * @return bool false if an error occurred
  40. * @since 8.1.0
  41. */
  42. public function setReadfile($path);
  43. /**
  44. * @param string $header
  45. * @since 8.1.0
  46. */
  47. public function setHeader($header);
  48. /**
  49. * @return int returns the current http response code
  50. * @since 8.1.0
  51. */
  52. public function getHttpResponseCode();
  53. /**
  54. * @param int $code sets the http status code
  55. * @since 8.1.0
  56. */
  57. public function setHttpResponseCode($code);
  58. /**
  59. * @param string $name
  60. * @param string $value
  61. * @param int $expire
  62. * @param string $path
  63. * @param string $domain
  64. * @param bool $secure
  65. * @param bool $httpOnly
  66. * @since 8.1.0
  67. */
  68. public function setCookie($name, $value, $expire, $path, $domain, $secure, $httpOnly);
  69. }