ioutput.php 1.7 KB

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