mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 08:44:01 +00:00
LevelDB: Check for LEVELDB_ZLIB_RAW_COMPRESSION when checking for the extension's presence
We always want to validate that the leveldb provided supports the world format.
This commit is contained in:
parent
5132ab6cd9
commit
a0a2ea01bc
@ -84,6 +84,10 @@ class LevelDB extends BaseLevelProvider{
|
||||
if(!extension_loaded('leveldb')){
|
||||
throw new LevelException("The leveldb PHP extension is required to use this world format");
|
||||
}
|
||||
|
||||
if(!defined('LEVELDB_ZLIB_RAW_COMPRESSION')){
|
||||
throw new LevelException("Given version of php-leveldb doesn't support zlib raw compression");
|
||||
}
|
||||
}
|
||||
|
||||
public function __construct(Level $level, string $path){
|
||||
@ -103,10 +107,6 @@ class LevelDB extends BaseLevelProvider{
|
||||
throw new LevelException("Invalid level.dat");
|
||||
}
|
||||
|
||||
if(!defined('LEVELDB_ZLIB_RAW_COMPRESSION')){
|
||||
throw new LevelException("Given version of php-leveldb doesn't support zlib raw compression");
|
||||
}
|
||||
|
||||
$this->db = new \LevelDB($this->path . "/db", [
|
||||
"compression" => LEVELDB_ZLIB_RAW_COMPRESSION
|
||||
]);
|
||||
|
Loading…
x
Reference in New Issue
Block a user