Deprecated methods removed/purged
authorRoland Häder <roland@mxchange.org>
Wed, 27 Aug 2008 18:51:59 +0000 (18:51 +0000)
committerRoland Häder <roland@mxchange.org>
Wed, 27 Aug 2008 18:51:59 +0000 (18:51 +0000)
12 files changed:
application/ship-simu/main/class_Merchant.php
application/ship-simu/main/filter/validator/class_MoneyRefillRequestValidatorFilter.php
application/ship-simu/main/personell/class_SimulatorPersonell.php
inc/classes/interfaces/database/class_FrameworkDatabaseInterface.php
inc/classes/main/class_BaseFrameworkSystem.php
inc/classes/main/database/databases/class_LocalFileDatabase.php
inc/classes/main/resolver/action/class_BaseActionResolver.php
inc/classes/main/resolver/command/class_BaseCommandResolver.php
inc/classes/main/resolver/controller/class_BaseControllerResolver.php
inc/classes/main/resolver/controller/image/class_ImageControllerResolver.php
inc/classes/main/resolver/controller/web/class_WebControllerResolver.php
inc/classes/middleware/database/class_DatabaseConnection.php

index b0748e7fc890f15118506f73624758fb12523b4f..52982537df6dca49986c1617474392cf06e21f2e 100644 (file)
@@ -99,44 +99,12 @@ class Merchant extends BaseFrameworkSystem {
 
        // Add new item to merchant's price list
        public function addItemToPriceList (TradeableItem $itemInstance, $price) {
 
        // Add new item to merchant's price list
        public function addItemToPriceList (TradeableItem $itemInstance, $price) {
-               // Secure pricing
-               $price = (float) $price;
-
-               // Construct pricing item and add it to the list
-               $this->priceList->append(array(
-                       'item'  => $itemInstance,
-                       'price' => $price
-               ));
-
-               // Remove price attribute
-               $itemInstance->removePrice();
+               $this->makeDeprecated();
        }
 
        // Get a price from the merchant's list
        public final function getPriceFromList (TradeableItem $itemInstance) {
        }
 
        // Get a price from the merchant's list
        public final function getPriceFromList (TradeableItem $itemInstance) {
-               $price = 0;
-
-               // Iterate throw whole list
-               for ($iter = $this->priceList->getIterator(); $iter->valid(); $iter->next()) {
-                       // Get current item
-                       $item = $iter->current();
-
-                       // Does this item match? The unique ID may not work...
-                       if ($item['item']->itemMatches($itemInstance)) {
-                               // Extract price and stop searching
-                               $price = $item['price'];
-                               break;
-                       }
-               }
-
-               // Was the item found?
-               if ($price === 0) {
-                       // Throw exception
-                       throw new ItemNotInPriceListException($itemInstance, self::EXCEPTION_ITEM_NOT_IN_PRICE_LIST);
-               }
-
-               // Return price
-               return $price;
+               $this->makeDeprecated();
        }
 }
 
        }
 }
 
index 632df4344736bca7d7013ef733afb00b385196de..1bcd9323bdca823a0731d4fe075a9d4e3bf9080c 100644 (file)
@@ -58,7 +58,18 @@ class MoneyRefillRequestValidatorFilter extends BaseFrameworkSystem implements F
         * @todo        0% done
         */
        public function execute (Requestable $requestInstance, Responseable $responseInstance) {
         * @todo        0% done
         */
        public function execute (Requestable $requestInstance, Responseable $responseInstance) {
-               $requestInstance->debugInstance();
+               // Are all required request fields set?
+               if ((!$requestInstance->isRequestElementSet('type')) || (!$requestInstance->isRequestElementSet('amount'))) {
+                       // Something important is missing
+                       $requestInstance->requestIsValid(false);
+
+                       // Add a message to the response
+                       $responseInstance->addFatalMessage('refill_page_required_fields_missing');
+
+                       // Abort here
+                       return false;
+               } // END - if
+               die("OK!");
        }
 }
 
        }
 }
 
