Deprecated methods and exceptions removed
authorRoland Häder <roland@mxchange.org>
Fri, 20 Jun 2008 16:28:38 +0000 (16:28 +0000)
committerRoland Häder <roland@mxchange.org>
Fri, 20 Jun 2008 16:28:38 +0000 (16:28 +0000)
.gitattributes
application/ship-simu/main/personell/class_SimulatorPersonell.php
application/ship-simu/main/ships/class_BaseShip.php
inc/classes/exceptions/main/class_ExceptionNotChangedException.php [deleted file]
inc/classes/exceptions/template/class_InvalidTemplateVariableNameException.php [deleted file]
inc/classes/interfaces/extended/.htaccess [deleted file]
inc/classes/interfaces/extended/class_LimitableObject.php [deleted file]
inc/classes/main/database/databases/class_LocalFileDatabase.php

index 7a90d3b4e25f58e52356a447de0b9ec67f002f10..be0e2867c68862ecb0d83733f3385315306eeb42 100644 (file)
@@ -222,7 +222,6 @@ inc/classes/exceptions/main/class_ConfigEntryIsEmptyException.php -text
 inc/classes/exceptions/main/class_ConfigEntryNotFoundException.php -text
 inc/classes/exceptions/main/class_DimNotFoundInArrayException.php -text
 inc/classes/exceptions/main/class_EmptyVariableException.php -text
-inc/classes/exceptions/main/class_ExceptionNotChangedException.php -text
 inc/classes/exceptions/main/class_ExceptionNotFoundException.php -text
 inc/classes/exceptions/main/class_FatalErrorException.php -text
 inc/classes/exceptions/main/class_GetterNotFoundException.php -text
@@ -248,7 +247,6 @@ inc/classes/exceptions/template/class_BasePathIsEmptyException.php -text
 inc/classes/exceptions/template/class_BasePathIsNoDirectoryException.php -text
 inc/classes/exceptions/template/class_BasePathReadProtectedException.php -text
 inc/classes/exceptions/template/class_InvalidBasePathStringException.php -text
-inc/classes/exceptions/template/class_InvalidTemplateVariableNameException.php -text
 inc/classes/exceptions/template/class_UnexpectedTemplateTypeException.php -text
 inc/classes/exceptions/template/class_UnsupportedTemplateEngineException.php -text
 inc/classes/exceptions/template/class_ViewHelperNotFoundException.php -text
@@ -285,8 +283,6 @@ inc/classes/interfaces/database/middleware/.htaccess -text
 inc/classes/interfaces/database/middleware/class_DatabaseConnector.php -text
 inc/classes/interfaces/debug/.htaccess -text
 inc/classes/interfaces/debug/class_Debugger.php -text
-inc/classes/interfaces/extended/.htaccess -text
-inc/classes/interfaces/extended/class_LimitableObject.php -text
 inc/classes/interfaces/filter/.htaccess -text
 inc/classes/interfaces/filter/class_Filterable.php -text
 inc/classes/interfaces/helper/.htaccess -text
index f0b33b8a43905d2a255caeb1f0b1801b40d0e7bd..76d8ecfe433efcc5b8720cc4d05f5c7fdecd5fe3 100644 (file)
@@ -412,48 +412,8 @@ class SimulatorPersonell extends BasePersonell {
         *                                                              of a class.
         */
        public function loadPersonellList ($idNumber) {
-               // Get database instance
-               $dbInstance = $this->getDatabaseInstance();
-
-               // Get the serialization container within the  personell list from
-               // the database layer
-               $containerInstance = $dbInstance->getObjectFromCachedData($idNumber);
-
-               // Iterate through the whole container
-               for ($idx = $containerInstance->getIterator(); $idx->valid(); $idx->next()) {
-                       // Get current item from container
-                       $item = $idx->current();
-
-                       // Validate it a bit
-                       if (is_null($item)) {
-                               // Is null
-                               throw new ContainerItemIsNullException($this, self::EXCEPTION_CONTAINER_ITEM_IS_NULL);
-                       } elseif (!is_array($item)) {
-                               // Is not an array
-                               throw new ContainerItemIsNoArrayException($this, self::EXCEPTION_ITEM_IS_NO_ARRAY);
-                       } elseif ((!isset($item['name'])) || (!isset($item['value']))) {
-                               // Missing elements
-                               throw new ContainerMaybeDamagedException($this, self::EXCEPTION_CONTAINER_MAYBE_DAMAGED);
-                       }
-
-                       // Okay, now we can get the item and generate a valid command for eval().
-                       // We need to convert the first letter to lower-case but keep all others intact
-                       $eval = sprintf("\$this->%s = \$item['value'];",
-                               strtolower(substr($item['name'], 0, 1))
-                               .
-                               substr($item['name'], 1)
-                       );
-
-                       // Debug message
-                       if ((defined('DEBUG_EVAL')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Konstruierte PHP-Anweisung: <pre><em>%s</em></pre><br />\n",
-                               __CLASS__,
-                               __LINE__,
-                               htmlentities($eval)
-                       ));
-
-                       // Run the command
-                       @eval($eval);
-               }
+               // Cleared because old code
+               $this->partialStub("Clear because of old lost code was usaged.");
        }
 }
 
