// Lower framework classes
$lowerClasses = array(
- 0 => "exceptions", // Exceptions
- 1 => "interfaces", // Interfaces
- 2 => "main", // General main classes
- 3 => "middleware" // The middleware
+ 0 => 'exceptions', // Exceptions
+ 1 => 'interfaces', // Interfaces
+ 2 => 'main', // General main classes
+ 3 => 'middleware' // The middleware
);
// Load all classes
/**
* Extra data
*/
- private $extraData = "";
+ private $extraData = '';
/**
* The super constructor for all exceptions
// Are there arguments?
if ((isset($dbgInfo['args'])) && (is_array($dbgInfo['args'])) && (isset($dbgInfo['args'][0]))) {
//* DEBUG: */ echo $dbgIndex.": <pre>".htmlentities(print_r($dbgInfo['args'], true))."</pre>";
- $info = "";
+ $info = '';
foreach ($dbgInfo['args'] as $debug) {
// Add only non-array elements
if (!is_array($debug)) {
*/
public function __construct (array $classArray, $code) {
// Extract all elements
- $elements = "";
+ $elements = '';
if ((isset($classArray[2])) && (is_array($classArray[2]))) {
// Convert into strings
$elements = implode("</u>, <u>", $classArray[2]);
* @param $oldHash A hash from previous hashed string
* @return $hashed The hashed and salted string
*/
- function hashString ($str, $oldHash = "");
+ function hashString ($str, $oldHash = '');
/**
* Encrypt the string with fixed salt
*/
public final function __call ($methodName, $args) {
// Implode all given arguments
- $argsString = "";
+ $argsString = '';
if (empty($args)) {
// No arguments
$argsString = "NULL";
* @param $message Optional message to show in debug output
* @return void
*/
- public final function debugInstance ($message = "") {
+ public final function debugInstance ($message = '') {
// Restore the error handler to avoid trouble with missing array elements or undeclared variables
restore_error_handler();
// Init content
- $content = "";
+ $content = '';
// Is a message set?
if (!empty($message)) {
* @param $message An optional message to display
* @return void
*/
- protected function partialStub ($message = "") {
+ protected function partialStub ($message = '') {
// Get the backtrace
$backtrace = debug_backtrace();
*/
public function convertToClassName ($str) {
// Init class name
- $className = "";
+ $className = '';
// Convert all dashes in underscores
$str = str_replace("-", "_", $str);
*/
public function markupCode ($phpCode) {
// Init marked code
- $markedCode = "";
+ $markedCode = '';
// Get last error
$errorArray = error_get_last();
/**
* Real class name
*/
- private $realClass = "";
+ private $realClass = '';
/**
* Public constructor for setting real class name
/**
* The controller we need for this command
*/
- private $controllerName = "";
+ private $controllerName = '';
/**
* Protected constructor
/**
* Name of the action
*/
- private $actionName = "";
+ private $actionName = '';
/**
* Protected constructor
/**
* Wrapper class name stored in config entry
*/
- private $wrapperConfigEntry = "";
+ private $wrapperConfigEntry = '';
/**
* Protected constructor
/**
* Table name
*/
- private $tableName = "";
+ private $tableName = '';
/**
* Table columns (criteria) to store
/**
* Unique key
*/
- private $uniqueKey = "";
+ private $uniqueKey = '';
/**
* Primary key
*/
- private $primaryKey = "";
+ private $primaryKey = '';
/**
* Protected constructor
*/
public function getCacheKey () {
// Initialize the key
- $cacheKey = "";
+ $cacheKey = '';
// Now walk through all criterias
foreach ($this->searchCriteria as $criteriaKey => $criteriaValue) {
/**
* Salt for hashing operations
*/
- private $salt = "";
+ private $salt = '';
/**
* Protected constructor
* @param $oldHash A hash from previous hashed string
* @return $hashed The hashed and salted string
*/
- public function hashString ($str, $oldHash = "") {
+ public function hashString ($str, $oldHash = '') {
// Cast the string
$str = (string) $str;
/**
* Save path for "file database"
*/
- private $savePath = "";
+ private $savePath = '';
/**
* The file's extension
/**
* The last read file's name
*/
- private $lastFile = "";
+ private $lastFile = '';
/**
* The last read file's content including header information
/**
* Last error message
*/
- private $lastError = "";
+ private $lastError = '';
/**
* Last exception
* @return void
*/
private final function resetLastError () {
- $this->lastError = "";
+ $this->lastError = '';
$this->lastException = null;
}
*/
public final function outputStream ($output) {
// Strip out <br />
- $output = str_replace("<br />", "", $output);
+ $output = str_replace("<br />", '', $output);
print(stripslashes($output)."<br />\n");
}
/**
* Action name for payment discovery
*/
- private $actionName = "";
+ private $actionName = '';
/**
* Protected constructor
/**
* The login method we shall choose
*/
- private $authMethod = "";
+ private $authMethod = '';
/**
* Protected constructor
/**
* Action name for payment discovery
*/
- private $actionName = "";
+ private $actionName = '';
/**
* Protected constructor
$userInstance->updateDatabaseField(UserDatabaseWrapper::DB_COLUMN_USER_STATUS, $confirmed);
// Wipe out the confirm hash for extra security
- $userInstance->updateDatabaseField(UserDatabaseWrapper::DB_COLUMN_CONFIRM_HASH, "");
+ $userInstance->updateDatabaseField(UserDatabaseWrapper::DB_COLUMN_CONFIRM_HASH, '');
// Write all updates to the database
$userInstance->flushPendingUpdates();
/**
* The image name
*/
- private $imageName = "";
+ private $imageName = '';
/**
* Width of the image in pixel
/**
* Current string name
*/
- private $currString = "";
+ private $currString = '';
/**
* Protected constructor
public function addTextLine ($stringName) {
// Create the image string
$this->imageStrings[$stringName] = array(
- 'x' => "",
- 'y' => "",
- 'size' => "",
- 'string' => ""
+ 'x' => '',
+ 'y' => '',
+ 'size' => '',
+ 'string' => ''
);
// Set current string name
/**
* Hash of the CAPTCHA string
*/
- private $hashedString = "";
+ private $hashedString = '';
/**
* Encrypted string
*/
- private $encryptedString = "";
+ private $encryptedString = '';
/**
* Protected constructor
/**
* Rendered content created by the helper class
*/
- private $content = "";
+ private $content = '';
/**
* Array with groups
/**
* Previously opened group
*/
- private $previousGroupId = "";
+ private $previousGroupId = '';
/**
* Previously opened sub group
*/
- private $previousSubGroupId = "";
+ private $previousSubGroupId = '';
/**
* Total counter for groups and sub groups
* @return void
* @throws HelperNoPreviousOpenedGroupException If no previously opened group was found
*/
- public function closePreviousGroupByContent ($content = "") {
+ public function closePreviousGroupByContent ($content = '') {
// Check if any sub group was opened before
if ($this->ifSubGroupOpenedPreviously()) {
// Close it automatically
$this->groups[$groupId]['opened'] = false;
// Mark previous group as closed
- $this->setPreviousGroupId("");
+ $this->setPreviousGroupId('');
//* DEBUG: */ echo "CLOSE:groupId={$groupId}<br />\n";
}
* @return void
* @throws HelperNoPreviousOpenedSubGroupException If no previously opened sub group was found
*/
- public function closePreviousSubGroupByContent ($content = "") {
+ public function closePreviousSubGroupByContent ($content = '') {
// Check if any sub group was opened before
if ($this->ifSubGroupOpenedPreviously() === false) {
// Then throw an exception
$this->subGroups[$subGroupId]['opened'] = false;
// Mark previous sub group as closed
- $this->setPreviousSubGroupId("");
+ $this->setPreviousSubGroupId('');
//* DEBUG: */ echo "CLOSE:subGroupId={$subGroupId}<br />\n";
}
*/
public function renderContent () {
// Initialize content
- $content = "";
+ $content = '';
// Is header content there?
if (isset($this->groups['header'])) {
/**
* Name of the block
*/
- private $blockName = "";
+ private $blockName = '';
/**
* Protected constructor
/**
* Name of the form
*/
- private $formName = "";
+ private $formName = '';
/**
* Wether form tag is enabled (default: true)
// Check wether we shall open or close the form
if (($this->formOpened === false) && ($this->formEnabled === true)) {
// Add HTML code
- $formContent = sprintf("<form name=\"%s\" class=\"forms\" action=\"%s/%s\" method=\"%s\" target=\"%s\"",
+ $formContent = sprintf("<form name=\"%s\" class=\"forms\" action=\"%s/%s\" method=\"%s\" target=\"%s\'',
$formName,
$this->getConfigInstance()->readConfig('base_url'),
$this->getConfigInstance()->readConfig('form_action'),
);
// Add form id as well
- $formContent .= sprintf(" id=\"%s_form\"",
+ $formContent .= sprintf(" id=\"%s_form\'',
$formId
);
* @return void
* @throws FormClosedException If the form is not yet opened
*/
- public function addInputTextField ($fieldName, $fieldValue = "") {
+ public function addInputTextField ($fieldName, $fieldValue = '') {
// Is the form opened?
if (($this->formOpened === false) && ($this->formEnabled === true)) {
// Throw an exception
* @return void
* @throws FormClosedException If the form is not yet opened
*/
- public function addInputPasswordField ($fieldName, $fieldValue = "") {
+ public function addInputPasswordField ($fieldName, $fieldValue = '') {
// Is the form opened?
if (($this->formOpened === false) && ($this->formEnabled === true)) {
// Throw an exception
* @return void
* @throws FormClosedException If the form is not yet opened
*/
- public function addInputHiddenField ($fieldName, $fieldValue = "") {
+ public function addInputHiddenField ($fieldName, $fieldValue = '') {
// Is the form opened?
if (($this->formOpened === false) && ($this->formEnabled === true)) {
// Throw an exception
} // END - if
// Set wether the check box is checked...
- $checked = " checked=\"checked\"";
+ $checked = " checked=\"checked\'';
if ($fieldChecked === false) $checked = " ";
// Generate the content
* @throws FormClosedException If no form has been opened before
* @throws EmptyVariableException If $groupId is not set
*/
- public function addFormGroup ($groupId = "", $groupText = "") {
+ public function addFormGroup ($groupId = '', $groupText = '') {
// Is a form opened?
if (($this->formOpened === false) && ($this->formEnabled === true)) {
// Throw exception here
* @throws FormFormClosedException If no group has been opened before
* @throws EmptyVariableException If $subGroupId is not set
*/
- public function addFormSubGroup ($subGroupId = "", $subGroupText = "") {
+ public function addFormSubGroup ($subGroupId = '', $subGroupText = '') {
// Is a group opened?
if ($this->ifGroupOpenedPreviously() === false) {
// Throw exception here
/**
* Name of the link
*/
- private $linkName = "";
+ private $linkName = '';
/**
* Base of the link
*/
- private $linkBase = "";
+ private $linkBase = '';
/**
* Protected constructor
$helperInstance->setLinkBase($linkBase);
// Add default group
- $helperInstance->openGroupByIdContent('main', "", "");
+ $helperInstance->openGroupByIdContent('main', '', '');
// Return the prepared instance
return $helperInstance;
* @param $extraContent Optional extra HTML content
* @return $linkContent Rendered text link content
*/
- private function renderLinkContentWithTextExtraContent ($linkText, $linkTitle, $extraContent="") {
+ private function renderLinkContentWithTextExtraContent ($linkText, $linkTitle, $extraContent='') {
// Construct link content
$linkContent = sprintf("<a href=\"%s%s\" title=\"%s\">%s</a>",
$this->getLinkBase(),
// Is a previous opened group still open?
if ($this->ifGroupOpenedPreviously()) {
// Then close it
- $this->closePreviousGroupByContent("");
+ $this->closePreviousGroupByContent('');
} // END - if
// Get the content
// Is a group with that name open?
if ($this->ifGroupOpenedPreviously()) {
// Then close it here
- $this->closePreviousGroupByContent("");
+ $this->closePreviousGroupByContent('');
} // END - if
// Generate the group content
/**
* Image type
*/
- private $imageType = "";
+ private $imageType = '';
/**
* Width of the image
*/
- private $width = "";
+ private $width = '';
/**
* Height of the image
*/
- private $height = "";
+ private $height = '';
/**
* Background color in RGB
*/
private $backgroundColor = array(
- 'red' => "",
- 'green' => "",
- 'blue' => ""
+ 'red' => '',
+ 'green' => '',
+ 'blue' => ''
);
/**
* Foreground color in RGB
*/
private $foregroundColor = array(
- 'red' => "",
- 'green' => "",
- 'blue' => ""
+ 'red' => '',
+ 'green' => '',
+ 'blue' => ''
);
/**
* Current choosen color array
*/
- private $colorMode = "";
+ private $colorMode = '';
/**
* Image resource
/**
* Image name
*/
- private $imageName = "";
+ private $imageName = '';
/**
* String name
*/
- private $stringName = "";
+ private $stringName = '';
/**
* Groupable image strings?
*/
public final function saveFile ($fileName, $dataArray) {
// Try it five times
- $dirName = ""; $fileInstance = null;
+ $dirName = ''; $fileInstance = null;
for ($idx = 0; $idx < 5; $idx++) {
// Get a file output pointer
try {
*/
public final function loadFileContents ($fqfn) {
// Initialize some variables and arrays
- $inputBuffer = "";
- $lastBuffer = "";
+ $inputBuffer = '';
+ $lastBuffer = '';
$header = array();
$data = array();
- $readData = ""; // This will contain our read data
+ $readData = ''; // This will contain our read data
// Get a file input handler
$fileInstance = FrameworkFileInputPointer::createFrameworkFileInputPointer($fqfn);
/**
* The current path we are working in
*/
- private $pathName = "";
+ private $pathName = '';
/**
* The directory pointer
* @return string Directory and/or file names read from the current
* directory pointer
*/
- public function readDirectoryExcept ($except = "") {
+ public function readDirectoryExcept ($except = '') {
if ((empty($except)) || (!is_array($except)) || (count($except) == 0)) {
// No exception given, so read all data
return $this->readRawDirectory();
// Close the directory pointer and reset the instance variable
@closedir($this->getPointer());
$this->setPointer(null);
- $this->setPathName("");
+ $this->setPathName('');
}
/**
/**
* The current file we are working in
*/
- private $fileName = "";
+ private $fileName = '';
/**
* The file pointer
// Close the file pointer and reset the instance variable
@fclose($this->getPointer());
$this->setPointer(null);
- $this->setFileName("");
+ $this->setFileName('');
}
/**
/**
* The current file we are working in
*/
- private $fileName = "";
+ private $fileName = '';
/**
* The file pointer
// Close the file pointer and reset the instance variable
@fclose($this->getPointer());
$this->setPointer(null);
- $this->setFileName("");
+ $this->setFileName('');
}
/**
/**
* The full-qualified base path for the language include files
*/
- private $basePath = "";
+ private $basePath = '';
/**
* The 2-char language code
/**
* Template name
*/
- private $templateName = "";
+ private $templateName = '';
/**
* Protected constructor
if ($outStream === false) {
// Output something here...
foreach ($this->vars as $var => $value) {
- $this->output("var=".$var.", value=".$value."");
+ $this->output("var=".$var.", value=".$value.'');
}
} else {
// Output it to the console
/**
* Prefix for local, remote or other resolver
*/
- private $actionPrefix = "";
+ private $actionPrefix = '';
/**
* Validated action name
*/
- private $actionName = "";
+ private $actionName = '';
/**
* Protected constructor
/**
* Last successfull resolved action
*/
- private $lastActionInstance = "";
+ private $lastActionInstance = '';
/**
* Protected constructor
*/
public function resolveActionByRequest (Requestable $requestInstance) {
// Init variables
- $actionName = "";
+ $actionName = '';
$actionInstance = null;
// This goes fine so let's resolv the action
/**
* Class name
*/
- private $className = "";
+ private $className = '';
// Exception constants
const EXCEPTION_INVALID_COMMAND = 0x1d0;
/**
* Prefix for local, remote or other resolver
*/
- private $commandPrefix = "";
+ private $commandPrefix = '';
/**
* Validated command name
*/
- private $commandName = "";
+ private $commandName = '';
/**
* Protected constructor
*/
public function resolveCommandByRequest (Requestable $requestInstance) {
// Init variables
- $commandName = "";
+ $commandName = '';
$commandInstance = null;
// This goes fine so let's resolv the command
*/
public function resolveCommandByRequest (Requestable $requestInstance) {
// Init variables
- $commandName = "";
+ $commandName = '';
$commandInstance = null;
// This goes fine so let's resolv the command
/**
* Prefix for local, remote or other resolver
*/
- private $controllerPrefix = "";
+ private $controllerPrefix = '';
/**
* Validated controller name
*/
- private $controllerName = "";
+ private $controllerName = '';
/**
* Protected constructor
/**
* Last successfull resolved controller (name)
*/
- private $lastControllerName = "";
+ private $lastControllerName = '';
/**
* Last successfull resolved controller (instance)
*/
public function resolveController () {
// Init variables
- $controllerName = "";
+ $controllerName = '';
$controllerInstance = null;
// Get the command name
/**
* Last successfull resolved controller (name)
*/
- private $lastControllerName = "";
+ private $lastControllerName = '';
/**
* Last successfull resolved controller (instance)
*/
public function resolveController () {
// Init variables
- $controllerName = "";
+ $controllerName = '';
$controllerInstance = null;
// Get the command name
} // END - if
// Set default resolver config name
- $resolverConfigEntry = "";
+ $resolverConfigEntry = '';
// Try to read a config entry for our resolver including controller name... ;-)
try {
/**
* Body of the response
*/
- private $responseBody = "";
+ private $responseBody = '';
/**
* Instance of the template engine
}
// Clear response header and body
- $this->setResponseBody("");
+ $this->setResponseBody('');
$this->resetResponseHeaders();
}
}
$this->setResponseStatus("301 Moved Permanently");
// Clear the body
- $this->setResponseBody("");
+ $this->setResponseBody('');
// Flush the result
$this->flushBuffer();
// 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]);
$this->setResponseStatus("301 Moved Permanently");
// Clear the body
- $this->setResponseBody("");
+ $this->setResponseBody('');
// Flush the result
$this->flushBuffer();
// 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]);
/**
* Found value
*/
- private $foundValue = "";
+ private $foundValue = '';
/**
* Protected constructor
/**
* Extra salt for secured hashing
*/
- private $extraSalt = "";
+ private $extraSalt = '';
/**
* Fixed salt for secured hashing
*/
- private $fixedSalt = "";
+ private $fixedSalt = '';
/**
* Maximum length for random string
if ($length < 1) $length = $this->rndStrLen;
// Initialize the string
- $randomString = "";
+ $randomString = '';
// And generate it
for ($idx = 0; $idx < $length; $idx++) {
* templates are stored. We will internally determine the language plus
* "html" for web templates or "emails" for email templates
*/
- private $basePath = "";
+ private $basePath = '';
/**
* Template type
/**
* The raw (maybe uncompiled) template
*/
- private $rawTemplateData = "";
+ private $rawTemplateData = '';
/**
* Template data with compiled-in variables
*/
- private $compiledData = "";
+ private $compiledData = '';
/**
* The last loaded template's FQFN for debugging the engine
*/
- private $lastTemplate = "";
+ private $lastTemplate = '';
/**
* The variable stack for the templates
// Is it not a config variable?
if ($varName != 'config') {
// Regular template variables
- $this->assignVariable($var, "");
+ $this->assignVariable($var, '');
} else {
// Configuration variables
$this->assignConfigVariable($var);
}
// Do we have some quotes left and right side? Then it is free text
- if ((substr($varMatches[2][$key], 0, 1) == "\"") && (substr($varMatches[2][$key], -1, 1) == "\"")) {
+ if ((substr($varMatches[2][$key], 0, 1) == "\'') && (substr($varMatches[2][$key], -1, 1) == "\'')) {
// Free string detected! Which we can assign directly
$this->assignVariable($var, $varMatches[3][$key]);
} elseif (!empty($varMatches[2][$key])) {
$eval = str_replace(
"<%php", "\";",
str_replace(
- "%>", "\n\$result .= \"", $eval
+ "%>", "\n\$result .= \'', $eval
)
);
$this->insertRawTemplates();
// Remove the raw template content as well
- $this->setRawTemplateData("");
+ $this->setRawTemplateData('');
} // END - if
$this->assignVariable($variableName, $content);
// Purge raw content
- $this->setRawTemplateData("");
+ $this->setRawTemplateData('');
}
/**
/**
* Current main node
*/
- private $currMainNode = "";
+ private $currMainNode = '';
/**
* Protected constructor
/**
* Current main node
*/
- private $currMainNode = "";
+ private $currMainNode = '';
/**
* Protected constructor
*/
public function getMailCacheFqfn () {
// Initialize FQFN
- $fqfn = "";
+ $fqfn = '';
$this->debugBackTrace();
// Return it
/**
* Username of current user
*/
- private $userName = "";
+ private $userName = '';
/**
* User id of current user
/**
* Email of current user
*/
- private $email = "";
+ private $email = '';
/**
* Protected constructor
$exists = true;
// Is the username set?
- if ($this->getUserName() == "") {
+ if ($this->getUserName() == '') {
// Get current entry
$currEntry = $this->getResultInstance()->current();
* Array for connection data
*/
private $connectData = array(
- 'login' => "",
- 'pass' => "",
- 'dbase' => "",
- 'host' => ""
+ 'login' => '',
+ 'pass' => '',
+ 'dbase' => '',
+ 'host' => ''
);
// The real database layer
*/
public function detectScriptPath () {
// Default is empty
- $scriptPath = "";
+ $scriptPath = '';
// Is the scriptname set?
if (isset($_SERVER['SCRIPT_NAME'])) {
$application = htmlentities(strip_tags($application), ENT_QUOTES);
// Secure it a little more with a reg.exp.
-$application = preg_replace('/([^a-z0-9_-])+/i', "", $application);
+$application = preg_replace('/([^a-z0-9_-])+/i', '', $application);
// Set the application name for later usage
$cfg->setConfigEntry('app_name', $application);
/**
* Filename for the list cache
*/
- private $listCacheFQFN = "";
+ private $listCacheFQFN = '';
/**
* Cache for class content
*/
- private $classCacheFQFN = "";
+ private $classCacheFQFN = '';
/**
* Counter for loaded include files
// Skip here if already cached
if ($this->classesCached === false) {
// Generate a full-cache of all classes
- $cacheContent = "";
+ $cacheContent = '';
foreach ($this->loadedClasses as $fqfn) {
// Load the file
$cacheContent .= file_get_contents($fqfn);
*/
public function getPrintableIncludeList () {
// Prepare the list
- $includeList = "";
+ $includeList = '';
foreach ($this->loadedClasses as $classFile) {
$includeList .= basename($classFile)."<br />\n";
} // END - foreach
$debug = DebugMiddleware::createDebugMiddleware(FrameworkConfiguration::getInstance()->readConfig('debug_class'));
// Empty string should be ignored and used for testing the middleware
-DebugMiddleware::getInstance()->output("");
+DebugMiddleware::getInstance()->output('');
// [EOF]
?>
$cfg = FrameworkConfiguration::getInstance();
// Try to read an empty configuration variable
- $dummy = $cfg->readConfig("");
+ $dummy = $cfg->readConfig('');
} catch (ConfigEntryIsEmptyException $expected) {
// This exception was expected, so it is fine
$testPassed = true;
$cfg = FrameworkConfiguration::getInstance();
// Try to read an empty configuration variable
- $cfg->setConfigEntry("", 'will_never_be_set');
+ $cfg->setConfigEntry('', 'will_never_be_set');
} catch (ConfigEntryIsEmptyException $expected) {
// This exception was expected, so it is fine
$testPassed = true;
// Preisliste auffuellen
foreach ($einbauten['parts'] as $key=>$part) {
// Create item array string
- $item = "";
+ $item = '';
foreach ($part as $idx=>$itemPart) {
if (is_string($itemPart)) {
// String found