You are here

private static function FlmngrServer::reqDirMove in N1ED - Visual editor as CKEditor plugin with Bootstrap support 8.2

Processes request to move a directory.

1 call to FlmngrServer::reqDirMove()
FlmngrServer::flmngrRequest in src/Flmngr/FlmngrServer/FlmngrServer.php
Processes a request to file manager.

File

src/Flmngr/FlmngrServer/FlmngrServer.php, line 240

Class

FlmngrServer
File Manager server. This is a entry point for processing any of incoming Flmngr client's request. It takes "action" parameter from request and decides which request processor to use and executes it, then returns a result as…

Namespace

Drupal\n1ed\Flmngr\FlmngrServer

Code

private static function reqDirMove($config, RequestStack $request_stack) {
  $dirPath = $request_stack
    ->getCurrentRequest()->request
    ->get("d");
  $newPath = $request_stack
    ->getCurrentRequest()->request
    ->get("n");
  try {
    $fileSystem = new FMDiskFileSystem($config);
    $fileSystem
      ->moveDir($dirPath, $newPath);
    return new Response(NULL, TRUE);
  } catch (MessageException $e) {
    return new Response($e
      ->getFailMessage(), NULL);
  }
}