Skip to content

Commit 3d5faa8

Browse files
committed
add delete and rename to php bridge
1 parent d30d200 commit 3d5faa8

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

bridges/php/handler.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,27 @@ public function getContent($path)
183183
$oResponse->flushJson();
184184
}
185185

186+
if (Request::getApiParam('mode') === 'rename') {
187+
$path = Request::getApiParam('path');
188+
$newPath = Request::getApiParam('newPath');
189+
$result = $oFtp->move($path, $newPath);
190+
if (! $result) {
191+
throw new Exception("Unknown error renaming this folder");
192+
}
193+
$oResponse->setData($result);
194+
$oResponse->flushJson();
195+
}
196+
197+
if (Request::getApiParam('mode') === 'delete') {
198+
$path = Request::getApiParam('path');
199+
$result = $oFtp->delete($path);
200+
if (! $result) {
201+
throw new Exception("Unknown error removing this item");
202+
}
203+
$oResponse->setData($result);
204+
$oResponse->flushJson();
205+
}
206+
186207
if (Request::getApiParam('mode') === 'addfolder') {
187208
$path = Request::getApiParam('path');
188209
$name = Request::getApiParam('name');

bridges/php/php-classic

0 commit comments

Comments
 (0)