Skip to content

fix: remove parentheses from ENV in Dockerfile#7709

Open
error1001es wants to merge 1 commit intohyperf:masterfrom
error1001es:patch-1
Open

fix: remove parentheses from ENV in Dockerfile#7709
error1001es wants to merge 1 commit intohyperf:masterfrom
error1001es:patch-1

Conversation

@error1001es
Copy link

@error1001es error1001es commented Feb 11, 2026

remove parentheses from ENV in Dockerfile to prevent string literal parsing
➜ hyperf-test docker build -t hyperftest:v1.0.1 .
➜ hyperf-test docker run --rm --entrypoint php hyperftest:v1.0.1 -r "var_dump(getenv('SCAN_CACHEABLE'));"
string(6) "(true)"

…ral parsing

fix: remove parentheses from ENV in Dockerfile to prevent string literal parsing
@error1001es
Copy link
Author

error1001es commented Feb 11, 2026

Also updated the dev Dockerfile to maintain consistency. Using (false) as a string literal in ENV causes it to be evaluated as true in PHP's loose typing, which defeats the purpose of disabling the cache in development. "dev.Dockerfile"
➜ hyperf-test docker run --rm --entrypoint php hyperftest:v1.0.2 -r "var_dump(getenv('SCAN_CACHEABLE'));"
string(7) "(false)"

@error1001es
Copy link
Author

error1001es commented Feb 11, 2026

Router::addRoute(['GET', 'POST', 'HEAD'], '/', function () {
    return [
        'method' => 'GET',
        'message' => 'Checking environment variable',
        // Мы возвращаем и тип, и значение
        'scan_cacheable_raw' => getenv('SCAN_CACHEABLE'),
        'scan_cacheable_type' => gettype(getenv('SCAN_CACHEABLE')),
    ];
});

{"method":"GET","message":"Checking environment variable","scan_cacheable_raw":"(false)","scan_cacheable_type":"string"}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant