From 5d2d7b2329dd8b6cab49a94aa4d21080577b2f2c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sat, 31 May 2008 15:33:22 +0000 Subject: [PATCH] Client renamed in Wrapper --- .gitattributes | 10 +++++----- .../database/{clients => wrapper}/.htaccess | 0 .../class_WrapperUserNameNotFoundException.php} | 4 ++-- ...tabaseClient.php => class_BaseDatabaseWrapper.php} | 4 ++-- .../main/database/{clients => wrapper}/.htaccess | 0 .../class_UserDatabaseWrapper.php} | 10 +++++----- inc/classes/main/user/class_User.php | 11 ++++++++--- 7 files changed, 22 insertions(+), 17 deletions(-) rename inc/classes/exceptions/database/{clients => wrapper}/.htaccess (100%) rename inc/classes/exceptions/database/{clients/class_ClientUserNameNotFoundException.php => wrapper/class_WrapperUserNameNotFoundException.php} (90%) rename inc/classes/main/database/{class_BaseDatabaseClient.php => class_BaseDatabaseWrapper.php} (93%) rename inc/classes/main/database/{clients => wrapper}/.htaccess (100%) rename inc/classes/main/database/{clients/class_UserDatabaseClient.php => wrapper/class_UserDatabaseWrapper.php} (83%) diff --git a/.gitattributes b/.gitattributes index d919845..5ed3f32 100644 --- a/.gitattributes +++ b/.gitattributes @@ -151,13 +151,13 @@ inc/classes/exceptions/container/class_ContainerMaybeDamagedException.php -text inc/classes/exceptions/controller/.htaccess -text inc/classes/exceptions/controller/class_DefaultControllerException.php -text inc/classes/exceptions/database/.htaccess -text -inc/classes/exceptions/database/clients/.htaccess -text -inc/classes/exceptions/database/clients/class_ClientUserNameNotFoundException.php -text inc/classes/exceptions/database/local_file/.htaccess -text inc/classes/exceptions/database/local_file/class_SavePathIsEmptyException.php -text inc/classes/exceptions/database/local_file/class_SavePathIsNoDirectoryException.php -text inc/classes/exceptions/database/local_file/class_SavePathReadProtectedException.php -text inc/classes/exceptions/database/local_file/class_SavePathWriteProtectedException.php -text +inc/classes/exceptions/database/wrapper/.htaccess -text +inc/classes/exceptions/database/wrapper/class_WrapperUserNameNotFoundException.php -text inc/classes/exceptions/helper/.htaccess -text inc/classes/exceptions/helper/class_FormClosedException.php -text inc/classes/exceptions/helper/class_FormGroupClosedException.php -text @@ -285,12 +285,12 @@ inc/classes/main/controller/form/.htaccess -text inc/classes/main/controller/form/class_WebDoFormController.php -text inc/classes/main/database/.htaccess -text inc/classes/main/database/class_ -text -inc/classes/main/database/class_BaseDatabaseClient.php -text inc/classes/main/database/class_BaseDatabaseFrontend.php -text -inc/classes/main/database/clients/.htaccess -text -inc/classes/main/database/clients/class_UserDatabaseClient.php -text +inc/classes/main/database/class_BaseDatabaseWrapper.php -text inc/classes/main/database/databases/.htaccess -text inc/classes/main/database/databases/class_LocalFileDatabase.php -text +inc/classes/main/database/wrapper/.htaccess -text +inc/classes/main/database/wrapper/class_UserDatabaseWrapper.php -text inc/classes/main/debug/.htaccess -text inc/classes/main/debug/class_DebugConsoleOutput.php -text inc/classes/main/debug/class_DebugErrorLogOutput.php -text diff --git a/inc/classes/exceptions/database/clients/.htaccess b/inc/classes/exceptions/database/wrapper/.htaccess similarity index 100% rename from inc/classes/exceptions/database/clients/.htaccess rename to inc/classes/exceptions/database/wrapper/.htaccess diff --git a/inc/classes/exceptions/database/clients/class_ClientUserNameNotFoundException.php b/inc/classes/exceptions/database/wrapper/class_WrapperUserNameNotFoundException.php similarity index 90% rename from inc/classes/exceptions/database/clients/class_ClientUserNameNotFoundException.php rename to inc/classes/exceptions/database/wrapper/class_WrapperUserNameNotFoundException.php index d6fe7ed..0804803 100644 --- a/inc/classes/exceptions/database/clients/class_ClientUserNameNotFoundException.php +++ b/inc/classes/exceptions/database/wrapper/class_WrapperUserNameNotFoundException.php @@ -1,6 +1,6 @@ * @version 0.0.0 @@ -21,7 +21,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -class ClientUserNameNotFoundException extends FrameworkException { +class WrapperUserNameNotFoundException extends FrameworkException { /** * The constructor * diff --git a/inc/classes/main/database/class_BaseDatabaseClient.php b/inc/classes/main/database/class_BaseDatabaseWrapper.php similarity index 93% rename from inc/classes/main/database/class_BaseDatabaseClient.php rename to inc/classes/main/database/class_BaseDatabaseWrapper.php index 8117c38..9c42999 100644 --- a/inc/classes/main/database/class_BaseDatabaseClient.php +++ b/inc/classes/main/database/class_BaseDatabaseWrapper.php @@ -1,6 +1,6 @@ * @version 0.0.0 @@ -21,7 +21,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -class BaseDatabaseClient extends BaseFrameworkSystem { +class BaseDatabaseWrapper extends BaseFrameworkSystem { /** * Protected constructor * diff --git a/inc/classes/main/database/clients/.htaccess b/inc/classes/main/database/wrapper/.htaccess similarity index 100% rename from inc/classes/main/database/clients/.htaccess rename to inc/classes/main/database/wrapper/.htaccess diff --git a/inc/classes/main/database/clients/class_UserDatabaseClient.php b/inc/classes/main/database/wrapper/class_UserDatabaseWrapper.php similarity index 83% rename from inc/classes/main/database/clients/class_UserDatabaseClient.php rename to inc/classes/main/database/wrapper/class_UserDatabaseWrapper.php index 2790d85..18aabb0 100644 --- a/inc/classes/main/database/clients/class_UserDatabaseClient.php +++ b/inc/classes/main/database/wrapper/class_UserDatabaseWrapper.php @@ -22,7 +22,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -class UserDatabaseClient extends BaseDatabaseClient { +class UserDatabaseWrapper extends BaseDatabaseWrapper { // Constants const EXCEPTION_CLIENT_USERNAME_NOT_FOUND = 0xe00; @@ -47,17 +47,17 @@ class UserDatabaseClient extends BaseDatabaseClient { * * @param $userInstance An instance of a user class * @return $clientInstance An instance of the created client class - * @throws ClientUserNameNotFoundException If the supplied username + * @throws WrapperUserNameNotFoundException If the supplied username * does not exist */ - public final static function createUserDatabaseClient (ManageableUser $userInstance) { + public final static function createUserDatabaseWrapper (ManageableUser $userInstance) { // Get a new instance - $clientInstance = new UserDatabaseClient(); + $clientInstance = new UserDatabaseWrapper(); // Does the username exists? if (!$clientInstance->ifUserNameExists($userInstance->getUserName())) { // Throw an exception here - throw new ClientUserNameNotFoundException (array($clientInstance, $userInstance), self::EXCEPTION_CLIENT_USERNAME_NOT_FOUND); + throw new WrapperUserNameNotFoundException (array($clientInstance, $userInstance), self::EXCEPTION_CLIENT_USERNAME_NOT_FOUND); } // The user exists diff --git a/inc/classes/main/user/class_User.php b/inc/classes/main/user/class_User.php index 3a31883..62c4f17 100644 --- a/inc/classes/main/user/class_User.php +++ b/inc/classes/main/user/class_User.php @@ -27,6 +27,11 @@ class User extends BaseFrameworkSystem implements ManageableUser { */ private $username = ""; + /** + * An instance of a database wrapper + */ + private $userWrapper = null; + // Exceptions const EXCEPTION_USERNAME_NOT_FOUND = 0xd00; @@ -107,11 +112,11 @@ class User extends BaseFrameworkSystem implements ManageableUser { // By default the username does exist $exists = true; - // Try to get a UserDatabaseClient object back + // Try to get a UserDatabaseWrapper object back try { // Get the instance by providing this class - $this->userClient = UserDatabaseClient::createUserDatabaseClient($this); - } catch (ClientUserNameNotFoundException $e) { + $this->userWrapper = UserDatabaseWrapper::createUserDatabaseWrapper($this); + } catch (WrapperUserNameNotFoundException $e) { // Does not exist! $exists = false; } -- 2.39.2