/** * @ApiDoc( * section="File Manager", * description="Removes a file or folder (recursively) in /web" * ) * * @Rest\RequestParam(name="path", requirements=".+", strict=true, description="The file path") * * @Rest\Delete("/admin/file") * * @param string $path * * @return bool */ public function deleteFileAction($path) { $this->checkAccess($path); $this->checkAccess($path, ACL::MODE_DELETE); if (!($file = $this->webFilesystem->getFile($path))) { return false; } FileQuery::create()->filterByPath($path)->delete(); if ($result = $this->webFilesystem->remove($path)) { $this->newFeed($file, 'deleted', $path); } return $result; }
/** * {@inheritDoc} */ public function remove($primaryKey) { $this->mapPrimaryKey($primaryKey); parent::remove($primaryKey); $path = $this->webFilesystem->getPath($primaryKey['id']); return $this->webFilesystem->remove($path); }