$this->executePreFilters($requestInstance, $responseInstance);
// This request was valid! :-D
- $requestInstance->requestIsValid();
+ $requestInstance->setIsRequestValid(TRUE);
// Execute the command
$commandInstance->execute($requestInstance, $responseInstance);
}
// This request was valid! :-D
- $requestInstance->requestIsValid();
+ $requestInstance->setIsRequestValid(TRUE);
// Execute the command
$commandInstance->execute($requestInstance, $responseInstance);
$commandInstance = $this->getResolverInstance()->resolveCommandByRequest($requestInstance);
// This request was valid! :-D
- $requestInstance->requestIsValid();
+ $requestInstance->setIsRequestValid(TRUE);
// Execute the command
$commandInstance->execute($requestInstance, $responseInstance);
$commandInstance = $this->getResolverInstance()->resolveCommandByRequest($requestInstance);
// This request was valid! :-D
- $requestInstance->requestIsValid();
+ $requestInstance->setIsRequestValid(TRUE);
// Execute the command
$commandInstance->execute($requestInstance, $responseInstance);
$commandInstance = $this->getResolverInstance()->resolveCommandByRequest($requestInstance);
// This request was valid! :-D
- $requestInstance->requestIsValid();
+ $requestInstance->setIsRequestValid(TRUE);
// Execute the command
$commandInstance->execute($requestInstance, $responseInstance);
$commandInstance = $this->getResolverInstance()->resolveCommandByRequest($requestInstance);
// This request was valid! :-D
- $requestInstance->requestIsValid();
+ $requestInstance->setIsRequestValid(TRUE);
// Execute the command
$commandInstance->execute($requestInstance, $responseInstance);
$commandInstance = $this->getResolverInstance()->resolveCommandByRequest($requestInstance);
// This request was valid! :-D
- $requestInstance->requestIsValid();
+ $requestInstance->setIsRequestValid(TRUE);
// Execute the command
$commandInstance->execute($requestInstance, $responseInstance);
$commandInstance = $this->getResolverInstance()->resolveCommandByRequest($requestInstance);
// This request was valid! :-D
- $requestInstance->requestIsValid();
+ $requestInstance->setIsRequestValid(TRUE);
// Execute the command
$commandInstance->execute($requestInstance, $responseInstance);
$authInstance->destroyAuthData();
// Mark the request as invalid
- $requestInstance->requestIsValid(false);
+ $requestInstance->setIsRequestValid(FALSE);
// Add fatal message
$responseInstance->addFatalMessage('auth_data_incomplete');
// Is only first email set?
if ((!empty($email1)) && (empty($email2))) {
// Request is invalid!
- $requestInstance->requestIsValid(false);
+ $requestInstance->setIsRequestValid(FALSE);
// Email 2 is empty
$responseInstance->addFatalMessage('email2_empty');
// Is only second email set?
if ((empty($email1)) && (!empty($email2))) {
// Request is invalid!
- $requestInstance->requestIsValid(false);
+ $requestInstance->setIsRequestValid(FALSE);
// Email 1 is empty
$responseInstance->addFatalMessage('email1_empty');
// Do both match?
if ($email1 != $email2) {
// Request is invalid!
- $requestInstance->requestIsValid(false);
+ $requestInstance->setIsRequestValid(FALSE);
// Emails are mismatching
$responseInstance->addFatalMessage('emails_mismatch');
// Is only first email set?
if ((!empty($pass1)) && (empty($pass2))) {
// Request is invalid!
- $requestInstance->requestIsValid(false);
+ $requestInstance->setIsRequestValid(FALSE);
// Email 2 is empty
$responseInstance->addFatalMessage('pass2_empty');
// Is only second pass set?
if ((empty($pass1)) && (!empty($pass2))) {
// Request is invalid!
- $requestInstance->requestIsValid(false);
+ $requestInstance->setIsRequestValid(FALSE);
// Email 1 is empty
$responseInstance->addFatalMessage('pass1_empty');
// Do both match?
if ($pass1 != $pass2) {
// Request is invalid!
- $requestInstance->requestIsValid(false);
+ $requestInstance->setIsRequestValid(FALSE);
// Emails are mismatching
$responseInstance->addFatalMessage('pass_mismatch');
// Was the "rules" value found in form? And is it set?
if (is_null($rules)) {
// Not found in form so stop processing here
- $requestInstance->requestIsValid(false);
+ $requestInstance->setIsRequestValid(FALSE);
// Add a message to the response
$responseInstance->addFatalMessage('rules_unchecked');
// Is it there?
if (is_null($encryptRequest)) {
// Not found, so request is invalid
- $requestInstance->requestIsValid(false);
+ $requestInstance->setIsRequestValid(FALSE);
// Throw exception
throw new EncryptMissingException($this, CryptoHelper::EXCEPTION_ENCRYPT_MISSING);
// Is it the expected length?
if (strlen($decryptedString) != FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('captcha_string_length')) {
// Not found, so request is invalid
- $requestInstance->requestIsValid(false);
+ $requestInstance->setIsRequestValid(FALSE);
// Throw exception
throw new EncryptInvalidLengthException($this, CryptoHelper::EXCEPTION_ENCRYPT_INVALID);
GenericRegistry::getRegistry()->addInstance('payments', $discoveryInstance);
} catch (NoConfigEntryException $e) {
// Something bad happend
- $requestInstance->requestIsValid(false);
+ $requestInstance->setIsRequestValid(FALSE);
// Add a message to the response
$responseInstance->addFatalMessage('payment_config_entry_error');
throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
} catch (NoClassException $e) {
// Something bad happend
- $requestInstance->requestIsValid(false);
+ $requestInstance->setIsRequestValid(FALSE);
// Add a message to the response
$responseInstance->addFatalMessage('payment_class_error');
// Is the email still not set?
if ((is_null($email1)) || (is_null($email2))) {
// Not found in form so stop the filtering process
- $requestInstance->requestIsValid(false);
+ $requestInstance->setIsRequestValid(FALSE);
// Add a message to the response
$responseInstance->addFatalMessage('email_unset');
throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
} elseif ((empty($email1)) || (empty($email2))) {
// Email is empty
- $requestInstance->requestIsValid(false);
+ $requestInstance->setIsRequestValid(FALSE);
// Is the email empty?
if (empty($email1)) {
throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
} elseif ($this->ifEmailIsTaken($email1)) {
// Email is already taken
- $requestInstance->requestIsValid(false);
+ $requestInstance->setIsRequestValid(FALSE);
// Add a message to the response
$responseInstance->addFatalMessage('email_taken');
throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
} elseif ($email1 != $email2) {
// Emails didn't match
- $requestInstance->requestIsValid(false);
+ $requestInstance->setIsRequestValid(FALSE);
// Add a message to the response
$responseInstance->addFatalMessage('emails_mismatch');
}
} elseif (empty($email)) {
// Empty field!
- $requestInstance->requestIsValid(false);
+ $requestInstance->setIsRequestValid(FALSE);
// Add a message to the response
$responseInstance->addFatalMessage('email_empty');
// Is the password still not set?
if ((is_null($password1)) || (is_null($password2))) {
// Not found in form so stop the filtering process
- $requestInstance->requestIsValid(false);
+ $requestInstance->setIsRequestValid(FALSE);
// Add a message to the response
$responseInstance->addFatalMessage('password_unset');
throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
} elseif ((empty($password1)) || (empty($password2))) {
// Password is empty
- $requestInstance->requestIsValid(false);
+ $requestInstance->setIsRequestValid(FALSE);
// Is the password empty?
if (empty($password1)) {
throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
} elseif ($password1 != $password2) {
// Passwords didn't match
- $requestInstance->requestIsValid(false);
+ $requestInstance->setIsRequestValid(FALSE);
// Add a message to the response
$responseInstance->addFatalMessage('pass_mismatch');
// Is the username set?
if (is_null($userName)) {
// Not found in form so stop the filtering process
- $requestInstance->requestIsValid(false);
+ $requestInstance->setIsRequestValid(FALSE);
// Add a message to the response
$responseInstance->addFatalMessage('username_unset');
throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
} elseif (empty($userName)) {
// Empty field!
- $requestInstance->requestIsValid(false);
+ $requestInstance->setIsRequestValid(FALSE);
// Add a message to the response
$responseInstance->addFatalMessage('username_empty');
throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
} elseif ($this->ifUserNameIsTaken($userName)) {
// Username is already taken
- $requestInstance->requestIsValid(false);
+ $requestInstance->setIsRequestValid(FALSE);
// Add a message to the response
$responseInstance->addFatalMessage('username_taken');
// Is the password still not set?
if (is_null($password)) {
// Not found in form so stop the filtering process
- $requestInstance->requestIsValid(false);
+ $requestInstance->setIsRequestValid(FALSE);
// Add a message to the response
$responseInstance->addFatalMessage('password_unset');
if (empty($password)) {
// Password is empty
- $requestInstance->requestIsValid(false);
+ $requestInstance->setIsRequestValid(FALSE);
// Add a message to the response
$responseInstance->addFatalMessage('password_empty');
// Day of birth set?
if (!$requestInstance->isRequestElementSet('birth_day')) {
// Day of birth isn't set
- $requestInstance->requestIsValid(false);
+ $requestInstance->setIsRequestValid(FALSE);
// Add a message to the response
$responseInstance->addFatalMessage('day_of_birth_unset');
// Month of birth set?
if (!$requestInstance->isRequestElementSet('birth_month')) {
// Month of birth isn't set
- $requestInstance->requestIsValid(false);
+ $requestInstance->setIsRequestValid(FALSE);
// Add a message to the response
$responseInstance->addFatalMessage('month_of_birth_unset');
// Year of birth set?
if (!$requestInstance->isRequestElementSet('birth_year')) {
// Year of birth isn't set
- $requestInstance->requestIsValid(false);
+ $requestInstance->setIsRequestValid(FALSE);
// Add a message to the response
$responseInstance->addFatalMessage('year_of_birth_unset');
// Is there a number or such? (we don't care about the value itself here)
if (empty($birthCheck)) {
// Validation has failed
- $requestInstance->requestIsValid(false);
+ $requestInstance->setIsRequestValid(FALSE);
// Add a message to the response
$responseInstance->addFatalMessage('birthday_invalid');
// Is this code set?
if (is_null($confirmCode)) {
// Is not in request
- $requestInstance->requestIsValid(false);
+ $requestInstance->setIsRequestValid(FALSE);
// Add a message to the response
$responseInstance->addFatalMessage('confirm_code_unset');
throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
} elseif (empty($confirmCode)) {
// Email is empty
- $requestInstance->requestIsValid(false);
+ $requestInstance->setIsRequestValid(FALSE);
// Add a message to the response
$responseInstance->addFatalMessage('confirm_code_empty');
// Do we have the same code or different?
if ($userCode != $confirmCode) {
// Email is empty
- $requestInstance->requestIsValid(false);
+ $requestInstance->setIsRequestValid(FALSE);
// Redirect to error page
$responseInstance->redirectToConfiguredUrl('confirm_code_invalid');
// Is the form set?
if (($requestInstance->getRequestElement('command') !== 'do_form') || (!$requestInstance->isRequestElementSet('form'))) {
// Required field not set
- $requestInstance->requestIsValid(false);
+ $requestInstance->setIsRequestValid(FALSE);
// Add fatal message
$responseInstance->addFatalMessage('command_form_invalid');
// Is this set?
if (is_null($captchaCode)) {
// Not set so request is invalid
- $requestInstance->requestIsValid(false);
+ $requestInstance->setIsRequestValid(FALSE);
// Add fatal message
$responseInstance->addFatalMessage('captcha_code_unset');
throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
} elseif (empty($captchaCode)) {
// Empty value so request is invalid
- $requestInstance->requestIsValid(false);
+ $requestInstance->setIsRequestValid(FALSE);
// Add fatal message
$responseInstance->addFatalMessage('captcha_code_empty');
// Is this set?
if (is_null($captchaHash)) {
// Not set so request is invalid
- $requestInstance->requestIsValid(false);
+ $requestInstance->setIsRequestValid(FALSE);
// Add fatal message
$responseInstance->addFatalMessage('captcha_hash_unset');
throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
} elseif (empty($captchaHash)) {
// Empty value so request is invalid
- $requestInstance->requestIsValid(false);
+ $requestInstance->setIsRequestValid(FALSE);
// Add fatal message
$responseInstance->addFatalMessage('captcha_hash_empty');
// Is this CAPTCHA valid?
if ($hashedCode != $captchaHash) {
// Not the same so request is invalid
- $requestInstance->requestIsValid(false);
+ $requestInstance->setIsRequestValid(FALSE);
// Add fatal message
$responseInstance->addFatalMessage('captcha_hash_mismatch');
// Is the password still not set?
if (is_null($password)) {
// Not found in form so stop the filtering process
- $requestInstance->requestIsValid(false);
+ $requestInstance->setIsRequestValid(FALSE);
// Add a message to the response
$responseInstance->addFatalMessage('password_unset');
throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
} elseif (empty($password)) {
// Password is empty
- $requestInstance->requestIsValid(false);
+ $requestInstance->setIsRequestValid(FALSE);
// Add a message to the response
$responseInstance->addFatalMessage('password_empty');
// Is the password still not set?
if (is_null($password)) {
// Not found in form so stop the filtering process
- $requestInstance->requestIsValid(false);
+ $requestInstance->setIsRequestValid(FALSE);
// Add a message to the response
$responseInstance->addFatalMessage('password_unset');
throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
} elseif (empty($password)) {
// Password is empty
- $requestInstance->requestIsValid(false);
+ $requestInstance->setIsRequestValid(FALSE);
// Add a message to the response
$responseInstance->addFatalMessage('password_empty');
// Is the username set?
if (is_null($userName)) {
// Not found in form so stop the filtering process
- $requestInstance->requestIsValid(false);
+ $requestInstance->setIsRequestValid(FALSE);
// Add a message to the response
$responseInstance->addFatalMessage('username_guest_unset');
throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
} elseif (empty($userName)) {
// Empty field!
- $requestInstance->requestIsValid(false);
+ $requestInstance->setIsRequestValid(FALSE);
// Add a message to the response
$responseInstance->addFatalMessage('username_guest_empty');
throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
} elseif ($this->ifUserGuestIsTaken($userName) === false) {
// Username is already taken
- $requestInstance->requestIsValid(false);
+ $requestInstance->setIsRequestValid(FALSE);
// Add a message to the response
$responseInstance->addFatalMessage('username_guest_not_found');
// Is the username set?
if (is_null($userName)) {
// Not found in form so stop the filtering process
- $requestInstance->requestIsValid(false);
+ $requestInstance->setIsRequestValid(FALSE);
// Add a message to the response
$responseInstance->addFatalMessage('username_unset');
throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
} elseif (empty($userName)) {
// Empty field!
- $requestInstance->requestIsValid(false);
+ $requestInstance->setIsRequestValid(FALSE);
// Add a message to the response
$responseInstance->addFatalMessage('username_empty');
throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
} elseif ($this->ifUserNameIsTaken($userName) === false) {
// Username is already taken
- $requestInstance->requestIsValid(false);
+ $requestInstance->setIsRequestValid(FALSE);
// Add a message to the response
$responseInstance->addFatalMessage('username_not_found');
// Is the user account confirmed?
if ((!$userInstance->isConfirmed()) && (!$userInstance->isGuest()) && ($requestInstance->getRequestElement('action') != FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('action_status_problem'))) {
// Request is invalid!
- $requestInstance->requestIsValid(false);
+ $requestInstance->setIsRequestValid(FALSE);
// Redirect to configured URL
$responseInstance->redirectToConfiguredUrl('login_user_status');
// Is the email address valid?
if ($userInstance->ifEmailAddressExists() === false) {
// Request is invalid!
- $requestInstance->requestIsValid(false);
+ $requestInstance->setIsRequestValid(FALSE);
// Redirect to configured URL
$responseInstance->redirectToConfiguredUrl('user_unconfirmed_email_missing');
// Is the user account confirmed?
if ($userInstance->getField(UserDatabaseFrontend::DB_COLUMN_USER_STATUS) != FrameworkBootstrap::getConfigurationInstance()->getConfigEntry('user_status_unconfirmed')) {
// Request is invalid!
- $requestInstance->requestIsValid(false);
+ $requestInstance->setIsRequestValid(FALSE);
// Redirect to configured URL
$responseInstance->redirectToConfiguredUrl('user_not_unconfirmed');
* valid so make sure your intercepting filters sets this attribute to false
* when they need to intercept the data flow.
*/
- private $requestIsValid = true;
+ private $isRequestValid = true;
/**
* Protected constructor
}
/**
- * Sets whether the request was valid (default: true)
+ * Sets whether the request was valid
*
* @param $isValid Whether the request is valid
* @return void
*/
- public final function requestIsValid (bool $isValid = true) {
- $this->requestIsValid = $isValid;
+ public final function setIsRequestValid (bool $isValid) {
+ $this->isRequestValid = $isValid;
}
/**
* Returns whether this request is valid
*
- * @return $requestIsValid Whether this request is valid
+ * @return $isRequestValid Whether this request is valid
*/
public final function isRequestValid () {
- return $this->requestIsValid;
+ return $this->isRequestValid;
}
}
function getParameterNames ();
/**
- * Sets whether the request was valid (default: true)
+ * Sets whether the request was valid
*
* @param $isValid Whether the request is valid
* @return void
*/
- function requestIsValid (bool $isValid = true);
+ function setIsRequestValid (bool $isValid);
/**
* Returns whether this request is valid
*
- * @return $requestIsValid Whether this request is valid
+ * @return $isRequestValid Whether this request is valid
*/
function isRequestValid ();
*/
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', 'shutdown'] as $filterChain) {
+ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('TEST-CONSOLE-DEFAULT-NEWS-CONTROLLER: Initializing filterChain=%s ...', $filterChain));
$this->initFilterChain($filterChain);
}
+
+ // 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!');
}
/**