small fix

This commit is contained in:
kremsy 2014-01-18 22:06:07 +01:00 committed by Steffen Schröder
parent 0f8a2d91ec
commit 8b5563fbd2
2 changed files with 8 additions and 8 deletions

View File

@ -59,6 +59,7 @@ class ManiaControl implements CommandListener {
const API_VERSION = '2013-04-16'; const API_VERSION = '2013-04-16';
const OS_UNIX = 'Unix'; const OS_UNIX = 'Unix';
const OS_WIN = 'Windows'; const OS_WIN = 'Windows';
const CONNECT_TIMEOUT = 20;
/** /**
* Public properties * Public properties
@ -357,9 +358,8 @@ class ManiaControl implements CommandListener {
} }
$pass = (string)$pass[0]; $pass = (string)$pass[0];
//TODO timeout as constant
try { try {
$this->client = Connection::factory($host, $port, 20, $login, $pass); $this->client = Connection::factory($host, $port, self::CONNECT_TIMEOUT, $login, $pass);
} catch(Exception $e) { } catch(Exception $e) {
trigger_error("Couldn't authenticate on server with user '{$login}'! " . $e->getMessage(), E_USER_ERROR); trigger_error("Couldn't authenticate on server with user '{$login}'! " . $e->getMessage(), E_USER_ERROR);
} }
@ -407,7 +407,7 @@ class ManiaControl implements CommandListener {
try { try {
$this->client->setModeScriptSettings($scriptSettings); $this->client->setModeScriptSettings($scriptSettings);
} catch(Exception $e) { } catch(Exception $e) {
trigger_error("Couldn't set mode script settings to enable script callbacks. " . $this->getClientErrorText()); trigger_error("Couldn't set mode script settings to enable script callbacks. " . $e->getMessage());
return; return;
} }
$this->log('Script Callbacks successfully enabled!'); $this->log('Script Callbacks successfully enabled!');

View File

@ -126,7 +126,7 @@ class PluginManager {
* @param string $adminLogin * @param string $adminLogin
* @return bool * @return bool
*/ */
public function activatePlugin($pluginClass, $adminLogin = false) { public function activatePlugin($pluginClass, $adminLogin = null) {
if(!is_string($pluginClass)) { if(!is_string($pluginClass)) {
return false; return false;
} }