filestoragecommon.php 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <?php
  2. /**
  3. * ownCloud
  4. *
  5. * @author Michael Gapczynski
  6. * @copyright 2012 Michael Gapczynski GapczynskiM@gmail.com
  7. *
  8. * This library is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
  10. * License as published by the Free Software Foundation; either
  11. * version 3 of the License, or any later version.
  12. *
  13. * This library 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
  19. * License along with this library. If not, see <http://www.gnu.org/licenses/>.
  20. */
  21. class OC_Filestorage_Common extends OC_Filestorage {
  22. public function __construct($parameters){}
  23. public function mkdir($path){}
  24. public function rmdir($path){}
  25. public function opendir($path){}
  26. public function is_dir($path){}
  27. public function is_file($path){}
  28. public function stat($path){}
  29. public function filetype($path){}
  30. public function filesize($path) {
  31. $stat = $this->stat($path);
  32. return $stat['size'];
  33. }
  34. public function is_readable($path){}
  35. public function is_writable($path){}
  36. public function file_exists($path){}
  37. public function readfile($path) {
  38. $handle = $this->fopen($path, "r");
  39. $chunk = 1024;
  40. while (!feof($handle)) {
  41. echo fread($handle, $chunk);
  42. }
  43. return $this->filesize($path);
  44. }
  45. public function filectime($path) {
  46. $stat = $this->stat($path);
  47. return $stat['ctime'];
  48. }
  49. public function filemtime($path) {
  50. $stat = $this->stat($path);
  51. return $stat['mtime'];
  52. }
  53. public function fileatime($path) {
  54. $stat = $this->stat($path);
  55. return $stat['atime'];
  56. }
  57. public function file_get_contents($path) {
  58. $handle = $this->fopen($path, "r");
  59. return fread($handle, $this->filesize($path));
  60. }
  61. public function file_put_contents($path,$data) {
  62. $handle = $this->fopen($path, "w");
  63. return fwrite($handle, $data);
  64. }
  65. public function unlink($path){}
  66. public function rename($path1,$path2){}
  67. public function copy($path1,$path2) {
  68. $data = $this->file_get_contents($path1);
  69. return $this->file_put_contents($path2, $data);
  70. }
  71. public function fopen($path,$mode){}
  72. public function toTmpFile($path){}
  73. public function fromTmpFile($tmpPath,$path){}
  74. public function fromUploadedFile($tmpPath,$path){}
  75. public function getMimeType($path){}
  76. public function hash($type,$path,$raw){}
  77. public function free_space($path){}
  78. public function search($query){}
  79. public function getLocalFile($path){}
  80. }