mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-12-23 23:02:08 +03:00
ZIP Import: Finished base import process & error handling
Added file creation reverting and DB rollback on error. Added error display on failed import. Extracted likely shown import form/error text to translation files.
This commit is contained in:
@@ -153,11 +153,19 @@ class ImageService
|
||||
*/
|
||||
public function destroy(Image $image): void
|
||||
{
|
||||
$disk = $this->storage->getDisk($image->type);
|
||||
$disk->destroyAllMatchingNameFromPath($image->path);
|
||||
$this->destroyFileAtPath($image->type, $image->path);
|
||||
$image->delete();
|
||||
}
|
||||
|
||||
/**
|
||||
* Destroy the underlying image file at the given path.
|
||||
*/
|
||||
public function destroyFileAtPath(string $type, string $path): void
|
||||
{
|
||||
$disk = $this->storage->getDisk($type);
|
||||
$disk->destroyAllMatchingNameFromPath($path);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete gallery and drawings that are not within HTML content of pages or page revisions.
|
||||
* Checks based off of only the image name.
|
||||
|
||||
Reference in New Issue
Block a user