1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-22 05:41:20 +01:00

Use per-user cache folder (#4098)

Fixes vimeo/psalm#3869
This commit is contained in:
Bruce Weirdan 2020-09-01 16:20:24 +03:00 committed by Daniil Gentili
parent 7023c592be
commit 529a19db11
Signed by: danog
GPG Key ID: 8C1BE3B34B230CA7
2 changed files with 6 additions and 1 deletions

View File

@ -22,13 +22,14 @@
"ext-tokenizer": "*",
"amphp/amp": "^2.1",
"amphp/byte-stream": "^1.5",
"composer/package-versions-deprecated": "^1.8.0",
"composer/semver": "^1.4 || ^2.0 || ^3.0",
"composer/xdebug-handler": "^1.1",
"dnoegel/php-xdg-base-dir": "^0.1.1",
"felixfbecker/advanced-json-rpc": "^3.0.3",
"felixfbecker/language-server-protocol": "^1.4",
"netresearch/jsonmapper": "^1.0 || ^2.0 || ^3.0",
"nikic/php-parser": "^4.9",
"composer/package-versions-deprecated": "^1.8.0",
"openlss/lib-array2xml": "^1.0",
"sebastian/diff": "^3.0 || ^4.0",
"symfony/console": "^3.4.17 || ^4.1.6 || ^5.0",

View File

@ -64,6 +64,8 @@ use function rmdir;
use function scandir;
use function sha1;
use SimpleXMLElement;
use XdgBaseDir\Xdg;
use function strpos;
use function strrpos;
use function strtolower;
@ -876,6 +878,8 @@ class Config
if (isset($config_xml['cacheDirectory'])) {
$config->cache_directory = (string)$config_xml['cacheDirectory'];
} elseif ($user_cache_dir = (new Xdg())->getHomeCacheDir()) {
$config->cache_directory = $user_cache_dir . '/psalm';
} else {
$config->cache_directory = sys_get_temp_dir() . '/psalm';
}