]> git.mxchange.org Git - core.git/blobdiff - framework/main/classes/commands/image/class_ImageCodeCaptchaCommand.php
Continued:
[core.git] / framework / main / classes / commands / image / class_ImageCodeCaptchaCommand.php
index d3ad2f4b276a98e66dff3157a21cfd91e2aab5a1..eda6a9e9cbd4d4bffbb2ac3dc3268cb7a6d77c87 100644 (file)
@@ -6,6 +6,7 @@ namespace Org\Mxchange\CoreFramework\Command\Captcha;
 use Org\Mxchange\CoreFramework\Command\BaseCommand;
 use Org\Mxchange\CoreFramework\Command\Commandable;
 use Org\Mxchange\CoreFramework\Controller\Controller;
+use Org\Mxchange\CoreFramework\Helper\Application\ApplicationHelper;
 use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
 use Org\Mxchange\CoreFramework\Request\Requestable;
 use Org\Mxchange\CoreFramework\Resolver\Command\CommandResolver;
@@ -16,7 +17,7 @@ use Org\Mxchange\CoreFramework\Response\Responseable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2019 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2021 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -39,7 +40,7 @@ class ImageCodeCaptchaCommand extends BaseCommand implements Commandable {
         *
         * @return      void
         */
-       protected function __construct () {
+       private function __construct () {
                // Call parent constructor
                parent::__construct(__CLASS__);
        }
@@ -73,25 +74,22 @@ class ImageCodeCaptchaCommand extends BaseCommand implements Commandable {
                $decryptedCode = $requestInstance->getRequestElement('decrypted');
 
                // Get the application instance
-               $applicationInstance = GenericRegistry::getRegistry()->getInstance('application');
-
-               // Prepare a template instance
-               $templateInstance = $this->prepareTemplateInstance($applicationInstance);
+               $applicationInstance = ApplicationHelper::getSelfInstance();
 
                // Assign variable
-               $templateInstance->assignVariable('decrypted_code', $decryptedCode);
+               $this->getTemplateInstance()->assignVariable('decrypted_code', $decryptedCode);
 
                // Load the code (pardon, image...) template
-               $templateInstance->loadCodeTemplate('code_captcha');
+               $this->getTemplateInstance()->loadCodeTemplate('code_captcha');
 
                // Compile the template
-               $templateInstance->compileTemplate();
+               $this->getTemplateInstance()->compileTemplate();
 
                // Compile all variables
-               $templateInstance->compileVariables();
+               $this->getTemplateInstance()->compileVariables();
 
                // Transfer it to the response
-               $templateInstance->transferToResponse($responseInstance);
+               $this->getTemplateInstance()->transferToResponse($responseInstance);
        }
 
        /**