From 17f04d73360959d0e5b33530be9aef3a8acd256c Mon Sep 17 00:00:00 2001 From: skripnichenko Date: Sun, 9 Feb 2020 23:34:14 +0200 Subject: [PATCH] Solved the problem with files that have a space in the name or path --- src/Camelot.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Camelot.php b/src/Camelot.php index 0e9f24e..7884899 100644 --- a/src/Camelot.php +++ b/src/Camelot.php @@ -180,7 +180,7 @@ protected function getFilesContents($filePath) protected function runCommand($outputPath = null) { - $output = $outputPath ? " --output $outputPath" : ""; + $output = $outputPath ? " --output '$outputPath'" : ""; $mode = " {$this->mode}"; $pages = $this->pages ? " --pages {$this->pages}" : ""; $password = $this->password ? " --password {$this->password}" : ""; @@ -202,7 +202,7 @@ protected function runCommand($outputPath = null) $areas = $this->areas ? $this->areas->toDelimitedString(" -T ") : ""; $regions = $this->regions ? $this->regions->toDelimitedString(" -R ") : ""; - $cmd = "camelot --format csv {$output}{$pages}{$password}{$flagSize}{$split}{$strip}{$mode}{$textShift}{$copyText}{$lineScale}{$edgeTolerance}{$rowTolerance}{$background}{$plot}{$areas}{$regions}{$columnSeparators} " . $this->path; + $cmd = "camelot --format csv {$output}{$pages}{$password}{$flagSize}{$split}{$strip}{$mode}{$textShift}{$copyText}{$lineScale}{$edgeTolerance}{$rowTolerance}{$background}{$plot}{$areas}{$regions}{$columnSeparators} "."'$this->path'"; $process = Process::fromShellCommandline($cmd); $process->run();