elFinderVolumeGroup.class.php 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282
  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. 'cut',
  29. 'duplicate',
  30. 'edit',
  31. 'empty',
  32. 'extract',
  33. 'getfile',
  34. 'mkdir',
  35. 'mkfile',
  36. 'paste',
  37. 'resize',
  38. 'rm',
  39. 'upload'
  40. );
  41. }
  42. /*********************************************************************/
  43. /* FS API */
  44. /*********************************************************************/
  45. /*********************** paths/urls *************************/
  46. /**
  47. * @inheritdoc
  48. **/
  49. protected function _dirname($path) {
  50. return '/';
  51. }
  52. /**
  53. * {@inheritDoc}
  54. **/
  55. protected function _basename($path) {
  56. return '';
  57. }
  58. /**
  59. * {@inheritDoc}
  60. **/
  61. protected function _joinPath($dir, $name) {
  62. return '/' . $name;
  63. }
  64. /**
  65. * {@inheritDoc}
  66. **/
  67. protected function _normpath($path) {
  68. return '/';
  69. }
  70. /**
  71. * {@inheritDoc}
  72. **/
  73. protected function _relpath($path) {
  74. return '/';
  75. }
  76. /**
  77. * {@inheritDoc}
  78. **/
  79. protected function _abspath($path) {
  80. return '/';
  81. }
  82. /**
  83. * {@inheritDoc}
  84. **/
  85. protected function _path($path) {
  86. return '/';
  87. }
  88. /**
  89. * {@inheritDoc}
  90. **/
  91. protected function _inpath($path, $parent) {
  92. return false;
  93. }
  94. /***************** file stat ********************/
  95. /**
  96. * {@inheritDoc}
  97. **/
  98. protected function _stat($path) {
  99. if ($path === '/') {
  100. return array(
  101. 'size' => 0,
  102. 'ts' => 0,
  103. 'mime' => 'directory',
  104. 'read' => true,
  105. 'write' => false,
  106. 'locked' => true,
  107. 'hidden' => false,
  108. 'dirs' => 0
  109. );
  110. }
  111. return false;
  112. }
  113. /**
  114. * {@inheritDoc}
  115. **/
  116. protected function _subdirs($path) {
  117. return false;
  118. }
  119. /**
  120. * {@inheritDoc}
  121. **/
  122. protected function _dimensions($path, $mime) {
  123. return false;
  124. }
  125. /******************** file/dir content *********************/
  126. /**
  127. * {@inheritDoc}
  128. **/
  129. protected function readlink($path) {
  130. return null;
  131. }
  132. /**
  133. * {@inheritDoc}
  134. **/
  135. protected function _scandir($path) {
  136. return array();
  137. }
  138. /**
  139. * {@inheritDoc}
  140. **/
  141. protected function _fopen($path, $mode='rb') {
  142. return false;
  143. }
  144. /**
  145. * {@inheritDoc}
  146. **/
  147. protected function _fclose($fp, $path='') {
  148. return true;
  149. }
  150. /******************** file/dir manipulations *************************/
  151. /**
  152. * {@inheritDoc}
  153. **/
  154. protected function _mkdir($path, $name) {
  155. return false;
  156. }
  157. /**
  158. * {@inheritDoc}
  159. **/
  160. protected function _mkfile($path, $name) {
  161. return false;
  162. }
  163. /**
  164. * {@inheritDoc}
  165. **/
  166. protected function _symlink($source, $targetDir, $name) {
  167. return false;
  168. }
  169. /**
  170. * {@inheritDoc}
  171. **/
  172. protected function _copy($source, $targetDir, $name) {
  173. return false;
  174. }
  175. /**
  176. * {@inheritDoc}
  177. **/
  178. protected function _move($source, $targetDir, $name) {
  179. return false;
  180. }
  181. /**
  182. * {@inheritDoc}
  183. **/
  184. protected function _unlink($path) {
  185. return false;
  186. }
  187. /**
  188. * {@inheritDoc}
  189. **/
  190. protected function _rmdir($path) {
  191. return false;
  192. }
  193. /**
  194. * {@inheritDoc}
  195. **/
  196. protected function _save($fp, $dir, $name, $stat) {
  197. return false;
  198. }
  199. /**
  200. * {@inheritDoc}
  201. **/
  202. protected function _getContents($path) {
  203. return false;
  204. }
  205. /**
  206. * {@inheritDoc}
  207. **/
  208. protected function _filePutContents($path, $content) {
  209. return false;
  210. }
  211. /**
  212. * {@inheritDoc}
  213. **/
  214. protected function _checkArchivers() {
  215. return;
  216. }
  217. /**
  218. * {@inheritDoc}
  219. **/
  220. protected function _chmod($path, $mode) {
  221. return false;
  222. }
  223. /**
  224. * {@inheritDoc}
  225. **/
  226. protected function _findSymlinks($path) {
  227. return false;
  228. }
  229. /**
  230. * {@inheritDoc}
  231. **/
  232. protected function _extract($path, $arc) {
  233. return false;
  234. }
  235. /**
  236. * {@inheritDoc}
  237. **/
  238. protected function _archive($dir, $files, $name, $arc) {
  239. return false;
  240. }
  241. }