Merge commit 'df76c02e7ac3bfbde8ecb597653779e8e1516f58'

# Conflicts:
#	resources/vanilla
#	tests/phpstan/configs/l7-baseline.neon
This commit is contained in:
Dylan K. Taylor 2020-06-26 19:14:25 +01:00
commit a8180cdf0b
2 changed files with 4 additions and 0 deletions

View File

@ -281,6 +281,8 @@ namespace pocketmine {
echo Terminal::$FORMAT_RESET . PHP_EOL;
Filesystem::releaseLockFile($lockFilePath);
exit($exitCode);
}

View File

@ -46,6 +46,7 @@ use const DIRECTORY_SEPARATOR;
use const LOCK_EX;
use const LOCK_NB;
use const LOCK_SH;
use const LOCK_UN;
use const SCANDIR_SORT_NONE;
final class Filesystem{
@ -140,6 +141,7 @@ final class Filesystem{
throw new \InvalidArgumentException("Invalid lock file path");
}
if(isset(self::$lockFileHandles[$lockFilePath])){
flock(self::$lockFileHandles[$lockFilePath], LOCK_UN);
fclose(self::$lockFileHandles[$lockFilePath]);
unset(self::$lockFileHandles[$lockFilePath]);
@unlink($lockFilePath);