1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-08-06 12:02:45 +03:00

ZIP Import: Added model+migration, and reader class

This commit is contained in:
Dan Brown
2024-11-02 17:17:34 +00:00
parent 259aa829d4
commit 74fce9640e
8 changed files with 234 additions and 35 deletions

View File

@@ -2,6 +2,8 @@
namespace BookStack\Exports\Controllers;
use BookStack\Exports\Import;
use BookStack\Exports\ZipExports\ZipExportReader;
use BookStack\Exports\ZipExports\ZipExportValidator;
use BookStack\Http\Controller;
use Illuminate\Http\Request;
@@ -37,17 +39,23 @@ class ImportController extends Controller
return redirect('/import');
}
$zipEntityInfo = (new ZipExportReader($zipPath))->getEntityInfo();
$import = new Import();
$import->name = $zipEntityInfo['name'];
$import->book_count = $zipEntityInfo['book_count'];
$import->chapter_count = $zipEntityInfo['chapter_count'];
$import->page_count = $zipEntityInfo['page_count'];
$import->created_by = user()->id;
$import->size = filesize($zipPath);
// TODO - Set path
// TODO - Save
// TODO - Split out attachment service to separate out core filesystem/disk stuff
// To reuse for import handling
dd('passed');
// TODO - Upload to storage
// TODO - Store info/results for display:
// - zip_path
// - name (From name of thing being imported)
// - size
// - book_count
// - chapter_count
// - page_count
// - created_by
// - created_at/updated_at
// TODO - Send user to next import stage
}
}