You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

CommonTest.php 2.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2016, ownCloud, Inc.
  4. *
  5. * @author Bart Visscher <bartv@thisnet.nl>
  6. * @author Christopher Schäpers <kondou@ts.unde.re>
  7. * @author Christoph Wurst <christoph@winzerhof-wurst.at>
  8. * @author Felix Moeller <mail@felixmoeller.de>
  9. * @author Michael Gapczynski <GapczynskiM@gmail.com>
  10. * @author Morris Jobke <hey@morrisjobke.de>
  11. * @author Robin Appelman <robin@icewind.nl>
  12. * @author Thomas Müller <thomas.mueller@tmit.eu>
  13. *
  14. * @license AGPL-3.0
  15. *
  16. * This code is free software: you can redistribute it and/or modify
  17. * it under the terms of the GNU Affero General Public License, version 3,
  18. * as published by the Free Software Foundation.
  19. *
  20. * This program is distributed in the hope that it will be useful,
  21. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  22. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  23. * GNU Affero General Public License for more details.
  24. *
  25. * You should have received a copy of the GNU Affero General Public License, version 3,
  26. * along with this program. If not, see <http://www.gnu.org/licenses/>
  27. *
  28. */
  29. namespace OC\Files\Storage;
  30. class CommonTest extends \OC\Files\Storage\Common {
  31. /**
  32. * underlying local storage used for missing functions
  33. * @var \OC\Files\Storage\Local
  34. */
  35. private $storage;
  36. public function __construct($params) {
  37. $this->storage = new \OC\Files\Storage\Local($params);
  38. }
  39. public function getId() {
  40. return 'test::'.$this->storage->getId();
  41. }
  42. public function mkdir($path) {
  43. return $this->storage->mkdir($path);
  44. }
  45. public function rmdir($path) {
  46. return $this->storage->rmdir($path);
  47. }
  48. public function opendir($path) {
  49. return $this->storage->opendir($path);
  50. }
  51. public function stat($path) {
  52. return $this->storage->stat($path);
  53. }
  54. public function filetype($path) {
  55. return @$this->storage->filetype($path);
  56. }
  57. public function isReadable($path) {
  58. return $this->storage->isReadable($path);
  59. }
  60. public function isUpdatable($path) {
  61. return $this->storage->isUpdatable($path);
  62. }
  63. public function file_exists($path) {
  64. return $this->storage->file_exists($path);
  65. }
  66. public function unlink($path) {
  67. return $this->storage->unlink($path);
  68. }
  69. public function fopen($path, $mode) {
  70. return $this->storage->fopen($path, $mode);
  71. }
  72. public function free_space($path) {
  73. return $this->storage->free_space($path);
  74. }
  75. public function touch($path, $mtime = null) {
  76. return $this->storage->touch($path, $mtime);
  77. }
  78. }