*
* @author Roland Haeder <webmaster@shipsimu.org>
* @version 0.0.0
- * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2020 Core Developer Team
+ * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
* @license GNU GPL 3.0 or any newer version
* @link http://www.shipsimu.org
*
*/
private function __construct () {
// Call parent constructor
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TEST-CONSOLE-DEFAULT-NEWS-CONTROLLER: CONSTRUCTED!');
parent::__construct(__CLASS__);
// Init additional filter chains
- foreach (array('bootstrap', 'tests', 'shutdown') as $filterChain) {
+ foreach (['bootstrap', 'tests', BaseController::FILTER_CHAIN_SHUTDOWN] as $filterChain) {
+ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('TEST-CONSOLE-DEFAULT-NEWS-CONTROLLER: Initializing filterChain=%s ...', $filterChain));
$this->initFilterChain($filterChain);
- } // END - foreach
+ }
+
+ // Trace message
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TEST-CONSOLE-DEFAULT-NEWS-CONTROLLER: EXIT!');
}
/**
*/
public static final function createTestsConsoleDefaultNewsController (CommandResolver $resolverInstance) {
// Create the instance
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('TEST-CONSOLE-DEFAULT-NEWS-CONTROLLER: resolverInstance=%s - CALLED!', $resolverInstance->__toString()));
$controllerInstance = new TestsConsoleDefaultNewsController();
// Set the command resolver
$controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('news_process_filter_class'));
// Return the prepared instance
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('TEST-CONSOLE-DEFAULT-NEWS-CONTROLLER: controllerInstance=%s - EXIT!', $controllerInstance->__toString()));
return $controllerInstance;
}
*/
public function handleRequest (Requestable $requestInstance, Responseable $responseInstance) {
// Get the command instance from the resolver by sending a request instance to the resolver
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('TEST-CONSOLE-DEFAULT-NEWS-CONTROLLER: requestInstance=%s,responseInstance=%s - CALLED!', $requestInstance->__toString(), $responseInstance->__toString()));
$commandInstance = $this->getResolverInstance()->resolveCommandByRequest($requestInstance);
// Add more filters by the command
$this->executePreFilters($requestInstance, $responseInstance);
// This request was valid! :-D
- $requestInstance->requestIsValid();
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TEST-CONSOLE-DEFAULT-NEWS-CONTROLLER: Invoking requestInstance->setIsRequestValid(TRUE) ...');
+ $requestInstance->setIsRequestValid(TRUE);
// Execute the command
$commandInstance->execute($requestInstance, $responseInstance);
$this->executePostFilters($requestInstance, $responseInstance);
// Flush the response out
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TEST-CONSOLE-DEFAULT-NEWS-CONTROLLER: Invoking responseInstance->flushBuffer() ...');
$responseInstance->flushBuffer();
+
+ // Trace message
+ /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TEST-CONSOLE-DEFAULT-NEWS-CONTROLLER: EXIT!');
}
/**