From: Roland Häder Date: Thu, 18 Jul 2013 12:50:59 +0000 (+0000) Subject: Changed all true/false to TRUE/FALSE respectively as PHP constants are better than... X-Git-Url: https://git.mxchange.org/?p=core.git;a=commitdiff_plain;h=2e80331da79b13c3094f9039d4c584e3e4b89894 Changed all true/false to TRUE/FALSE respectively as PHP constants are better than keywords --- diff --git a/inc/classes/exceptions/class_FrameworkException.php b/inc/classes/exceptions/class_FrameworkException.php index 28249ecb..3d4cacd1 100644 --- a/inc/classes/exceptions/class_FrameworkException.php +++ b/inc/classes/exceptions/class_FrameworkException.php @@ -118,7 +118,7 @@ abstract class FrameworkException extends ReflectionException { // Are there arguments? if ((isset($dbgInfo['args'])) && (is_array($dbgInfo['args'])) && (isset($dbgInfo['args'][0]))) { - //* DEBUG: */ echo $dbgIndex.":
".htmlentities(print_r($dbgInfo['args'], true))."
"; + //* DEBUG: */ echo $dbgIndex.":
".htmlentities(print_r($dbgInfo['args'], TRUE))."
"; $info = ''; foreach ($dbgInfo['args'] as $debug) { // Add only non-array elements diff --git a/inc/classes/exceptions/helper/class_InvalidFormNameException.php b/inc/classes/exceptions/helper/class_InvalidFormNameException.php index 8d9c21ac..a12d1d87 100644 --- a/inc/classes/exceptions/helper/class_InvalidFormNameException.php +++ b/inc/classes/exceptions/helper/class_InvalidFormNameException.php @@ -1,6 +1,6 @@ * @version 0.0.0 @@ -31,7 +31,7 @@ class InvalidFormNameException extends FrameworkException { */ 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() ); diff --git a/inc/classes/interfaces/registry/socket/class_RegisterableSocket.php b/inc/classes/interfaces/registry/socket/class_RegisterableSocket.php index ded46b68..28ca7c39 100644 --- a/inc/classes/interfaces/registry/socket/class_RegisterableSocket.php +++ b/inc/classes/interfaces/registry/socket/class_RegisterableSocket.php @@ -24,7 +24,7 @@ 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 diff --git a/inc/classes/interfaces/request/class_Requestable.php b/inc/classes/interfaces/request/class_Requestable.php index 86837c84..0dfde481 100644 --- a/inc/classes/interfaces/request/class_Requestable.php +++ b/inc/classes/interfaces/request/class_Requestable.php @@ -63,7 +63,7 @@ interface Requestable extends FrameworkInterface { 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 diff --git a/inc/classes/interfaces/template/class_CompileableTemplate.php b/inc/classes/interfaces/template/class_CompileableTemplate.php index 64171319..ea1f912b 100644 --- a/inc/classes/interfaces/template/class_CompileableTemplate.php +++ b/inc/classes/interfaces/template/class_CompileableTemplate.php @@ -129,10 +129,10 @@ interface CompileableTemplate extends FrameworkInterface { * "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 diff --git a/inc/classes/main/class_BaseFrameworkSystem.php b/inc/classes/main/class_BaseFrameworkSystem.php index 34b0a22e..502ee84a 100644 --- a/inc/classes/main/class_BaseFrameworkSystem.php +++ b/inc/classes/main/class_BaseFrameworkSystem.php @@ -326,10 +326,10 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { $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 } @@ -404,11 +404,11 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { // .. 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 @@ -1344,7 +1344,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { $content .= sprintf('
%s
', trim( htmlentities( - print_r($this, true) + print_r($this, TRUE) ) ) ); @@ -1417,7 +1417,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { * 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) { @@ -1481,7 +1481,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { * * @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) { @@ -1718,7 +1718,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { // Get current array $fieldArray = $resultInstance->current(); - //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput($fieldName.':
'.print_r($fieldArray, true).'
'); + //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput($fieldName.':
'.print_r($fieldArray, TRUE).'
'); // Convert dashes to underscore $fieldName = $this->convertDashesToUnderscores($fieldName); @@ -1804,7 +1804,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { */ public function getMilliTime () { // Get the time of day as float - $milliTime = gettimeofday(true); + $milliTime = gettimeofday(TRUE); // Return it return $milliTime; @@ -1983,7 +1983,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { */ protected function isBase64Encoded ($encodedData) { // Determine it - $isBase64 = (@base64_decode($encodedData, true) !== FALSE); + $isBase64 = (@base64_decode($encodedData, TRUE) !== FALSE); // Return it return $isBase64; @@ -2043,7 +2043,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { */ 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); diff --git a/inc/classes/main/compressor/class_Bzip2Compressor.php b/inc/classes/main/compressor/class_Bzip2Compressor.php index 32991b81..59ec7c59 100644 --- a/inc/classes/main/compressor/class_Bzip2Compressor.php +++ b/inc/classes/main/compressor/class_Bzip2Compressor.php @@ -82,7 +82,7 @@ class Bzip2Compressor extends BaseFrameworkSystem implements Compressor { } // END - if // Decompress it - $streamData = bzdecompress($streamData, true); + $streamData = bzdecompress($streamData, TRUE); // Return the decompressed stream return $streamData; diff --git a/inc/classes/main/console/class_ConsoleTools.php b/inc/classes/main/console/class_ConsoleTools.php index 4d220d71..a8bd7bd1 100644 --- a/inc/classes/main/console/class_ConsoleTools.php +++ b/inc/classes/main/console/class_ConsoleTools.php @@ -309,7 +309,7 @@ class ConsoleTools extends BaseFrameworkSystem { // 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 diff --git a/inc/classes/main/container/socket/class_SocketContainer.php b/inc/classes/main/container/socket/class_SocketContainer.php index 445a90f0..1e2c5756 100644 --- a/inc/classes/main/container/socket/class_SocketContainer.php +++ b/inc/classes/main/container/socket/class_SocketContainer.php @@ -49,7 +49,7 @@ class SocketContainer extends BaseContainer implements Registerable { 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); @@ -75,7 +75,7 @@ class SocketContainer extends BaseContainer implements Registerable { $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)); diff --git a/inc/classes/main/decorator/template/class_XmlRewriterTemplateDecorator.php b/inc/classes/main/decorator/template/class_XmlRewriterTemplateDecorator.php index fe3a437c..d89092ca 100644 --- a/inc/classes/main/decorator/template/class_XmlRewriterTemplateDecorator.php +++ b/inc/classes/main/decorator/template/class_XmlRewriterTemplateDecorator.php @@ -309,9 +309,9 @@ class XmlRewriterTemplateDecorator extends BaseDecorator implements CompileableT * * @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); } diff --git a/inc/classes/main/discovery/payment/class_LocalPaymentDiscovery.php b/inc/classes/main/discovery/payment/class_LocalPaymentDiscovery.php index b6309baa..444e4e14 100644 --- a/inc/classes/main/discovery/payment/class_LocalPaymentDiscovery.php +++ b/inc/classes/main/discovery/payment/class_LocalPaymentDiscovery.php @@ -70,11 +70,8 @@ class LocalPaymentDiscovery extends BaseDiscovery implements Discoverable, Regis // 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); diff --git a/inc/classes/main/factories/xml/class_XmlTemplateEngineFactory.php b/inc/classes/main/factories/xml/class_XmlTemplateEngineFactory.php index 060ebf81..be05063e 100644 --- a/inc/classes/main/factories/xml/class_XmlTemplateEngineFactory.php +++ b/inc/classes/main/factories/xml/class_XmlTemplateEngineFactory.php @@ -52,7 +52,7 @@ class XmlTemplateEngineFactory extends ObjectFactory { $templateInstance = ObjectFactory::createObjectByConfiguredName($configEntry); // Disable language support - $templateInstance->enableLanguageSupport(false); + $templateInstance->enableLanguageSupport(FALSE); /* * Enable compacting/rewriting of the XML to save bandwidth from XML diff --git a/inc/classes/main/filter/auth/class_UserAuthFilter.php b/inc/classes/main/filter/auth/class_UserAuthFilter.php index 5d21a1ce..3c9b5f9f 100644 --- a/inc/classes/main/filter/auth/class_UserAuthFilter.php +++ b/inc/classes/main/filter/auth/class_UserAuthFilter.php @@ -92,7 +92,7 @@ class UserAuthFilter extends BaseFilter implements Filterable { $authInstance->destroyAuthData(); // Mark the request as invalid - $requestInstance->requestIsValid(false); + $requestInstance->requestIsValid(FALSE); // Add fatal message $responseInstance->addFatalMessage('auth_data_incomplete'); diff --git a/inc/classes/main/filter/change/class_EmailChangeFilter.php b/inc/classes/main/filter/change/class_EmailChangeFilter.php index f4bb048c..5a2cbc91 100644 --- a/inc/classes/main/filter/change/class_EmailChangeFilter.php +++ b/inc/classes/main/filter/change/class_EmailChangeFilter.php @@ -51,6 +51,7 @@ class EmailChangeFilter extends BaseFilter implements Filterable { * @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) { @@ -61,43 +62,43 @@ class EmailChangeFilter extends BaseFilter implements Filterable { // 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 @@ -109,11 +110,11 @@ class EmailChangeFilter extends BaseFilter implements Filterable { // 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.'); } } diff --git a/inc/classes/main/filter/change/class_PasswordChangeFilter.php b/inc/classes/main/filter/change/class_PasswordChangeFilter.php index 75534a3a..ed7ceefa 100644 --- a/inc/classes/main/filter/change/class_PasswordChangeFilter.php +++ b/inc/classes/main/filter/change/class_PasswordChangeFilter.php @@ -53,6 +53,7 @@ class PasswordChangeFilter extends BaseFilter implements Filterable { * @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 @@ -62,50 +63,50 @@ class PasswordChangeFilter extends BaseFilter implements Filterable { // 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.'); } } diff --git a/inc/classes/main/filter/checkboxes/class_RulesAcceptedFilter.php b/inc/classes/main/filter/checkboxes/class_RulesAcceptedFilter.php index 37b27c41..b14cf530 100644 --- a/inc/classes/main/filter/checkboxes/class_RulesAcceptedFilter.php +++ b/inc/classes/main/filter/checkboxes/class_RulesAcceptedFilter.php @@ -53,6 +53,7 @@ class RulesAcceptedFilter extends BaseFilter implements Filterable { * @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 @@ -61,14 +62,14 @@ class RulesAcceptedFilter extends BaseFilter implements Filterable { // 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 } } diff --git a/inc/classes/main/filter/class_ b/inc/classes/main/filter/class_ index fc442830..cb8d461b 100644 --- a/inc/classes/main/filter/class_ +++ b/inc/classes/main/filter/class_ @@ -51,6 +51,7 @@ class ???Filter extends BaseFilter implements Filterable { * @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) { diff --git a/inc/classes/main/filter/class_FilterChain.php b/inc/classes/main/filter/class_FilterChain.php index d1374a59..5b1e0202 100644 --- a/inc/classes/main/filter/class_FilterChain.php +++ b/inc/classes/main/filter/class_FilterChain.php @@ -65,7 +65,8 @@ class FilterChain extends BaseFrameworkSystem implements Registerable { } /** - * 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 diff --git a/inc/classes/main/filter/crypto/class_CaptchaEncryptFilter.php b/inc/classes/main/filter/crypto/class_CaptchaEncryptFilter.php index 93183f08..1d54d0be 100644 --- a/inc/classes/main/filter/crypto/class_CaptchaEncryptFilter.php +++ b/inc/classes/main/filter/crypto/class_CaptchaEncryptFilter.php @@ -60,7 +60,7 @@ class CaptchaEncryptFilter extends BaseFilter implements Filterable { // 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); @@ -75,7 +75,7 @@ class CaptchaEncryptFilter extends BaseFilter implements Filterable { // 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); diff --git a/inc/classes/main/filter/payment/class_PaymentDiscoveryFilter.php b/inc/classes/main/filter/payment/class_PaymentDiscoveryFilter.php index f40358d7..3c88d98e 100644 --- a/inc/classes/main/filter/payment/class_PaymentDiscoveryFilter.php +++ b/inc/classes/main/filter/payment/class_PaymentDiscoveryFilter.php @@ -110,7 +110,7 @@ class PaymentDiscoveryFilter extends BaseFilter implements Filterable { 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'); @@ -120,7 +120,7 @@ class PaymentDiscoveryFilter extends BaseFilter implements Filterable { 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'); diff --git a/inc/classes/main/filter/validator/class_EmailValidatorFilter.php b/inc/classes/main/filter/validator/class_EmailValidatorFilter.php index 99c2291c..b46713f9 100644 --- a/inc/classes/main/filter/validator/class_EmailValidatorFilter.php +++ b/inc/classes/main/filter/validator/class_EmailValidatorFilter.php @@ -69,7 +69,7 @@ class EmailValidatorFilter extends BaseFilter implements Filterable { // 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'); @@ -78,7 +78,7 @@ class EmailValidatorFilter extends BaseFilter implements Filterable { 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)) { @@ -96,7 +96,7 @@ class EmailValidatorFilter extends BaseFilter implements Filterable { 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'); @@ -105,7 +105,7 @@ class EmailValidatorFilter extends BaseFilter implements Filterable { 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'); @@ -115,7 +115,7 @@ class EmailValidatorFilter extends BaseFilter implements Filterable { } // END - elseif } elseif (empty($email)) { // Empty field! - $requestInstance->requestIsValid(false); + $requestInstance->requestIsValid(FALSE); // Add a message to the response $responseInstance->addFatalMessage('email_empty'); diff --git a/inc/classes/main/filter/validator/class_PasswordValidatorFilter.php b/inc/classes/main/filter/validator/class_PasswordValidatorFilter.php index 3251cc66..b421fe5e 100644 --- a/inc/classes/main/filter/validator/class_PasswordValidatorFilter.php +++ b/inc/classes/main/filter/validator/class_PasswordValidatorFilter.php @@ -62,7 +62,7 @@ class PasswordValidatorFilter extends BaseFilter implements Filterable { // 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'); @@ -71,7 +71,7 @@ class PasswordValidatorFilter extends BaseFilter implements Filterable { 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)) { @@ -89,7 +89,7 @@ class PasswordValidatorFilter extends BaseFilter implements Filterable { 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'); diff --git a/inc/classes/main/filter/validator/class_UserNameValidatorFilter.php b/inc/classes/main/filter/validator/class_UserNameValidatorFilter.php index 305db340..ed8098c9 100644 --- a/inc/classes/main/filter/validator/class_UserNameValidatorFilter.php +++ b/inc/classes/main/filter/validator/class_UserNameValidatorFilter.php @@ -62,7 +62,7 @@ class UserNameValidatorFilter extends BaseFilter implements Filterable { // 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'); @@ -71,7 +71,7 @@ class UserNameValidatorFilter extends BaseFilter implements Filterable { 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'); @@ -80,7 +80,7 @@ class UserNameValidatorFilter extends BaseFilter implements Filterable { 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'); diff --git a/inc/classes/main/filter/verifier/class_AccountPasswordVerifierFilter.php b/inc/classes/main/filter/verifier/class_AccountPasswordVerifierFilter.php index c9bbff64..ecefb6e0 100644 --- a/inc/classes/main/filter/verifier/class_AccountPasswordVerifierFilter.php +++ b/inc/classes/main/filter/verifier/class_AccountPasswordVerifierFilter.php @@ -68,7 +68,7 @@ class AccountPasswordVerifierFilter extends BaseFilter implements Filterable { // 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'); @@ -80,7 +80,7 @@ class AccountPasswordVerifierFilter extends BaseFilter implements Filterable { if (empty($password)) { // Password is empty - $requestInstance->requestIsValid(false); + $requestInstance->requestIsValid(FALSE); // Add a message to the response $responseInstance->addFatalMessage('password_empty'); diff --git a/inc/classes/main/filter/verifier/class_ConfirmCodeVerifierFilter.php b/inc/classes/main/filter/verifier/class_ConfirmCodeVerifierFilter.php index 112e63bc..8992ee8f 100644 --- a/inc/classes/main/filter/verifier/class_ConfirmCodeVerifierFilter.php +++ b/inc/classes/main/filter/verifier/class_ConfirmCodeVerifierFilter.php @@ -60,7 +60,7 @@ class ConfirmCodeVerifierFilter extends BaseFilter implements Filterable { // 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'); @@ -69,7 +69,7 @@ class ConfirmCodeVerifierFilter extends BaseFilter implements Filterable { 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'); @@ -87,7 +87,7 @@ class ConfirmCodeVerifierFilter extends BaseFilter implements Filterable { // 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'); diff --git a/inc/classes/main/filter/verifier/class_GraphicalCodeCaptchaVerifierFilter.php b/inc/classes/main/filter/verifier/class_GraphicalCodeCaptchaVerifierFilter.php index f23e13e3..1e23c641 100644 --- a/inc/classes/main/filter/verifier/class_GraphicalCodeCaptchaVerifierFilter.php +++ b/inc/classes/main/filter/verifier/class_GraphicalCodeCaptchaVerifierFilter.php @@ -51,6 +51,7 @@ class GraphicalCodeCaptchaVerifierFilter extends BaseFilter implements Filterabl * @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 @@ -59,22 +60,22 @@ class GraphicalCodeCaptchaVerifierFilter extends BaseFilter implements Filterabl // 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 @@ -83,22 +84,22 @@ class GraphicalCodeCaptchaVerifierFilter extends BaseFilter implements Filterabl // 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 @@ -110,10 +111,13 @@ class GraphicalCodeCaptchaVerifierFilter extends BaseFilter implements Filterabl // 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! } } diff --git a/inc/classes/main/filter/verifier/class_PasswordGuestVerifierFilter.php b/inc/classes/main/filter/verifier/class_PasswordGuestVerifierFilter.php index 51ade979..aa6027af 100644 --- a/inc/classes/main/filter/verifier/class_PasswordGuestVerifierFilter.php +++ b/inc/classes/main/filter/verifier/class_PasswordGuestVerifierFilter.php @@ -61,7 +61,7 @@ class PasswordGuestVerifierFilter extends BaseFilter implements Filterable { // 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'); @@ -70,7 +70,7 @@ class PasswordGuestVerifierFilter extends BaseFilter implements Filterable { 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'); diff --git a/inc/classes/main/filter/verifier/class_PasswordVerifierFilter.php b/inc/classes/main/filter/verifier/class_PasswordVerifierFilter.php index c0233451..ca5f146e 100644 --- a/inc/classes/main/filter/verifier/class_PasswordVerifierFilter.php +++ b/inc/classes/main/filter/verifier/class_PasswordVerifierFilter.php @@ -61,7 +61,7 @@ class PasswordVerifierFilter extends BaseFilter implements Filterable { // 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'); @@ -70,7 +70,7 @@ class PasswordVerifierFilter extends BaseFilter implements Filterable { 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'); diff --git a/inc/classes/main/filter/verifier/class_UserGuestVerifierFilter.php b/inc/classes/main/filter/verifier/class_UserGuestVerifierFilter.php index 126073ef..b17e694e 100644 --- a/inc/classes/main/filter/verifier/class_UserGuestVerifierFilter.php +++ b/inc/classes/main/filter/verifier/class_UserGuestVerifierFilter.php @@ -62,7 +62,7 @@ class UserGuestVerifierFilter extends BaseFilter implements Filterable { // 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'); @@ -71,7 +71,7 @@ class UserGuestVerifierFilter extends BaseFilter implements Filterable { 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'); @@ -80,7 +80,7 @@ class UserGuestVerifierFilter extends BaseFilter implements Filterable { 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'); diff --git a/inc/classes/main/filter/verifier/class_UserNameVerifierFilter.php b/inc/classes/main/filter/verifier/class_UserNameVerifierFilter.php index f82a0632..d7342cda 100644 --- a/inc/classes/main/filter/verifier/class_UserNameVerifierFilter.php +++ b/inc/classes/main/filter/verifier/class_UserNameVerifierFilter.php @@ -62,7 +62,7 @@ class UserNameVerifierFilter extends BaseFilter implements Filterable { // 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'); @@ -71,7 +71,7 @@ class UserNameVerifierFilter extends BaseFilter implements Filterable { 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'); @@ -80,7 +80,7 @@ class UserNameVerifierFilter extends BaseFilter implements Filterable { 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'); diff --git a/inc/classes/main/filter/verifier/class_UserStatusVerifierFilter.php b/inc/classes/main/filter/verifier/class_UserStatusVerifierFilter.php index e4f0ef7f..0596bd53 100644 --- a/inc/classes/main/filter/verifier/class_UserStatusVerifierFilter.php +++ b/inc/classes/main/filter/verifier/class_UserStatusVerifierFilter.php @@ -59,7 +59,7 @@ class UserStatusVerifierFilter extends BaseFilter implements Filterable { // 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'); diff --git a/inc/classes/main/filter/verifier/class_UserUnconfirmedVerifierFilter.php b/inc/classes/main/filter/verifier/class_UserUnconfirmedVerifierFilter.php index 9d341194..ba8ad6f8 100644 --- a/inc/classes/main/filter/verifier/class_UserUnconfirmedVerifierFilter.php +++ b/inc/classes/main/filter/verifier/class_UserUnconfirmedVerifierFilter.php @@ -62,7 +62,7 @@ class UserUnconfirmedVerifierFilter extends BaseFilter implements Filterable { // 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'); @@ -74,7 +74,7 @@ class UserUnconfirmedVerifierFilter extends BaseFilter implements Filterable { // 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'); diff --git a/inc/classes/main/helper/web/forms/class_WebFormHelper.php b/inc/classes/main/helper/web/forms/class_WebFormHelper.php index e0eea486..97cae364 100644 --- a/inc/classes/main/helper/web/forms/class_WebFormHelper.php +++ b/inc/classes/main/helper/web/forms/class_WebFormHelper.php @@ -23,7 +23,7 @@ */ 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; @@ -34,7 +34,7 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate { private $formName = ''; /** - * Whether form tag is enabled (default: true) + * Whether form tag is enabled (default: TRUE) */ private $formEnabled = TRUE; @@ -79,13 +79,13 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate { // 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 @@ -95,8 +95,8 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate { /** * 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 @@ -389,7 +389,7 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate { // 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 @@ -464,7 +464,7 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate { // 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 @@ -852,7 +852,7 @@ class WebFormHelper extends BaseWebHelper implements HelpableTemplate { * @todo Implement check if rules have been changed */ public function ifRulesHaveChanged () { - return false; + return FALSE; } /** diff --git a/inc/classes/main/images/class_BaseImage.php b/inc/classes/main/images/class_BaseImage.php index 7a556111..cb7c8a88 100644 --- a/inc/classes/main/images/class_BaseImage.php +++ b/inc/classes/main/images/class_BaseImage.php @@ -505,7 +505,7 @@ class BaseImage extends BaseFrameworkSystem implements Registerable { // 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()); diff --git a/inc/classes/main/io/class_FrameworkFileOutputPointer.php b/inc/classes/main/io/class_FrameworkFileOutputPointer.php index 4be2d02e..24633cd1 100644 --- a/inc/classes/main/io/class_FrameworkFileOutputPointer.php +++ b/inc/classes/main/io/class_FrameworkFileOutputPointer.php @@ -73,7 +73,7 @@ class FrameworkFileOutputPointer extends BaseFrameworkSystem { // 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 diff --git a/inc/classes/main/parser/xml/class_XmlParser.php b/inc/classes/main/parser/xml/class_XmlParser.php index 85b6ab73..5e88beb7 100644 --- a/inc/classes/main/parser/xml/class_XmlParser.php +++ b/inc/classes/main/parser/xml/class_XmlParser.php @@ -84,7 +84,7 @@ class XmlParser extends BaseParser implements Parseable { $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'); diff --git a/inc/classes/main/request/class_BaseRequest.php b/inc/classes/main/request/class_BaseRequest.php index 01207d18..d2ca3867 100644 --- a/inc/classes/main/request/class_BaseRequest.php +++ b/inc/classes/main/request/class_BaseRequest.php @@ -29,7 +29,7 @@ class BaseRequest extends BaseFrameworkSystem { /** * 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; @@ -113,7 +113,7 @@ class BaseRequest extends BaseFrameworkSystem { } /** - * 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 diff --git a/inc/classes/main/response/http/class_HttpResponse.php b/inc/classes/main/response/http/class_HttpResponse.php index 3130e345..23f4a38a 100644 --- a/inc/classes/main/response/http/class_HttpResponse.php +++ b/inc/classes/main/response/http/class_HttpResponse.php @@ -177,7 +177,7 @@ class HttpResponse extends BaseResponse implements Responseable { // 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]); @@ -194,7 +194,7 @@ class HttpResponse extends BaseResponse implements Responseable { // 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 } diff --git a/inc/classes/main/response/image/class_ImageResponse.php b/inc/classes/main/response/image/class_ImageResponse.php index 0a6170e4..1aeb0a79 100644 --- a/inc/classes/main/response/image/class_ImageResponse.php +++ b/inc/classes/main/response/image/class_ImageResponse.php @@ -210,7 +210,7 @@ class ImageResponse extends BaseResponse implements Responseable { // 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]); @@ -227,7 +227,7 @@ class ImageResponse extends BaseResponse implements Responseable { // 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 } diff --git a/inc/classes/main/rng/class_RandomNumberGenerator.php b/inc/classes/main/rng/class_RandomNumberGenerator.php index 6b26fe84..dc3e6028 100644 --- a/inc/classes/main/rng/class_RandomNumberGenerator.php +++ b/inc/classes/main/rng/class_RandomNumberGenerator.php @@ -105,7 +105,7 @@ class RandomNumberGenerator extends BaseFrameworkSystem { $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'; diff --git a/inc/classes/main/template/image/class_ImageTemplateEngine.php b/inc/classes/main/template/image/class_ImageTemplateEngine.php index 22262c09..8d978eb0 100644 --- a/inc/classes/main/template/image/class_ImageTemplateEngine.php +++ b/inc/classes/main/template/image/class_ImageTemplateEngine.php @@ -221,11 +221,11 @@ class ImageTemplateEngine extends BaseTemplateEngine implements CompileableTempl // 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!'); } /** diff --git a/inc/classes/main/template/mail/class_MailTemplateEngine.php b/inc/classes/main/template/mail/class_MailTemplateEngine.php index 308b2667..7615a567 100644 --- a/inc/classes/main/template/mail/class_MailTemplateEngine.php +++ b/inc/classes/main/template/mail/class_MailTemplateEngine.php @@ -214,7 +214,7 @@ class MailTemplateEngine extends BaseTemplateEngine implements CompileableTempla // Is this string empty? if (empty($characters)) { // Then skip it silently - return false; + return; } // END - if // Add the message now diff --git a/inc/classes/main/template/menu/class_MenuTemplateEngine.php b/inc/classes/main/template/menu/class_MenuTemplateEngine.php index 9adf01e6..7b638fbf 100644 --- a/inc/classes/main/template/menu/class_MenuTemplateEngine.php +++ b/inc/classes/main/template/menu/class_MenuTemplateEngine.php @@ -273,7 +273,7 @@ class MenuTemplateEngine extends BaseTemplateEngine implements CompileableTempla // 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 diff --git a/inc/config.php b/inc/config.php index bb0defe4..dfefbcb9 100644 --- a/inc/config.php +++ b/inc/config.php @@ -48,7 +48,7 @@ $cfg->setConfigEntry('local_db_path', $cfg->getConfigEntry('base_path') . 'db/') $cfg->setDefaultTimezone('Europe/Berlin'); // CFG: MAGIC-QUOTES-RUNTIME -$cfg->setMagicQuotesRuntime(false); +$cfg->setMagicQuotesRuntime(FALSE); // CFG: CLASS-PREFIX $cfg->setConfigEntry('class_prefix', 'class_'); diff --git a/inc/loader/class_ClassLoader.php b/inc/loader/class_ClassLoader.php index 0c54eb63..50f34f37 100644 --- a/inc/loader/class_ClassLoader.php +++ b/inc/loader/class_ClassLoader.php @@ -69,7 +69,7 @@ class ClassLoader { private $ignoreList = array(); /** - * Debug this class loader? (true = yes, false = no) + * Debug this class loader? (TRUE = yes, FALSE = no) */ private $debug = FALSE; @@ -268,7 +268,7 @@ class ClassLoader { */ $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 . ' !');