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.

130 lines
2.4 KiB

10 years ago
  1. <?php
  2. /**
  3. * @author Robin Appelman <icewind@owncloud.com>
  4. *
  5. * @copyright Copyright (c) 2016, ownCloud, Inc.
  6. * @license AGPL-3.0
  7. *
  8. * This code is free software: you can redistribute it and/or modify
  9. * it under the terms of the GNU Affero General Public License, version 3,
  10. * as published by the Free Software Foundation.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU Affero General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Affero General Public License, version 3,
  18. * along with this program. If not, see <http://www.gnu.org/licenses/>
  19. *
  20. */
  21. namespace OCA\Files_External\Lib;
  22. use OC\Files\Cache\CacheEntry;
  23. use OCP\Files\Cache\ICache;
  24. /**
  25. * Storage placeholder to represent a missing precondition, storage unavailable
  26. */
  27. class FailedCache implements ICache {
  28. public function getNumericStorageId() {
  29. return -1;
  30. }
  31. public function get($file) {
  32. if ($file === '') {
  33. return new CacheEntry([
  34. 'fileid' => -1,
  35. 'size' => 0,
  36. 'mimetype' => 'httpd/unix-directory',
  37. 'mimepart' => 'httpd',
  38. 'permissions' => 0,
  39. 'mtime' => time()
  40. ]);
  41. } else {
  42. return false;
  43. }
  44. }
  45. public function getFolderContents($folder) {
  46. return [];
  47. }
  48. public function getFolderContentsById($fileId) {
  49. return [];
  50. }
  51. public function put($file, array $data) {
  52. return;
  53. }
  54. public function insert($file, array $data) {
  55. return;
  56. }
  57. public function update($id, array $data) {
  58. return;
  59. }
  60. public function getId($file) {
  61. return -1;
  62. }
  63. public function getParentId($file) {
  64. return -1;
  65. }
  66. public function inCache($file) {
  67. return false;
  68. }
  69. public function remove($file) {
  70. return;
  71. }
  72. public function move($source, $target) {
  73. return;
  74. }
  75. public function moveFromCache(ICache $sourceCache, $sourcePath, $targetPath) {
  76. return;
  77. }
  78. public function clear() {
  79. return;
  80. }
  81. public function getStatus($file) {
  82. return ICache::NOT_FOUND;
  83. }
  84. public function search($pattern) {
  85. return [];
  86. }
  87. public function searchByMime($mimetype) {
  88. return [];
  89. }
  90. public function searchByTag($tag, $userId) {
  91. return [];
  92. }
  93. public function getAll() {
  94. return [];
  95. }
  96. public function getIncomplete() {
  97. return [];
  98. }
  99. public function getPathById($id) {
  100. return null;
  101. }
  102. public function normalize($path) {
  103. return $path;
  104. }
  105. }