]> BookStack Code Mirror - bookstack/blobdiff - app/Exports/ZipExports/ZipValidationHelper.php
ZIP Import: Added model+migration, and reader class
[bookstack] / app / Exports / ZipExports / ZipValidationHelper.php
index 8c285deaf5dd802fd42a8d16f87924d905ded3cf..55c86b03b5ba1ee982e34f37bb7410922ecff40a 100644 (file)
@@ -4,14 +4,13 @@ namespace BookStack\Exports\ZipExports;
 
 use BookStack\Exports\ZipExports\Models\ZipExportModel;
 use Illuminate\Validation\Factory;
-use ZipArchive;
 
 class ZipValidationHelper
 {
     protected Factory $validationFactory;
 
     public function __construct(
-        protected ZipArchive $zip,
+        public ZipExportReader $zipReader,
     ) {
         $this->validationFactory = app(Factory::class);
     }
@@ -27,11 +26,6 @@ class ZipValidationHelper
         return $messages;
     }
 
-    public function zipFileExists(string $name): bool
-    {
-        return $this->zip->statName("files/{$name}") !== false;
-    }
-
     public function fileReferenceRule(): ZipFileReferenceRule
     {
         return new ZipFileReferenceRule($this);