1
0
Fork 0

Fix PHP_OS check and use XDG_CACHE_HOME

pull/260/head
Felix Becker 2017-02-01 15:35:42 +01:00
parent 22d0ac921c
commit 92829e014c
1 changed files with 5 additions and 3 deletions

View File

@ -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/';
} }
} }