BookStack/tests/Exports/ZipResultData.php
Dan Brown d1f69feb4a
Some checks failed
test-migrations / build (8.1) (push) Has been cancelled
test-migrations / build (8.2) (push) Has been cancelled
analyse-php / build (push) Has been cancelled
lint-php / build (push) Has been cancelled
test-migrations / build (8.3) (push) Has been cancelled
test-php / build (8.1) (push) Has been cancelled
test-php / build (8.2) (push) Has been cancelled
test-php / build (8.3) (push) Has been cancelled
ZIP Exports: Tested each type and model of export
2024-10-27 14:33:43 +00:00

23 lines
548 B
PHP

<?php
namespace Tests\Exports;
class ZipResultData
{
public function __construct(
public string $zipPath,
public string $extractedDirPath,
public array $data,
) {
}
/**
* Build a path to a location the extracted content, using the given relative $path.
*/
public function extractPath(string $path): string
{
$relPath = implode(DIRECTORY_SEPARATOR, explode('/', $path));
return $this->extractedDirPath . DIRECTORY_SEPARATOR . ltrim($relPath, DIRECTORY_SEPARATOR);
}
}