Added config to warn if assertions are enabled and to disable exception throws

This commit is contained in:
Dylan K. Taylor
2017-01-10 02:27:28 +00:00
parent 3b82a5fddf
commit 4577f3ee22
2 changed files with 11 additions and 1 deletions

View File

@@ -1453,7 +1453,11 @@ class Server{
define('pocketmine\DEBUG', (int) $this->getProperty("debug.level", 1));
ini_set('assert.exception', 1);
if(((int) ini_get('zend.assertions')) > 0 and ((bool) $this->getProperty("debug.assertions.warn-if-enabled", true)) !== false){
$this->logger->warning("Debugging assertions are enabled, this may impact on performance. To disable them, set `zend.assertions = -1` in php.ini.");
}
ini_set('assert.exception', (bool) $this->getProperty("debug.assertions.throw-exception", 0));
if($this->logger instanceof MainLogger){
$this->logger->setLogDebug(\pocketmine\DEBUG > 1);