Allow configuring tmpDir using PHPSTAN_TMPDIR environment variable
It'd be useful if the tmpDir is configurable using an environment variable. Right now it's only configurable in phpstan.neon > parameters > tmpDir. For example projects without tmpDir configured for the user, could still have/need a consistent tmpDir in CI. This way we can more easily persist the cache result for multiple projects, for subsequent CI runs.
Alternatively this could be implemented using a command option (analyse --tmpDir=..)
there is another proposal which might also fix your problem: https://github.com/phpstan/phpstan-src/pull/1469
the PR will use a better default logic so phpstan will in the end use a separate result-cache per phpstan-config.
could you check whether this would also work for you?
@staabm that seems to be a different usecase. I would actually want different cache directories depending on the context the analysis is running in.
Hi, environment- and machine-specific configuration options are already possible via: https://phpstan.org/config-reference#multiple-files
Alternative proposal and more general one is to allow any environment variable to be referenced in the configuration.