- }
- }
-
- /**
- * 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')) {
- // Cast to string
- $type = (string) $type;
-
- // Set the constant
- define('_DB_TYPE', $type);
- } else {
- // 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__
- ));
- }
- }
-
- /**
- * 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')) {
- // Set the constant
- define('PATH', $path);
- } else {
- // 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__
- ));
- }