-
-
Notifications
You must be signed in to change notification settings - Fork 647
Closed
Description
I want to parametrise the path to a command-line tool:
C:\Program Files\wkhtmltopdf\bin\wkhtmltoimage.exe
... with this test script:
<?php
require __DIR__ . '/vendor/autoload.php';
$dotenv = new Dotenv\Dotenv(__DIR__);
$dotenv->load();
var_dump($_ENV['WKHTMLTOPDF']);
... and this expected output:
string(50) "C:\Program Files\wkhtmltopdf\bin\wkhtmltoimage.exe"
As of v2.2.0 it's apparently not possible:
WKHTMLTOPDF=C:\Program Files\wkhtmltopdf\bin\wkhtmltoimage.exe
... triggers:
Dotenv values containing spaces must be surrounded by quotes.
WKHTMLTOPDF="C:\Program Files\wkhtmltopdf\bin\wkhtmltoimage.exe"
.... prints:
string(52) ""C:\Program Files\wkhtmltopdf\bin\wkhtmltoimage.exe""
WKHTMLTOPDF='C:\Program Files\wkhtmltopdf\bin\wkhtmltoimage.exe'
... prints:
string(52) "'C:\Program Files\wkhtmltopdf\bin\wkhtmltoimage.exe'"
Escaping spaces with \
(as in bash) triggers Dotenv values containing spaces must be surrounded by quotes as well.
Note: on Windows you can use short file names (if enabled) as a workaround:
WKHTMLTOPDF=C:\PROGRA~1\wkhtmltopdf\bin\wkhtmltopdf.exe
ocram, Esperancia, xerardoo and Sallu24
Metadata
Metadata
Assignees
Labels
No labels