index a37bdb03c291422d67bcff85b0b45159c23a891e..c04762792229b0228eb0cc01a9e113a79999ac4d 100644 (file)
@@ -122,13 +122,6 @@ class BaseShip extends BaseSimulator {
                                $e->getMessage()
                        ));
                        return false;
-               } catch (ExceptionNotChangedException $e) {
-                       if ((defined('DEBUG_SHIP')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Eine Exception wurde nicht ge&auml;ndert. Details: <strong>%s</strong><br />\n",
-                               __CLASS__,
-                               __LINE__,
-                               $e->getMessage()
-                       ));
-                       return false;
                } catch (ExceptionNotFoundException $e) {
                        if ((defined('DEBUG_SHIP')) || (defined('DEBUG_ALL'))) $this->getDebugInstance()->output(sprintf("[%s:%d] Eine Exception wurde nicht gefunden. Details: <strong>%s</strong><br />\n",
                                __CLASS__,
diff --git a/inc/classes/exceptions/main/class_ExceptionNotChangedException.php b/inc/classes/exceptions/main/class_ExceptionNotChangedException.php
deleted file mode 100644 (file)
index 6fe9445..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-<?php
-/**
- * An exception thrown when an exception was not changed
- *
- * @author             Roland Haeder <webmaster@ship-simu.org>
- * @version            0.0.0
- * @copyright  Copyright(c) 2007, 2008 Roland Haeder, this is free software
- * @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
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-class ExceptionNotChangedException extends FrameworkException {
-       /**
-        * The constructor
-        *
-        * @param               $message                Message from the exception
-        * @param               $code           Code number for the exception
-        * @return      void
-        */
-       public function __construct (BaseFrameworkSystem $class, $code) {
-               // Add a message around the missing class
-               $message = sprintf("[%s:%d] Exception(s) wurde(n) nicht ge&auml;ndert.",
-                       $class,
-                       $this->getLine()
-               );
-
-               // Call parent constructor
-               parent::__construct($message, $code);
-       }
-}
-
-// [EOF]
-?>
diff --git a/inc/classes/exceptions/template/class_InvalidTemplateVariableNameException.php b/inc/classes/exceptions/template/class_InvalidTemplateVariableNameException.php
deleted file mode 100644 (file)
index b309f7b..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-<?php
-/**
- * An exception thrown when a template variable name is invalid
- *
- * @author             Roland Haeder <webmaster@ship-simu.org>
- * @version            0.0.0
- * @copyright  Copyright(c) 2007, 2008 Roland Haeder, this is free software
- * @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
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-class InvalidTemplateVariableNameException extends FrameworkException {
-       /**
-        * The constructor
-        *
-        * @param               $classArray             An array holding our informations
-        * @param               $code                   Code number for the exception
-        * @return      void
-        */
-       public function __construct (array $classArray, $code) {
-               // Add a message around the missing class
-               $message = sprintf("[%s:%d] The template <u>%s</u> contains an invalid variable called <u>%s</u>. Valid variable names are only <u>%s</u>.",
-                       $classArray[0]->__toString(),
-                       $this->getLine(),
-                       basename($classArray[1]),
-                       $classArray[2],
-                       $classArray[3]->readConfig('tpl_valid_var')
-               );
-
-               // Call parent constructor
-               parent::__construct($message, $code);
-       }
-}
-
-// [EOF]
-?>
diff --git a/inc/classes/interfaces/extended/.htaccess b/inc/classes/interfaces/extended/.htaccess
deleted file mode 100644 (file)
index 3a42882..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Deny from all
diff --git a/inc/classes/interfaces/extended/class_LimitableObject.php b/inc/classes/interfaces/extended/class_LimitableObject.php
deleted file mode 100644 (file)
index 9c03202..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-<?php
-/**
- * This is an inface for limiting object while saving them with the
- * DatabaseConnection class.
- *
- * @author             Roland Haeder <webmaster@ship-simu.org>
- * @version            0.0.0
- * @copyright  Copyright(c) 2007, 2008 Roland Haeder, this is free software
- * @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
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-interface LimitableObject extends FrameworkInterface {
-       /**
-        * Reduces the volume of a processed object.
-        *
-        * @param               $limitInstance          An instance to ObjectLimits which holds
-        *                                                      attribute names that we want to include
-        *                                                      in the processing phase. Other attributes
-        *                                                      except $uniqueID and $realClass will be
-        *                                                      ignored and keept out.
-        * @return      void
-        */
-       function limitObject (ObjectLimits $limitInstance);
-}
-
-// [EOF]
-?>
index 417c861ea61d8fe5176c156bc87468c0cfab01aa..f9e67a9f5106adddf2efb8269a393532d10eef9f 100644 (file)
@@ -301,130 +301,6 @@ class LocalFileDatabase extends BaseDatabaseFrontend implements DatabaseFrontend
                return $this->fileExtension;
        }
 
