Fix PHP_OS check and use XDG_CACHE_HOME
parent
22d0ac921c
commit
92829e014c
|
@ -18,10 +18,12 @@ class FileSystemCache implements Cache
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
if (PHP_OS === 'Windows') {
|
if (PHP_OS === 'WINNT') {
|
||||||
$this->cacheDir = getenv('LOCALAPPDATA') . '\\PHP Language Server\\';
|
$this->cacheDir = $_ENV['LOCALAPPDATA'] . '\\PHP Language Server\\';
|
||||||
|
} else if (!empty($_ENV['XDG_CACHE_HOME'])) {
|
||||||
|
$this->cacheDir = $_ENV['XDG_CACHE_HOME'] . '/phpls/';
|
||||||
} else {
|
} else {
|
||||||
$this->cacheDir = getenv('HOME') . '/.phpls/';
|
$this->cacheDir = $_ENV['HOME'] . '/.phpls/';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue