X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=vendor%2Fpsy%2Fpsysh%2Fsrc%2FPsy%2FConfigPaths.php;fp=vendor%2Fpsy%2Fpsysh%2Fsrc%2FPsy%2FConfigPaths.php;h=6672491992043db4a3be9957eb8d9f5a9b487402;hb=9917807b03b64faf00f6a1f29dcb6eafc454efa5;hp=2295a911be49ad9a15c89fb34098beb4ff35d377;hpb=aea91e65e895364e460983b890e295aa5d5540a5;p=yaffs-website diff --git a/vendor/psy/psysh/src/Psy/ConfigPaths.php b/vendor/psy/psysh/src/Psy/ConfigPaths.php index 2295a911b..667249199 100644 --- a/vendor/psy/psysh/src/Psy/ConfigPaths.php +++ b/vendor/psy/psysh/src/Psy/ConfigPaths.php @@ -136,7 +136,22 @@ class ConfigPaths { $xdg = new Xdg(); - return $xdg->getRuntimeDir(false) . '/psysh'; + set_error_handler(array('Psy\Exception\ErrorException', 'throwException')); + + try { + // XDG doesn't really work on Windows, sometimes complains about + // permissions, sometimes tries to remove non-empty directories. + // It's a bit flaky. So we'll give this a shot first... + $runtimeDir = $xdg->getRuntimeDir(false); + } catch (\Exception $e) { + // Well. That didn't work. Fall back to a boring old folder in the + // system temp dir. + $runtimeDir = sys_get_temp_dir(); + } + + restore_error_handler(); + + return strtr($runtimeDir, '\\', '/') . '/psysh'; } private static function getDirNames(array $baseDirs)