index 6c1e08407835b26f42d0a0f8a83356dcd2499706..21fab3f206a18df4c2b473637aa52fac93538041 100644 (file)
@@ -118,51 +118,12 @@ class SimulatorPersonell extends BasePersonell {
         * @throws      InvalidIDFormatException        If the given id number
         *                                                                              $idNumber is invalid
         * @throws      MissingSimulatorIdException             If an ID number was not found
         * @throws      InvalidIDFormatException        If the given id number
         *                                                                              $idNumber is invalid
         * @throws      MissingSimulatorIdException             If an ID number was not found
+        * @deprecated
         */
        public final static function createSimulatorPersonellByID ($idNumber) {
         */
        public final static function createSimulatorPersonellByID ($idNumber) {
-               // Use the direct ID number
-               $tempID = $idNumber;
-
-               // Add the class name if it was not found
-               if (count(explode("@", $idNumber)) < 2) {
-                       // Add class name in front of the incomplete ID number
-                       $tempID = sprintf("%s@%s", __CLASS__, $idNumber);
-               } // END - if
-
-               // Validate the ID number
-               if (!preg_match(sprintf("/%s\@([a-f0-9]){32}/i", __CLASS__), $tempID)) {
-                       // Invalid format
-                       throw new InvalidIDFormatException(new SimulatorPersonell(), self::EXCEPTION_ID_IS_INVALID_FORMAT);
-               } // END - if
-
                // Get instance
                $personellInstance = new SimulatorPersonell(false);
                // Get instance
                $personellInstance = new SimulatorPersonell(false);
-
-               // Get database instance
-               $dbInstance = $personellInstance->getDatabaseInstance();
-
-               // Is the unique ID already used? Then it must be there!
-               if (!$dbInstance->isUniqueIdUsed($tempID))  {
-                       // Entry not found!
-                       throw new MissingSimulatorIdException(array($personellInstance, $idNumber), self::EXCEPTION_SIMULATOR_ID_INVALID);
-               } // END - if
-
-               // Load the personell list and add it to this object
-               $personellInstance->loadPersonellList($tempID);
-
-               // Clean-up a little
-               $personellInstance->removeGender();
-               $personellInstance->removeNames();
-               $personellInstance->removeBirthday();
-               $personellInstance->removeSalary();
-               $personellInstance->removeEmployed();
-               $personellInstance->removeMarried();
-               $personellInstance->removeNumberFormaters();
-               //$personellInstance->removeCache();
-               $personellInstance->removeSystemArray();
-
-               // Return instance
-               return $personellInstance;
+               $personellInstance->makeDeprecated();
        }
 
        // Create personell list
        }
 
        // Create personell list
@@ -359,17 +320,10 @@ class SimulatorPersonell extends BasePersonell {
         * @param       $idNumber       The ID number we shall use for looking up
         *                                              the right data.
         * @return      void
         * @param       $idNumber       The ID number we shall use for looking up
         *                                              the right data.
         * @return      void
-        * @throws      ContainerItemIsNullException    If a container item is null
-        * @throws      ContainerItemIsNoArrayException If a container item is
-        *                                                                                      not an array
-        * @throws      ContainerMaybeDamagedException  If the container item
-        *                                                                                      is missing the indexes
-        *                                                                                      'name' and/or 'value'
         * @deprecated
         */
        public function loadPersonellList ($idNumber) {
         * @deprecated
         */
        public function loadPersonellList ($idNumber) {
-               // Cleared because old code
-               $this->partialStub("Cleared because old lost code was used.");
+               $this->makeDeprecated();
        }
 }
 
        }
 }
 
index 846f140d04474decf80be2a8ac78fb77c459fe14..6e3f3d6d4f5c5d4fe18fa072bca8272445abad5c 100644 (file)
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
 interface FrameworkDatabaseInterface extends FrameworkInterface {
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
 interface FrameworkDatabaseInterface extends FrameworkInterface {
-       /**
-        * Analyses if a unique ID has already been used or not. This method does
-        * only pass the given ID through to the "real" database layer.
-        *
-        * @param       $uniqueID               A unique ID number which shall be checked
-        *                                                      before it will be used
-        * @param       $inConstructor  If called from a constructor or from
-        *                                                      somewhere else
-        * @return      $isUnused               true = The unique ID was not found in the database,
-        *                                                      false = It is already in use by an other object
-        */
-       function isUniqueIdUsed ($uniqueID, $inConstructor = false);
 }
 
 // [EOF]
 }
 
 // [EOF]
index 9dd62b4f4467abcbb78a441bd2e85cdc914dd3b4..5652f4fa03001c7363ee453b6f6487eb6daaadbc 100644 (file)
@@ -557,25 +557,6 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                $this->realClass = $realClass;
        }
 
                $this->realClass = $realClass;
        }
 
