Code rewritten to reflect latest changes in core
authorRoland Häder <roland@mxchange.org>
Thu, 10 Dec 2009 10:35:08 +0000 (10:35 +0000)
committerRoland Häder <roland@mxchange.org>
Thu, 10 Dec 2009 10:35:08 +0000 (10:35 +0000)
application/ship-simu/class_ApplicationHelper.php
application/ship-simu/main/class_WorksContract.php
application/ship-simu/main/companies/class_ShippingCompany.php
application/ship-simu/main/ships/class_BaseShip.php
application/ship-simu/templates/de/code/action_ship_simu_login_company.ctp
docs/TODOs.txt

index d85438a..150fa58 100644 (file)
@@ -172,15 +172,19 @@ class ApplicationHelper extends BaseApplication implements ManageableApplication
         * @return      void
         */
        public final function entryPoint () {
+               // Analyze the environment for type of response/request
+               $type = ConsoleTools::analyzeEnvironmentForType();
+               $classType = ConsoleTools::analyzeEnvironmentForClassType();
+
                // Create a new request object
-               $requestInstance = ObjectFactory::createObjectByName('HttpRequest');
+               $requestInstance = ObjectFactory::createObjectByName(ucfirst($type) . 'Request');
 
                // Remember request instance here
                $this->setRequestInstance($requestInstance);
 
                // Default response is HTTP (HTML page) and type is 'Web'
-               $response = 'http';
-               $responseType = 'web';
+               $response = $type;
+               $responseType = $classType;
 
                // Do we have another response?
                if ($requestInstance->isRequestElementSet('request')) {
index ff4e019..48a3e35 100644 (file)
@@ -61,7 +61,7 @@ class WorksContract extends BaseFrameworkSystem implements SignableContract {
                // Existiert die Klasse ueberhaupt?
                if (!class_exists($shipType)) {
                        // Klasse nicht gefunden
-                       throw new ClassNotFoundException ($shipType, self::EXCEPTION_CLASS_NOT_FOUND);
+                       throw new NoClassException ($shipType, self::EXCEPTION_CLASS_NOT_FOUND);
                }
 
                // Schiff-Instanz temporaer erzeugen und in den Bauvertrag einfuegen
@@ -140,9 +140,9 @@ class WorksContract extends BaseFrameworkSystem implements SignableContract {
                                        $this->getShipInstance()->getShipName()
                                ));
                        }
-               } catch (ClassNotFoundException $e) {
+               } catch (NoClassException $e) {
                        // Throw it again...
-                       throw new ClassNotFoundException($e->getMessage(), $e->getCode());
+                       throw new NoClassException($e->getMessage(), $e->getCode());
                }
 
                // Get price for this item
index 9ffb604..8891432 100644 (file)
@@ -471,7 +471,7 @@ class ShippingCompany extends BaseSimulator implements Customer, ContractPartner
                // Is the class there?
                if (!class_exists($shipType)) {
                        // Throw exception
-                       throw new ClassNotFoundException($shipType, self::EXCEPTION_CLASS_NOT_FOUND);
+                       throw new NoClassException($shipType, self::EXCEPTION_CLASS_NOT_FOUND);
                }
 
                // Create dummy ship
