From d0e54028694e7af87c6eed5ec26fc0d05174d500 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Mon, 30 Mar 2009 05:41:53 +0000 Subject: [PATCH] Misc fixes/code cleanups --- .../class_DatabaseUpdateSupportException.php | 3 +- .../interfaces/database/class_Updateable.php | 1 - inc/classes/main/user/class_BaseUser.php | 9 +-- inc/classes/main/user/member/class_Member.php | 2 +- inc/config/config-hubmaster.php | 68 +------------------ 5 files changed, 6 insertions(+), 77 deletions(-) diff --git a/inc/classes/exceptions/database/general/class_DatabaseUpdateSupportException.php b/inc/classes/exceptions/database/general/class_DatabaseUpdateSupportException.php index 79b7deaf..59e76f5c 100644 --- a/inc/classes/exceptions/database/general/class_DatabaseUpdateSupportException.php +++ b/inc/classes/exceptions/database/general/class_DatabaseUpdateSupportException.php @@ -7,7 +7,8 @@ * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Core Developer Team * @license GNU GPL 3.0 or any newer version * @link http://www.ship-simu.org - * + * @deprecated + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or diff --git a/inc/classes/interfaces/database/class_Updateable.php b/inc/classes/interfaces/database/class_Updateable.php index 84b81ced..57e34f2d 100644 --- a/inc/classes/interfaces/database/class_Updateable.php +++ b/inc/classes/interfaces/database/class_Updateable.php @@ -28,7 +28,6 @@ interface Updateable extends FrameworkInterface { * @param $fieldName Field to update * @param $fieldValue New value to store * @return void - * @throws DatabaseUpdateSupportException If this class does not support database updates */ function updateDatabaseField ($fieldName, $fieldValue); } diff --git a/inc/classes/main/user/class_BaseUser.php b/inc/classes/main/user/class_BaseUser.php index c7240e59..7943b7c2 100644 --- a/inc/classes/main/user/class_BaseUser.php +++ b/inc/classes/main/user/class_BaseUser.php @@ -21,7 +21,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -class BaseUser extends BaseFrameworkSystem { +class BaseUser extends BaseFrameworkSystem implements Updateable { // Exception constances const EXCEPTION_USERNAME_NOT_FOUND = 0x150; const EXCEPTION_USER_EMAIL_NOT_FOUND = 0x151; @@ -306,16 +306,9 @@ class BaseUser extends BaseFrameworkSystem { * @param $fieldName Field to update * @param $fieldValue New value to store * @return void - * @throws DatabaseUpdateSupportException If this class does not support database updates * @todo Try to make this method more generic so we can move it in BaseFrameworkSystem */ public function updateDatabaseField ($fieldName, $fieldValue) { - // Is updating database fields allowed by interface? - if (!$this instanceof Updateable) { - // Update not supported! - throw new DatabaseUpdateSupportException($this, self::EXCEPTION_DATABASE_UPDATED_NOT_ALLOWED); - } // END - if - // Get a critieria instance $searchInstance = ObjectFactory::createObjectByConfiguredName('search_criteria_class'); diff --git a/inc/classes/main/user/member/class_Member.php b/inc/classes/main/user/member/class_Member.php index 9fd68192..9fc58839 100644 --- a/inc/classes/main/user/member/class_Member.php +++ b/inc/classes/main/user/member/class_Member.php @@ -21,7 +21,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -class Member extends BaseUser implements ManageableMember, Registerable, Updateable { +class Member extends BaseUser implements ManageableMember, Registerable { /** * Protected constructor * diff --git a/inc/config/config-hubmaster.php b/inc/config/config-hubmaster.php index f1c3ebf6..cd07b8cc 100644 --- a/inc/config/config-hubmaster.php +++ b/inc/config/config-hubmaster.php @@ -21,75 +21,11 @@ * along with this program. If not, see . */ -/////////////////////////////////////////////////////////////////////////////// -/// DO NOT RELY ON THIS CONFIG ENTRIES! THEY ARE SUBJECT OF BEING REPLACED. /// -/////////////////////////////////////////////////////////////////////////////// - // Get the configuration instance $cfg = FrameworkConfiguration::getInstance(); -// CFG: HUB-LISTEN-ADDR -$cfg->setConfigEntry('hub_listen_addr', "0.0.0.0"); - -// CFG: HUB-LISTEN-PORT (zero = auto-choose) -$cfg->setConfigEntry('hub_listen_port', 9060); - -// CFG: HUB-MAX-AUTH-TRIES -$cfg->setConfigEntry('hub_max_auth_tries', 3); - -// CFG: HUB-MSG-AUTH-TRIES -$cfg->setConfigEntry('hub_msg_auth_tries', "AUTH_MAX_TRIES"); - -// CFG: HUB-MSG-SPOOFING -$cfg->setConfigEntry('hub_msg_spoofing', "SPOOFING"); - -// CFG: HUB-MSG-AUTH-REPLY -$cfg->setConfigEntry('hub_msg_auth_reply_timeout', "TIMEOUT_AUTH"); - -// CFG: HUB-MSG-BYE -$cfg->setConfigEntry('hub_msg_bye', "BYE"); - -// CFG: HUB-MASTER-IP -$cfg->setConfigEntry('hub_master_ip', "192.168.1.1"); - -// CFG: HUB-MASTER-PORT -$cfg->setConfigEntry('hub_master_port', 9060); - -// CFG: HUB-AUTH-REQUEST -$cfg->setConfigEntry('hub_auth_request', "AUTH"); - -// CFG: HUB-AUTH-REQUEST-TIMEOUT (5 seconds for whole auth procedure shall be fine) -$cfg->setConfigEntry('hub_auth_request_timeout', 5); - -// CFG: HUB-PEER-HELLO -$cfg->setConfigEntry('hub_peer_hello', "HELLO"); - -// CFG: HUB-HELLO-REPLY -$cfg->setConfigEntry('hub_hello_reply', "ELHO"); - -// CFG: HUB-HELLO-TIMEOUT -$cfg->setConfigEntry('hub_hello_timeout', 30); - -// CFG: HUB-HELLO-RETRIES -$cfg->setConfigEntry('hub_hello_retires', 3); - -// CFG: HUB-PEER-PING -$cfg->setConfigEntry('hub_peer_ping', "PING"); - -// CFG: HUB-PING-REPLY -$cfg->setConfigEntry('hub_ping_reply', "PONG"); - -// CFG: HUB-PING-TIMEOUT -$cfg->setConfigEntry('hub_ping_timeout', 10); - -// CFG: HUB-PING-MAXDROPS -$cfg->setConfigEntry('hub_ping_maxdrops', 3); - -// CFG: HUB-PEER-MISS-PONG -$cfg->setConfigEntry('hub_peer_miss_pong', "PONG_MISS"); - -// CFG: HUB-INTRO-ENABLED -$cfg->setConfigEntry('hub_intro_enabled', "Y"); +// CFG: HUB-BOOTSTRAP-NODES +$cfg->setConfigEntry('hub_bootstrap_nodes', "192.168.1.1:9060"); // [EOF] ?> -- 2.39.5