]> BookStack Code Mirror - bookstack/blob - tests/Exports/ZipResultData.php
Drawings: Added class to extract drawio data from png files
[bookstack] / tests / Exports / ZipResultData.php
1 <?php
2
3 namespace Tests\Exports;
4
5 class ZipResultData
6 {
7     public function __construct(
8         public string $zipPath,
9         public string $extractedDirPath,
10         public array $data,
11     ) {
12     }
13
14     /**
15      * Build a path to a location the extracted content, using the given relative $path.
16      */
17     public function extractPath(string $path): string
18     {
19         $relPath = implode(DIRECTORY_SEPARATOR, explode('/', $path));
20         return $this->extractedDirPath . DIRECTORY_SEPARATOR . ltrim($relPath, DIRECTORY_SEPARATOR);
21     }
22 }