-       /**
-        * Get cached (last fetched) data from the local file database
-        *
-        * @param       $uniqueID       The ID number for looking up the data
-        * @return      $object         The restored object from the maybe compressed
-        *                                              serialized data
-        * @throws      MismatchingCompressorsException         If the compressor from
-        *                                                                      the loaded file
-        *                                                                      mismatches with the
-        *                                                                      current used one.
-        * @throws      NullPointerException    If the restored object
-        *                                                                      is null
-        * @throws      NoObjectException               If the restored "object"
-        *                                                                      is not an object instance
-        * @throws      MissingMethodException  If the required method
-        *                                                                      toString() is missing
-        * @deprecated
-        */
-       public final function getObjectFromCachedData ($uniqueID) {
-               // Get instance for file handler
-               $inputHandler = $this->getFileIoInstance();
-
-               // Get last file's name and contents
-               $fqfn = $this->repairFQFN($this->getLastFile(), $uniqueID);
-               $contents = $this->repairContents($this->getLastContents(), $fqfn);
-
-               // Let's decompress it. First we need the instance
-               $compressInstance = $this->getCompressorChannel();
-
-               // Is the compressor's extension the same as the one from the data?
-               if ($compressInstance->getCompressorExtension() != $contents['header'][0]) {
-                       /**
-                        * @todo        For now we abort here but later we need to make this a little more dynamic.
-                        */
-                       throw new MismatchingCompressorsException(array($this, $contents['header'][0], $fqfn, $compressInstance->getCompressorExtension()), self::EXCEPTION_MISMATCHING_COMPRESSORS);
-               }
-
-               // Decompress the data now
-               $serialized = $compressInstance->getCompressor()->decompressStream($contents['data']);
-
-               // And unserialize it...
-               $object = unserialize($serialized);
-
-               // This must become a valid object, so let's check it...
-               if (is_null($object)) {
-                       // Is null, throw exception
-                       throw new NullPointerException($object, self::EXCEPTION_IS_NULL_POINTER);
-               } elseif (!is_object($object)) {
-                       // Is not an object, throw exception
-                       throw new NoObjectException($object, self::EXCEPTION_IS_NO_OBJECT);
-               } elseif (!$object instanceof FrameworkInterface) {
-                       // A highly required method was not found... :-(
-                       throw new MissingMethodException(array($object, '__toString'), self::EXCEPTION_MISSING_METHOD);
-               }
-
-               // And return the object
-               return $object;
-       }
-
-       /**
-        * Private method for re-gathering (repairing) the FQFN
-        *
-        * @param       $fqfn           The current FQFN we shall validate
-        * @param       $uniqueID       The unique ID number
-        * @return      $fqfn           The repaired FQFN when it is empty
-        * @throws      NoArrayCreatedException         If explode() has not
-        *                                                                              created an array
-        * @throws      InvalidArrayCountException      If the array count is not
-        *                                                                              as the expected
-        * @deprecated
-        */
-       private function repairFQFN ($fqfn, $uniqueID) {
-               // Cast both strings
-               $fqfn     = (string) $fqfn;
-               $uniqueID = (string) $uniqueID;
-
-               // Is there pre-cached data available?
-               if (empty($fqfn)) {
-                       // Split the unique ID up in path and file name
-                       $pathFile = explode("@", $uniqueID);
-
-                       // Are there two elements? Index 0 is the path, 1 the file name + global extension
-                       if (!is_array($pathFile)) {
-                               // No array found
-                               throw new NoArrayCreatedException(array($this, "pathFile"), self::EXCEPTION_ARRAY_EXPECTED);
-                       } elseif (count($pathFile) != 2) {
-                               // Invalid ID returned!
-                               throw new InvalidArrayCountException(array($this, "pathFile", count($pathFile), 2), self::EXCEPTION_ARRAY_HAS_INVALID_COUNT);
-                       }
-
-                       // Create full path name
-                       $pathName = $this->getSavePath() . $pathFile[0];
-
-                       // Nothing cached, so let's create a FQFN first
-                       $fqfn = sprintf("%s/%s.%s", $pathName, $pathFile[1], $this->getFileExtension());
-                       $this->setLastFile($fqfn);
-               }
-
-               // Return repaired FQFN
-               return $fqfn;
-       }
-
-       /**
-        * Private method for re-gathering the contents of a given file
-        *
-        * @param               $contents               The (maybe) already cached contents as an array
-        * @param               $fqfn           The current FQFN we shall validate
-        * @return      $contents               The repaired contents from the given file
-        * @deprecated
-        */
-       private function repairContents ($contents, $fqfn) {
-               // Is there some content and header (2 indexes) in?
-               if ((!is_array($contents)) || (count($contents) != 2) || (!isset($contents['header'])) || (!isset($contents['data']))) {
-                       // No content found so load the file again
-                       $contents = $inputHandler->loadFileContents($fqfn);
-
-                       // And remember all data for later usage
-                       $this->setLastContents($contents);
-               }
-
-               // Return the repaired contents
-               return $contents;
-       }
-
        /**
         * Reads a local data file  and returns it's contents in an array
         *