* @param $stripTags Whether HTML tags shall be stripped out
* @return void
*/
- function outputStream ($output, $stripTags = false);
+ function outputStream ($output, $stripTags = FALSE);
}
// [EOF]
* @param $stripTags Whether HTML tags shall be stripped out
* @return void
*/
- function output ($outStream = false, $stripTags = false);
+ function output ($outStream = FALSE, $stripTags = FALSE);
}
// [EOF]
* @param $isValid Whether the request is valid
* @return void
*/
- function requestIsValid ($isValid = true);
+ function requestIsValid ($isValid = TRUE);
/**
* Reads a cookie and returns it's value or null if not found
* @throws ResponseHeadersAlreadySentException Thrown if headers are
* already sent
*/
- function flushBuffer ($force = false);
+ function flushBuffer ($force = FALSE);
/**
* Adds a fatal message id to the response. The added messages can then be
* @return void
* @throws ResponseHeadersAlreadySentException If headers are already sent
*/
- function addCookie ($cookieName, $cookieValue, $encrypted = false);
+ function addCookie ($cookieName, $cookieValue, $encrypted = FALSE);
/**
* Redirect to a configured URL. The URL can be absolute or relative. In
* @param $languageSupport New language support setting
* @return void
*/
- function enableLanguageSupport ($languageSupport = true);
+ function enableLanguageSupport ($languageSupport = TRUE);
/**
* Checks whether language support is enabled
* @param $xmlCompacting New XML compacting setting
* @return void
*/
- function enableXmlCompacting ($xmlCompacting = true);
+ function enableXmlCompacting ($xmlCompacting = TRUE);
/**
* Checks whether XML compacting is enabled
/**
* Socket resource
*/
- private $socketResource = false;
+ private $socketResource = FALSE;
/**
* Package data
} elseif (is_array($arg)) {
// .. or size if array
$argsString .= ', ' . count($arg);
- } elseif ($arg === true) {
+ } elseif ($arg === TRUE) {
// ... is boolean 'true'
$argsString .= ', true';
- } elseif ($arg === false) {
+ } elseif ($arg === FALSE) {
// ... is boolean 'true'
$argsString .= ', false';
}
print('</pre>');
// Exit program?
- if ($doExit === true) {
+ if ($doExit === TRUE) {
exit();
} // END - if
}
* @paran $stripTags Whether to strip tags (default: false)
* @return void
*/
- public function debugOutput ($message, $doPrint = true, $stripTags = false) {
+ public function debugOutput ($message, $doPrint = TRUE, $stripTags = FALSE) {
// Set debug instance to NULL
$debugInstance = NULL;
// Use debug output handler
$debugInstance->output($message, $stripTags);
- if ($doPrint === false) {
+ if ($doPrint === FALSE) {
// Die here if not printed
exit();
} // END - if
} // END - if
// Put directly out
- if ($doPrint === true) {
+ if ($doPrint === TRUE) {
// Print message
print($message . chr(10));
} else {
$this->getResultInstance()->rewind();
// Do we have an entry?
- if ($this->getResultInstance()->valid() === false) {
+ if ($this->getResultInstance()->valid() === FALSE) {
throw new InvalidDatabaseResultException(array($this, $this->getResultInstance()), DatabaseResult::EXCEPTION_INVALID_DATABASE_RESULT);
} // END - if
*/
public function idle ($milliSeconds) {
// Sleep is fine by default
- $hasSlept = true;
+ $hasSlept = TRUE;
// Idle so long with found function
if (function_exists('time_sleep_until')) {
*/
protected function isBase64Encoded ($encodedData) {
// Determine it
- $isBase64 = (@base64_decode($encodedData, true) !== false);
+ $isBase64 = (@base64_decode($encodedData, true) !== FALSE);
// Return it
return $isBase64;
* @param $assertMismatch Whether to assert mismatches
* @return $ret The (hopefully) secured numbered value
*/
- public function bigintval ($num, $castValue = true, $assertMismatch = false) {
+ public function bigintval ($num, $castValue = TRUE, $assertMismatch = FALSE) {
// Filter all numbers out
$ret = preg_replace('/[^0123456789]/', '', $num);
// Shall we cast?
- if ($castValue === true) {
+ if ($castValue === TRUE) {
// Cast to biggest numeric type
$ret = (double) $ret;
} // END - if
// Assert only if requested
- if ($assertMismatch === true) {
+ if ($assertMismatch === TRUE) {
// Has the whole value changed?
assert(('' . $ret . '' != '' . $num . '') && (!is_null($num)));
} // END - if
* @param $assertMismatch Whether to assert mismatches
* @return $ret The (hopefully) secured hext-numbered value
*/
- public function hexval ($num, $assertMismatch = false) {
+ public function hexval ($num, $assertMismatch = FALSE) {
// Filter all numbers out
$ret = preg_replace('/[^0123456789abcdefABCDEF]/', '', $num);
// Assert only if requested
- if ($assertMismatch === true) {
+ if ($assertMismatch === TRUE) {
// Has the whole value changed?
assert(('' . $ret . '' != '' . $num . '') && (!is_null($num)));
} // END - if
$ipResolved = gethostbyname($hostname);
// Was it fine?
- if (($ipResolved !== false) && ($ipResolved != $hostname)) {
+ if (($ipResolved !== FALSE) && ($ipResolved != $hostname)) {
// Okay, this works!
$ip = $ipResolved;
// @TODO Add some DNS caching here
// Open connection
- if ($helperInstance->isProxyUsed() === true) {
+ if ($helperInstance->isProxyUsed() === TRUE) {
// Resolve hostname into IP address
$ip = $helperInstance->resolveIpAddress($helperInstance->getConfigInstance()->getConfigEntry('proxy_host'));
} // END - if
// Prepare the GET request
- $request = 'GET ' . ($helperInstance->isProxyUsed() === true ? 'http://ship-simu.org' : '') . '/ip.php HTTP/1.0' . self::HTTP_EOL;
+ $request = 'GET ' . ($helperInstance->isProxyUsed() === TRUE ? 'http://ship-simu.org' : '') . '/ip.php HTTP/1.0' . self::HTTP_EOL;
$request .= 'Host: ship-simu.org' . self::HTTP_EOL;
$request .= 'User-Agent: ' . self::HTTP_USER_AGENT . self::HTTP_EOL;
$request .= 'Connection: close' . self::HTTP_EOL;
// Do we use proxy?
- if ($helperInstance->isProxyUsed() === true) {
+ if ($helperInstance->isProxyUsed() === TRUE) {
// CONNECT method?
if ($helperInstance->getConfigInstance()->getConfigEntry('proxy_connect_method') == 'Y') {
// Setup proxy tunnel
*/
public function ifEntryMatches (array $entryArray, $criteriaType = 'default') {
// First nothing matches and nothing is counted
- $matches = false;
+ $matches = FALSE;
$counted = 0;
// Walk through all entries
* @param $withFixed Whether to include a fixed salt (not recommended in p2p applications)
* @return $hashed The hashed and salted string
*/
- public function hashString ($str, $oldHash = '', $withFixed = true) {
+ public function hashString ($str, $oldHash = '', $withFixed = TRUE) {
// Cast the string
$str = (string) $str;
// Hash the password with salt
//* DEBUG: */ echo "salt=".$salt."/plain=".$str."<br />\n";
- if ($withFixed === true) {
+ if ($withFixed === TRUE) {
// Use additional fixed salt
$hashed = $salt . md5(sprintf($this->getConfigInstance()->getConfigEntry('hash_extra_mask'),
$salt,
/**
* Whether the "connection is already up
*/
- private $alreadyConnected = false;
+ private $alreadyConnected = FALSE;
/**
* Table information array
* @param $stripTags Whether HTML tags shall be stripped out
* @return void
*/
- public final function outputStream ($output, $stripTags = false) {
+ public final function outputStream ($output, $stripTags = FALSE) {
// Strip HTML tags out?
- if ($stripTags === true) {
+ if ($stripTags === TRUE) {
// Prepare the output without HTML tags
$output = trim(html_entity_decode(strip_tags(stripslashes($output))));
} else {
* @param $stripTags Whether HTML tags shall be stripped out
* @return void
*/
- public final function output ($outStream = false, $stripTags = false) {
+ public final function output ($outStream = FALSE, $stripTags = FALSE) {
// Empty output will be silently ignored
- if ($outStream !== false) {
+ if ($outStream !== FALSE) {
$this->outputStream($outStream, $stripTags);
} // END - if
}
* @param $stripTags Whether HTML tags shall be stripped out
* @return void
*/
- public final function outputStream ($output, $stripTags = false) {
+ public final function outputStream ($output, $stripTags = FALSE) {
// Split multiple lines into and array to put them out line-by-line
$errorLines = explode(chr(10), $output);
* @param $stripTags Whether HTML tags shall be stripped out
* @return void
*/
- public final function output ($outStream = false, $stripTags = false) {
+ public final function output ($outStream = FALSE, $stripTags = FALSE) {
// Empty output will be silently ignored
- if ($outStream !== false) {
+ if ($outStream !== FALSE) {
$this->outputStream($outStream);
}
}
* @param $stripTags Whether HTML tags shall be stripped out
* @return void
*/
- public final function outputStream ($output, $stripTags = false) {
+ public final function outputStream ($output, $stripTags = FALSE) {
// Strip out <br />
$output = str_replace("<br />", '', $output);
print(stripslashes($output)."<br />\n");
* @param $stripTags Whether HTML tags shall be stripped out
* @return void
*/
- public final function output ($outStream = false, $stripTags = false) {
+ public final function output ($outStream = FALSE, $stripTags = FALSE) {
// Empty output will be silently ignored
- if ($outStream !== false) {
+ if ($outStream !== FALSE) {
$this->outputStream($outStream, $stripTags);
} // END - if
}
* @param $add Whether add this group
* @return void
*/
- public function setVariableGroup ($groupName, $add = true) {
+ public function setVariableGroup ($groupName, $add = TRUE) {
// Call the inner class' method
$this->getTemplateInstance()->setVariableGroup($groupName, $add);
}
* @param $languageSupport New language support setting
* @return void
*/
- public final function enableLanguageSupport ($languageSupport = true) {
+ public final function enableLanguageSupport ($languageSupport = TRUE) {
// Call the inner class' method
$this->getTemplateInstance()->enableLanguageSupport($languageSupport);
}
* @param $xmlCompacting New XML compacting setting
* @return void
*/
- public final function enableXmlCompacting ($xmlCompacting = true) {
+ public final function enableXmlCompacting ($xmlCompacting = TRUE) {
// Call the inner class' method
$this->getTemplateInstance()->enableXmlCompacting($xmlCompacting);
}
*/
private function ifEmailIsTaken ($email) {
// Default is already taken
- $alreadyTaken = true;
+ $alreadyTaken = TRUE;
// Initialize instance
$userInstance = NULL;
}
// Does the email exist?
- if ($userInstance->ifEmailAddressExists() === false) {
+ if ($userInstance->ifEmailAddressExists() === FALSE) {
// This email has not being used yet
- $alreadyTaken = false;
+ $alreadyTaken = FALSE;
}
// Return the result
*/
private function ifUserNameIsTaken ($userName) {
// Default is already taken
- $alreadyTaken = true;
+ $alreadyTaken = TRUE;
// Initialize instance
$userInstance = NULL;
}
// Does the username exist?
- if ((is_null($userInstance)) || ($userInstance->ifUsernameExists() === false)) {
+ if ((is_null($userInstance)) || ($userInstance->ifUsernameExists() === FALSE)) {
// This username is still available
- $alreadyTaken = false;
+ $alreadyTaken = FALSE;
} // END - if
// Return the result
// Abort here
throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
- } elseif ($this->ifUserGuestIsTaken($userName) === false) {
+ } elseif ($this->ifUserGuestIsTaken($userName) === FALSE) {
// Username is already taken
$requestInstance->requestIsValid(false);
*/
private function ifUserGuestIsTaken ($userName) {
// Default is already taken
- $alreadyTaken = true;
+ $alreadyTaken = TRUE;
// Initialize instance
$userInstance = NULL;
}
// Does the username exist?
- if ((is_null($userInstance)) || ($userInstance->ifUsernameExists() === false)) {
+ if ((is_null($userInstance)) || ($userInstance->ifUsernameExists() === FALSE)) {
// This username is still available
- $alreadyTaken = false;
+ $alreadyTaken = FALSE;
}
// Return the result
// Abort here
throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
- } elseif ($this->ifUserNameIsTaken($userName) === false) {
+ } elseif ($this->ifUserNameIsTaken($userName) === FALSE) {
// Username is already taken
$requestInstance->requestIsValid(false);
*/
private function ifUserNameIsTaken ($userName) {
// Default is already taken
- $alreadyTaken = true;
+ $alreadyTaken = TRUE;
// Initialize instance
$userInstance = NULL;
}
// Does the username exist?
- if ((is_null($userInstance)) || ($userInstance->ifUsernameExists() === false)) {
+ if ((is_null($userInstance)) || ($userInstance->ifUsernameExists() === FALSE)) {
// This username is still available
- $alreadyTaken = false;
+ $alreadyTaken = FALSE;
} // END - if
// Return the result
$userInstance = call_user_func_array(array($userClass, 'createMemberByRequest'), array($requestInstance));
// Is the email address valid?
- if ($userInstance->ifEmailAddressExists() === false) {
+ if ($userInstance->ifEmailAddressExists() === FALSE) {
// Request is invalid!
$requestInstance->requestIsValid(false);
// Add the group to the stack
$this->groups[$this->totalCounter] = $groupId;
- $this->groups[$groupId]['opened'] = true;
+ $this->groups[$groupId]['opened'] = TRUE;
$this->groups[$groupId]['content'] = sprintf(
"<!-- group %s opened (length: %s, tag: %s) //-->%s\n",
$groupId,
} // END - if
// Check if any group was opened before
- if ($this->ifGroupOpenedPreviously() === false) {
+ if ($this->ifGroupOpenedPreviously() === FALSE) {
// Then throw an exception
throw new HelperNoPreviousOpenedGroupException(array($this, $content), self::EXCEPTION_NO_PREVIOUS_SUB_GROUP_OPENED);
} // END - if
$this->groups[$groupId]['tag'],
$content
);
- $this->groups[$groupId]['opened'] = false;
+ $this->groups[$groupId]['opened'] = FALSE;
// Mark previous group as closed
$this->setPreviousGroupId('');
// Add the group to the stack
$this->subGroups[$this->totalCounter] = $subGroupId;
- $this->subGroups[$subGroupId]['opened'] = true;
+ $this->subGroups[$subGroupId]['opened'] = TRUE;
$this->subGroups[$subGroupId]['content'] = sprintf("<!-- sub-group %s opened (length: %s, tag: %s) //-->%s\n", $subGroupId, strlen($content), $tag, $content);
$this->subGroups[$subGroupId]['tag'] = $tag;
*/
public function closePreviousSubGroupByContent ($content = '') {
// Check if any sub group was opened before
- if ($this->ifSubGroupOpenedPreviously() === false) {
+ if ($this->ifSubGroupOpenedPreviously() === FALSE) {
// Then throw an exception
throw new HelperNoPreviousOpenedSubGroupException(array($this, $content), self::EXCEPTION_NO_PREVIOUS_SUB_GROUP_OPENED);
} // END - if
// Add content to it and mark it as closed
$this->subGroups[$subGroupId]['content'] .= sprintf("<!-- sub-group %s closed (length: %s, tag: %s) //-->%s\n", $subGroupId, strlen($content), $this->subGroups[$subGroupId]['tag'], $content);
- $this->subGroups[$subGroupId]['opened'] = false;
+ $this->subGroups[$subGroupId]['opened'] = FALSE
+ ;
// Mark previous sub group as closed
$this->setPreviousSubGroupId('');
// Now "walk" through all groups and sub-groups
for ($idx = 1; $idx <= $this->totalCounter; $idx++) {
// Is this a sub/group and is it closed?
- if ((isset($this->groups[$idx])) && ($this->groups[$this->groups[$idx]]['opened'] === false)) {
+ if ((isset($this->groups[$idx])) && ($this->groups[$this->groups[$idx]]['opened'] === FALSE)) {
// Then add it's content
$groupContent = trim($this->groups[$this->groups[$idx]]['content']);
//* DEBUG: */ echo "group={$this->groups[$idx]},content=<pre>".htmlentities($groupContent)."</pre><br />\n";
$content .= $groupContent;
- } elseif ((isset($this->subGroups[$idx])) && ($this->subGroups[$this->subGroups[$idx]]['opened'] === false)) {
+ } elseif ((isset($this->subGroups[$idx])) && ($this->subGroups[$this->subGroups[$idx]]['opened'] === FALSE)) {
// Then add it's content
$subGroupContent = $this->subGroups[$this->subGroups[$idx]]['content'];
//* DEBUG: */ echo "subgroup={$this->subGroups[$idx]},content=<pre>".htmlentities($subGroupContent)."</pre><br />\n";
*/
protected function ifGroupIsOpened ($groupId) {
// Is the group open?
- $isOpened = ((isset($this->groups[$groupId])) && ($this->groups[$groupId]['opened'] === true));
+ $isOpened = ((isset($this->groups[$groupId])) && ($this->groups[$groupId]['opened'] === TRUE));
// Return status
return $isOpened;
* Whether the form tag is opened (keep at false or else your forms will
* never work!)
*/
- private $formOpened = false;
+ private $formOpened = FALSE;
/**
* Name of the form
/**
* Whether form tag is enabled (default: true)
*/
- private $formEnabled = true;
+ private $formEnabled = TRUE;
// Class Constants
const EXCEPTION_FORM_NAME_INVALID = 0x120;
* @param $withForm Whether include the form tag
* @return $helperInstance A preparedf instance of this helper
*/
- public static final function createWebFormHelper (CompileableTemplate $templateInstance, $formName, $formId = false, $withForm = true) {
+ public static final function createWebFormHelper (CompileableTemplate $templateInstance, $formName, $formId = FALSE, $withForm = TRUE) {
// Get new instance
$helperInstance = new WebFormHelper();
$helperInstance->setTemplateInstance($templateInstance);
// Is the form id not set?
- if ($formId === false) {
+ if ($formId === FALSE) {
// Use form id from form name
$formId = $formName;
} // END - if
$helperInstance->setFormName($formName);
// A form-less field may say 'false' here...
- if ($withForm === true) {
+ if ($withForm === TRUE) {
// Create the form
$helperInstance->addFormTag($formName, $formId);
} else {
* @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)
+ * @throws InvalidFormNameException If the form name is invalid ( = FALSE)
* @todo Add some unique PIN here to bypass problems with some browser and/or extensions
*/
- public function addFormTag ($formName = false, $formId = false) {
+ public function addFormTag ($formName = FALSE, $formId = FALSE) {
// When the form is not yet opened at least form name must be valid
- if (($this->formOpened === false) && ($formName === false)) {
+ if (($this->formOpened === FALSE) && ($formName === FALSE)) {
// Thrown an exception
throw new InvalidFormNameException ($this, self::EXCEPTION_FORM_NAME_INVALID);
} // END - if
$formContent = '</form>';
// Check whether we shall open or close the form
- if (($this->formOpened === false) && ($this->formEnabled === true)) {
+ if (($this->formOpened === FALSE) && ($this->formEnabled === TRUE)) {
// Add HTML code
$formContent = sprintf("<form name=\"%s\" class=\"forms\" action=\"%s/%s\" method=\"%s\" target=\"%s\"",
$formName,
$formContent .= '>';
// Open the form and remeber the form name
- $this->formOpened = true;
+ $this->formOpened = TRUE;
// Add it to the content
$this->addHeaderContent($formContent);
} // END - if
// Simply close it
- $this->formOpened = false;
+ $this->formOpened = FALSE;
// Add it to the content
$this->addFooterContent($formContent);
*/
public function addInputTextField ($fieldName, $fieldValue = '') {
// Is the form opened?
- if (($this->formOpened === false) && ($this->formEnabled === true)) {
+ if (($this->formOpened === FALSE) && ($this->formEnabled === TRUE)) {
// Throw an exception
throw new FormClosedException (array($this, $fieldName), self::EXCEPTION_CLOSED_FORM);
} // END - if
*/
public function addInputPasswordField ($fieldName, $fieldValue = '') {
// Is the form opened?
- if (($this->formOpened === false) && ($this->formEnabled === true)) {
+ if (($this->formOpened === FALSE) && ($this->formEnabled === TRUE)) {
// Throw an exception
throw new FormClosedException (array($this, $fieldName), self::EXCEPTION_CLOSED_FORM);
} // END - if
*/
public function addInputHiddenField ($fieldName, $fieldValue = '') {
// Is the form opened?
- if (($this->formOpened === false) && ($this->formEnabled === true)) {
+ if (($this->formOpened === FALSE) && ($this->formEnabled === TRUE)) {
// Throw an exception
throw new FormClosedException (array($this, $fieldName), self::EXCEPTION_CLOSED_FORM);
} // END - if
* @return void
* @throws FormClosedException If the form is not yet opened
*/
- public function addInputCheckboxField ($fieldName, $fieldChecked = true) {
+ public function addInputCheckboxField ($fieldName, $fieldChecked = TRUE) {
// Is the form opened?
- if (($this->formOpened === false) && ($this->formEnabled === true)) {
+ if (($this->formOpened === FALSE) && ($this->formEnabled === TRUE)) {
// Throw an exception
throw new FormClosedException (array($this, $fieldName), self::EXCEPTION_CLOSED_FORM);
} // END - if
// Set whether the check box is checked...
$checked = " checked=\"checked\"";
- if ($fieldChecked === false) $checked = ' ';
+ if ($fieldChecked === FALSE) $checked = ' ';
// Generate the content
$inputContent = sprintf("<input type=\"checkbox\" name=\"%s\" class=\"checkbox %s_field\" value=\"1\"%s/>",
*/
public function addInputResetButton ($buttonText) {
// Is the form opened?
- if (($this->formOpened === false) && ($this->formEnabled === true)) {
+ if (($this->formOpened === FALSE) && ($this->formEnabled === TRUE)) {
// Throw an exception
throw new FormClosedException (array($this, 'reset'), self::EXCEPTION_CLOSED_FORM);
} // END - if
*/
public function addInputSubmitButton ($buttonText) {
// Is the form opened?
- if (($this->formOpened === false) && ($this->formEnabled === true)) {
+ if (($this->formOpened === FALSE) && ($this->formEnabled === TRUE)) {
// Throw an exception
throw new FormClosedException (array($this, 'submit'), self::EXCEPTION_CLOSED_FORM);
} // END - if
*/
public function addFormGroup ($groupId = '', $groupText = '') {
// Is a form opened?
- if (($this->formOpened === false) && ($this->formEnabled === true)) {
+ if (($this->formOpened === FALSE) && ($this->formEnabled === TRUE)) {
// Throw exception here
throw new FormClosedException(array($this, $groupId), self::EXCEPTION_CLOSED_FORM);
} // END - if
// At least the group name should be set
- if ((empty($groupId)) && ($this->ifGroupOpenedPreviously() === false)) {
+ if ((empty($groupId)) && ($this->ifGroupOpenedPreviously() === FALSE)) {
// Throw exception here
throw new EmptyVariableException(array($this, 'groupId'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
} elseif (empty($groupId)) {
}
// Same group to open?
- if (($this->ifGroupOpenedPreviously() === false) && ($groupId === $this->getPreviousGroupId())) {
+ if (($this->ifGroupOpenedPreviously() === FALSE) && ($groupId === $this->getPreviousGroupId())) {
// Abort here silently
return false;
} // END - if
$content = " </div>\n</div><!-- Group - CLOSE //-->";
// Is this group opened?
- if ($this->ifGroupOpenedPreviously() === false) {
+ if ($this->ifGroupOpenedPreviously() === FALSE) {
// Begin the div/span blocks
$content = sprintf("<!-- Group %s - OPEN //-->
<div class=\"group_box\" id=\"%s_group_box\">
*/
public function addFormSubGroup ($subGroupId = '', $subGroupText = '') {
// Is a group opened?
- if ($this->ifGroupOpenedPreviously() === false) {
+ if ($this->ifGroupOpenedPreviously() === FALSE) {
// Throw exception here
throw new FormFormClosedException(array($this, $subGroupId), self::EXCEPTION_UNEXPECTED_CLOSED_GROUP);
} // END - if
// At least the sub group name should be set
- if ((empty($subGroupId)) && ($this->ifSubGroupOpenedPreviously() === false)) {
+ if ((empty($subGroupId)) && ($this->ifSubGroupOpenedPreviously() === FALSE)) {
// Throw exception here
throw new EmptyVariableException(array($this, 'subGroupId'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
} elseif (empty($subGroupId)) {
}
// Same sub group to open?
- if (($this->ifSubGroupOpenedPreviously() === false) && ($subGroupId == $this->getPreviousSubGroupId())) {
+ if (($this->ifSubGroupOpenedPreviously() === FALSE) && ($subGroupId == $this->getPreviousSubGroupId())) {
// Abort here silently
return false;
} // END - if
$content = " </div>\n</div><!-- Sub group- CLOSE //-->";
// Is this group opened?
- if ($this->ifSubGroupOpenedPreviously() === false) {
+ if ($this->ifSubGroupOpenedPreviously() === FALSE) {
// Begin the span block
$content = sprintf("<!-- Sub group %s - OPEN //-->
<div class=\"subgroup_box\" id=\"%s_subgroup_box\">
*/
public function addFieldText ($fieldName, $fieldText) {
// Is the form opened?
- if (($this->formOpened === false) && ($this->formEnabled === true)) {
+ if (($this->formOpened === FALSE) && ($this->formEnabled === TRUE)) {
// Throw an exception
throw new FormClosedException (array($this, $fieldName), self::EXCEPTION_CLOSED_FORM);
} // END - if
*/
public function addFormNote ($noteId, $formNotes) {
// Is the form opened?
- if (($this->formOpened === false) && ($this->formEnabled === true)) {
+ if (($this->formOpened === FALSE) && ($this->formEnabled === TRUE)) {
// Throw an exception
throw new FormClosedException (array($this, 'form_notes'), self::EXCEPTION_CLOSED_FORM);
} // END - if
*/
public function addInputSelectField ($selectId, $firstEntry) {
// Is the form group opened?
- if (($this->formOpened === false) && ($this->formEnabled === true)) {
+ if (($this->formOpened === FALSE) && ($this->formEnabled === TRUE)) {
// Throw an exception
throw new FormClosedException (array($this, 'form_notes'), self::EXCEPTION_CLOSED_FORM);
} // END - if
// Shall we close or open the sub group?
- if (($this->ifSubGroupOpenedPreviously() === false) && ($this->getPreviousSubGroupId() !== $selectId)) {
+ if (($this->ifSubGroupOpenedPreviously() === FALSE) && ($this->getPreviousSubGroupId() !== $selectId)) {
// Initialize first entry (which might be non-selectable if content is provided
if (!empty($firstEntry)) {
// Add selection around it
*/
public function addSelectSubOption ($subName, $subValue) {
// Is there a sub group (shall be a selection box!)
- if ($this->ifSubGroupOpenedPreviously() === false) {
+ if ($this->ifSubGroupOpenedPreviously() === FALSE) {
// Then throw an exception here
throw new HelperNoPreviousOpenedSubGroupException(array($this, $content), self::EXCEPTION_NO_PREVIOUS_SUB_GROUP_OPENED);
} // END - if
*/
public function addSelectOption ($optionName, $optionValue) {
// Is there a sub group (shall be a selection box!)
- if ($this->ifSubGroupOpenedPreviously() === false) {
+ if ($this->ifSubGroupOpenedPreviously() === FALSE) {
// Then throw an exception here
throw new HelperNoPreviousOpenedSubGroupException(array($this, $content), self::EXCEPTION_NO_PREVIOUS_SUB_GROUP_OPENED);
} // END - if
* @param $formEnabled Whether form is enabled or disabled
* @return void
*/
- public final function enableForm ($formEnabled = true) {
+ public final function enableForm ($formEnabled = TRUE) {
$this->formEnabled = (bool) $formEnabled;
}
*/
public function flushContent () {
// Is the form still open?
- if (($this->formOpened === true) && ($this->formEnabled === true)) {
+ if (($this->formOpened === TRUE) && ($this->formEnabled === TRUE)) {
// Close the form automatically
$this->addFormTag();
- } elseif ($this->formEnabled === false) {
+ } elseif ($this->formEnabled === FALSE) {
if ($this->ifSubGroupOpenedPreviously()) {
// Close sub group
$this->addFormSubGroup();
*/
public function addLinkNote ($groupId, $groupNote, $groupCode = "div") {
// Check if a previous group was opened
- if ($this->ifGroupOpenedPreviously() === false) {
+ if ($this->ifGroupOpenedPreviously() === FALSE) {
// No group was opened before!
throw new NoGroupOpenedException(array($this, $groupNote), self::EXCEPTION_GROUP_NOT_OPENED);
} // END - if
*/
protected function addActionLink ($linkAction, $linkText, $linkTitle) {
// Check if a previous group was opened
- if ($this->ifGroupOpenedPreviously() === false) {
+ if ($this->ifGroupOpenedPreviously() === FALSE) {
// No group was opened before!
throw new NoGroupOpenedException(array($this, $linkAction . '(' . $linkText . ')'), self::EXCEPTION_GROUP_NOT_OPENED);
} // END - if
* @throws PathReadProtectedException If the provided path name is read-protected
* @throws DirPointerNotOpenedException If opendir() returns not a directory resource
*/
- public static final function createFrameworkDirectoryPointer ($pathName, $inConstructor = false) {
+ public static final function createFrameworkDirectoryPointer ($pathName, $inConstructor = FALSE) {
// Some pre-sanity checks...
if (is_null($pathName)) {
// No pathname given
if ($inConstructor) {
return NULL;
} else {
- throw new PathIsEmptyException(null, self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
+ throw new PathIsEmptyException(NULL, self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
}
} elseif (!is_string($pathName)) {
// Is not a string
if ($inConstructor) {
return NULL;
} else {
- throw new InvalidPathStringException(null, self::EXCEPTION_INVALID_STRING);
+ throw new InvalidPathStringException(NULL, self::EXCEPTION_INVALID_STRING);
}
} elseif (!is_dir($pathName)) {
// Not a directory
$rawLine = $this->readRawDirectory();
// Shall we exclude directories?
- if ((!is_null($rawLine)) && ($rawLine !== false) && (!in_array($rawLine, $except))) {
+ if ((!is_null($rawLine)) && ($rawLine !== FALSE) && (!in_array($rawLine, $except))) {
// Return read data
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DIRECTORY[' . __LINE__ . ']: rawLine[' . gettype($rawLine) . ']=' . $rawLine);
return $rawLine;
- } elseif ((!is_null($rawLine)) && ($rawLine !== false)) {
+ } elseif ((!is_null($rawLine)) && ($rawLine !== FALSE)) {
// Exclude this part
//* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('DIRECTORY[' . __LINE__ . ']: rawline[' . gettype($rawLine) . ']=' . $rawLine . ' - Recursive call!');
return $this->readDirectoryExcept($except);
// Some pre-sanity checks...
if ((is_null($fileName)) || (empty($fileName))) {
// No filename given
- throw new FileIsEmptyException(null, self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
+ throw new FileIsEmptyException(NULL, self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
} elseif (!file_exists($fileName)) {
// File does not exist!
throw new FileIoException($fileName, self::EXCEPTION_FILE_NOT_FOUND);
// Try to open a handler
$filePointer = fopen($fileName, 'rb');
- if ((is_null($filePointer)) || ($filePointer === false)) {
+ if ((is_null($filePointer)) || ($filePointer === FALSE)) {
// Something bad happend
throw new FileIoException($fileName, self::EXCEPTION_FILE_POINTER_INVALID);
} // END - if
// Some pre-sanity checks...
if (is_null($fileName)) {
// No filename given
- throw new FileIsEmptyException(null, self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
+ throw new FileIsEmptyException(NULL, self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
} // END - if
// Try to open a handler
$filePointer = @fopen($fileName, $mode);
- if (($filePointer === null) || ($filePointer === false)) {
+ if (($filePointer === null) || ($filePointer === FALSE)) {
// Something bad happend
throw new FileIoException ($fileName, self::EXCEPTION_FILE_POINTER_INVALID);
} // END - if
* @param $stripTags Whether HTML tags shall be stripped out
* @return void
*/
- public final function output ($outStream = false, $stripTags = false) {
+ public final function output ($outStream = FALSE, $stripTags = FALSE) {
print trim($outStream) . PHP_EOL;
}
}
* @param $stripTags Whether HTML tags shall be stripped out
* @return void
*/
- public final function output ($outStream = false, $stripTags = false) {
+ public final function output ($outStream = FALSE, $stripTags = FALSE) {
print(stripslashes($outStream));
}
}
*/
public function ifUserHasRequiredPoints ($action) {
// Default is that everyone is poor... ;-)
- $hasRequired = false;
+ $hasRequired = FALSE;
// Get the required points entry
$requiredPoints = $this->getConfigInstance()->getConfigEntry($action . '_action_points');
* valid so make sure your intercepting filters sets this attribute to false
* when they need to intercept the data flow.
*/
- private $requestIsValid = true;
+ private $requestIsValid = TRUE;
/**
* Protected constructor
* @param $isValid Whether the request is valid
* @return void
*/
- public final function requestIsValid ($isValid = true) {
+ public final function requestIsValid ($isValid = TRUE) {
$this->requestIsValid = (bool) $isValid;
}
*/
public function isActionValid ($actionName) {
// By default nothing shall be valid
- $isValid = false;
+ $isValid = FALSE;
// Is a action set?
if (empty($actionName)) {
// Is this class already loaded?
if (class_exists($this->getClassName())) {
// This class does exist. :-)
- $isValid = true;
+ $isValid = TRUE;
} // END - if
// Set action name
if (empty($actionName)) {
// Then thrown an exception here
throw new EmptyVariableException(array($resolverInstance, 'defaultAction'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
- } elseif ($resolverInstance->isActionValid($actionName) === false) {
+ } elseif ($resolverInstance->isActionValid($actionName) === FALSE) {
// Invalid action found
throw new InvalidActionException(array($resolverInstance, $actionName), self::EXCEPTION_INVALID_ACTION);
}
} // END - if
// Check if action is valid
- if ($this->isActionValid($actionName) === false) {
+ if ($this->isActionValid($actionName) === FALSE) {
// This action is invalid!
throw new InvalidActionException(array($this, $actionName), self::EXCEPTION_INVALID_ACTION);
} // END - if
} // END - if
// Check if action is valid
- if ($this->isActionValid($actionName) === false) {
+ if ($this->isActionValid($actionName) === FALSE) {
// This action is invalid!
throw new InvalidActionException(array($this, $actionName), self::EXCEPTION_INVALID_ACTION);
} // END - if
if (empty($!!!Name)) {
// Then thrown an exception here
throw new EmptyVariableException(array($resolverInstance, 'default|||'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
- } elseif ($resolverInstance->is|||Valid($!!!Name) === false) {
+ } elseif ($resolverInstance->is|||Valid($!!!Name) === FALSE) {
// Invalid action found
throw new Invalid|||Exception(array($resolverInstance, $!!!Name), self::EXCEPTION_INVALID_ACTION);
}
if (empty($!!!Name)) $!!!Name = $this->getConfigInstance()->getConfigEntry('default_action');
// Check if action is valid
- if ($this->is|||Valid($!!!Name) === false) {
+ if ($this->is|||Valid($!!!Name) === FALSE) {
// This action is invalid!
throw new Invalid|||Exception(array($this, $!!!Name), self::EXCEPTION_INVALID_ACTION);
} // END - if
} // END - if
// Check if action is valid
- if ($this->is|||Valid($!!!Name) === false) {
+ if ($this->is|||Valid($!!!Name) === FALSE) {
// This action is invalid!
throw new Invalid|||Exception(array($this, $!!!Name), self::EXCEPTION_INVALID_ACTION);
} // END - if
if (empty($!!!Name)) {
// Then thrown an exception here
throw new EmptyVariableException(array($resolverInstance, 'default|||'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
- } elseif ($resolverInstance->is|||Valid($!!!Name) === false) {
+ } elseif ($resolverInstance->is|||Valid($!!!Name) === FALSE) {
// Invalid action found
throw new Invalid|||Exception(array($resolverInstance, $!!!Name), self::EXCEPTION_INVALID_ACTION);
}
if (empty($!!!Name)) $!!!Name = $this->getConfigInstance()->getConfigEntry('default_action');
// Check if action is valid
- if ($this->is|||Valid($!!!Name) === false) {
+ if ($this->is|||Valid($!!!Name) === FALSE) {
// This action is invalid!
throw new Invalid|||Exception(array($this, $!!!Name), self::EXCEPTION_INVALID_ACTION);
} // END - if
} // END - if
// Check if action is valid
- if ($this->is|||Valid($!!!Name) === false) {
+ if ($this->is|||Valid($!!!Name) === FALSE) {
// This action is invalid!
throw new Invalid|||Exception(array($this, $!!!Name), self::EXCEPTION_INVALID_ACTION);
} // END - if
if (empty($!!!Name)) {
// Then thrown an exception here
throw new EmptyVariableException(array($resolverInstance, 'default|||'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
- } elseif ($resolverInstance->is|||Valid($!!!Name) === false) {
+ } elseif ($resolverInstance->is|||Valid($!!!Name) === FALSE) {
// Invalid action found
throw new Invalid|||Exception(array($resolverInstance, $!!!Name), self::EXCEPTION_INVALID_ACTION);
}
if (empty($!!!Name)) $!!!Name = $this->getConfigInstance()->getConfigEntry('default_action');
// Check if action is valid
- if ($this->is|||Valid($!!!Name) === false) {
+ if ($this->is|||Valid($!!!Name) === FALSE) {
// This action is invalid!
throw new Invalid|||Exception(array($this, $!!!Name), self::EXCEPTION_INVALID_ACTION);
} // END - if
} // END - if
// Check if action is valid
- if ($this->is|||Valid($!!!Name) === false) {
+ if ($this->is|||Valid($!!!Name) === FALSE) {
// This action is invalid!
throw new Invalid|||Exception(array($this, $!!!Name), self::EXCEPTION_INVALID_ACTION);
} // END - if
if (empty($!!!Name)) {
// Then thrown an exception here
throw new EmptyVariableException(array($resolverInstance, 'default|||'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
- } elseif ($resolverInstance->is|||Valid($!!!Name) === false) {
+ } elseif ($resolverInstance->is|||Valid($!!!Name) === FALSE) {
// Invalid action found
throw new Invalid|||Exception(array($resolverInstance, $!!!Name), self::EXCEPTION_INVALID_ACTION);
}
if (empty($!!!Name)) $!!!Name = $this->getConfigInstance()->getConfigEntry('default_action');
// Check if action is valid
- if ($this->is|||Valid($!!!Name) === false) {
+ if ($this->is|||Valid($!!!Name) === FALSE) {
// This action is invalid!
throw new Invalid|||Exception(array($this, $!!!Name), self::EXCEPTION_INVALID_ACTION);
} // END - if
} // END - if
// Check if action is valid
- if ($this->is|||Valid($!!!Name) === false) {
+ if ($this->is|||Valid($!!!Name) === FALSE) {
// This action is invalid!
throw new Invalid|||Exception(array($this, $!!!Name), self::EXCEPTION_INVALID_ACTION);
} // END - if
*/
public function isCommandValid ($commandName) {
// By default nothing shall be valid
- $isValid = false;
+ $isValid = FALSE;
// Is a command set?
if (empty($commandName)) {
// Is this class already loaded?
if (class_exists($this->getClassName())) {
// This class does exist. :-)
- $isValid = true;
+ $isValid = TRUE;
} // END - if
// Set command name
if (empty($commandName)) {
// Then thrown an exception here
throw new EmptyVariableException(array($resolverInstance, 'commandName'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
- } elseif ($resolverInstance->isCommandValid($commandName) === false) {
+ } elseif ($resolverInstance->isCommandValid($commandName) === FALSE) {
// Invalid command found
throw new InvalidCommandException(array($resolverInstance, $commandName), self::EXCEPTION_INVALID_COMMAND);
}
} // END - if
// Check if command is valid
- if ($this->isCommandValid($commandName) === false) {
+ if ($this->isCommandValid($commandName) === FALSE) {
// This command is invalid!
throw new InvalidCommandException(array($this, $commandName), self::EXCEPTION_INVALID_COMMAND);
} // END - if
} // END - if
// Check if command is valid
- if ($this->isCommandValid($commandName) === false) {
+ if ($this->isCommandValid($commandName) === FALSE) {
// This command is invalid!
throw new InvalidCommandException(array($this, $commandName), self::EXCEPTION_INVALID_COMMAND);
} // END - if
if (empty($commandName)) {
// Then thrown an exception here
throw new EmptyVariableException(array($resolverInstance, 'commandName'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
- } elseif ($resolverInstance->isCommandValid($commandName) === false) {
+ } elseif ($resolverInstance->isCommandValid($commandName) === FALSE) {
// Invalid command found
throw new InvalidCommandException(array($resolverInstance, $commandName), self::EXCEPTION_INVALID_COMMAND);
}
} // END - if
// Check if command is valid
- if ($this->isCommandValid($commandName) === false) {
+ if ($this->isCommandValid($commandName) === FALSE) {
// This command is invalid!
throw new InvalidCommandException(array($this, $commandName), self::EXCEPTION_INVALID_COMMAND);
} // END - if
} // END - if
// Check if command is valid
- if ($this->isCommandValid($commandName) === false) {
+ if ($this->isCommandValid($commandName) === FALSE) {
// This command is invalid!
throw new InvalidCommandException(array($this, $commandName), self::EXCEPTION_INVALID_COMMAND);
} // END - if
if (empty($commandName)) {
// Then thrown an exception here
throw new EmptyVariableException(array($resolverInstance, 'commandName'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
- } elseif ($resolverInstance->isCommandValid($commandName) === false) {
+ } elseif ($resolverInstance->isCommandValid($commandName) === FALSE) {
// Invalid command found
throw new InvalidCommandException(array($resolverInstance, $commandName), self::EXCEPTION_INVALID_COMMAND);
}
if (empty($commandName)) $commandName = $this->getConfigInstance()->getConfigEntry('default_web_command');
// Check if the command is valid
- if ($this->isCommandValid($commandName) === false) {
+ if ($this->isCommandValid($commandName) === FALSE) {
// This command is invalid!
throw new InvalidCommandException(array($this, $commandName), self::EXCEPTION_INVALID_COMMAND);
} // END - if
if (empty($commandName)) $commandName = $this->getConfigInstance()->getConfigEntry('default_web_command');
// Check if the command is valid
- if ($this->isCommandValid($commandName) === false) {
+ if ($this->isCommandValid($commandName) === FALSE) {
// This command is invalid!
throw new InvalidCommandException(array($this, $commandName), self::EXCEPTION_INVALID_COMMAND);
}
if (empty($commandName)) {
// Then thrown an exception here
throw new EmptyVariableException(array($resolverInstance, 'commandName'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
- } elseif ($resolverInstance->isCommandValid($commandName) === false) {
+ } elseif ($resolverInstance->isCommandValid($commandName) === FALSE) {
// Invalid command found
throw new InvalidCommandException(array($resolverInstance, $commandName), self::EXCEPTION_INVALID_COMMAND);
}
} // END - if
// Check if command is valid
- if ($this->isCommandValid($commandName) === false) {
+ if ($this->isCommandValid($commandName) === FALSE) {
// This command is invalid!
throw new InvalidCommandException(array($this, $commandName), self::EXCEPTION_INVALID_COMMAND);
} // END - if
} // END - if
// Check if command is valid
- if ($this->isCommandValid($commandName) === false) {
+ if ($this->isCommandValid($commandName) === FALSE) {
// This command is invalid!
throw new InvalidCommandException(array($this, $commandName), self::EXCEPTION_INVALID_COMMAND);
} // END - if
*/
public function isControllerValid ($controllerName) {
// By default nothing shall be valid
- $isValid = false;
+ $isValid = FALSE;
// Is a controller set?
if (empty($controllerName)) {
$this->setClassName($className);
// Try it hard to get an controller
- while ($isValid === false) {
+ while ($isValid === FALSE) {
// Is this class already loaded?
if (class_exists($this->getClassName())) {
// This class does exist. :-)
- $isValid = true;
+ $isValid = TRUE;
} elseif ($this->getClassName() != $this->getClassPrefix() . 'DefaultNewsController') {
// Set default controller
$this->setClassName($this->getClassPrefix() . 'DefaultNewsController');
if (empty($controllerName)) {
// Then thrown an exception here
throw new EmptyVariableException(array($resolverInstance, 'commandName'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
- } elseif ($resolverInstance->isControllerValid($controllerName) === false) {
+ } elseif ($resolverInstance->isControllerValid($controllerName) === FALSE) {
// Invalid command found
throw new InvalidControllerException(array($resolverInstance, $controllerName), self::EXCEPTION_INVALID_CONTROLLER);
}
if (empty($controllerName)) {
// Then thrown an exception here
throw new EmptyVariableException(array($resolverInstance, 'commandName'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
- } elseif ($resolverInstance->isControllerValid($controllerName) === false) {
+ } elseif ($resolverInstance->isControllerValid($controllerName) === FALSE) {
// Invalid command found
throw new InvalidControllerException(array($resolverInstance, $controllerName), self::EXCEPTION_INVALID_CONTROLLER);
}
if (empty($controllerName)) {
// Then thrown an exception here
throw new EmptyVariableException(array($resolverInstance, 'commandName'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
- } elseif ($resolverInstance->isControllerValid($controllerName) === false) {
+ } elseif ($resolverInstance->isControllerValid($controllerName) === FALSE) {
// Invalid command found
throw new InvalidControllerException(array($resolverInstance, $controllerName), self::EXCEPTION_INVALID_CONTROLLER);
}
* @throws ResponseHeadersAlreadySentException Thrown if headers are
* already sent
*/
- public function flushBuffer ($force = false) {
- if ((headers_sent()) && ($force === false)) {
+ public function flushBuffer ($force = FALSE) {
+ if ((headers_sent()) && ($force === FALSE)) {
// Headers are already sent!
throw new ResponseHeadersAlreadySentException($this, self::EXCEPTION_HEADERS_ALREADY_SENT);
} elseif (!headers_sent()) {
* @return void
* @throws ResponseHeadersAlreadySentException If headers are already sent
*/
- public function addCookie ($cookieName, $cookieValue, $encrypted = false, $expires = NULL) {
+ public function addCookie ($cookieName, $cookieValue, $encrypted = FALSE, $expires = NULL) {
//* DEBUG: */ echo $cookieName.'='.$cookieValue."<br />\n";
$this->partialStub('Naturally unimplemented in console response.');
}
* @throws ResponseHeadersAlreadySentException Thrown if headers are
* already sent
*/
- public function flushBuffer ($force = false) {
+ public function flushBuffer ($force = FALSE) {
$this->partialStub('Please implement this class.');
}
}
* @todo If the return statement is removed and setcookie() commented out,
* @todo this will send only one cookie out, the first one.
*/
- public function addCookie ($cookieName, $cookieValue, $encrypted = false, $expires = NULL) {
+ public function addCookie ($cookieName, $cookieValue, $encrypted = FALSE, $expires = NULL) {
//* DEBUG: */ echo $cookieName.'='.$cookieValue."<br />\n";
// Are headers already sent?
if (headers_sent()) {
} // END - if
// Shall we encrypt the cookie?
- if ($encrypted === true) {
+ if ($encrypted === TRUE) {
// Unsupported at the moment
$this->partialStub('Encryption is unsupported at the moment.');
} // END - if
* @todo If the return statement is removed and setcookie() commented out,
* @todo this will send only one cookie out, the first one.
*/
- public function addCookie ($cookieName, $cookieValue, $encrypted = false, $expires = NULL) {
+ public function addCookie ($cookieName, $cookieValue, $encrypted = FALSE, $expires = NULL) {
// Are headers already sent?
if (headers_sent()) {
// Throw an exception here
} // END - if
// Shall we encrypt the cookie?
- if ($encrypted === true) {
+ if ($encrypted === TRUE) {
// Unsupported at the moment
$this->partialStub('Encryption is unsupported at the moment.');
} // END - if
* already sent with an exception
* @return void
*/
- public function flushBuffer ($force = false) {
+ public function flushBuffer ($force = FALSE) {
// Finish the image
$this->getImageInstance()->finishImage();
*/
public function next () {
// Default is not valid
- $nextValid = false;
+ $nextValid = FALSE;
// Is the result valid?
if ($this->valid()) {
// Next entry found, so count one up and cache it
$this->currentPos++;
$this->currentRow = $this->resultArray[BaseDatabaseBackend::RESULT_INDEX_ROWS][$this->currentPos];
- $nextValid = true;
+ $nextValid = TRUE;
} // END - if
// Return the result
*/
public function valid () {
// By default nothing is valid
- $isValid = false;
+ $isValid = FALSE;
// Check if
if (($this->ifStatusIsOkay()) && (isset($this->resultArray[BaseDatabaseBackend::RESULT_INDEX_ROWS][($this->currentPos + 1)])) && (isset($this->resultArray[BaseDatabaseBackend::RESULT_INDEX_ROWS][0]))) {
// All fine!
- $isValid = true;
+ $isValid = TRUE;
} // END - if
// Return the result
*/
public function find ($key) {
// By default nothing is found
- $found = false;
+ $found = FALSE;
// Rewind the pointer
$this->rewind();
// Is the element there?
if (isset($currentEntry[$key])) {
// Okay, found!
- $found = true;
+ $found = TRUE;
// So "cache" it
$this->foundValue = $currentEntry[$key];
* @return void
* @throws AlreadyInitializedStackerException If the stack is already initialized
*/
- public final function initStacker ($stackerName, $forceReInit = false) {
+ public final function initStacker ($stackerName, $forceReInit = FALSE) {
// Is the stack already initialized?
- if (($forceReInit === false) && ($this->isStackInitialized($stackerName))) {
+ if (($forceReInit === FALSE) && ($this->isStackInitialized($stackerName))) {
// Then throw the exception
throw new AlreadyInitializedStackerException(array($this, $stackerName), self::EXCEPTION_STACKER_ALREADY_INITIALIZED);
} // END - if
// First everything is not found
$found = FALSE;
- // If the stack is null, use the current group
+ // If the stack is NULL, use the current group
if (is_null($variableGroup)) {
// Use current group
//* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(__METHOD__.' currGroup=' . $this->currGroup . ' set as stack!');
// First everything is not found
$content = NULL;
- // If the stack is null, use the current group
+ // If the stack is NULL, use the current group
if (is_null($variableGroup)) {
// Use current group
//* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(__METHOD__.' currGroup=' . $this->currGroup . ' set as stack!');
*/
public function ifUsernameExists () {
// By default the username does not exist
- $exists = false;
+ $exists = FALSE;
// Is a previous result there?
if (is_null($this->getResultInstance())) {
// Search for it
if ($this->getResultInstance()->next()) {
// Entry found
- $exists = true;
+ $exists = TRUE;
} // END - if
// Return the status
*/
public function ifEmailAddressExists () {
// By default the email does not exist
- $exists = false;
+ $exists = FALSE;
// Is a previous result there?
if (is_null($this->getResultInstance())) {
// Search for it
if ($this->getResultInstance()->next()) {
// Entry found
- $exists = true;
+ $exists = TRUE;
// Is the username set?
if ($this->getUserName() == '') {
*/
public function ifPasswordHashMatches (Requestable $requestInstance) {
// By default nothing matches... ;)
- $matches = false;
+ $matches = FALSE;
// Is a previous result there?
if (is_null($this->getResultInstance())) {
$userInstance->setUserName($userName);
// Check if username exists
- if ($userInstance->ifUsernameExists() === false) {
+ if ($userInstance->ifUsernameExists() === FALSE) {
// Throw an exception here
throw new UsernameMissingException(array($userInstance, $userName), self::EXCEPTION_USERNAME_NOT_FOUND);
} // END - if
$userInstance->setUserName($userName);
// Check if username exists
- if ($userInstance->ifUsernameExists() === false) {
+ if ($userInstance->ifUsernameExists() === FALSE) {
// Throw an exception here
throw new UsernameMissingException(array($userInstance, $userName), self::EXCEPTION_USERNAME_NOT_FOUND);
} // END - if
* @param $stripTags Whether HTML tags shall be stripped out
* @return void
*/
- public final function output ($outStream, $stripTags = false) {
+ public final function output ($outStream, $stripTags = FALSE) {
// Is the output stream set
if (empty($outStream)) {
// @TODO Initialization phase
* $status = $apiInstance->payPrimera('garbage', 10000, 'Auszahlung IhreSeite.de - ID: 12345');
* 3. Überprüfung des Status (Rückgabecode):
* CODE:
- * if ($status === false) {
+ * if ($status === FALSE) {
* // Ein Fehler ist aufgetreten
* // Fehlerbehandlung hier einfügen...
* } else {
* @param string $Description Beschreibung (Sichtbar in Einzelauflistung)
*/
public function payPrimera ($Receiver, $Amount, $Description = '') {
- $valid = false;
+ $valid = FALSE;
$postData = array(
'PrimusInterface_Action' => 'Pay',
'PrimusInterface_Receiver' => base64_encode($Receiver),
$this->data = $postReturn;
if ($postReturn['status'] == '200') {
- $valid = true;
+ $valid = TRUE;
} // END - if
return $valid;
}
* @param string/int $User Userid / Username
*/
public function checkPrimusUser ($userName) {
- $valid = false;
+ $valid = FALSE;
$postData = array(
'PrimusInterface_Action' => 'CheckPrimusUser',
'PrimusInterface_CheckPrimusUser' => $userName
$this->data = $postReturn;
if ($postReturn['status'] == self::PI_USER_CHECK_OK) {
- $valid = true;
+ $valid = TRUE;
} // END - if
return $valid;
}
* Die Funktion liefer den aktuellen Primerastand
*/
public function getPrimera() {
- $primera = false;
+ $primera = FALSE;
$postData = array(
'PrimusInterface_Action' => 'GetPrimera'
);
$response = $this->sendRawRequest($requestString);
// Check the response header if all is fine
- if (strpos($response[0], '200') === false) {
+ if (strpos($response[0], '200') === FALSE) {
// Something bad happend... :(
return array(
'status' => "request_error",
// Widthdraw this amount
private function executeWithdraw ($amount) {
// First all fails...
- $result = false;
+ $result = FALSE;
// Prepare the purpose
$purpose = "\"Bube oder Dame\"-Einsatz gesetzt.";
if ($return['status'] == $this->statusOkay) {
// All fine!
- $result = true;
+ $result = TRUE;
} else {
// Status failture text
$this->setStatusMessage($return['message'], $return['status']);
// Payout this amount
private function executePayout ($amount) {
// First all fails...
- $result = false;
+ $result = FALSE;
// Prepare the purpose
$purpose = "\"Bube oder Dame\"-Gewinn erhalten.";
if ($return['status'] == $this->statusOkay) {
// All fine!
- $result = true;
+ $result = TRUE;
} else {
// Status failture text
$this->setStatusMessage($return['message'], $return['status']);
/**
* Debug this class loader? (true = yes, false = no)
*/
- private $debug = false;
+ private $debug = FALSE;
/**
* Whether the file list is cached
*/
- private $listCached = false;
+ private $listCached = FALSE;
/**
* Wethe class content has been cached
*/
- private $classesCached = false;
+ private $classesCached = FALSE;
/**
* Filename for the list cache
} // END - if
// Skip here if already cached
- if ($this->listCached === false) {
+ if ($this->listCached === FALSE) {
// Writes the cache file of our list away
$cacheContent = serialize($this->classes);
file_put_contents($this->listCacheFQFN, $cacheContent);
} // END - if
// Skip here if already cached
- if ($this->classesCached === false) {
+ if ($this->classesCached === FALSE) {
// Generate a full-cache of all classes
$cacheContent = '';
foreach ($this->loadedClasses as $fqfn) {
$this->classes = unserialize($cacheContent);
// List has been restored from cache!
- $this->listCached = true;
+ $this->listCached = TRUE;
} // END - if
// Does the class cache exist?
require($this->classCacheFQFN);
// Mark the class cache as loaded
- $this->classesCached = true;
+ $this->classesCached = TRUE;
} // END - if
}
*/
public function scanClassPath ($basePath, array $ignoreList = array() ) {
// Is a list has been restored from cache, don't read it again
- if ($this->listCached === true) {
+ if ($this->listCached === TRUE) {
// Abort here
return;
} // END - if
$basePath2 = realpath($basePath);
// If the basePath is false it is invalid
- if ($basePath2 === false) {
+ if ($basePath2 === FALSE) {
/* @todo: Do not die here. */
exit(__METHOD__ . ':Cannot read ' . $basePath . ' !');
} else {
// Developer mode excludes caching (better debugging)
if (!defined('DEVELOPER')) {
// Reset cache
- $this->classesCached = false;
+ $this->classesCached = FALSE;
} // END - if
} // END - if
}