From: Roland Häder Date: Fri, 19 Sep 2008 00:27:14 +0000 (+0000) Subject: Constants PATH and _DB_TYPE replaced X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=a2cc983f5fe910115d25800c258875a3919fb143;p=shipsimu.git Constants PATH and _DB_TYPE replaced --- diff --git a/application/blog/init.php b/application/blog/init.php index a9739a5..4043f37 100644 --- a/application/blog/init.php +++ b/application/blog/init.php @@ -34,17 +34,17 @@ */ // Initialize output system -require(PATH . 'inc/output.php'); +require($cfg->readConfig('base_path') . 'inc/output.php'); // Initialize file i/o system -require(PATH . 'inc/file_io.php'); +require($cfg->readConfig('base_path') . 'inc/file_io.php'); // Include the language sub-system -require(PATH . 'inc/language.php'); +require($cfg->readConfig('base_path') . 'inc/language.php'); // This application needs a database connection then we have to simply include // the inc/database.php script -require(PATH . 'inc/database.php'); +require($cfg->readConfig('base_path') . 'inc/database.php'); // Generate call-back function $callback = sprintf("%s::getInstance", diff --git a/application/selector/class_ApplicationSelector.php b/application/selector/class_ApplicationSelector.php index ddae1d4..1f664a6 100644 --- a/application/selector/class_ApplicationSelector.php +++ b/application/selector/class_ApplicationSelector.php @@ -188,7 +188,7 @@ class ApplicationSelector extends BaseFrameworkSystem { public function readApplicationDirectory () { // Generate the base path for all applications $appBasePath = sprintf("%s%s/", - PATH, + $this->getConfigInstance()->readConfig('base_path'), $this->getConfigInstance()->readConfig('application_path') ); diff --git a/application/selector/init.php b/application/selector/init.php index 4a4a147..cac841d 100644 --- a/application/selector/init.php +++ b/application/selector/init.php @@ -26,13 +26,13 @@ */ // Initialize output system -require(PATH . 'inc/output.php'); +require($cfg->readConfig('base_path') . 'inc/output.php'); // Initialize file i/o system -require(PATH . 'inc/file_io.php'); +require($cfg->readConfig('base_path') . 'inc/file_io.php'); // Include the language sub-system -require(PATH . 'inc/language.php'); +require($cfg->readConfig('base_path') . 'inc/language.php'); // Generate call-back function $callback = sprintf("%s::getInstance", diff --git a/application/ship-simu/init.php b/application/ship-simu/init.php index b9220e9..548894c 100644 --- a/application/ship-simu/init.php +++ b/application/ship-simu/init.php @@ -34,17 +34,17 @@ */ // Initialize output system -require(PATH . 'inc/output.php'); +require($cfg->readConfig('base_path') . 'inc/output.php'); // Initialize file i/o system -require(PATH . 'inc/file_io.php'); +require($cfg->readConfig('base_path') . 'inc/file_io.php'); // Include the language sub-system -require(PATH . 'inc/language.php'); +require($cfg->readConfig('base_path') . 'inc/language.php'); // This application needs a database connection then we have to simply include // the inc/database.php script -require(PATH . 'inc/database.php'); +require($cfg->readConfig('base_path') . 'inc/database.php'); // Generate call-back function $callback = sprintf("%s::getInstance", diff --git a/application/todo/init.php b/application/todo/init.php index 38482f9..3f7a885 100644 --- a/application/todo/init.php +++ b/application/todo/init.php @@ -34,17 +34,17 @@ */ // Initialize output system -require(PATH . 'inc/output.php'); +require($cfg->readConfig('base_path') . 'inc/output.php'); // Initialize file i/o system -require(PATH . 'inc/file_io.php'); +require($cfg->readConfig('base_path') . 'inc/file_io.php'); // Include the language sub-system -require(PATH . 'inc/language.php'); +require($cfg->readConfig('base_path') . 'inc/language.php'); // This application needs a database connection then we have to simply include // the inc/database.php script -require(PATH . 'inc/database.php'); +require($cfg->readConfig('base_path') . 'inc/database.php'); // Generate call-back function $callback = sprintf("%s::getInstance", diff --git a/inc/classes/main/class_BaseFrameworkSystem.php b/inc/classes/main/class_BaseFrameworkSystem.php index 5652f4f..061b2f4 100644 --- a/inc/classes/main/class_BaseFrameworkSystem.php +++ b/inc/classes/main/class_BaseFrameworkSystem.php @@ -281,7 +281,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { // Set the compressor channel $this->setCompressorChannel(CompressorChannel::createCompressorChannel(sprintf("%s%s", - PATH, + $this->getConfigInstance()->readConfig('base_path'), $this->getConfigInstance()->readConfig('compressor_base_path') ))); @@ -719,7 +719,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { // Generate FQFN for all application templates $fqfn = sprintf("%s%s/%s/%s", - PATH, + $this->getConfigInstance()->readConfig('base_path'), $this->getConfigInstance()->readConfig('application_path'), strtolower($appInstance->getAppShortName()), $this->getConfigInstance()->readConfig('tpl_base_path') diff --git a/inc/classes/main/template/image/class_ImageTemplateEngine.php b/inc/classes/main/template/image/class_ImageTemplateEngine.php index 210002f..68d1cbe 100644 --- a/inc/classes/main/template/image/class_ImageTemplateEngine.php +++ b/inc/classes/main/template/image/class_ImageTemplateEngine.php @@ -100,7 +100,7 @@ class ImageTemplateEngine extends BaseTemplateEngine implements CompileableTempl $tplInstance->setCodeTemplateExtension($cfgInstance->readConfig('code_template_extension')); // Absolute output path for compiled templates - $tplInstance->setCompileOutputPath(PATH . $cfgInstance->readConfig('compile_output_path')); + $tplInstance->setCompileOutputPath($cfgInstance->readConfig('base_path') . $cfgInstance->readConfig('compile_output_path')); // Return the prepared instance return $tplInstance; diff --git a/inc/classes/main/template/mail/class_MailTemplateEngine.php b/inc/classes/main/template/mail/class_MailTemplateEngine.php index fbe229d..8fcd0f9 100644 --- a/inc/classes/main/template/mail/class_MailTemplateEngine.php +++ b/inc/classes/main/template/mail/class_MailTemplateEngine.php @@ -100,7 +100,7 @@ class MailTemplateEngine extends BaseTemplateEngine implements CompileableTempla $tplInstance->setCodeTemplateExtension($cfgInstance->readConfig('code_template_extension')); // Absolute output path for compiled templates - $tplInstance->setCompileOutputPath(PATH . $cfgInstance->readConfig('compile_output_path')); + $tplInstance->setCompileOutputPath($cfgInstance->readConfig('base_path') . $cfgInstance->readConfig('compile_output_path')); // Return the prepared instance return $tplInstance; diff --git a/inc/classes/main/template/web/class_WebTemplateEngine.php b/inc/classes/main/template/web/class_WebTemplateEngine.php index d166f9f..61a6bbb 100644 --- a/inc/classes/main/template/web/class_WebTemplateEngine.php +++ b/inc/classes/main/template/web/class_WebTemplateEngine.php @@ -81,7 +81,7 @@ class WebTemplateEngine extends BaseTemplateEngine implements CompileableTemplat $tplInstance->setCodeTemplateExtension($cfgInstance->readConfig('code_template_extension')); // Absolute output path for compiled templates - $tplInstance->setCompileOutputPath(PATH . $cfgInstance->readConfig('compile_output_path')); + $tplInstance->setCompileOutputPath($cfgInstance->readConfig('base_path') . $cfgInstance->readConfig('compile_output_path')); // Return the prepared instance return $tplInstance; diff --git a/inc/config.php b/inc/config.php index 4c73950..8f25248 100644 --- a/inc/config.php +++ b/inc/config.php @@ -33,16 +33,16 @@ $cfg = FrameworkConfiguration::createFrameworkConfiguration(); // CFG: SERVER-PATH -$cfg->definePath(dirname(dirname(__FILE__)) . '/'); // DON'T MISS THE TRAILING SLASH!!! +$cfg->setConfigEntry('base_path', (dirname(dirname(__FILE__)) . '/')); // DON'T MISS THE TRAILING SLASH!!! // CFG: BASE-URL $cfg->setConfigEntry('base_url', $cfg->detectBaseUrl()); // CFG: DATABASE-TYPE -$cfg->defineDatabaseType('local'); +$cfg->setConfigEntry('db_type', "local"); // CFG: LOCAL-DB-PATH -$cfg->setConfigEntry('local_db_path', "db/"); +$cfg->setConfigEntry('local_db_path', $cfg->readConfig('base_path', "db/")); // CFG: TIME-ZONE $cfg->setDefaultTimezone("Europe/Berlin"); diff --git a/inc/config/class_FrameworkConfiguration.php b/inc/config/class_FrameworkConfiguration.php index 6bfdfbf..8f6fa15 100644 --- a/inc/config/class_FrameworkConfiguration.php +++ b/inc/config/class_FrameworkConfiguration.php @@ -139,7 +139,7 @@ class FrameworkConfiguration implements Registerable { // Base path added? (Uni* / Windows) if ((substr($inc, 0, 1) != "/") && (substr($inc, 1, 1) != ":")) { // Generate FQFN - $fqfn = sprintf("%s/inc/extra/%s", PATH, $inc); + $fqfn = sprintf("%s/inc/extra/%s", $this->readConfig('base_path'), $inc); } // END - if } // END - if @@ -149,63 +149,14 @@ class FrameworkConfiguration implements Registerable { } // END - if } - /** - * Define the database type which must be valid and will not be verified. - * - * @param $type The database type. See path inc/database/. - * @return void - */ - public function defineDatabaseType ($type) { - // Is it defined or not? - if (defined('_DB_TYPE')) { - // Already defined! But we cannot throw an exception here... :( - ApplicationEntryPoint::app_die(sprintf("[%s:] Please define the database type only once in your application!", - __CLASS__ - )); - } - - // Set the constant - define('_DB_TYPE', (string) $type); - } - - /** - * Define the local file path - * - * @param $path Local file path for include files. - * @return void - */ - public function definePath ($path) { - // Cast to string - $path = (string) $path; - - // Replace backslashes with slashes - $path = str_replace("\\", "/", $path); - - // Is it defined or not? - if ((!is_dir($path)) || (!is_readable($path))) { - // Is not a valid path - ApplicationEntryPoint::app_die(sprintf("[%s:] Invalid path (not found) specified. Please make sure it is created.", - __CLASS__ - )); - } elseif (defined('PATH')) { - // Already defined! But we cannot throw an exception here... :( - ApplicationEntryPoint::app_die(sprintf("[%s:] Please define the local file path only once in your application.", - __CLASS__ - )); - } - - // Define path here - define('PATH', $path); - } - /** * Read a configuration element. * - * @param $cfgEntry The configuration element + * @param $cfgEntry The configuration element * @return $cfgValue The fetched configuration value - * @throws ConfigEntryIsEmptyException If $cfgEntry is empty + * @throws ConfigEntryIsEmptyException If $cfgEntry is empty * @throws ConfigEntryNotFoundException If a configuration element - * was not found + * was not found */ public function readConfig ($cfgEntry) { // Cast to string @@ -232,8 +183,8 @@ class FrameworkConfiguration implements Registerable { /** * Set a configuration entry. * - * @param $cfgEntry The configuration entry we want to add/change - * @param $cfgValue The configuration value we want to set + * @param $cfgEntry The configuration entry we want to add/change + * @param $cfgValue The configuration value we want to set * @return void * @throws ConfigEntryIsEmptyException If $cfgEntry is empty */ diff --git a/inc/database.php b/inc/database.php index 1d381d2..7f9003a 100644 --- a/inc/database.php +++ b/inc/database.php @@ -25,19 +25,14 @@ // Initialize layer $layer = null; -// Is the type defined? -if (!defined('_DB_TYPE')) { - // Abort here - ApplicationEntryPoint::app_die("[Main:] Please define a database type first!
-E.g.:
$cfg->defineDatabaseType("local");
-This will choose the local file-based database layer."); -} +// Get config instance +$cfg = FrameworkConfiguration::getInstance(); // Generate FQFN for the database layer $INC = sprintf("%sinc/database/lib-%s%s", - PATH, - _DB_TYPE, - FrameworkConfiguration::getInstance()->readConfig('php_extension') + $cfg->readConfig('base_path'), + $cfg->readConfig('db_type'), + $cfg->readConfig('php_extension') ); // Load the database layer include @@ -47,7 +42,7 @@ if ((file_exists($INC)) && (is_file($INC)) && (is_readable($INC))) { } else { // Layer is missing! ApplicationEntryPoint::app_die(sprintf("[Main:] Database layer is missing! (%s) -> R.I.P.", - _DB_TYPE + $cfg->readConfig('db_type') )); } diff --git a/inc/database/lib-local.php b/inc/database/lib-local.php index 7216bed..f9ec63e 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 . FrameworkConfiguration::getInstance()->readConfig('local_db_path'), FileIoHandler::getInstance()); + $layer = LocalFileDatabase::createLocalFileDatabase(FrameworkConfiguration::getInstance()->readConfig('local_db_path'), FileIoHandler::getInstance()); } catch (SavePathIsEmptyException $e) { ApplicationEntryPoint::app_die(sprintf("[Main:] Database layer could not be initialized. Reason: %s", $e->getMessage() diff --git a/inc/includes.php b/inc/includes.php index 41933d9..54bd39b 100644 --- a/inc/includes.php +++ b/inc/includes.php @@ -26,7 +26,7 @@ $cfg = FrameworkConfiguration::getInstance(); // Include the class loader function -require(sprintf("%sinc/loader/class_ClassLoader%s", PATH, $cfg->readConfig('php_extension'))); +require(sprintf("%sinc/loader/class_ClassLoader%s", $cfg->readConfig('base_path'), $cfg->readConfig('php_extension'))); // Does the user has an application specified? if (!empty($_GET['app'])) { @@ -71,7 +71,7 @@ function __autoload ($className) { /** * Is the devel package included? */ -if (is_dir(sprintf("%sdevel", PATH))) { +if (is_dir(sprintf("%sdevel", $cfg->readConfig('base_path')))) { /** * Load all development includes */ diff --git a/inc/language.php b/inc/language.php index 3f7c385..6db17c0 100644 --- a/inc/language.php +++ b/inc/language.php @@ -22,7 +22,7 @@ */ try { $lang = LanguageSystem::createLanguageSystem(sprintf("%s%s", - PATH, + $cfg->readConfig('base_path'), FrameworkConfiguration::getInstance()->readConfig('lang_base_path') )); } catch (LanguagePathIsEmptyException $e) { diff --git a/inc/loader/class_ClassLoader.php b/inc/loader/class_ClassLoader.php index 7297c7d..5f5f97a 100644 --- a/inc/loader/class_ClassLoader.php +++ b/inc/loader/class_ClassLoader.php @@ -119,8 +119,8 @@ class ClassLoader { // Construct the FQFN for the cache if (!defined('DEVELOPER')) { - $this->listCacheFQFN = PATH . $this->cfgInstance->readConfig('local_db_path') . "list-" . $this->cfgInstance->readConfig('app_name') . ".cache"; - $this->classCacheFQFN = PATH . $this->cfgInstance->readConfig('local_db_path') . "class-" . $this->cfgInstance->readConfig('app_name') . ".cache"; + $this->listCacheFQFN = $this->cfgInstance->readConfig('base_path') . $this->cfgInstance->readConfig('local_db_path') . "list-" . $this->cfgInstance->readConfig('app_name') . ".cache"; + $this->classCacheFQFN = $this->cfgInstance->readConfig('base_path') . $this->cfgInstance->readConfig('local_db_path') . "class-" . $this->cfgInstance->readConfig('app_name') . ".cache"; } // END - if // Set suffix and prefix from configuration @@ -208,8 +208,8 @@ class ClassLoader { /** * Scans recursively a local path for class files which must have a prefix and a suffix as given by $this->suffix and $this->prefix * - * @param $basePath The relative base path to PATH constant for all classes - * @param $ignoreList An optional list (array or string) of directory names which shall be ignored + * @param $basePath The relative base path to 'base_path' constant for all classes + * @param $ignoreList An optional list (array or string) of directory names which shall be ignored * @return void */ public function loadClasses ($basePath, $ignoreList = array() ) { @@ -280,7 +280,7 @@ class ClassLoader { $this->prefixLen = strlen($this->prefix); // Set base directory - $basePath = sprintf("%sinc/config/", PATH); + $basePath = sprintf("%sinc/config/", $this->cfgInstance->readConfig('base_path')); // Load all classes from the config directory $this->loadClasses($basePath); diff --git a/inc/selector.php b/inc/selector.php index a1ae868..69f4134 100644 --- a/inc/selector.php +++ b/inc/selector.php @@ -46,7 +46,7 @@ foreach ($configAppIncludes as $inc) { // Generate a FQFN for the helper class $fqfn = sprintf("%s%s/%s/%s%s", - PATH, + $cfg->readConfig('base_path'), $cfg->readConfig('application_path'), $cfg->readConfig('app_name'), $inc, diff --git a/index.php b/index.php index 9d61748..f6c6005 100644 --- a/index.php +++ b/index.php @@ -68,7 +68,7 @@ class ApplicationEntryPoint { if (empty($message)) { // No message provided $message = "No message provided!"; - } + } // END - if // Get some instances $tpl = FrameworkConfiguration::getInstance()->readConfig('template_class'); @@ -150,13 +150,13 @@ class ApplicationEntryPoint { require(dirname(__FILE__) . '/inc/config.php'); // Load all include files - require(PATH . 'inc/includes.php'); + require($cfg->readConfig('base_path') . 'inc/includes.php'); // Load all framework classes - require(PATH . 'inc/classes.php'); + require($cfg->readConfig('base_path') . 'inc/classes.php'); // Include the application selector - require(PATH . 'inc/selector.php'); + require($cfg->readConfig('base_path') . 'inc/selector.php'); } // END - main() } // END - class diff --git a/tests/ConfigTest.php b/tests/ConfigTest.php index df0cc13..7c70e61 100644 --- a/tests/ConfigTest.php +++ b/tests/ConfigTest.php @@ -8,10 +8,10 @@ print (basename(__FILE__).": Init...\n"); require(dirname(dirname(__FILE__)) . '/inc/config.php'); // Load all include files -require(PATH . 'inc/includes.php'); +require($cfg->readConfig('base_path') . 'inc/includes.php'); // Load all game classes -require(PATH . 'inc/classes.php'); +require($cfg->readConfig('base_path') . 'inc/classes.php'); // Set default application FrameworkConfiguration::getInstance()->setConfigEntry('default_application', 'ship-simu'); diff --git a/tests/RegistryTest.php b/tests/RegistryTest.php index 73ca258..e4dc50e 100644 --- a/tests/RegistryTest.php +++ b/tests/RegistryTest.php @@ -8,10 +8,10 @@ print (basename(__FILE__).": Init...\n"); require(dirname(dirname(__FILE__)) . '/inc/config.php'); // Load all include files -require(PATH . 'inc/includes.php'); +require($cfg->readConfig('base_path') . 'inc/includes.php'); // Load all game classes -require(PATH . 'inc/classes.php'); +require($cfg->readConfig('base_path') . 'inc/classes.php'); // Set default application FrameworkConfiguration::getInstance()->setConfigEntry('default_application', 'ship-simu'); diff --git a/tests/RequestTest.php b/tests/RequestTest.php index d7e8653..0104f63 100644 --- a/tests/RequestTest.php +++ b/tests/RequestTest.php @@ -8,10 +8,10 @@ print (basename(__FILE__).": Init...\n"); require(dirname(dirname(__FILE__)) . '/inc/config.php'); // Load all include files -require(PATH . 'inc/includes.php'); +require($cfg->readConfig('base_path') . 'inc/includes.php'); // Load all game classes -require(PATH . 'inc/classes.php'); +require($cfg->readConfig('base_path') . 'inc/classes.php'); // Set default application FrameworkConfiguration::getInstance()->setConfigEntry('default_application', 'ship-simu'); diff --git a/tests/Test.php b/tests/Test.php index a3f8c65..7e5a551 100644 --- a/tests/Test.php +++ b/tests/Test.php @@ -8,10 +8,10 @@ print (basename(__FILE__).": Init...\n"); require(dirname(dirname(__FILE__)) . '/inc/config.php'); // Load all include files -require(PATH . 'inc/includes.php'); +require($cfg->readConfig('base_path') . 'inc/includes.php'); // Load all game classes -require(PATH . 'inc/classes.php'); +require($cfg->readConfig('base_path') . 'inc/classes.php'); // Set default application FrameworkConfiguration::getInstance()->setConfigEntry('default_application', 'ship-simu'); diff --git a/tests/old/contract-test.php b/tests/old/contract-test.php index 3c56da5..3e9cd2b 100644 --- a/tests/old/contract-test.php +++ b/tests/old/contract-test.php @@ -9,23 +9,23 @@ define('TEST_MODE', true); require(dirname(dirname(dirname(__FILE__))) . "/inc/config.php"); // Load all include files -require(PATH . 'inc/includes.php'); +require($cfg->readConfig('base_path') . 'inc/includes.php'); // Load all game classes -require(PATH . 'inc/classes.php'); +require($cfg->readConfig('base_path') . 'inc/classes.php'); // Load file I/O handler -require(PATH . 'inc/file_io.php'); +require($cfg->readConfig('base_path') . 'inc/file_io.php'); // Load database layer -require(PATH . 'inc/database.php'); +require($cfg->readConfig('base_path') . 'inc/database.php'); // Set default application FrameworkConfiguration::getInstance()->setConfigEntry('default_application', 'ship-simu'); $application = 'ship-simu'; // Load more includes -require(PATH . 'application/ship-simu/loader.php'); +require($cfg->readConfig('base_path') . 'application/ship-simu/loader.php'); // Wir tun hier so, als waere schon das Reederei-Objekt generiert und wir wollen // jetzt die Personalliste wiederherstellen diff --git a/tests/old/loader-test.php b/tests/old/loader-test.php index a00440a..6d885ab 100644 --- a/tests/old/loader-test.php +++ b/tests/old/loader-test.php @@ -9,23 +9,23 @@ define('TEST_MODE', true); require(dirname(dirname(dirname(__FILE__))) . "/inc/config.php"); // Load all include files -require(PATH . 'inc/includes.php'); +require($cfg->readConfig('base_path') . 'inc/includes.php'); // Load all game classes -require(PATH . 'inc/classes.php'); +require($cfg->readConfig('base_path') . 'inc/classes.php'); // Load file I/O handler -require(PATH . 'inc/file_io.php'); +require($cfg->readConfig('base_path') . 'inc/file_io.php'); // Load database layer -require(PATH . 'inc/database.php'); +require($cfg->readConfig('base_path') . 'inc/database.php'); // Set default application FrameworkConfiguration::getInstance()->setConfigEntry('default_application', 'ship-simu'); $application = 'ship-simu'; // Load more includes -require(PATH . 'application/ship-simu/loader.php'); +require($cfg->readConfig('base_path') . 'application/ship-simu/loader.php'); // Wir tun hier so, als waere schon das Reederei-Objekt generiert und wir wollen // jetzt die Personalliste wiederherstellen diff --git a/tests/old/personell-test.php b/tests/old/personell-test.php index 43c2944..67dea21 100644 --- a/tests/old/personell-test.php +++ b/tests/old/personell-test.php @@ -9,23 +9,23 @@ define('TEST_MODE', true); require(dirname(dirname(dirname(__FILE__))) . "/inc/config.php"); // Load all include files -require(PATH . 'inc/includes.php'); +require($cfg->readConfig('base_path') . 'inc/includes.php'); // Load all game classes -require(PATH . 'inc/classes.php'); +require($cfg->readConfig('base_path') . 'inc/classes.php'); // Load file I/O handler -require(PATH . 'inc/file_io.php'); +require($cfg->readConfig('base_path') . 'inc/file_io.php'); // Load database layer -require(PATH . 'inc/database.php'); +require($cfg->readConfig('base_path') . 'inc/database.php'); // Set default application FrameworkConfiguration::getInstance()->setConfigEntry('default_application', 'ship-simu'); $application = 'ship-simu'; // Load more includes -require(PATH . 'application/ship-simu/loader.php'); +require($cfg->readConfig('base_path') . 'application/ship-simu/loader.php'); // Wir tun hier so, als waere schon das Reederei-Objekt generiert und wir wollen // jetzt die Personalliste wiederherstellen