index 14ed9d2..b57afd7 100644 (file)
@@ -68,7 +68,7 @@ class BaseShip extends BaseSimulator {
                // Ist die gewuenschte Klasse vorhanden?
                if (!class_exists($partClass)) {
                        // Nicht vorhanden, dann Ausnahme werfen!
-                       throw new ClassNotFoundException($partClass, self::EXCEPTION_CLASS_NOT_FOUND);
+                       throw new NoClassException($partClass, self::EXCEPTION_CLASS_NOT_FOUND);
                } // END - if
 
                // Get an instance back from our object factory
index 680dc55..b9df5fc 100644 (file)
@@ -6,7 +6,7 @@ $linkInstance = ObjectFactory::createObjectByConfiguredName('web_link_helper', a
 $linkInstance->prefetchValueInstance('user');
 
 // Add link group for company founder
-$linkInstance->addLinkGroup('company_founder', "Vielleicht willst du eine virtuelle Reederei gr&uuml;nden, um dich virtuell selbstst&auml;ndig zu machen?");
+$linkInstance->addLinkGroup('company_founder', "Vielleicht willst du eine Reederei gr&uuml;nden, um dich selbstst&auml;ndig zu machen?");
 
 // Maximum of allowed companies reached?
 if ($linkInstance->getValueInstance()->ifUserCreatedMaximumAllowedCompanies()) {
@@ -18,7 +18,7 @@ if ($linkInstance->getValueInstance()->ifUserCreatedMaximumAllowedCompanies()) {
 }
 
 // Add link group for government
-$linkInstance->addLinkGroup('government', "Bewerbe dich bei anderen Firmen und hole dir eine Starthilfe vom virtuellen Staat ab wenn du nicht fl&uuml;ssig bist!");
+$linkInstance->addLinkGroup('government', "Bewerbe dich bei anderen Firmen und hole dir eine Starthilfe vom Staat ab wenn du nicht fl&uuml;ssig bist!");
 
 if ($linkInstance->getValueInstance()->ifUserHasRequiredPoints('write_applications')) {
        // Enough money to write applications to other companies
@@ -30,7 +30,7 @@ if ($linkInstance->getValueInstance()->ifUserHasRequiredPoints('write_applicatio
        // Can the government pay startup help?
        if ($linkInstance->getValueInstance()->ifGovernmentPaysStartupHelp()) {
                // Add link note
-               $linkInstance->addLinkNote('government_startup_help', "Virtuelle Starthilfe beantragen:");
+               $linkInstance->addLinkNote('government_startup_help', "Starthilfe beantragen:");
 
                // Display link to government for startup help
                $linkInstance->addActionLinkById('government_startup_help', 'apply_startup_help_government');
@@ -46,7 +46,7 @@ if ($linkInstance->getValueInstance()->ifUserHasRequiredPoints('write_applicatio
 // Checks wether the money bank has opened
 if ($linkInstance->getValueInstance()->ifMoneyBankHasOpened()) {
        // Add link group for money bank
-       $linkInstance->addLinkGroup('moneybank', "Leihe dir zu g&uuml;nstigen Zinsen virtuelles Geld aus, wenn du mehr brauchst!");
+       $linkInstance->addLinkGroup('moneybank', "Leihe dir zu g&uuml;nstigen Zinsen Geld aus, wenn du mehr brauchst!");
 
        // Add link to moneybank
        if ($linkInstance->getValueInstance()->ifUserAllowedTakeCreditsFromMoneyBank()) {
@@ -67,7 +67,7 @@ if ($linkInstance->getValueInstance()->ifMoneyBankHasOpened()) {
 }
 
 // Add link group for refill page
-$linkInstance->addLinkGroup('refill_page', "Hole dir virtuelles Geld von uns zu fairen Preisen!");
+$linkInstance->addLinkGroup('refill_page', "Hole dir Geld von uns zu fairen Preisen!");
 
 if ($linkInstance->ifRefillPageActive()) {
        // Display link to refill page
index 53cc954..2533ba6 100644 (file)
 ./application/ship-simu/main/wrapper/class_CompanyDatabaseWrapper.php:111:      * @todo        Find an interface suitable for all types of companies
 ./application/ship-simu/main/wrapper/class_CompanyDatabaseWrapper.php:121:      * @todo        Find an interface suitable for all types of companies
 ./application/ship-simu/main/wrapper/class_CompanyDatabaseWrapper.php:52:       * @todo        Find an interface which is suitable for all companies
-./inc/classes/exceptions/io/class_FileNotFoundException.php:10: * @todo                Rename this class to FileIoException
-./inc/classes/exceptions/main/class_ClassNotFoundException.php:10: * @todo             Rename this class to NoClassException
-./inc/classes/exceptions/main/class_ConfigEntryNotFoundException.php:10: * @todo               Rename this class to NoFoundEntryException
 ./inc/classes/exceptions/main/class_MissingMethodException.php:13: * @todo             Try to rewrite user/guest login classes and mark this exception as deprecated
+./inc/classes/exceptions/main/class_NoConfigEntryException.php:10: * @todo             Rename this class to NoFoundEntryException
 ./inc/classes/interfaces/class_FrameworkInterface.php:11: * @todo              Find a better name for this interface
-./inc/classes/main/class_BaseFrameworkSystem.php:1078:  * @todo        Write a logging mechanism for productive mode
-./inc/classes/main/class_BaseFrameworkSystem.php:1092:                 // @TODO Finish this part!
-./inc/classes/main/class_BaseFrameworkSystem.php:119:  // @todo Try to clean these constants up
-./inc/classes/main/class_BaseFrameworkSystem.php:200:   * @todo        This is old code. Do we still need this old lost code?
-./inc/classes/main/class_BaseFrameworkSystem.php:268:   * @todo        SearchableResult and UpdateableResult shall have a super interface to use here
+./inc/classes/main/class_BaseFrameworkSystem.php:1083:  * @todo        Write a logging mechanism for productive mode
+./inc/classes/main/class_BaseFrameworkSystem.php:1097:                 // @TODO Finish this part!
+./inc/classes/main/class_BaseFrameworkSystem.php:124:  // @todo Try to clean these constants up
+./inc/classes/main/class_BaseFrameworkSystem.php:205:   * @todo        This is old code. Do we still need this old lost code?
+./inc/classes/main/class_BaseFrameworkSystem.php:273:   * @todo        SearchableResult and UpdateableResult shall have a super interface to use here
 ./inc/classes/main/commands/web/class_WebLoginAreaCommand.php:64:       * @todo        Add some stuff here: Some personal data, app/game related data
 ./inc/classes/main/commands/web/class_WebProblemCommand.php:58:         * @todo        0% done
 ./inc/classes/main/commands/web/class_WebStatusCommand.php:58:  * @todo        0% done
 ./inc/classes/main/result/class_DatabaseResult.php:379:4        * @todo        Find a caching way without modifying the result array
 ./inc/classes/main/rng/class_RandomNumberGenerator.php:150:     * @todo        I had a better random number generator here but now it is somewhere lost :(
 ./inc/classes/main/rng/class_RandomNumberGenerator.php:83:      * @todo        Add site key for stronger salt!
-./inc/classes/main/template/class_BaseTemplateEngine.php:810:   * @todo        Unfinished work or don't die here.
-./inc/classes/main/template/class_BaseTemplateEngine.php:827:                          // @TODO Non-string found so we need some deeper analysis...
-./inc/classes/main/template/class_BaseTemplateEngine.php:904:                  // @TODO Old behaviour, will become obsolete!
-./inc/classes/main/template/class_BaseTemplateEngine.php:907:                  // @TODO Yet another old way
-./inc/classes/main/template/class_BaseTemplateEngine.php:983:   * @todo        Make this code some nicer...
+./inc/classes/main/template/class_BaseTemplateEngine.php:804:   * @todo        Unfinished work or don't die here.
+./inc/classes/main/template/class_BaseTemplateEngine.php:821:                          // @TODO Non-string found so we need some deeper analysis...
+./inc/classes/main/template/class_BaseTemplateEngine.php:898:                  // @TODO Old behaviour, will become obsolete!
+./inc/classes/main/template/class_BaseTemplateEngine.php:901:                  // @TODO Yet another old way
+./inc/classes/main/template/class_BaseTemplateEngine.php:977:   * @todo        Make this code some nicer...
 ./inc/classes/main/template/image/class_ImageTemplateEngine.php:224:    * @todo        Find something usefull with this!
 ./inc/classes/main/template/image/class_ImageTemplateEngine.php:244:    * @todo        Add cache creation here
 ./inc/classes/main/template/mail/class_MailTemplateEngine.php:234:      * @todo        Add cache creation here
 ./inc/classes/main/template/mail/class_MailTemplateEngine.php:244:      * @todo        Should we call back the mailer class here?
 ./inc/classes/main/template/mail/class_MailTemplateEngine.php:325:      * @todo        0% done
-./inc/classes/main/template/menu/class_MenuTemplateEngine.php:270:      * @todo        Find something useful with this!
-./inc/classes/main/template/menu/class_MenuTemplateEngine.php:315:      * @todo        Add cache creation here
+./inc/classes/main/template/menu/class_MenuTemplateEngine.php:276:      * @todo        Find something useful with this!
+./inc/classes/main/template/menu/class_MenuTemplateEngine.php:322:      * @todo        Add cache creation here
 ./inc/classes/main/user/class_BaseUser.php:308:         * @todo        Try to make this method more generic so we can move it in BaseFrameworkSystem
 ./inc/classes/main/user/class_BaseUser.php:80:  * @todo        Find a way of casting here. "(int)" might destroy the user id > 32766
 ./inc/classes/main/user/member/class_Member.php:84:     * @todo        Add more ways over creating user classes
 ./inc/classes/middleware/debug/class_DebugMiddleware.php:112:                  // @TODO Initialization phase
+./inc/classes.php:10: * @todo          We should minimize these includes
 ./inc/config/class_FrameworkConfiguration.php:172:      * @todo        We have to add some more entries from $_SERVER here
-./inc/database.php:49:// @TODO Rewrite this
-./inc/hooks.php:26:// @TODO This makes the core depending on the SPL. But it should be installed anyway.
-./inc/includes.php:36:// @TODO Find a nicer OOP-ed way for this
-./inc/language.php:31:// @TODO Rewrite this
+./inc/database.php:11: * @todo         We should minimize these includes
+./inc/database.php:51:// @TODO Rewrite this
+./inc/file_io.php:13: * @todo          We should minimize these includes
+./inc/hooks.php:11: * @todo            We should minimize these includes
+./inc/hooks.php:28:// @TODO This makes the core depending on the SPL. But it should be installed anyway.
+./inc/includes.php:11: * @todo         We should minimize these includes
+./inc/includes.php:38:// @TODO Find a nicer OOP-ed way for this
+./inc/language.php:10: * @todo         We should minimize these includes
+./inc/language.php:33:// @TODO Rewrite this
 ./inc/loader/class_ClassLoader.php:262:                        /* @todo: Do not die here. */
+./inc/output.php:11: * @todo           We should minimize these includes
+./inc/selector.php:11: * @todo         We should minimize these includes
 ./application/ship-simu/templates/de/.xml:10:@todo             Unfinished template
 ./application/ship-simu/templates/game/building/advanced_research_lab.xml:38:          <!-- @TODO Find technology types //-->
 ./application/ship-simu/templates/game/contract/base_contract.xml:51:          <!-- @TODO We need to make this more XML than free text. //-->
 ### ### DEPRECATION FOLLOWS: ### ###
 ./application/ship-simu/main/personell/class_SimulatorPersonell.php:118:        * @deprecated
 ./application/ship-simu/main/personell/class_SimulatorPersonell.php:319:        * @deprecated
-./inc/classes/exceptions/io/class_FileNotFoundException.php:11: * @deprecated
-./inc/classes/exceptions/io/class_InvalidDirectoryResourceException.php:10: * @deprecated
-./inc/classes/exceptions/main/class_ClassNotFoundException.php:11: * @deprecated
-./inc/classes/exceptions/main/class_ConfigEntryNotFoundException.php:11: * @deprecated
-./inc/classes/main/template/class_BaseTemplateEngine.php:1133:  * @deprecated
-./inc/classes/main/template/class_BaseTemplateEngine.php:953:   * @deprecated
+./inc/classes/exceptions/io/class_FileNotFoundException.php:2:// @DEPRECATED
+./inc/classes/exceptions/io/class_FilePointerNotOpenedException.php:2:// @DEPRECATED
+./inc/classes/exceptions/io/class_InvalidDirectoryResourceException.php:2:// @DEPRECATED
+./inc/classes/exceptions/main/class_ClassNotFoundException.php:2:// @DEPRECATED
+./inc/classes/exceptions/main/class_ConfigEntryNotFoundException.php:2:// @DEPRECATED
+./inc/classes/main/template/class_BaseTemplateEngine.php:1127:  * @deprecated
+./inc/classes/main/template/class_BaseTemplateEngine.php:947:   * @deprecated
+./inc/classes.php:9: * @deprecated
+./inc/database.php:10: * @deprecated
+./inc/file_io.php:12: * @deprecated
+./inc/hooks.php:10: * @deprecated
+./inc/includes.php:10: * @deprecated
+./inc/language.php:9: * @deprecated
+./inc/output.php:10: * @deprecated
+./inc/selector.php:10: * @deprecated