FrameworkBootstrap::getRequestTypeFromSystem()
))
);
- $resolverInstance = ObjectFactory::createObjectByName($resolverClass, array($commandName, $this));
+ $resolverInstance = ObjectFactory::createObjectByName($resolverClass, array($commandName));
// Get a controller instance as well
$this->setControllerInstance($resolverInstance->resolveController());
// And set it here
$this->setLanguageInstance($languageInstance);
- // Launch the test suite here
+ // Is html request?
+ if (FrameworkBootstrap::getRequestTypeFromSystem() == 'html') {
+ // Init web output instance
+ $this->initWebOutputInstance();
+ }
+
+ // Launch the application here
$this->getControllerInstance()->handleRequest($requestInstance, $responseInstance);
- // -------------------------- Shutdown phase --------------------------
- self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('MAIN: Shutdown in progress ...');
- $this->getControllerInstance()->executeShutdownFilters($requestInstance, $responseInstance);
- self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('MAIN: Shutdown completed. (This is the last line.)');
+ // Is console request?
+ if (FrameworkBootstrap::getRequestTypeFromSystem() == 'console') {
+ // -------------------------- Shutdown phase --------------------------
+ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('MAIN: Shutdown in progress ...');
+ $this->getControllerInstance()->executeShutdownFilters($requestInstance, $responseInstance);
+ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('MAIN: Shutdown completed. (This is the last line.)');
+ }
}
/**
$templateInstance = $this->prepareTemplateInstance($applicationInstance);
// Assign application data with template engine
- $templateInstance->assignApplicationData($applicationInstance);
+ $templateInstance->assignApplicationData();
// Assign base URL
$templateInstance->assignConfigVariable('base_url');
$templateInstance->assignConfigVariable('base_url');
// Assign all the application's data with template variables
- $templateInstance->assignApplicationData($applicationInstance);
+ $templateInstance->assignApplicationData();
// Load the master template
$masterTemplate = $applicationInstance->buildMasterTemplateName();
$this->actionName = $this->convertDashesToUnderscores($applicationInstance->getAppShortName()) . '_login_' . $actReq;
} // END - if
- // Get application instance
- $applicationInstance = GenericRegistry::getRegistry()->getInstance('application');
-
// Get a resolver
- $actionResolver = HtmlActionResolver::createHtmlActionResolver($this->actionName, $applicationInstance);
+ $actionResolver = HtmlActionResolver::createHtmlActionResolver($this->actionName);
// Resolve the action
$actionInstance = $actionResolver->resolveAction();
// Remember this action in registry
GenericRegistry::getRegistry()->addInstance('action', $actionInstance);
}
+
}
$templateInstance = $this->prepareTemplateInstance($applicationInstance);
// Assign application data with template engine
- $templateInstance->assignApplicationData($applicationInstance);
+ $templateInstance->assignApplicationData();
// Assign base URL
$templateInstance->assignConfigVariable('base_url');
$templateInstance = $this->prepareTemplateInstance($applicationInstance);
// Assign application data with template engine
- $templateInstance->assignApplicationData($applicationInstance);
+ $templateInstance->assignApplicationData();
// Load the master template
$masterTemplate = $applicationInstance->buildMasterTemplateName();
$templateInstance = $this->prepareTemplateInstance($applicationInstance);
// Assign the application data with the template engine
- $templateInstance->assignApplicationData($applicationInstance);
+ $templateInstance->assignApplicationData();
// Get a mailer class
- $mailerInstance = ObjectFactory::createObjectByConfiguredName('mailer_class', array($templateInstance, $applicationInstance, 'resend_link'));
+ $mailerInstance = ObjectFactory::createObjectByConfiguredName('mailer_class', array($templateInstance, 'resend_link'));
// Set this mailer in our template engine
$templateInstance->setMailerInstance($mailerInstance);
$templateInstance = $this->prepareTemplateInstance($applicationInstance);
// Assign application data
- $templateInstance->assignApplicationData($applicationInstance);
+ $templateInstance->assignApplicationData();
// Load the master template
$masterTemplate = $applicationInstance->buildMasterTemplateName();
// Get a registry
$applicationInstance = GenericRegistry::getRegistry()->getInstance('application');
- // Set the app instance
- $cityInstance->setApplicationInstance($applicationInstance);
-
// Add city-specific filters
$cityInstance->addExtraFilters($applicationInstance->getControllerInstance(), $responseInstance);
} else {
// Return the instance
return $cityInstance;
}
+
}
namespace Org\Mxchange\City\Resolver\Command;
// Import framework stuff
-use Org\Mxchange\CoreFramework\Manager\ManageableApplication;
use Org\Mxchange\CoreFramework\Resolver\Command\BaseCommandResolver;
use Org\Mxchange\CoreFramework\Resolver\Command\CommandResolver;
* Creates an instance of a CityConsole command resolver with a given default command
*
* @param $commandName The default command we shall execute
- * @param $applicationInstance An instance of a manageable application helper class
* @return $resolverInstance The prepared command resolver instance
* @throws EmptyVariableException Thrown if default command is not set
* @throws InvalidCommandException Thrown if default command is invalid
*/
- public static final function createCityConsoleCommandResolver ($commandName, ManageableApplication $applicationInstance) {
+ public static final function createCityConsoleCommandResolver ($commandName) {
// Create the new instance
$resolverInstance = new CityConsoleCommandResolver();
throw new InvalidCommandException(array($resolverInstance, $commandName), self::EXCEPTION_INVALID_COMMAND);
}
- // Set namespace and application instance
+ // Set namespace
$resolverInstance->setNamespace('Org\Mxchange\City\Command');
- $resolverInstance->setApplicationInstance($applicationInstance);
// Return the prepared instance
return $resolverInstance;
}
+
}
namespace Org\Mxchange\City\Resolver\Command;
// Import framework stuff
-use Org\Mxchange\CoreFramework\Manager\ManageableApplication;
use Org\Mxchange\CoreFramework\Resolver\Command\BaseCommandResolver;
use Org\Mxchange\CoreFramework\Resolver\Command\CommandResolver;
* Creates an instance of a CityHtml command resolver with a given default command
*
* @param $commandName The default command we shall execute
- * @param $applicationInstance An instance of a manageable application helper class
* @return $resolverInstance The prepared command resolver instance
* @throws EmptyVariableException Thrown if default command is not set
* @throws InvalidCommandException Thrown if default command is invalid
*/
- public static final function createCityHtmlCommandResolver ($commandName, ManageableApplication $applicationInstance) {
+ public static final function createCityHtmlCommandResolver ($commandName) {
// Create the new instance
$resolverInstance = new CityHtmlCommandResolver();
throw new InvalidCommandException(array($resolverInstance, $commandName), self::EXCEPTION_INVALID_COMMAND);
}
- // Set namespace and application instance
+ // Set namespace
$resolverInstance->setNamespace('Org\Mxchange\City\Command');
- $resolverInstance->setApplicationInstance($applicationInstance);
// Return the prepared instance
return $resolverInstance;
}
+
}
namespace Org\Mxchange\City\Resolver\Controller;
// Import framework stuff
-use Org\Mxchange\CoreFramework\Manager\ManageableApplication;
use Org\Mxchange\CoreFramework\Resolver\Controller\BaseControllerResolver;
use Org\Mxchange\CoreFramework\Resolver\Controller\ControllerResolver;
* Creates an instance of a resolver class with a given controller
*
* @param $controllerName The controller we shall resolve
- * @param $applicationInstance An instance of a manageable application helper class
* @return $resolverInstance The prepared controller resolver instance
* @throws EmptyVariableException Thrown if default controller is not set
* @throws InvalidControllerException Thrown if default controller is invalid
*/
- public static final function createCityConsoleControllerResolver ($controllerName, ManageableApplication $applicationInstance) {
+ public static final function createCityConsoleControllerResolver ($controllerName) {
// Create the new instance
$resolverInstance = new CityConsoleControllerResolver();
throw new InvalidControllerException(array($resolverInstance, $controllerName), self::EXCEPTION_INVALID_CONTROLLER);
}
- // Set the application instance
- $resolverInstance->setApplicationInstance($applicationInstance);
-
// Set namespace and controller name
$resolverInstance->setNamespace('Org\Mxchange\City\Controller');
$resolverInstance->setControllerName($controllerName);
// Return the prepared instance
return $resolverInstance;
}
+
}
namespace Org\Mxchange\City\Resolver\Controller;
// Import framework stuff
-use Org\Mxchange\CoreFramework\Manager\ManageableApplication;
use Org\Mxchange\CoreFramework\Resolver\Controller\BaseControllerResolver;
use Org\Mxchange\CoreFramework\Resolver\Controller\ControllerResolver;
* Creates an instance of a resolver class with a given controller
*
* @param $controllerName The controller we shall resolve
- * @param $applicationInstance An instance of a manageable application helper class
* @return $resolverInstance The prepared controller resolver instance
* @throws EmptyVariableException Thrown if default controller is not set
* @throws InvalidControllerException Thrown if default controller is invalid
*/
- public static final function createCityHtmlControllerResolver ($controllerName, ManageableApplication $applicationInstance) {
+ public static final function createCityHtmlControllerResolver ($controllerName) {
// Create the new instance
$resolverInstance = new CityHtmlControllerResolver();
throw new InvalidControllerException(array($resolverInstance, $controllerName), self::EXCEPTION_INVALID_CONTROLLER);
}
- // Set the application instance
- $resolverInstance->setApplicationInstance($applicationInstance);
-
// Set namespace and controller name
$resolverInstance->setNamespace('Org\Mxchange\City\Controller');
$resolverInstance->setControllerName($controllerName);
// Return the prepared instance
return $resolverInstance;
}
+
}
namespace Org\Mxchange\City\Resolver\Controller;
// Import framework stuff
-use Org\Mxchange\CoreFramework\Manager\ManageableApplication;
use Org\Mxchange\CoreFramework\Resolver\Controller\BaseControllerResolver;
use Org\Mxchange\CoreFramework\Resolver\Controller\ControllerResolver;
* Creates an instance of a resolver class with a given controller
*
* @param $controllerName The controller we shall resolve
- * @param $applicationInstance An instance of a manageable application helper class
* @return $resolverInstance The prepared controller resolver instance
* @throws EmptyVariableException Thrown if default controller is not set
* @throws InvalidControllerException Thrown if default controller is invalid
*/
- public static final function createCityImageControllerResolver ($controllerName, ManageableApplication $applicationInstance) {
+ public static final function createCityImageControllerResolver ($controllerName) {
// Create the new instance
$resolverInstance = new CityImageControllerResolver();
throw new InvalidControllerException(array($resolverInstance, $controllerName), self::EXCEPTION_INVALID_CONTROLLER);
}
- // Set the application instance
- $resolverInstance->setApplicationInstance($applicationInstance);
-
// Set namespace and controller name
$resolverInstance->setNamespace('Org\Mxchange\City\Controller');
$resolverInstance->setControllerName($controllerName);
// Return the prepared instance
return $resolverInstance;
}
+
}
-Subproject commit e137daa3a06f4b9e3767db913854c609383e8533
+Subproject commit 2b4f4b88ec5f9d385110e800494c680e164b5a36
$applicationInstance = ApplicationHelper::getSelfInstance();
// Assign application data
- $templateInstance->assignApplicationData($applicationInstance);
+ $templateInstance->assignApplicationData();
} // END - if
// We only try this