-       /**
-        * Compare if both simulation part description and class name matches
-        * (shall be enough)
-        *
-        * @param       $itemInstance   An object instance to an other class
-        * @return      boolean                 The result of comparing class name simulation part description
-        * @deprecated
-        */
-       public function itemMatches ($itemInstance) {
-               $this->partialStub("Deprecated!");
-               return (
-                       (
-                               $this->__toString()   == $itemInstance->__toString()
-                       ) && (
-                               $this->getObjectDescription() == $itemInstance->getObjectDescription()
-                       )
-               );
-       }
-
        /**
         * Compare class name of this and given class name
         *
        /**
         * Compare class name of this and given class name
         *
index 69ce662f9e4055ae034a006259ff6bafaa027007..a8cda7430d8f92bd8366a49fde3247624024573d 100644 (file)
@@ -150,96 +150,6 @@ class LocalFileDatabase extends BaseDatabaseFrontend implements DatabaseFrontend
                return $this->lastException;
        }
 
                return $this->lastException;
        }
 
-       /**
-        * Analyses if a unique ID has already been used or not by search in the
-        * local database folder.
-        *
-        * @param       $uniqueID               A unique ID number which shall be checked
-        *                                                      before it will be used
-        * @param       $inConstructor  If we got called in a de/con-structor or
-        *                                                      from somewhere else
-        * @return      $isUnused               true    = The unique ID was not found in the database,
-        *                                                      false = It is already in use by an other object
-        * @throws      NoArrayCreatedException         If explode() fails to create an array
-        * @throws      InvalidArrayCountException      If the array contains less or
-        *                                                                      more than two elements
-        * @deprecated
-        */
-       public function isUniqueIdUsed ($uniqueID, $inConstructor = false) {
-               // Currently not used... ;-)
-               $isUsed = false;
-
-               // 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
-                       if ($inConstructor) {
-                               return false;
-                       } else {
-                               throw new NoArrayCreatedException(array($this, 'pathFile'), self::EXCEPTION_ARRAY_EXPECTED);
-                       }
-               } elseif (count($pathFile) != 2) {
-                       // Invalid ID returned!
-                       if ($inConstructor) {
-                               return false;
-                       } else {
-                               throw new InvalidArrayCountException(array($this, 'pathFile', count($pathFile), 2), self::EXCEPTION_ARRAY_HAS_INVALID_COUNT);
-                       }
-               }
-
-               // Create full path name
-               $pathName = $this->getSavePath() . $pathFile[0];
-
-               // Check if the file is there with a file handler
-               if ($inConstructor) {
-                       // No exceptions in constructors and destructors!
-                       $dirInstance = FrameworkDirectoryPointer::createFrameworkDirectoryPointer($pathName, true);
-
-                       // Has an object being created?
-                       if (!is_object($dirInstance)) return false;
-               } else {
-                       // Outside a constructor
-                       try {
-                               $dirInstance = FrameworkDirectoryPointer::createFrameworkDirectoryPointer($pathName);
-                       } catch (PathIsNoDirectoryException $e) {
-                               // Okay, path not found
-                               return false;
-                       }
-               }
-
-               // Initialize the search loop
-               $isValid = false;
-               while ($dataFile = $dirInstance->readDirectoryExcept(array(".", "..", ".htaccess", ".svn", "info." . $this->getFileExtension()))) {
-                       // Generate FQFN for testing
-                       $fqfn = sprintf("%s/%s", $pathName, $dataFile);
-                       $this->setLastFile($fqfn);
-
-                       // Get instance for file handler
-                       $inputHandler = $this->getFileIoInstance();
-
-                       // Try to read from it. This makes it sure that the file is
-                       // readable and a valid database file
-                       $this->setLastFileContents($inputHandler->loadFileContents($fqfn));
-
-                       // Extract filename (= unique ID) from it
-                       $ID = substr(basename($fqfn), 0, -(strlen($this->getFileExtension()) + 1));
-
-                       // Is this the required unique ID?
-                       if ($ID == $pathFile[1]) {
-                               // Okay, already in use!
-                               $isUsed = true;
-                       }
-               }
-
-               // Close the directory handler
-               $dirInstance->closeDirectory();
-
-               // Now the same for the file...
-               return $isUsed;
-       }
-
        /**
         * Setter for the last read file
         *
        /**
         * Setter for the last read file
         *
index 0f41a35df2cd993a2a702b28278f4616044aa731..0c7f268faf88de2a449f14377ad7180325da9865 100644 (file)
@@ -101,9 +101,6 @@ class BaseActionResolver extends BaseResolver {
                        $isValid = true;
                } // END - if
 
                        $isValid = true;
                } // END - if
 
-               // Debug output
-               //* DEBUG: */ $this->debugBackTrace();
-
                // Set action name
                $this->setActionName($actionName);
 
                // Set action name
                $this->setActionName($actionName);
 
