// Are there arguments?
if ((isset($dbgInfo['args'])) && (is_array($dbgInfo['args'])) && (isset($dbgInfo['args'][0]))) {
- //* DEBUG: */ echo $dbgIndex.": <pre>".htmlentities(print_r($dbgInfo['args'], true))."</pre>";
+ //* DEBUG: */ echo $dbgIndex.": <pre>".htmlentities(print_r($dbgInfo['args'], TRUE))."</pre>";
$info = '';
foreach ($dbgInfo['args'] as $debug) {
// Add only non-array elements
<?php
/**
- * An exception thrown when the form name is invalid (set to false)
+ * An exception thrown when the form name is invalid (set to FALSE)
*
* @author Roland Haeder <webmaster@ship-simu.org>
* @version 0.0.0
*/
public function __construct (BaseHelper $helperInstance, $code) {
// Add a message around the missing class
- $message = sprintf("[%s:%d] Form name not set.",
+ $message = sprintf('[%s:%d] Form name not set.',
$helperInstance->__toString(),
$this->getLine()
);
interface RegisterableSocket extends Registerable {
/**
* Checks whether given socket resource is registered. If $socketResource is
- * false only the instance will be checked.
+ * FALSE only the instance will be checked.
*
* @param $protocolInstance An instance of a ProtocolHandler class
* @param $socketResource A valid socket resource
function getHeader ($headerName);
/**
- * Sets whether the request was valid (default: true)
+ * Sets whether the request was valid (default: TRUE)
*
* @param $isValid Whether the request is valid
* @return void
* "Compiles" a variable by replacing {?var?} with it's content
*
* @param $rawCode Raw code to compile
- * @param $setMatchAsCode Sets $match if readVariable() returns empty result
- * @return $rawCode Compile code with inserted variable value
+ * @param $setMatchAsCode Sets $match if readVariable() returns empty result (default: FALSE)
+ * @return $rawCode Compile code with inserted variable value
*/
- function compileRawCode ($rawCode, $setMatchAsCode=false);
+ function compileRawCode ($rawCode, $setMatchAsCode = FALSE);
/**
* Renames a variable in code and in stack
$this->setConfigInstance(FrameworkConfiguration::getSelfInstance());
} // END - if
- // Is the startup time set? (0 cannot be true anymore)
+ // Is the startup time set? (0 cannot be TRUE anymore)
if (self::$startupTime == 0) {
// Then set it
- self::$startupTime = microtime(true);
+ self::$startupTime = microtime(TRUE);
} // END - if
}
// .. or size if array
$argsString .= ', ' . count($arg);
} elseif ($arg === TRUE) {
- // ... is boolean 'true'
- $argsString .= ', true';
+ // ... is boolean 'TRUE'
+ $argsString .= ', TRUE';
} elseif ($arg === FALSE) {
- // ... is boolean 'true'
- $argsString .= ', false';
+ // ... is boolean 'FALSE'
+ $argsString .= ', FALSE';
}
// Closing bracket
$content .= sprintf('<pre>%s</pre>',
trim(
htmlentities(
- print_r($this, true)
+ print_r($this, TRUE)
)
)
);
* Outputs a debug backtrace and stops further script execution
*
* @param $message An optional message to output
- * @param $doExit Whether exit the program (true is default)
+ * @param $doExit Whether exit the program (TRUE is default)
* @return void
*/
public function debugBackTrace ($message = '', $doExit = TRUE) {
*
* @param $message Message we shall send out...
* @param $doPrint Whether print or die here (default: print)
- * @paran $stripTags Whether to strip tags (default: false)
+ * @paran $stripTags Whether to strip tags (default: FALSE)
* @return void
*/
public function debugOutput ($message, $doPrint = TRUE, $stripTags = FALSE) {
// Get current array
$fieldArray = $resultInstance->current();
- //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput($fieldName.':<pre>'.print_r($fieldArray, true).'</pre>');
+ //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput($fieldName.':<pre>'.print_r($fieldArray, TRUE).'</pre>');
// Convert dashes to underscore
$fieldName = $this->convertDashesToUnderscores($fieldName);
*/
public function getMilliTime () {
// Get the time of day as float
- $milliTime = gettimeofday(true);
+ $milliTime = gettimeofday(TRUE);
// Return it
return $milliTime;
*/
protected function isBase64Encoded ($encodedData) {
// Determine it
- $isBase64 = (@base64_decode($encodedData, true) !== FALSE);
+ $isBase64 = (@base64_decode($encodedData, TRUE) !== FALSE);
// Return it
return $isBase64;
*/
protected function getPrintableExecutionTime () {
// Caculate the execution time
- $executionTime = microtime(true) - $this->getStartupTime();
+ $executionTime = microtime(TRUE) - $this->getStartupTime();
// Pack it in nice braces
$executionTime = sprintf('[ %01.5f ] ', $executionTime);
} // END - if
// Decompress it
- $streamData = bzdecompress($streamData, true);
+ $streamData = bzdecompress($streamData, TRUE);
// Return the decompressed stream
return $streamData;
// If the response is invalid, abort
if ((count($response) == 3) && (empty($response[0])) && (empty($response[1])) && (empty($response[2]))) {
// Invalid response!
- $helperInstance->debugBackTrace('Proxy tunnel not working: response=' . print_r($response, true));
+ $helperInstance->debugBackTrace('Proxy tunnel not working: response=' . print_r($response, TRUE));
} // END - if
} else {
// Add header for proxy
unset($packageData[NetworkPackage::PACKAGE_DATA_SIGNATURE]);
// Debug message
- //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(__METHOD__ . ':socketResource=' . $socketResource . ',packageData='.print_r($packageData,true));
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(__METHOD__ . ':socketResource=' . $socketResource . ',packageData='.print_r($packageData, TRUE));
// Set the resource ...
$containerInstance->setSocketResource($socketResource);
$packageData = $this->getPackageData();
// Debug message
- //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-CONTAINER: addressPort=' . $addressPort . ',packageData=' . print_r($packageData, true));
+ //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('SOCKET-CONTAINER: addressPort=' . $addressPort . ',packageData=' . print_r($packageData, TRUE));
// So, does both match?
$matches = ((isset($packageData[NetworkPackage::PACKAGE_DATA_RECIPIENT])) && ($packageData[NetworkPackage::PACKAGE_DATA_RECIPIENT] === $addressPort));
*
* @param $rawCode Raw code to compile
* @param $setMatchAsCode Sets $match if readVariable() returns empty result
- * @return $rawCode Compile code with inserted variable value
+ * @return $rawCode Compile code with inserted variable value
*/
- public function compileRawCode ($rawCode, $setMatchAsCode=false) {
+ public function compileRawCode ($rawCode, $setMatchAsCode = FALSE) {
return $this->getTemplateInstance()->compileRawCode($rawCode, $setMatchAsCode);
}
// Get result back
$resultInstance = $wrapperInstance->doSelectByCriteria($criteriaInstance);
- // Advanced to next entry
- if (!$resultInstance->next()) {
- // Not valid!
- assert(false);
- } // END - if
+ // Advanced to next entry and assert on it as it should always be there
+ assert($resultInstance->next());
// Set the result instance
$this->setResultInstance($resultInstance);
$templateInstance = ObjectFactory::createObjectByConfiguredName($configEntry);
// Disable language support
- $templateInstance->enableLanguageSupport(false);
+ $templateInstance->enableLanguageSupport(FALSE);
/*
* Enable compacting/rewriting of the XML to save bandwidth from XML
$authInstance->destroyAuthData();
// Mark the request as invalid
- $requestInstance->requestIsValid(false);
+ $requestInstance->requestIsValid(FALSE);
// Add fatal message
$responseInstance->addFatalMessage('auth_data_incomplete');
* @param $requestInstance An instance of a class with an Requestable interface
* @param $responseInstance An instance of a class with an Responseable interface
* @return void
+ * @throws FilterChainException If this filter fails to operate
* @todo Implement email change of the user here. HINT: Use the User class!
*/
public function execute (Requestable $requestInstance, Responseable $responseInstance) {
// Is only first email set?
if ((!empty($email1)) && (empty($email2))) {
// Request is invalid!
- $requestInstance->requestIsValid(false);
+ $requestInstance->requestIsValid(FALSE);
// Email 2 is empty
$responseInstance->addFatalMessage('email2_empty');
// Stop processing here
- return false;
+ throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
} // END - if
// Is only second email set?
if ((empty($email1)) && (!empty($email2))) {
// Request is invalid!
- $requestInstance->requestIsValid(false);
+ $requestInstance->requestIsValid(FALSE);
// Email 1 is empty
$responseInstance->addFatalMessage('email1_empty');
// Stop processing here
- return false;
+ throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
} // END - if
// Do both match?
if ($email1 != $email2) {
// Request is invalid!
- $requestInstance->requestIsValid(false);
+ $requestInstance->requestIsValid(FALSE);
// Emails are mismatching
$responseInstance->addFatalMessage('emails_mismatch');
// Stop processing here
- return false;
+ throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
} // END - if
// Are email and confirmation empty?
if ((empty($email1)) && (empty($email2))) {
// No email change required!
- return true;
+ return TRUE;
} // END - if
// Now, get a user instance for comparison
// Are they different?
if ($userEmail == $email1) {
// Nothing has been changed is fine...
- return true;
+ return TRUE;
} // END - if
// Update the "new_email" field
- $this->partialStub("Unfinished part.");
+ $this->partialStub('Unfinished part.');
}
}
* @param $responseInstance An instance of a class with an Responseable interface
* @return void
* @todo Finished updating user password hash here. HINT: Use the User class again.
+ * @throws FilterChainException If this filter fails to operate
*/
public function execute (Requestable $requestInstance, Responseable $responseInstance) {
// Get both passwords
// Is only first email set?
if ((!empty($pass1)) && (empty($pass2))) {
// Request is invalid!
- $requestInstance->requestIsValid(false);
+ $requestInstance->requestIsValid(FALSE);
// Email 2 is empty
$responseInstance->addFatalMessage('pass2_empty');
// Stop processing here
- return false;
+ throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
} // END - if
// Is only second pass set?
if ((empty($pass1)) && (!empty($pass2))) {
// Request is invalid!
- $requestInstance->requestIsValid(false);
+ $requestInstance->requestIsValid(FALSE);
// Email 1 is empty
$responseInstance->addFatalMessage('pass1_empty');
// Stop processing here
- return false;
+ throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
} // END - if
// Are password and confirmation empty?
if ((empty($pass1)) && (empty($pass2))) {
// Don't change password here
- return true;
+ return TRUE;
} // END - if
// Do both match?
if ($pass1 != $pass2) {
// Request is invalid!
- $requestInstance->requestIsValid(false);
+ $requestInstance->requestIsValid(FALSE);
// Emails are mismatching
$responseInstance->addFatalMessage('pass_mismatch');
// Stop processing here
- return false;
+ throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
} // END - if
// Now, get a user instance for comparison
$userInstance = Registry::getRegistry()->getInstance('user');
// Update the "password" field
- $this->partialStub("Unfinished part.");
+ $this->partialStub('Unfinished part.');
}
}
* @param $requestInstance An instance of a class with an Requestable interface
* @param $responseInstance An instance of a class with an Responseable interface
* @return void
+ * @throws FilterChainException If this filter fails to operate
*/
public function execute (Requestable $requestInstance, Responseable $responseInstance) {
// Get the "rules" value from request
// 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->requestIsValid(FALSE);
// Add a message to the response
$responseInstance->addFatalMessage('rules_unchecked');
// Skip further processing
- return false;
- }
+ throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
+ } // END - if
}
}
* @param $requestInstance An instance of a class with an Requestable interface
* @param $responseInstance An instance of a class with an Responseable interface
* @return void
+ * @throws FilterChainException If this filter fails to operate
* @todo 0% done
*/
public function execute (Requestable $requestInstance, Responseable $responseInstance) {
}
/**
- * Process all added filters
+ * Process all added filters. Please note that filters must throw
+ * FilterChainException if they need to interrupt the filter chain.
*
* @param $requestInstance An instance of a request class
* @param $responseInstance An instance of a response class
// Is it there?
if (is_null($encryptRequest)) {
// Not found, so request is invalid
- $requestInstance->requestIsValid(false);
+ $requestInstance->requestIsValid(FALSE);
// Throw exception
throw new EncryptMissingException($this, CryptoHelper::EXCEPTION_ENCRYPT_MISSING);
// Is it the expected length?
if (strlen($decryptedString) != $this->getConfigInstance()->getConfigEntry('captcha_string_length')) {
// Not found, so request is invalid
- $requestInstance->requestIsValid(false);
+ $requestInstance->requestIsValid(FALSE);
// Throw exception
throw new EncryptInvalidLengthException($this, CryptoHelper::EXCEPTION_ENCRYPT_INVALID);
Registry::getRegistry()->addInstance('payments', $discoveryInstance);
} catch (NoConfigEntryException $e) {
// Something bad happend
- $requestInstance->requestIsValid(false);
+ $requestInstance->requestIsValid(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->requestIsValid(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->requestIsValid(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->requestIsValid(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->requestIsValid(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->requestIsValid(FALSE);
// Add a message to the response
$responseInstance->addFatalMessage('emails_mismatch');
} // END - elseif
} elseif (empty($email)) {
// Empty field!
- $requestInstance->requestIsValid(false);
+ $requestInstance->requestIsValid(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->requestIsValid(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->requestIsValid(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->requestIsValid(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->requestIsValid(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->requestIsValid(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->requestIsValid(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->requestIsValid(FALSE);
// Add a message to the response
$responseInstance->addFatalMessage('password_unset');
if (empty($password)) {
// Password is empty
- $requestInstance->requestIsValid(false);
+ $requestInstance->requestIsValid(FALSE);
// Add a message to the response
$responseInstance->addFatalMessage('password_empty');
// Is this code set?
if (is_null($confirmCode)) {
// Is not in request
- $requestInstance->requestIsValid(false);
+ $requestInstance->requestIsValid(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->requestIsValid(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->requestIsValid(FALSE);
// Redirect to error page
$responseInstance->redirectToConfiguredUrl('confirm_code_invalid');
* @param $requestInstance An instance of a class with an Requestable interface
* @param $responseInstance An instance of a class with an Responseable interface
* @return void
+ * @throws FilterChainException If this filter fails to operate
*/
public function execute (Requestable $requestInstance, Responseable $responseInstance) {
// Get the captcha code
// Is this set?
if (is_null($captchaCode)) {
// Not set so request is invalid
- $requestInstance->requestIsValid(false);
+ $requestInstance->requestIsValid(FALSE);
// Add fatal message
$responseInstance->addFatalMessage('captcha_code_unset');
// Skip further processing
- return false;
+ throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
} elseif (empty($captchaCode)) {
// Empty value so request is invalid
- $requestInstance->requestIsValid(false);
+ $requestInstance->requestIsValid(FALSE);
// Add fatal message
$responseInstance->addFatalMessage('captcha_code_empty');
// Skip further processing
- return false;
+ throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
}
// Get the hash as well
// Is this set?
if (is_null($captchaHash)) {
// Not set so request is invalid
- $requestInstance->requestIsValid(false);
+ $requestInstance->requestIsValid(FALSE);
// Add fatal message
$responseInstance->addFatalMessage('captcha_hash_unset');
// Skip further processing
- return false;
+ throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
} elseif (empty($captchaHash)) {
// Empty value so request is invalid
- $requestInstance->requestIsValid(false);
+ $requestInstance->requestIsValid(FALSE);
// Add fatal message
$responseInstance->addFatalMessage('captcha_hash_empty');
// Skip further processing
- return false;
+ throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
}
// Now, both are set hash the given one. First get a crypto instance
// Is this CAPTCHA valid?
if ($hashedCode != $captchaHash) {
// Not the same so request is invalid
- $requestInstance->requestIsValid(false);
+ $requestInstance->requestIsValid(FALSE);
// Add fatal message
$responseInstance->addFatalMessage('captcha_hash_mismatch');
+
+ // Skip further processing
+ throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
} // END - not the same!
}
}
// Is the password still not set?
if (is_null($password)) {
// Not found in form so stop the filtering process
- $requestInstance->requestIsValid(false);
+ $requestInstance->requestIsValid(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->requestIsValid(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->requestIsValid(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->requestIsValid(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->requestIsValid(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->requestIsValid(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->requestIsValid(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->requestIsValid(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->requestIsValid(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->requestIsValid(FALSE);
// Add a message to the response
$responseInstance->addFatalMessage('username_not_found');
// Is the user account confirmed?
if (($userInstance->getField(UserDatabaseWrapper::DB_COLUMN_USER_STATUS) != $this->getConfigInstance()->getConfigEntry('user_status_confirmed')) && ($userInstance->getField(UserDatabaseWrapper::DB_COLUMN_USER_STATUS) != $this->getConfigInstance()->getConfigEntry('user_status_guest')) && ($requestInstance->getRequestElement('action') != $this->getConfigInstance()->getConfigEntry('action_status_problem'))) {
// Request is invalid!
- $requestInstance->requestIsValid(false);
+ $requestInstance->requestIsValid(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->requestIsValid(FALSE);
// Redirect to configured URL
$responseInstance->redirectToConfiguredUrl('user_unconfirmed_email_missing');
// Is the user account confirmed?
if ($userInstance->getField(UserDatabaseWrapper::DB_COLUMN_USER_STATUS) != $this->getConfigInstance()->getConfigEntry('user_status_unconfirmed')) {
// Request is invalid!
- $requestInstance->requestIsValid(false);
+ $requestInstance->requestIsValid(FALSE);
// Redirect to configured URL
$responseInstance->redirectToConfiguredUrl('user_not_unconfirmed');
*/
class WebFormHelper extends BaseWebHelper implements HelpableTemplate {
/**
- * Whether the form tag is opened (keep at false or else your forms will
+ * Whether the form tag is opened (keep at FALSE or else your forms will
* never work!)
*/
private $formOpened = FALSE;
private $formName = '';
/**
- * Whether form tag is enabled (default: true)
+ * Whether form tag is enabled (default: TRUE)
*/
private $formEnabled = TRUE;
// Set form name
$helperInstance->setFormName($formName);
- // A form-less field may say 'false' here...
+ // A form-less field may say 'FALSE' here...
if ($withForm === TRUE) {
// Create the form
$helperInstance->addFormTag($formName, $formId);
} else {
// Disable form
- $helperInstance->enableForm(false);
+ $helperInstance->enableForm(FALSE);
}
// Return the prepared instance
/**
* Add the form tag or close it an already opened form tag
*
- * @param $formName Name of the form (default: false)
- * @param $formId Id of the form (attribute 'id'; default: false)
+ * @param $formName Name of the form (default: FALSE)
+ * @param $formId Id of the form (attribute 'id'; default: FALSE)
* @return void
* @throws InvalidFormNameException If the form name is invalid ( = FALSE)
* @todo Add some unique PIN here to bypass problems with some browser and/or extensions
// Same group to open?
if (($this->ifGroupOpenedPreviously() === FALSE) && ($groupId === $this->getPreviousGroupId())) {
// Abort here silently
- return false;
+ return FALSE;
} // END - if
// Initialize content with closing div by default
// Same sub group to open?
if (($this->ifSubGroupOpenedPreviously() === FALSE) && ($subGroupId == $this->getPreviousSubGroupId())) {
// Abort here silently
- return false;
+ return FALSE;
} // END - if
// Initialize content with closing div by default
* @todo Implement check if rules have been changed
*/
public function ifRulesHaveChanged () {
- return false;
+ return FALSE;
}
/**
// Walk through all groups
foreach ($templateInstance->getVariableGroups() as $group => $set) {
// Set the group
- $templateInstance->setVariableGroup($group, false);
+ $templateInstance->setVariableGroup($group, FALSE);
// Compile image string
$imageString = $templateInstance->compileRawCode($this->getString());
// Try to open a handler
$filePointer = @fopen($fileName, $mode);
- if (($filePointer === null) || ($filePointer === FALSE)) {
+ if ((is_null($filePointer)) || ($filePointer === FALSE)) {
// Something bad happend
throw new FileIoException ($fileName, self::EXCEPTION_FILE_POINTER_INVALID);
} // END - if
$xmlParser = xml_parser_create();
// Force case-folding to on
- xml_parser_set_option($xmlParser, XML_OPTION_CASE_FOLDING, true);
+ xml_parser_set_option($xmlParser, XML_OPTION_CASE_FOLDING, TRUE);
// Set UTF-8
xml_parser_set_option($xmlParser, XML_OPTION_TARGET_ENCODING, 'UTF-8');
/**
* Whether this request is valid and can be further processed. The default is
- * valid so make sure your intercepting filters sets this attribute to false
+ * valid so make sure your intercepting filters sets this attribute to FALSE
* when they need to intercept the data flow.
*/
private $requestIsValid = TRUE;
}
/**
- * Sets whether the request was valid (default: true)
+ * Sets whether the request was valid (default: TRUE)
*
* @param $isValid Whether the request is valid
* @return void
// Is the cookie there?
if (isset($_COOKIE[$cookieName])) {
// Then expire it with 20 minutes past
- $this->addCookie($cookieName, '', false, (time() - 1200));
+ $this->addCookie($cookieName, '', FALSE, (time() - 1200));
// Remove it from array
unset($_COOKIE[$cookieName]);
// Only update existing cookies
if (isset($_COOKIE[$cookieName])) {
// Update the cookie
- $this->addCookie($cookieName, $_COOKIE[$cookieName], false);
+ $this->addCookie($cookieName, $_COOKIE[$cookieName], FALSE);
} // END - if
}
// Is the cookie there?
if (isset($_COOKIE[$cookieName])) {
// Then expire it with 20 minutes past
- $this->addCookie($cookieName, '', false, (time() - 1200));
+ $this->addCookie($cookieName, '', FALSE, (time() - 1200));
// Remove it from array
unset($_COOKIE[$cookieName]);
// Only update existing cookies
if (isset($_COOKIE[$cookieName])) {
// Update the cookie
- $this->addCookie($cookieName, $_COOKIE[$cookieName], false);
+ $this->addCookie($cookieName, $_COOKIE[$cookieName], FALSE);
} // END - if
}
$this->extraNumber = ($this->prime * $this->prime / pow(pi(), 2));
// Seed mt_rand()
- mt_srand((double) sqrt(microtime(true) * 100000000 * $this->extraNumber));
+ mt_srand((double) sqrt(microtime(TRUE) * 100000000 * $this->extraNumber));
// Set the server IP to cluster
$serverIp = 'cluster';
// Is this string empty?
if (empty($characters)) {
// Then skip it silently
- return false;
+ return;
} // END - if
// Unfinished work!
- $this->partialStub("Handling extra characters is not yet supported!");
+ $this->partialStub('Handling extra characters is not yet supported!');
}
/**
// Is this string empty?
if (empty($characters)) {
// Then skip it silently
- return false;
+ return;
} // END - if
// Add the message now
// Is this string empty?
if (empty($characters)) {
// Then skip it silently
- return false;
+ return;
} // END - if
// Assign the found characters to variable and use the last entry from
$cfg->setDefaultTimezone('Europe/Berlin');
// CFG: MAGIC-QUOTES-RUNTIME
-$cfg->setMagicQuotesRuntime(false);
+$cfg->setMagicQuotesRuntime(FALSE);
// CFG: CLASS-PREFIX
$cfg->setConfigEntry('class_prefix', 'class_');
private $ignoreList = array();
/**
- * Debug this class loader? (true = yes, false = no)
+ * Debug this class loader? (TRUE = yes, FALSE = no)
*/
private $debug = FALSE;
*/
$basePath2 = realpath($basePath);
- // If the basePath is false it is invalid
+ // If the basePath is FALSE it is invalid
if ($basePath2 === FALSE) {
/* @todo: Do not die here. */
exit(__METHOD__ . ':Cannot read ' . $basePath . ' !');