From: Roland Häder Date: Sat, 24 May 2008 21:48:19 +0000 (+0000) Subject: Registration stub added, naming convention applied, support for PHP code (keep it... X-Git-Url: https://git.mxchange.org/?p=shipsimu.git;a=commitdiff_plain;h=7625f0ed496dbf1bb3efbb3bd327dbd0fd747af4 Registration stub added, naming convention applied, support for PHP code (keep it simple!) in templates added --- diff --git a/.gitattributes b/.gitattributes index 99a5f08..ee51bff 100644 --- a/.gitattributes +++ b/.gitattributes @@ -119,9 +119,10 @@ application/ship-simu/templates/.htaccess -text application/ship-simu/templates/de/.htaccess -text application/ship-simu/templates/de/code/footer.ctp -text application/ship-simu/templates/de/code/header.ctp -text +application/ship-simu/templates/de/code/home.ctp -text +application/ship-simu/templates/de/code/register.ctp -text application/ship-simu/templates/de/code/shipsimu_main.ctp -text application/ship-simu/templates/de/html/.htaccess -text -application/ship-simu/templates/de/html/home.tpl -text application/ship-simu/templates/de/html/nav_advert.tpl -text application/ship-simu/templates/de/html/selector_ship-simu.tpl -text db/.htaccess -text @@ -246,9 +247,11 @@ inc/classes/main/class_ -text inc/classes/main/class_BaseFrameworkSystem.php -text inc/classes/main/class_FrameworkArrayObject.php -text inc/classes/main/commands/.htaccess -text +inc/classes/main/commands/class_ -text inc/classes/main/commands/class_BaseCommand.php -text inc/classes/main/commands/web/.htaccess -text inc/classes/main/commands/web/class_WebHomeCommand.php -text +inc/classes/main/commands/web/class_WebRegisterCommand.php -text inc/classes/main/compressor/.htaccess -text inc/classes/main/compressor/class_Bzip2Compressor.php -text inc/classes/main/compressor/class_GzipCompressor.php -text @@ -281,7 +284,7 @@ inc/classes/main/factories/objects/class_ObjectFactory.php -text inc/classes/main/factories/web/.htaccess -text inc/classes/main/factories/web/class_NewsFactory.php -text inc/classes/main/io/.htaccess -text -inc/classes/main/io/class_FileIOStream.php -text +inc/classes/main/io/class_FileIoStream.php -text inc/classes/main/io/class_FrameworkDirectoryPointer.php -text inc/classes/main/io/class_FrameworkFileInputPointer.php -text inc/classes/main/io/class_FrameworkFileOutputPointer.php -text @@ -310,7 +313,7 @@ inc/classes/middleware/database/class_DatabaseConnection.php -text inc/classes/middleware/debug/.htaccess -text inc/classes/middleware/debug/class_DebugMiddleware.php -text inc/classes/middleware/io/.htaccess -text -inc/classes/middleware/io/class_FileIOHandler.php -text +inc/classes/middleware/io/class_FileIoHandler.php -text inc/config.php -text inc/config/.htaccess -text inc/config/class_FrameworkConfiguration.php -text diff --git a/application/selector/class_ApplicationHelper.php b/application/selector/class_ApplicationHelper.php index 7f721c3..feafd24 100644 --- a/application/selector/class_ApplicationHelper.php +++ b/application/selector/class_ApplicationHelper.php @@ -179,7 +179,7 @@ class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplica */ public final function entryPoint () { // Get a prepared instance of ApplicationSelector - $selInstance = ApplicationSelector::createApplicationSelector(LanguageSystem::getInstance(), FileIOHandler::getInstance()); + $selInstance = ApplicationSelector::createApplicationSelector(LanguageSystem::getInstance(), FileIoHandler::getInstance()); // Remove the ignore list from the object $selInstance->removeDirIgnoreList(); diff --git a/application/selector/class_ApplicationSelector.php b/application/selector/class_ApplicationSelector.php index a7f3294..2af2f70 100644 --- a/application/selector/class_ApplicationSelector.php +++ b/application/selector/class_ApplicationSelector.php @@ -80,7 +80,7 @@ class ApplicationSelector extends BaseFrameworkSystem { * @param $fileIOInstance The file I/O instance * @return $selInstance An instance of ApplicationSelector */ - public final static function createApplicationSelector (ManageableLanguage $langInstance, FileIOHandler $fileIOInstance) { + public final static function createApplicationSelector (ManageableLanguage $langInstance, FileIoHandler $fileIOInstance) { // Get a new instance $selInstance = new ApplicationSelector(); @@ -89,7 +89,7 @@ class ApplicationSelector extends BaseFrameworkSystem { // Set language and file I/O instances $selInstance->setLanguageInstance($langInstance); - $selInstance->setFileIOInstance($fileIOInstance); + $selInstance->setFileIoInstance($fileIOInstance); // Return the prepared instance return $selInstance; diff --git a/application/ship-simu/init.php b/application/ship-simu/init.php index 1a3fc08..00df8b6 100644 --- a/application/ship-simu/init.php +++ b/application/ship-simu/init.php @@ -49,7 +49,7 @@ require(PATH . "inc/output.php"); // Initialize file i/o system require(PATH . "inc/file_io.php"); -$app->setFileIOInstance($io); +$app->setFileIoInstance($io); // Include the language sub-system require(PATH . "inc/language.php"); diff --git a/application/ship-simu/templates/de/code/home.ctp b/application/ship-simu/templates/de/code/home.ctp new file mode 100644 index 0000000..8625082 --- /dev/null +++ b/application/ship-simu/templates/de/code/home.ctp @@ -0,0 +1,7 @@ +
+ Willkommen zum Schiffsimulator "Ship-Simu"! +
+ +
+ {?ship_simu_news?} +
diff --git a/application/ship-simu/templates/de/code/register.ctp b/application/ship-simu/templates/de/code/register.ctp new file mode 100644 index 0000000..9c599c2 --- /dev/null +++ b/application/ship-simu/templates/de/code/register.ctp @@ -0,0 +1,13 @@ +
+ Anmeldung bei {?app_full_name?} +
+ +
+
+ + + + + addTextInputForm("username", 10, 255, true); ?> +
+
diff --git a/application/ship-simu/templates/de/html/home.tpl b/application/ship-simu/templates/de/html/home.tpl deleted file mode 100644 index 8625082..0000000 --- a/application/ship-simu/templates/de/html/home.tpl +++ /dev/null @@ -1,7 +0,0 @@ -
- Willkommen zum Schiffsimulator "Ship-Simu"! -
- -
- {?ship_simu_news?} -
diff --git a/inc/classes/exceptions/io/class_FilePointerNotOpenedException.php b/inc/classes/exceptions/io/class_FilePointerNotOpenedException.php index 841782a..27fe8d1 100644 --- a/inc/classes/exceptions/io/class_FilePointerNotOpenedException.php +++ b/inc/classes/exceptions/io/class_FilePointerNotOpenedException.php @@ -25,13 +25,13 @@ class FilePointerNotOpenedException extends FrameworkException { /** * The constructor * - * @param $message Message from the exception + * @param $fqfn Full-qualified file name of (maybe) missing file * @param $code Code number for the exception * @return void */ - public function __construct ($path, $code) { + public function __construct ($fqfn, $code) { // Add a message around the missing class - $message = sprintf("Für die Datei %s konnte kein Pointer initialisiert werden. Möglicherweise ist die Datei nicht lesbar oder fehlt!", $path); + $message = sprintf("Not able to initialize a pointer for the file %s. Maybe the file is missing.", $fqfn); // Call parent constructor parent::__construct($message, $code); diff --git a/inc/classes/exceptions/template/class_InvalidTemplateVariableNameException.php b/inc/classes/exceptions/template/class_InvalidTemplateVariableNameException.php index c5cbce4..3f92b37 100644 --- a/inc/classes/exceptions/template/class_InvalidTemplateVariableNameException.php +++ b/inc/classes/exceptions/template/class_InvalidTemplateVariableNameException.php @@ -25,18 +25,18 @@ class InvalidTemplateVariableNameException extends FrameworkException { /** * The constructor * - * @param $class An array holding our informations + * @param $classArray An array holding our informations * @param $code Code number for the exception * @return void */ - public function __construct (BaseFrameworkSystem $class, $code) { + public function __construct (array $classArray, $code) { // Add a message around the missing class - $message = sprintf("[%s:%d] Die im Template %s gefundene Variable %s ist nicht gültig! Gültige Variablennamen sind nur %s.", - $class[0]->__toString(), + $message = sprintf("[%s:%d] The template %s contains an invalid variable called %s. Valid variable names are only %s.", + $classArray[0]->__toString(), $this->getLine(), - basename($class[1]), - $class[2], - $class[3]->readConfig("tpl_valid_var") + basename($classArray[1]), + $classArray[2], + $classArray[3]->readConfig("tpl_valid_var") ); // Call parent constructor diff --git a/inc/classes/main/class_BaseFrameworkSystem.php b/inc/classes/main/class_BaseFrameworkSystem.php index f341fc9..c1f216e 100644 --- a/inc/classes/main/class_BaseFrameworkSystem.php +++ b/inc/classes/main/class_BaseFrameworkSystem.php @@ -219,8 +219,50 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { */ public final function __call ($methodName, $args) { // Implode all given arguments - $argsString = implode("|", $args); - if (empty($argsString)) $argsString = "NULL"; + $argsString = ""; + if (empty($args)) { + // No arguments + $argsString = "NULL"; + } elseif (is_array($args)) { + // Some arguments are there + foreach ($args as $arg) { + // Check the type + if (is_bool($arg)) { + // Boolean! + if ($arg) $argsString .= "true(bool)"; else $argsString .= "false(bool)"; + } elseif (is_int($arg)) { + // Integer + $argsString .= $arg."(int)"; + } elseif (is_float($arg)) { + // Floating point + $argsString .= $arg."(float)"; + } elseif ($arg instanceof BaseFramework) { + // Own object instance + $argsString .= $arg->__toString()."(Object)"; + } elseif (is_object($arg)) { + // External object + $argsString .= "unknown object(!)"; + } elseif (is_array($arg)) { + // Array + $argsString .= "Array(array)"; + } elseif (is_string($arg)) { + // String + $argsString .= "\"".$arg."\"(string)"; + } else { + // Unknown type (please report!) + $argsString .= $arg."(unknown!)"; + } + + // Add comma + $argsString .= ", "; + } + + // Remove last comma + if (substr($argsString, -2, 1) === ",") $argsString = substr($argsString, 0, -2); + } else { + // Invalid arguments! + $argsString = sprintf("!INVALID:%s!", $args); + } $this->getDebugInstance()->output(sprintf("[%s::%s] Stub! Args: %s", $this->__toString(), @@ -732,7 +774,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { * * @return $fileIOInstance An instance to the file I/O sub-system */ - protected final function getFileIOInstance () { + protected final function getFileIoInstance () { return $this->fileIOInstance; } @@ -742,7 +784,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { * @param $fileIOInstance An instance to the file I/O sub-system * @return void */ - public final function setFileIOInstance (FileIOHandler $fileIOInstance) { + public final function setFileIoInstance (FileIoHandler $fileIOInstance) { $this->fileIOInstance = $fileIOInstance; } @@ -806,7 +848,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { if ($appInstance->getLanguageInstance() === null) { // Invalid language instance throw new MissingLanguageHandlerException($appInstance, self::EXCEPTION_MISSING_LANGUAGE_HANDLER); - } elseif ($appInstance->getFileIOInstance() === null) { + } elseif ($appInstance->getFileIoInstance() === null) { // Invalid language instance throw new MissingFileIoHandlerException($appInstance, self::EXCEPTION_MISSING_FILE_IO_HANDLER); } @@ -816,7 +858,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { $eval = sprintf("\$tplEngine = %s::create%s( \"%s\", \$appInstance->getLanguageInstance(), - \$appInstance->getFileIOInstance() + \$appInstance->getFileIoInstance() );", $this->getConfigInstance()->readConfig("tpl_engine"), $this->getConfigInstance()->readConfig("tpl_engine"), diff --git a/inc/classes/main/commands/class_ b/inc/classes/main/commands/class_ new file mode 100644 index 0000000..cbb5b60 --- /dev/null +++ b/inc/classes/main/commands/class_ @@ -0,0 +1,73 @@ + + * @version 0.0.0 + * @copyright Copyright(c) 2007, 2008 Roland Haeder, this is free software + * @license GNU GPL 3.0 or any newer version + * @link http://www.ship-simu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class ???Command extends BaseCommand implements Commandable { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + + // Set special description + $this->setObjectDescription(""); + + // Create unique ID number + $this->createUniqueID(); + + // Clean up a little + $this->removeSystemArray(); + } + + /** + * Creates an instance of this class + * + * @param $resolverInstance An instance of a command resolver class + * @return $commandInstance An instance a prepared command class + */ + public final static function create???Command (CommandResolver $resolverInstance) { + // Get new instance + $commandInstance = new ???Command(); + + // Set the application instance + $commandInstance->setResolverInstance($resolverInstance); + + // Return the prepared instance + return $commandInstance; + } + + /** + * Executes the given command with given request and response objects + * + * @param $requestInstance An instance of a class with an Requestable interface + * @param $responseInstance An instance of a class with an Responseable interface + * @return void + */ + public function execute (Requestable $requestInstance, Responseable $responseInstance) { + } +} + +// [EOF] +?> diff --git a/inc/classes/main/commands/web/class_WebHomeCommand.php b/inc/classes/main/commands/web/class_WebHomeCommand.php index 9629b97..7030bd1 100644 --- a/inc/classes/main/commands/web/class_WebHomeCommand.php +++ b/inc/classes/main/commands/web/class_WebHomeCommand.php @@ -90,7 +90,7 @@ class WebHomeCommand extends BaseCommand implements Commandable { $templateInstance->assignTemplateWithVariable("footer", "footer"); // Load the home template - $templateInstance->loadWebTemplate("home"); + $templateInstance->loadCodeTemplate("home"); // Assign the home template with the master template as a content ... ;) $templateInstance->assignTemplateWithVariable("home", "content"); diff --git a/inc/classes/main/commands/web/class_WebRegisterCommand.php b/inc/classes/main/commands/web/class_WebRegisterCommand.php new file mode 100644 index 0000000..01ba9cd --- /dev/null +++ b/inc/classes/main/commands/web/class_WebRegisterCommand.php @@ -0,0 +1,121 @@ + + * @version 0.0.0 + * @copyright Copyright(c) 2007, 2008 Roland Haeder, this is free software + * @license GNU GPL 3.0 or any newer version + * @link http://www.ship-simu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class WebRegisterCommand extends BaseCommand implements Commandable { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + + // Set special description + $this->setObjectDescription("Anmeldeformular-Command"); + + // Create unique ID number + $this->createUniqueID(); + + // Clean up a little + $this->removeSystemArray(); + } + + /** + * Creates an instance of this class + * + * @param $resolverInstance An instance of a command resolver class + * @return $commandInstance An instance a prepared command class + */ + public final static function createWebRegisterCommand (CommandResolver $resolverInstance) { + // Get new instance + $commandInstance = new WebRegisterCommand(); + + // Set the application instance + $commandInstance->setResolverInstance($resolverInstance); + + // Return the prepared instance + return $commandInstance; + } + + /** + * Executes the given command with given request and response objects + * + * @param $requestInstance An instance of a class with an Requestable interface + * @param $responseInstance An instance of a class with an Responseable interface + * @return void + */ + public function execute (Requestable $requestInstance, Responseable $responseInstance) { + // Get the application instance + $appInstance = $this->getResolverInstance()->getApplicationInstance(); + + // Prepare a template instance + $templateInstance = $this->prepareTemplateEngine($appInstance); + + // Assign all the application's data with template variables + $templateInstance->assignApplicationData($appInstance); + + // Load the master template + $masterTemplate = $appInstance->getMasterTemplate(); + + // Load header template + $templateInstance->loadCodeTemplate("header"); + + // Compile and assign it with a variable + $templateInstance->compileTemplate(); + $templateInstance->assignTemplateWithVariable("header", "header"); + + // Load footer template + $templateInstance->loadCodeTemplate("footer"); + + // Compile and assign it with a variable + $templateInstance->compileTemplate(); + $templateInstance->assignTemplateWithVariable("footer", "footer"); + + // Load the register template + $templateInstance->loadCodeTemplate("register"); + + // Assign the register template with the master template as a content ... ;) + $templateInstance->compileTemplate(); + $templateInstance->assignTemplateWithVariable("register", "content"); + + // Load the master template + $templateInstance->loadCodeTemplate($masterTemplate); + + // Set title + $title = ucfirst($requestInstance->getRequestElement($this->getConfigInstance()->readConfig("command_parameter"))); + if (empty($title)) $title = "Register"; + $templateInstance->assignVariable("title", $title); + + // ... and all variables. This should be merged together in a pattern + // to make things easier. A cache mechanism should be added between + // these two calls to cache compiled templates. + $templateInstance->compileVariables(); + + // Get the content back from the template engine and put it in the response class + $templateInstance->transferToResponse($responseInstance); + } +} + +// [EOF] +?> diff --git a/inc/classes/main/database/classes/class_LocalFileDatabase.php b/inc/classes/main/database/classes/class_LocalFileDatabase.php index 84babfe..b23dbc5 100644 --- a/inc/classes/main/database/classes/class_LocalFileDatabase.php +++ b/inc/classes/main/database/classes/class_LocalFileDatabase.php @@ -70,7 +70,7 @@ class LocalFileDatabase extends BaseDatabaseFrontend implements DatabaseFrontend * * @param $savePath The local file path string * @param $ioInstance The input/output handler. This - * should be FileIOHandler + * should be FileIoHandler * @return $dbInstance An instance of LocalFileDatabase * @throws SavePathIsEmptyException If the given save path is an * empty string @@ -81,7 +81,7 @@ class LocalFileDatabase extends BaseDatabaseFrontend implements DatabaseFrontend * @throws SavePathWriteProtectedException If the save path is write- * protected */ - public final static function createLocalFileDatabase ($savePath, FileIOHandler $ioInstance) { + public final static function createLocalFileDatabase ($savePath, FileIoHandler $ioInstance) { // Get an instance $dbInstance = new LocalFileDatabase(); @@ -101,7 +101,7 @@ class LocalFileDatabase extends BaseDatabaseFrontend implements DatabaseFrontend // Set save path and IO instance $dbInstance->setSavePath($savePath); - $dbInstance->setFileIOInstance($ioInstance); + $dbInstance->setFileIoInstance($ioInstance); // Return database instance return $dbInstance; @@ -163,7 +163,7 @@ class LocalFileDatabase extends BaseDatabaseFrontend implements DatabaseFrontend // Save the file to disc we don't care here if the path is there, // this must be done in later methods. - $this->getFileIOInstance()->saveFile($fqfn, array($this->getCompressorChannel()->getCompressorExtension(), $serialized)); + $this->getFileIoInstance()->saveFile($fqfn, array($this->getCompressorChannel()->getCompressorExtension(), $serialized)); } /** @@ -263,7 +263,7 @@ class LocalFileDatabase extends BaseDatabaseFrontend implements DatabaseFrontend $this->setLastFile($fqfn); // Get instance for file handler - $inputHandler = $this->getFileIOInstance(); + $inputHandler = $this->getFileIoInstance(); // Try to read from it. This makes it sure that the file is // readable and a valid database file @@ -356,7 +356,7 @@ class LocalFileDatabase extends BaseDatabaseFrontend implements DatabaseFrontend */ public final function getObjectFromCachedData ($uniqueID) { // Get instance for file handler - $inputHandler = $this->getFileIOInstance(); + $inputHandler = $this->getFileIoInstance(); // Get last file's name and contents $fqfn = $this->repairFQFN($this->getLastFile(), $uniqueID); diff --git a/inc/classes/main/io/class_FileIOStream.php b/inc/classes/main/io/class_FileIOStream.php deleted file mode 100644 index c983346..0000000 --- a/inc/classes/main/io/class_FileIOStream.php +++ /dev/null @@ -1,232 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright(c) 2007, 2008 Roland Haeder, this is free software - * @license GNU GPL 3.0 or any newer version - * @link http://www.ship-simu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class FileIOStream extends BaseFrameworkSystem implements FileInputStreamer, FileOutputStreamer { - /** - * Protected constructor - */ - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - - // Set part description - $this->setObjectDescription("Universal Datei-Ein-/Ausgabesystem"); - - // Create unique ID - $this->createUniqueID(); - - // Clean-up a little - $this->removeNumberFormaters(); - $this->removeSystemArray(); - } - - /** - * Create a file IO stream. This is a class for performing all actions - * on files like creating, deleting and loading them. - * - * @return $ioInstance An instance of FileIOStream - */ - public final static function createFileIOStream () { - // Create new instance - $ioInstance = new FileIOStream(); - - // Return the instance - return $ioInstance; - } - - /** - * Saves data to a given local file - * - * @param $fileName The file name for the to be saved file - * @param $dataArray The data we shall store to the file - * @return void - * @see FileOutputStreamer - */ - public final function saveFile ($fileName, $dataArray) { - // Try it five times - $dirName = ""; $fileInstance = null; - for ($idx = 0; $idx < 5; $idx++) { - // Get a file output pointer - try { - $fileInstance = FrameworkFileOutputPointer::createFrameworkFileOutputPointer($fileName, 'w'); - } catch (FilePointerNotOpenedException $e) { - // Create missing directory - $dirName = dirname($fileName); - for ($idx2 = 0; $idx2 < (2 - $idx); $idx2++) { - $dirName = dirname($dirName); - } - // Try to create it - @mkdir($dirName); - } - } - - // Write a header information for validation purposes - $fileInstance->writeToFile(sprintf("@head^%s:%s:%s:%s\n", - $dataArray[0], - time(), - strlen($dataArray[1]), - md5($dataArray[1]) - )); - - // Encode the (maybe) binary stream with Base64 - $b64Stream = base64_encode($dataArray[1]); - - // write the data line by line - $line = str_repeat(" ", 50); $idx = 0; - while (strlen($line) == 50) { - // Get 50 chars or less - $line = substr($b64Stream, $idx, 50); - - // Save it to the stream - $fileInstance->writeToFile(sprintf("@data^%s:%s\n", - $line, - md5($line) - )); - - // Advance to the next 50-chars block - $idx += 50; - } - - // Close the file - $fileInstance->closeFile(); - } - - /** - * Reads from a local file - * - * @param $fqfn The full-qualified file-name which we shall load - * @return $array An array with the element 'header' and 'data' - * @see FileInputStreamer - */ - public final function loadFileContents ($fqfn) { - // Initialize some variables and arrays - $inputBuffer = ""; - $lastBuffer = ""; - $header = array(); - $data = array(); - $readData = ""; // This will contain our read data - - // Get a file input handler - $fileInstance = FrameworkFileInputPointer::createFrameworkFileInputPointer($fqfn); - - // Read all it's contents (we very and transparently decompress it below) - while ($readRawLine = $fileInstance->readFromFile()) { - // Add the read line to the buffer - $inputBuffer .= $readRawLine; - - // Break infinite loop maybe caused by the input handler - if ($lastBuffer == $inputBuffer) break; - - // Remember last read line for avoiding possible infinite loops - $lastBuffer = $inputBuffer; - } - - // Close directory handle - $fileInstance->closeFile(); - - // Convert it into an array - $inputBuffer = explode("\n", $inputBuffer); - - // Now process the read lines and verify it's content - foreach ($inputBuffer as $rawLine) { - // Trim it a little but not the leading spaces/tab-stops - $rawLine = rtrim($rawLine); - - // Analyze this line - if (substr($rawLine, 0, 5) == "@head") { - // Header found, so let's extract it - $header = explode("^", $rawLine); - $header = trim($header[1]); - - // Now we must convert it again into an array - $header = explode(":", $header); - - // Is the header (maybe) valid? - if (count($header) != 4) { - // Throw an exception - throw new InvalidArrayCountException(array($this, "header", count($header), 4), self::EXCEPTION_ARRAY_HAS_INVALID_COUNT); - } - } elseif (substr($rawLine, 0, 5) == "@data") { - // Is a data line! - $data = explode("^", $rawLine); - $data = $data[1]; - - // First element is the data, second the MD5 checksum - $data = explode(":", $data); - - // Validate the read line - if (count($data) == 2) { - if (md5($data[0]) != $data[1]) { - // MD5 hash did not match! - throw new InvalidMD5ChecksumException(array($this, md5($data[0]), $data[1]), self::EXCEPTION_MD5_CHECKSUMS_MISMATCH); - } - } else { - // Invalid count! - throw new InvalidArrayCountException(array($this, "data", count($data), 2), self::EXCEPTION_ARRAY_HAS_INVALID_COUNT); - } - - // Add this to the readData string - $readData .= $data[0]; - } else { - // Other raw lines than header/data tagged lines and re-add the new-line char - $readData .= $rawLine."\n"; - } - } - - // Was raw lines read and no header/data? - if ((!empty($readData)) && (count($header) == 0) && (count($data) == 0)) { - // Return raw lines back - return $readData; - } - - // Was a header found? - if (count($header) != 4) { - // Throw an exception - throw new InvalidArrayCountException(array($this, "header", count($header), 4), self::EXCEPTION_ARRAY_HAS_INVALID_COUNT); - } - - // Decode all from Base64 - $readData = @base64_decode($readData); - - // Does the size match? - if (strlen($readData) != $header[2]) { - // Size did not match - throw new InvalidDataLengthException(array($this, strlen($readData), $header[2]), self::EXCEPTION_UNEXPECTED_STRING_SIZE); - } - - // Validate the decoded data with the final MD5 hash - if (md5($readData) != $header[3]) { - // MD5 hash did not match! - throw new InvalidMD5ChecksumException(array($this, md5($readData), $header[3]), self::EXCEPTION_MD5_CHECKSUMS_MISMATCH); - } - - // Return all in an array - return array( - 'header' => $header, - 'data' => $readData - ); - } -} - -// [EOF] -?> diff --git a/inc/classes/main/io/class_FileIoStream.php b/inc/classes/main/io/class_FileIoStream.php new file mode 100644 index 0000000..c983346 --- /dev/null +++ b/inc/classes/main/io/class_FileIoStream.php @@ -0,0 +1,232 @@ + + * @version 0.0.0 + * @copyright Copyright(c) 2007, 2008 Roland Haeder, this is free software + * @license GNU GPL 3.0 or any newer version + * @link http://www.ship-simu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class FileIOStream extends BaseFrameworkSystem implements FileInputStreamer, FileOutputStreamer { + /** + * Protected constructor + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + + // Set part description + $this->setObjectDescription("Universal Datei-Ein-/Ausgabesystem"); + + // Create unique ID + $this->createUniqueID(); + + // Clean-up a little + $this->removeNumberFormaters(); + $this->removeSystemArray(); + } + + /** + * Create a file IO stream. This is a class for performing all actions + * on files like creating, deleting and loading them. + * + * @return $ioInstance An instance of FileIOStream + */ + public final static function createFileIOStream () { + // Create new instance + $ioInstance = new FileIOStream(); + + // Return the instance + return $ioInstance; + } + + /** + * Saves data to a given local file + * + * @param $fileName The file name for the to be saved file + * @param $dataArray The data we shall store to the file + * @return void + * @see FileOutputStreamer + */ + public final function saveFile ($fileName, $dataArray) { + // Try it five times + $dirName = ""; $fileInstance = null; + for ($idx = 0; $idx < 5; $idx++) { + // Get a file output pointer + try { + $fileInstance = FrameworkFileOutputPointer::createFrameworkFileOutputPointer($fileName, 'w'); + } catch (FilePointerNotOpenedException $e) { + // Create missing directory + $dirName = dirname($fileName); + for ($idx2 = 0; $idx2 < (2 - $idx); $idx2++) { + $dirName = dirname($dirName); + } + // Try to create it + @mkdir($dirName); + } + } + + // Write a header information for validation purposes + $fileInstance->writeToFile(sprintf("@head^%s:%s:%s:%s\n", + $dataArray[0], + time(), + strlen($dataArray[1]), + md5($dataArray[1]) + )); + + // Encode the (maybe) binary stream with Base64 + $b64Stream = base64_encode($dataArray[1]); + + // write the data line by line + $line = str_repeat(" ", 50); $idx = 0; + while (strlen($line) == 50) { + // Get 50 chars or less + $line = substr($b64Stream, $idx, 50); + + // Save it to the stream + $fileInstance->writeToFile(sprintf("@data^%s:%s\n", + $line, + md5($line) + )); + + // Advance to the next 50-chars block + $idx += 50; + } + + // Close the file + $fileInstance->closeFile(); + } + + /** + * Reads from a local file + * + * @param $fqfn The full-qualified file-name which we shall load + * @return $array An array with the element 'header' and 'data' + * @see FileInputStreamer + */ + public final function loadFileContents ($fqfn) { + // Initialize some variables and arrays + $inputBuffer = ""; + $lastBuffer = ""; + $header = array(); + $data = array(); + $readData = ""; // This will contain our read data + + // Get a file input handler + $fileInstance = FrameworkFileInputPointer::createFrameworkFileInputPointer($fqfn); + + // Read all it's contents (we very and transparently decompress it below) + while ($readRawLine = $fileInstance->readFromFile()) { + // Add the read line to the buffer + $inputBuffer .= $readRawLine; + + // Break infinite loop maybe caused by the input handler + if ($lastBuffer == $inputBuffer) break; + + // Remember last read line for avoiding possible infinite loops + $lastBuffer = $inputBuffer; + } + + // Close directory handle + $fileInstance->closeFile(); + + // Convert it into an array + $inputBuffer = explode("\n", $inputBuffer); + + // Now process the read lines and verify it's content + foreach ($inputBuffer as $rawLine) { + // Trim it a little but not the leading spaces/tab-stops + $rawLine = rtrim($rawLine); + + // Analyze this line + if (substr($rawLine, 0, 5) == "@head") { + // Header found, so let's extract it + $header = explode("^", $rawLine); + $header = trim($header[1]); + + // Now we must convert it again into an array + $header = explode(":", $header); + + // Is the header (maybe) valid? + if (count($header) != 4) { + // Throw an exception + throw new InvalidArrayCountException(array($this, "header", count($header), 4), self::EXCEPTION_ARRAY_HAS_INVALID_COUNT); + } + } elseif (substr($rawLine, 0, 5) == "@data") { + // Is a data line! + $data = explode("^", $rawLine); + $data = $data[1]; + + // First element is the data, second the MD5 checksum + $data = explode(":", $data); + + // Validate the read line + if (count($data) == 2) { + if (md5($data[0]) != $data[1]) { + // MD5 hash did not match! + throw new InvalidMD5ChecksumException(array($this, md5($data[0]), $data[1]), self::EXCEPTION_MD5_CHECKSUMS_MISMATCH); + } + } else { + // Invalid count! + throw new InvalidArrayCountException(array($this, "data", count($data), 2), self::EXCEPTION_ARRAY_HAS_INVALID_COUNT); + } + + // Add this to the readData string + $readData .= $data[0]; + } else { + // Other raw lines than header/data tagged lines and re-add the new-line char + $readData .= $rawLine."\n"; + } + } + + // Was raw lines read and no header/data? + if ((!empty($readData)) && (count($header) == 0) && (count($data) == 0)) { + // Return raw lines back + return $readData; + } + + // Was a header found? + if (count($header) != 4) { + // Throw an exception + throw new InvalidArrayCountException(array($this, "header", count($header), 4), self::EXCEPTION_ARRAY_HAS_INVALID_COUNT); + } + + // Decode all from Base64 + $readData = @base64_decode($readData); + + // Does the size match? + if (strlen($readData) != $header[2]) { + // Size did not match + throw new InvalidDataLengthException(array($this, strlen($readData), $header[2]), self::EXCEPTION_UNEXPECTED_STRING_SIZE); + } + + // Validate the decoded data with the final MD5 hash + if (md5($readData) != $header[3]) { + // MD5 hash did not match! + throw new InvalidMD5ChecksumException(array($this, md5($readData), $header[3]), self::EXCEPTION_MD5_CHECKSUMS_MISMATCH); + } + + // Return all in an array + return array( + 'header' => $header, + 'data' => $readData + ); + } +} + +// [EOF] +?> diff --git a/inc/classes/main/template/class_TemplateEngine.php b/inc/classes/main/template/class_TemplateEngine.php index 4c15006..f929b8a 100644 --- a/inc/classes/main/template/class_TemplateEngine.php +++ b/inc/classes/main/template/class_TemplateEngine.php @@ -138,7 +138,7 @@ class TemplateEngine extends BaseFrameworkSystem implements CompileableTemplate * * @param $basePath The local base path for all templates * @param $langInstance An instance of LanguageSystem (default) - * @param $ioInstance An instance of FileIOHandler (default, middleware!) + * @param $ioInstance An instance of FileIoHandler (default, middleware!) * @return $tplInstance An instance of TemplateEngine * @throws BasePathIsEmptyException If the provided $basePath is empty * @throws InvalidBasePathStringException If $basePath is no string @@ -147,7 +147,7 @@ class TemplateEngine extends BaseFrameworkSystem implements CompileableTemplate * @throws BasePathReadProtectedException If $basePath is * read-protected */ - public final static function createTemplateEngine ($basePath, ManageableLanguage $langInstance, FileIOHandler $ioInstance) { + public final static function createTemplateEngine ($basePath, ManageableLanguage $langInstance, FileIoHandler $ioInstance) { // Get a new instance $tplInstance = new TemplateEngine(); @@ -177,7 +177,7 @@ class TemplateEngine extends BaseFrameworkSystem implements CompileableTemplate // Set the language and IO instances $tplInstance->setLanguageInstance($langInstance); - $tplInstance->setFileIOInstance($ioInstance); + $tplInstance->setFileIoInstance($ioInstance); // Set template extensions $tplInstance->setRawTemplateExtension($cfgInstance->readConfig("raw_template_extension")); @@ -548,7 +548,7 @@ class TemplateEngine extends BaseFrameworkSystem implements CompileableTemplate */ private function loadRawTemplateData ($fqfn) { // Get a input/output instance from the middleware - $ioInstance = $this->getFileIOInstance(); + $ioInstance = $this->getFileIoInstance(); // Validate the instance if (is_null($ioInstance)) { @@ -612,13 +612,14 @@ class TemplateEngine extends BaseFrameworkSystem implements CompileableTemplate // Initialize all missing variables foreach ($variableMatches[3] as $key=>$var) { // Is the variable name valid? - if (($variableMatches[1][$key] != $this->getConfigInstance()->readConfig("tpl_valid_var")) && ($variableMatches[1][$key] != "config")) { + // @TODO Find a better way than ignoring our instance variable $this + if (($variableMatches[1][$key] != $this->getConfigInstance()->readConfig("tpl_valid_var")) && ($variableMatches[1][$key] != "config") && ($variableMatches[1][$key] != "this")) { // Invalid variable name throw new InvalidTemplateVariableNameException(array($this, $this->getLastTemplate(), $variableMatches[1][$key], $this->getConfigInstance()), self::EXCEPTION_TEMPLATE_CONTAINS_INVALID_VAR); + } elseif ($variableMatches[1][$key] != "this") { + // Try to assign it, empty strings are being ignored + $this->assignTemplateVariable($variableMatches[1][$key], $var); } - - // Try to assign it, empty strings are being ignored - $this->assignTemplateVariable($variableMatches[1][$key], $var); } } } @@ -990,6 +991,40 @@ class TemplateEngine extends BaseFrameworkSystem implements CompileableTemplate addslashes($this->getRawTemplateData()) ); + // This loop does remove the backslashes (\) in PHP parameters + // @TODO Make this some nicer... + while (strpos($eval, ""))); + $evalMiddle = stripslashes($evalMiddle); + + // Remove the middle part from right one + $evalRight = substr($evalRight, (strpos($evalRight, "?>") + 2)); + + // And put all together + $eval = sprintf("%s<%%php %s %%>%s", $evalLeft, $evalMiddle, $evalRight); + } + + // Prepare PHP code for eval() command + $eval = str_replace( + "<%php", "\";", + str_replace( + "%>", "\$result = \"", $eval + ) + ); + // Debug message if ((defined('DEBUG_EVAL')) && (is_object($this->getDebugInstance()))) $this->getDebugInstance()->output(sprintf("[%s:] Constructed PHP command:
%s

\n", $this->__toString(), @@ -1158,6 +1193,23 @@ class TemplateEngine extends BaseFrameworkSystem implements CompileableTemplate // Get the content and set it in the response class $responseInstance->writeToBody($this->getCompiledData()); } + + /** + * Assigns all the application data with template variables + * + * @param $appInstance A manageable application instance + * @return void + */ + public function assignApplicationData (ManageableApplication $appInstance) { + // Get long name and assign it + $this->assignVariable("app_full_name" , $appInstance->getAppName()); + + // Get short name and assign it + $this->assignVariable("app_short_name", $appInstance->getAppShortName()); + + // Get version number and assign it + $this->assignVariable("app_version" , $appInstance->getAppVersion()); + } } // [EOF] diff --git a/inc/classes/middleware/io/class_FileIOHandler.php b/inc/classes/middleware/io/class_FileIOHandler.php deleted file mode 100644 index 8c7a47a..0000000 --- a/inc/classes/middleware/io/class_FileIOHandler.php +++ /dev/null @@ -1,181 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright(c) 2007, 2008 Roland Haeder, this is free software - * @license GNU GPL 3.0 or any newer version - * @link http://www.ship-simu.org - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -class FileIOHandler extends BaseMiddleware { - /** - * The *real* file input class we shall use for reading data - */ - private $inputStream = null; - - /** - * The *real* file output class we shall use for reading data - */ - private $outputStream = null; - - /** - * An instance of this class - */ - private static $thisInstance = null; - - /** - * Protected constructor - * - * @return void - */ - protected function __construct () { - // Call parent constructor - parent::__construct(__CLASS__); - - // Set description - $this->setObjectDescription("Datei-Ein-/Ausgabe-Handler"); - - // Create an unique ID - $this->createUniqueID(); - - // Clean up a little - $this->removeNumberFormaters(); - $this->removeSystemArray(); - - // Set own instance - self::$thisInstance = $this; - } - - /** - * Creates an instance of this class and prepares the IO system. This is - * being done by setting the default file IO class - * - * @return $ioInstance A prepared instance of FilIOHandler - */ - public final static function createFileIOHandler () { - // Get instance - $ioHandler = new FileIOHandler(); - - // Set the *real* file IO instances (both the same) - $ioHandler->setInputStream(FileIOStream::createFileIOStream()); - $ioHandler->setOutputStream(FileIOStream::createFileIOStream()); - - // Return instance - return $ioHandler; - } - - /** - * Getter for an instance of this class - * - * @return $thisInstance An instance of this class - */ - public final static function getInstance () { - return self::$thisInstance; - } - - /** - * Setter for the *real* file input instance - * - * @param $inputStream The *real* file-input class - */ - public final function setInputStream (FileInputStreamer $inputStream) { - $this->inputStream = $inputStream; - } - - /** - * Getter for the *real* file input instance - * - * @return $inputStream The *real* file-input class - */ - public final function getInputStream () { - return $this->inputStream; - } - - /** - * Setter for the *real* file output instance - * - * @param $outputStream The *real* file-output class - */ - public final function setOutputStream (FileOutputStreamer $outputStream) { - $this->outputStream = $outputStream; - } - - /** - * Getter for the *real* file output instance - * - * @return $outputStream The *real* file-output class - */ - public final function getOutputStream () { - return $this->outputStream; - } - - /** - * Saves a file with data by using the current output stream - * - * @see FileOutputStreamer - */ - public function saveFile ($fileName, $dataArray) { - // Get output stream - $outInstance = $this->getOutputStream(); - - // Is it a valid stream? - if (is_null($outInstance)) { - // No class returned - throw new NullPointerException($this, self::EXCEPTION_IS_NULL_POINTER); - } elseif (!is_object($outInstance)) { - // Not an object! ;-( - throw new NoObjectException($outInstance, self::EXCEPTION_IS_NO_OBJECT); - } elseif (!method_exists($outInstance, 'saveFile')) { - // Nope, so throw exception - throw new MissingMethodException(array($outInstance, 'saveFile'), self::EXCEPTION_MISSING_METHOD); - } - - // Send the fileName and dataArray to the output handler - $outInstance->saveFile($fileName, $dataArray); - } - - /** Loads data from a file over the input handler - * - * @see FileInputStreamer - */ - public function loadFileContents ($fqfn) { - // Initialize the array - $array = array(); - - // Get output stream - $inInstance = $this->getInputStream(); - - // Is it a valid stream? - if (is_null($inInstance)) { - // No class returned - throw new NullPointerException($this, self::EXCEPTION_IS_NULL_POINTER); - } elseif (!is_object($inInstance)) { - // Not an object! ;-( - throw new NoObjectException($inInstance, self::EXCEPTION_IS_NO_OBJECT); - } elseif (!method_exists($inInstance, 'loadFileContents')) { - // Nope, so throw exception - throw new MissingMethodException(array($inInstance, 'loadFileContents'), self::EXCEPTION_MISSING_METHOD); - } - - // Read from the input handler - return $inInstance->loadFileContents($fqfn); - } -} - -// [EOF] -?> diff --git a/inc/classes/middleware/io/class_FileIoHandler.php b/inc/classes/middleware/io/class_FileIoHandler.php new file mode 100644 index 0000000..8c7a47a --- /dev/null +++ b/inc/classes/middleware/io/class_FileIoHandler.php @@ -0,0 +1,181 @@ + + * @version 0.0.0 + * @copyright Copyright(c) 2007, 2008 Roland Haeder, this is free software + * @license GNU GPL 3.0 or any newer version + * @link http://www.ship-simu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class FileIOHandler extends BaseMiddleware { + /** + * The *real* file input class we shall use for reading data + */ + private $inputStream = null; + + /** + * The *real* file output class we shall use for reading data + */ + private $outputStream = null; + + /** + * An instance of this class + */ + private static $thisInstance = null; + + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + + // Set description + $this->setObjectDescription("Datei-Ein-/Ausgabe-Handler"); + + // Create an unique ID + $this->createUniqueID(); + + // Clean up a little + $this->removeNumberFormaters(); + $this->removeSystemArray(); + + // Set own instance + self::$thisInstance = $this; + } + + /** + * Creates an instance of this class and prepares the IO system. This is + * being done by setting the default file IO class + * + * @return $ioInstance A prepared instance of FilIOHandler + */ + public final static function createFileIOHandler () { + // Get instance + $ioHandler = new FileIOHandler(); + + // Set the *real* file IO instances (both the same) + $ioHandler->setInputStream(FileIOStream::createFileIOStream()); + $ioHandler->setOutputStream(FileIOStream::createFileIOStream()); + + // Return instance + return $ioHandler; + } + + /** + * Getter for an instance of this class + * + * @return $thisInstance An instance of this class + */ + public final static function getInstance () { + return self::$thisInstance; + } + + /** + * Setter for the *real* file input instance + * + * @param $inputStream The *real* file-input class + */ + public final function setInputStream (FileInputStreamer $inputStream) { + $this->inputStream = $inputStream; + } + + /** + * Getter for the *real* file input instance + * + * @return $inputStream The *real* file-input class + */ + public final function getInputStream () { + return $this->inputStream; + } + + /** + * Setter for the *real* file output instance + * + * @param $outputStream The *real* file-output class + */ + public final function setOutputStream (FileOutputStreamer $outputStream) { + $this->outputStream = $outputStream; + } + + /** + * Getter for the *real* file output instance + * + * @return $outputStream The *real* file-output class + */ + public final function getOutputStream () { + return $this->outputStream; + } + + /** + * Saves a file with data by using the current output stream + * + * @see FileOutputStreamer + */ + public function saveFile ($fileName, $dataArray) { + // Get output stream + $outInstance = $this->getOutputStream(); + + // Is it a valid stream? + if (is_null($outInstance)) { + // No class returned + throw new NullPointerException($this, self::EXCEPTION_IS_NULL_POINTER); + } elseif (!is_object($outInstance)) { + // Not an object! ;-( + throw new NoObjectException($outInstance, self::EXCEPTION_IS_NO_OBJECT); + } elseif (!method_exists($outInstance, 'saveFile')) { + // Nope, so throw exception + throw new MissingMethodException(array($outInstance, 'saveFile'), self::EXCEPTION_MISSING_METHOD); + } + + // Send the fileName and dataArray to the output handler + $outInstance->saveFile($fileName, $dataArray); + } + + /** Loads data from a file over the input handler + * + * @see FileInputStreamer + */ + public function loadFileContents ($fqfn) { + // Initialize the array + $array = array(); + + // Get output stream + $inInstance = $this->getInputStream(); + + // Is it a valid stream? + if (is_null($inInstance)) { + // No class returned + throw new NullPointerException($this, self::EXCEPTION_IS_NULL_POINTER); + } elseif (!is_object($inInstance)) { + // Not an object! ;-( + throw new NoObjectException($inInstance, self::EXCEPTION_IS_NO_OBJECT); + } elseif (!method_exists($inInstance, 'loadFileContents')) { + // Nope, so throw exception + throw new MissingMethodException(array($inInstance, 'loadFileContents'), self::EXCEPTION_MISSING_METHOD); + } + + // Read from the input handler + return $inInstance->loadFileContents($fqfn); + } +} + +// [EOF] +?> diff --git a/inc/database/lib-local.php b/inc/database/lib-local.php index a14e7c8..1551156 100644 --- a/inc/database/lib-local.php +++ b/inc/database/lib-local.php @@ -24,7 +24,7 @@ // Zum Testen speichern wir in lokale Dateien (LocalFileDatabase) try { - $layer = LocalFileDatabase::createLocalFileDatabase(PATH . "db/", FileIOHandler::getInstance()); + $layer = LocalFileDatabase::createLocalFileDatabase(PATH . "db/", FileIoHandler::getInstance()); } catch (SavePathIsEmptyException $e) { ApplicationEntryPoint::app_die(sprintf("[Main:] Debug-Instanz konnte nicht gesetzt werden. Reason: %s
\n", $e->getMessage() diff --git a/inc/file_io.php b/inc/file_io.php index 18b0cb4..de20bf5 100644 --- a/inc/file_io.php +++ b/inc/file_io.php @@ -25,7 +25,7 @@ */ // Get the instance -$io = FileIOHandler::createFileIOHandler(); +$io = FileIoHandler::createFileIoHandler(); // [EOF] ?> diff --git a/index.php b/index.php index 9cabcb0..1956b02 100644 --- a/index.php +++ b/index.php @@ -68,7 +68,7 @@ class ApplicationEntryPoint { // Get some instances $tpl = FrameworkConfiguration::getInstance()->readConfig("tpl_engine"); $lang = LanguageSystem::getInstance(); - $io = FileIOHandler::getInstance(); + $io = FileIoHandler::getInstance(); // Is the template engine loaded? if ((class_exists($tpl)) && (is_object($lang)) && (is_object($io))) { diff --git a/templates/de/code/emergency_exit.ctp b/templates/de/code/emergency_exit.ctp index 4cd1cf9..d5c6f90 100644 --- a/templates/de/code/emergency_exit.ctp +++ b/templates/de/code/emergency_exit.ctp @@ -2,7 +2,7 @@ {?header:title="Problem in application framework detected!"?} -{?navigation:nav_row=home;imprint;contact?} +{?navigation?}
$content[message]