Skip to content

Commit 51c0882

Browse files
committed
allow user to disable sandbox for docker support
1 parent 98cfa18 commit 51c0882

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

src/PDF.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ class PDF
4747
'margin',
4848
'preferCSSPageSize',
4949
'file',
50+
'sandbox',
5051
);
5152

5253
/**
@@ -332,6 +333,16 @@ private function make(array $options) : string
332333
}
333334

334335
foreach ($options as $option => $value) {
336+
if ($option == 'sandbox') {
337+
// only mess with sandbox if it is explicitly disabled
338+
if ($value === false) {
339+
$command[] = '--no-sandbox';
340+
}
341+
342+
// don't need the below lines
343+
continue;
344+
}
345+
335346
$command[] = '--' . $option;
336347
$command[] = (is_array($value)) ? implode(',', $value) : $value;
337348
}

0 commit comments

Comments
 (0)