Merge branch 'release/3.2'

This commit is contained in:
Dylan K. Taylor 2018-07-26 14:03:39 +01:00
commit 7e81a09409
5 changed files with 38 additions and 6 deletions

View File

@ -1974,6 +1974,7 @@ class Server{
$this->pluginManager->disablePlugins(); $this->pluginManager->disablePlugins();
$this->pluginManager->clearPlugins(); $this->pluginManager->clearPlugins();
PermissionManager::getInstance()->clearPermissions();
$this->commandMap->clearCommands(); $this->commandMap->clearCommands();
$this->logger->info("Reloading properties..."); $this->logger->info("Reloading properties...");

View File

@ -212,4 +212,10 @@ class PermissionManager{
public function getPermissions() : array{ public function getPermissions() : array{
return $this->permissions; return $this->permissions;
} }
public function clearPermissions() : void{
$this->permissions = [];
$this->defaultPerms = [];
$this->defaultPermsOp = [];
}
} }

View File

@ -662,9 +662,6 @@ class PluginManager{
$this->plugins = []; $this->plugins = [];
$this->enabledPlugins = []; $this->enabledPlugins = [];
$this->fileAssociations = []; $this->fileAssociations = [];
$this->permissions = [];
$this->defaultPerms = [];
$this->defaultPermsOp = [];
} }
/** /**

View File

@ -131,11 +131,11 @@ class Internet{
* *
* @return array a plain array of three [result body : string, headers : array[], HTTP response code : int]. Headers are grouped by requests with strtolower(header name) as keys and header value as values * @return array a plain array of three [result body : string, headers : array[], HTTP response code : int]. Headers are grouped by requests with strtolower(header name) as keys and header value as values
* *
* @throws \RuntimeException if a cURL error occurs * @throws InternetException if a cURL error occurs
*/ */
public static function simpleCurl(string $page, $timeout = 10, array $extraHeaders = [], array $extraOpts = [], callable $onSuccess = null){ public static function simpleCurl(string $page, $timeout = 10, array $extraHeaders = [], array $extraOpts = [], callable $onSuccess = null){
if(!self::$online){ if(!self::$online){
throw new \RuntimeException("Cannot execute web request while offline"); throw new InternetException("Cannot execute web request while offline");
} }
$ch = curl_init($page); $ch = curl_init($page);
@ -157,7 +157,7 @@ class Internet{
$raw = curl_exec($ch); $raw = curl_exec($ch);
$error = curl_error($ch); $error = curl_error($ch);
if($error !== ""){ if($error !== ""){
throw new \RuntimeException($error); throw new InternetException($error);
} }
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
$headerSize = curl_getinfo($ch, CURLINFO_HEADER_SIZE); $headerSize = curl_getinfo($ch, CURLINFO_HEADER_SIZE);

View File

@ -0,0 +1,28 @@
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
declare(strict_types=1);
namespace pocketmine\utils;
class InternetException extends \RuntimeException{
}