elFinderVolumeGroup.class.php 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283
  1. <?php
  2. /**
  3. * elFinder driver for Volume Group.
  4. *
  5. * @author Naoki Sawada
  6. **/
  7. class elFinderVolumeGroup extends elFinderVolumeDriver {
  8. /**
  9. * Driver id
  10. * Must be started from letter and contains [a-z0-9]
  11. * Used as part of volume id
  12. *
  13. * @var string
  14. **/
  15. protected $driverId = 'g';
  16. /**
  17. * Constructor
  18. * Extend options with required fields
  19. */
  20. public function __construct() {
  21. $this->options['type'] = 'group';
  22. $this->options['path'] = '/';
  23. $this->options['dirUrlOwn'] = true;
  24. $this->options['syncMinMs'] = 0;
  25. $this->options['tmbPath'] = '';
  26. $this->options['disabled'] = array(
  27. 'archive',
  28. 'copy',
  29. 'cut',
  30. 'duplicate',
  31. 'edit',
  32. 'empty',
  33. 'extract',
  34. 'getfile',
  35. 'mkdir',
  36. 'mkfile',
  37. 'paste',
  38. 'resize',
  39. 'rm',
  40. 'upload'
  41. );
  42. }
  43. /*********************************************************************/
  44. /* FS API */
  45. /*********************************************************************/
  46. /*********************** paths/urls *************************/
  47. /**
  48. * @inheritdoc
  49. **/
  50. protected function _dirname($path) {
  51. return '/';
  52. }
  53. /**
  54. * {@inheritDoc}
  55. **/
  56. protected function _basename($path) {
  57. return '';
  58. }
  59. /**
  60. * {@inheritDoc}
  61. **/
  62. protected function _joinPath($dir, $name) {
  63. return '/' . $name;
  64. }
  65. /**
  66. * {@inheritDoc}
  67. **/
  68. protected function _normpath($path) {
  69. return '/';
  70. }
  71. /**
  72. * {@inheritDoc}
  73. **/
  74. protected function _relpath($path) {
  75. return '/';
  76. }
  77. /**
  78. * {@inheritDoc}
  79. **/
  80. protected function _abspath($path) {
  81. return '/';
  82. }
  83. /**
  84. * {@inheritDoc}
  85. **/
  86. protected function _path($path) {
  87. return '/';
  88. }
  89. /**
  90. * {@inheritDoc}
  91. **/
  92. protected function _inpath($path, $parent) {
  93. return false;
  94. }
  95. /***************** file stat ********************/
  96. /**
  97. * {@inheritDoc}
  98. **/
  99. protected function _stat($path) {
  100. if ($path === '/') {
  101. return array(
  102. 'size' => 0,
  103. 'ts' => 0,
  104. 'mime' => 'directory',
  105. 'read' => true,
  106. 'write' => false,
  107. 'locked' => true,
  108. 'hidden' => false,
  109. 'dirs' => 0
  110. );
  111. }
  112. return false;
  113. }
  114. /**
  115. * {@inheritDoc}
  116. **/
  117. protected function _subdirs($path) {
  118. return false;
  119. }
  120. /**
  121. * {@inheritDoc}
  122. **/
  123. protected function _dimensions($path, $mime) {
  124. return false;
  125. }
  126. /******************** file/dir content *********************/
  127. /**
  128. * {@inheritDoc}
  129. **/
  130. protected function readlink($path) {
  131. return null;
  132. }
  133. /**
  134. * {@inheritDoc}
  135. **/
  136. protected function _scandir($path) {
  137. return array();
  138. }
  139. /**
  140. * {@inheritDoc}
  141. **/
  142. protected function _fopen($path, $mode='rb') {
  143. return false;
  144. }
  145. /**
  146. * {@inheritDoc}
  147. **/
  148. protected function _fclose($fp, $path='') {
  149. return true;
  150. }
  151. /******************** file/dir manipulations *************************/
  152. /**
  153. * {@inheritDoc}
  154. **/
  155. protected function _mkdir($path, $name) {
  156. return false;
  157. }
  158. /**
  159. * {@inheritDoc}
  160. **/
  161. protected function _mkfile($path, $name) {
  162. return false;
  163. }
  164. /**
  165. * {@inheritDoc}
  166. **/
  167. protected function _symlink($source, $targetDir, $name) {
  168. return false;
  169. }
  170. /**
  171. * {@inheritDoc}
  172. **/
  173. protected function _copy($source, $targetDir, $name) {
  174. return false;
  175. }
  176. /**
  177. * {@inheritDoc}
  178. **/
  179. protected function _move($source, $targetDir, $name) {
  180. return false;
  181. }
  182. /**
  183. * {@inheritDoc}
  184. **/
  185. protected function _unlink($path) {
  186. return false;
  187. }
  188. /**
  189. * {@inheritDoc}
  190. **/
  191. protected function _rmdir($path) {
  192. return false;
  193. }
  194. /**
  195. * {@inheritDoc}
  196. **/
  197. protected function _save($fp, $dir, $name, $stat) {
  198. return false;
  199. }
  200. /**
  201. * {@inheritDoc}
  202. **/
  203. protected function _getContents($path) {
  204. return false;
  205. }
  206. /**
  207. * {@inheritDoc}
  208. **/
  209. protected function _filePutContents($path, $content) {
  210. return false;
  211. }
  212. /**
  213. * {@inheritDoc}
  214. **/
  215. protected function _checkArchivers() {
  216. return;
  217. }
  218. /**
  219. * {@inheritDoc}
  220. **/
  221. protected function _chmod($path, $mode) {
  222. return false;
  223. }
  224. /**
  225. * {@inheritDoc}
  226. **/
  227. protected function _findSymlinks($path) {
  228. return false;
  229. }
  230. /**
  231. * {@inheritDoc}
  232. **/
  233. protected function _extract($path, $arc) {
  234. return false;
  235. }
  236. /**
  237. * {@inheritDoc}
  238. **/
  239. protected function _archive($dir, $files, $name, $arc) {
  240. return false;
  241. }
  242. }