index f26d351fa6d4c7536c050868f96198de2ad0f813..d1fa003a380d07015beb28a2dd86ef061f271449 100644 (file)
@@ -125,9 +125,6 @@ class BaseCommandResolver extends BaseResolver {
                        $isValid = true;
                } // END - if
 
                        $isValid = true;
                } // END - if
 
-               // Debug output
-               //* DEBUG: */ $this->debugBackTrace();
-
                // Set command name
                $this->setCommandName($commandName);
 
                // Set command name
                $this->setCommandName($commandName);
 
index 2548b4f702fceb914c7cf1702ab514cd10cc0835..ec61d4e1cbc6e85676c0cf63f1ab68f8952fe4eb 100644 (file)
@@ -117,9 +117,6 @@ class BaseControllerResolver extends BaseResolver {
                        }
                } // END - while
 
                        }
                } // END - while
 
-               // Debug output
-               //* DEBUG: */ $this->debugBackTrace();
-
                // Return the result
                return $isValid;
        }
                // Return the result
                return $isValid;
        }
index 157a98c60f5f16fc1bb040b1d6d024c184cb9526..b2f4fcd815eb755996b572a0a13c85e07927df08 100644 (file)
@@ -120,9 +120,6 @@ class ImageControllerResolver extends BaseControllerResolver implements Controll
         *                                                                              controller class is missing (bad!)
         */
        private function loadController ($controllerName) {
         *                                                                              controller class is missing (bad!)
         */
        private function loadController ($controllerName) {
-                // Debug message
-                //* DEBUG: */ $this->debugBackTrace();
-
                // Cache default command
                $defaultController = $this->getConfigInstance()->readConfig('default_image_command');
 
                // Cache default command
                $defaultController = $this->getConfigInstance()->readConfig('default_image_command');
 
index 2446e6dc776b885ea3d370ff63c77b7cecb1cb79..da09dca315e5e2e3cde48a959fd50146c3801d0f 100644 (file)
@@ -120,9 +120,6 @@ class WebControllerResolver extends BaseControllerResolver implements Controller
         *                                                                              controller class is missing (bad!)
         */
        private function loadController ($controllerName) {
         *                                                                              controller class is missing (bad!)
         */
        private function loadController ($controllerName) {
-                // Debug message
-                //* DEBUG: */ $this->debugBackTrace();
-
                // Cache default command
                $defaultController = $this->getConfigInstance()->readConfig('default_web_command');
 
                // Cache default command
                $defaultController = $this->getConfigInstance()->readConfig('default_web_command');
 
index 1d9fe9b43e45671eb24ed75597b79d134debb52a..736ea4b501c14eb7261912180802c355d49049e1 100644 (file)
@@ -98,25 +98,6 @@ class DatabaseConnection extends BaseMiddleware implements DatabaseConnector, Re
                $this->dbLayer = $dbLayer;
        }
 
                $this->dbLayer = $dbLayer;
        }
 
-       /**
-        * Analyses if a unique ID has already been used or not. This method does
-        * only pass the given ID through to the "real" database layer.
-        *
-        * @param       $uniqueID               A unique ID number which shall be checked
-        *                                                      before it will be used
-        * @param       $inConstructor  If called from a constructor or from
-        *                                                      somewhere else
-        * @return      $isUnused               true    = The unique ID was not found in the database,
-        *                                                      false = It is already in use by an other object
-        */
-       public function isUniqueIdUsed ($uniqueID, $inConstructor = false) {
-               // Connect to the database
-               $this->dbLayer->connectToDatabase();
-
-               // Pass the returning result through
-               return $this->dbLayer->isUniqueIdUsed($uniqueID, $inConstructor);
-       }
-
        /**
         * Runs a "select" statement on the database layer with given table name
         * and criteria. If this doesn't fail the result will be returned
        /**
         * Runs a "select" statement on the database layer with given table name
         * and criteria. If this doesn't fail the result will be returned