elFinderVolumeGroup.class.php 5.2 KB

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