From: Roland Haeder Date: Sun, 26 Mar 2017 14:39:13 +0000 (+0200) Subject: Continued with rewrites: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=4e95c4e90f08f67f43591eaaa0c006f923d8bacf;p=core.git Continued with rewrites: - rewrote bootstrap to a more easier way, still index.php will contain a class - this class has a method to detect the framework's path on common places - splitted application_base_path and framework_base_path, was only base_path before Signed-off-by: Roland Häder --- diff --git a/application/tests/init.php b/application/tests/init.php index 77c9fb87..29dfc167 100644 --- a/application/tests/init.php +++ b/application/tests/init.php @@ -37,7 +37,7 @@ ApplicationHelper::createDebugInstance('ApplicationHelper'); // This application needs a database connection then we have to simply include // the framework/database.php script -require($cfg->getConfigEntry('base_path') . 'framework/database.php'); +require($cfg->getConfigEntry('framework_base_path') . 'database.php'); // Register core tests ClassLoader::registerTestsPath('framework/main/tests'); diff --git a/framework/bootstrap/bootstrap.inc.php b/framework/bootstrap/bootstrap.inc.php new file mode 100644 index 00000000..4c2ebd42 --- /dev/null +++ b/framework/bootstrap/bootstrap.inc.php @@ -0,0 +1,32 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2016 Core Developer Team + * @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 . + */ + +// Load very basic classes, required to bootstrap +require(__DIR__ . '/class_BootstrapFramework.php'); + +// Bootstrap framework +BootstrapFramework::doBootstrap(); diff --git a/framework/bootstrap/class_BootstrapFramework.php b/framework/bootstrap/class_BootstrapFramework.php index ee8b6b95..565f3c8b 100644 --- a/framework/bootstrap/class_BootstrapFramework.php +++ b/framework/bootstrap/class_BootstrapFramework.php @@ -1,4 +1,10 @@ . */ -class BootstrapFramework { +final class BootstrapFramework { /** * Private constructor, no instance is needed from this class as only * static methods exist. @@ -29,7 +35,20 @@ class BootstrapFramework { private function __construct () { // Prevent making instances from this "utilities" class } -} -// [EOF] -?> + /** + * Does the actual bootstrap + * + * @return void + */ + public static function doBootstrap () { + // Load basic include files to continue bootstrapping + require(ApplicationEntryPoint::detectFrameworkPath() . 'main/interfaces/class_FrameworkInterface.php'); + require(ApplicationEntryPoint::detectFrameworkPath() . 'main/interfaces/registry/class_Registerable.php'); + require(ApplicationEntryPoint::detectFrameworkPath() . 'config/class_FrameworkConfiguration.php'); + + // Load main configuration + require(ApplicationEntryPoint::detectFrameworkPath() . 'config.inc.php'); + } + +} diff --git a/framework/config.inc.php b/framework/config.inc.php new file mode 100644 index 00000000..1ea33974 --- /dev/null +++ b/framework/config.inc.php @@ -0,0 +1,472 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2017 Core Developer Team + * @license GNU GPL 3.0 or any newer version + * @link http://www.shipsimu.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 . + */ + +// Get a new configuration instance +$cfg = FrameworkConfiguration::getSelfInstance(); + +// CFG: ROOT-BASE-PATH +$cfg->setConfigEntry('root_base_path', BootstrapFramework::detectRootPath() . '/'); + +// CFG: CORE-BASE-PATH +$cfg->setConfigEntry('framework_base_path', ApplicationEntryPoint::detectFrameworkPath()); + +// CFG: BASE-URL +$cfg->setConfigEntry('base_url', $cfg->detectBaseUrl()); + +// CFG: DATABASE-TYPE +$cfg->setConfigEntry('database_type', 'lfdb'); + +// CFG: LOCAL-DATABASE-PATH +$cfg->setConfigEntry('local_database_path', $cfg->getConfigEntry('root_base_path') . 'db/'); + +// CFG: TIME-ZONE +$cfg->setDefaultTimezone('Europe/Berlin'); + +// CFG: MAGIC-QUOTES-RUNTIME +// @DEPRECATED As PHP is deprecating this +$cfg->setMagicQuotesRuntime(FALSE); + +// CFG: CLASS-PREFIX +$cfg->setConfigEntry('class_prefix', 'class_'); + +// CFG: CLASS-SUFFIX +$cfg->setConfigEntry('class_suffix', '.php'); + +// CFG: RAW-TEMPLATE-EXTENSION +$cfg->setConfigEntry('raw_template_extension', '.tpl'); + +// CFG: CODE-TEMPLATE-EXTENSION +$cfg->setConfigEntry('code_template_extension', '.ctp'); + +// CFG: SELECTOR-PATH +$cfg->setConfigEntry('selector_path', 'selector'); + +// CFG: LAUNCH-METHOD +$cfg->setConfigEntry('entry_method', 'entryPoint'); + +// CFG: TEMPLATE-BASE-PATH +$cfg->setConfigEntry('tpl_base_path', 'templates/'); + +// CFG: LANGUAGE-BASE-PATH +$cfg->setConfigEntry('language_base_path', 'language/'); + +// CFG: COMPRESSOR-BASE-PATH +$cfg->setConfigEntry('compressor_base_path', 'main/classes/compressor/'); + +// CFG: APPLICATION-BASE-PATH +$cfg->setConfigEntry('application_base_path', FrameworkBootstrap::detectApplicationBasePath()); + +// CFG: COMPILE-OUTPUT-PATH +$cfg->setConfigEntry('compile_output_path', 'templates/_compiled/'); + +// CFG: HTML-TEMPLATE-CLASS +$cfg->setConfigEntry('html_template_class', 'CoreFramework\Template\Engine\HtmlTemplateEngine'); + +// CFG: DECO-XML-REWRITER-TEMPLATE-CLASS +$cfg->setConfigEntry('deco_xml_rewriter_template_class', 'CoreFramework\Template\Xml\XmlRewriterTemplateDecorator'); + +// CFG: DEBUG-HTML-CLASS +$cfg->setConfigEntry('debug_html_class', 'CoreFramework\Output\Debug\DebugWebOutput'); + +// CFG: DEBUG-CONSOLE-CLASS +$cfg->setConfigEntry('debug_console_class', 'CoreFramework\Debug\Output\DebugConsoleOutput'); + +// CFG: DEFAULT-LANGUAGE +$cfg->setConfigEntry('default_lang', 'de'); // A two-char language string: de for german, en for english and so on + +// CFG: HTML-TEMPLATE-TYPE +$cfg->setConfigEntry('html_template_type', 'html'); + +// CFG: EMAIL-TEMPLATE-TYPE +$cfg->setConfigEntry('email_template_type', 'emails'); + +// CFG: CODE-HTML-TEMPLATE-TYPE +$cfg->setConfigEntry('code_html_template_type', 'code'); + +// CFG: CODE-CONSOLE-TEMPLATE-TYPE +$cfg->setConfigEntry('code_console_template_type', 'xml'); + +// CFG: IMAGE-TEMPLATE-TYPE +$cfg->setConfigEntry('image_template_type', 'image'); + +// CFG: MENU-TEMPLATE-TYPE +$cfg->setConfigEntry('menu_template_type', 'menu'); + +// CFG: OUTPUT-CLASS +$cfg->setConfigEntry('output_class', 'CoreFramework\Output\WebOutput'); + +// CFG: LANGUAGE-SYSTEM-CLASS +$cfg->setConfigEntry('language_system_class', 'CoreFramework\Localization\LanguageSystem'); + +// CFG: SELECTOR-TEMPLATE-PREFIX +$cfg->setConfigEntry('tpl_selector_prefix', 'selector'); + +// CFG: WEB-CONTENT-TYPE +$cfg->setConfigEntry('web_content_type', 'text/html'); + +// CFG: VALID-TEMPLATE-VARIABLE +$cfg->setConfigEntry('tpl_valid_var', 'content'); + +// CFG: META-AUTHOR +$cfg->setConfigEntry('meta_author', 'Your-name-here'); + +// CFG: META-PUBLISHER +$cfg->setConfigEntry('meta_publisher', 'Your-name-here'); + +// CFG: META-KEYWORDS +$cfg->setConfigEntry('meta_keywords', 'test,test,test'); + +// CFG: META-DESCRIPTION +$cfg->setConfigEntry('meta_description', 'A description for your website'); + +// CFG: SELECTOR-MAIN-TEMPLATE +$cfg->setConfigEntry('selector_main_tpl', 'selector_main'); + +// CFG: SELECTOR-APPS-TEMPLATE +$cfg->setConfigEntry('selector_apps_tpl', 'selector_apps'); + +// CFG: SELECTOR-NAME +$cfg->setConfigEntry('selector_name', 'selector'); + +// CFG: DEFAULT-APPLICATION +$cfg->setConfigEntry('default_application', 'selector'); + +// CFG: VERBOSE-LEVEL +$cfg->setConfigEntry('verbose_level', 0); + +// CFG: CACHE-CLASS +$cfg->setConfigEntry('cache_class', 'CoreFramework\Cache\Memory\MemoryCache'); + +// CFG: SEARCH-CRITERIA-CLASS +$cfg->setConfigEntry('search_criteria_class', 'CoreFramework\Criteria\Search\SearchCriteria'); + +// CFG: DATASET-CRITERIA-CLASS +$cfg->setConfigEntry('dataset_criteria_class', 'CoreFramework\Criteria\DataSet\DataSetCriteria'); + +// CFG: UPDATE-CRITERIA-CLASS +$cfg->setConfigEntry('update_criteria_class', 'CoreFramework\Criteria\Update\UpdateCriteria'); + +// CFG: FILE-IO-CLASS +$cfg->setConfigEntry('file_io_class', 'CoreFramework\Handler\Filesystem\FileIoHandler'); + +// CFG: DATABASE-RESULT-CLASS +$cfg->setConfigEntry('database_result_class', 'CoreFramework\Result\Database\CachedDatabaseResult'); + +// CFG: FILTER-CHAIN-CLASS +$cfg->setConfigEntry('filter_chain_class', 'CoreFramework\Chain\Filter\FilterChain'); + +// CFG: FILE-INPUT-CLASS +$cfg->setConfigEntry('file_input_class', 'CoreFramework\Stream\Filesystem\FileIoStream'); + +// CFG: FILE-OUTPUT-CLASS +$cfg->setConfigEntry('file_output_class', 'CoreFramework\Stream\Filesystem\FileIoStream'); + +// CFG: EMAIL-VALIDATOR-FILTER-CLASS +$cfg->setConfigEntry('email_validator_filter_class', 'CoreFramework\Filter\Validator\Email\EmailValidatorFilter'); + +// CFG: USERNAME-VALIDATOR-FILTER-CLASS +$cfg->setConfigEntry('username_validator_filter_class', 'CoreFramework\Filter\Validator\Username\UserNameValidatorFilter'); + +// CFG: USERNAME-IS-GUEST-FILTER-CLASS +$cfg->setConfigEntry('username_is_guest_filter_class', 'CoreFramework\Filter\User\Username\UserNameIsGuestFilter'); + +// CFG: PASSWORD-VALIDATOR-FILTER-CLASS +$cfg->setConfigEntry('password_validator_filter_class', 'CoreFramework\Filter\Validator\Password\PasswordValidatorFilter'); + +// CFG: RULES-ACCEPTED-FILTER-CLASS +$cfg->setConfigEntry('rules_accepted_filter_class', 'CoreFramework\Filter\RulesCheckbox\RulesAcceptedFilter'); + +// CFG: USERNAME-VERIFIER-FILTER-CLASS +$cfg->setConfigEntry('username_verifier_filter_class', 'CoreFramework\Filter\Verifier\User\UserNameVerifierFilter'); + +// CFG: USER-GUEST-VERIFIER-FILTER-CLASS +$cfg->setConfigEntry('user_guest_verifier_filter_class', 'CoreFramework\Filter\Verifier\User\UserGuestVerifierFilter'); + +// CFG: EMAIL-VERIFIER-FILTER-CLASS +$cfg->setConfigEntry('email_verifier_filter_class', 'CoreFramework\Filter\Verifier\Email\EmailVerifierFilter'); + +// CFG: PASSWORD-VERIFIER-FILTER-CLASS +$cfg->setConfigEntry('password_verifier_filter_class', 'CoreFramework\Filter\Verifier\Password\PasswordVerifierFilter'); + +// CFG: PASSWD-GUEST-VERIFIER-FILTER-CLASS +$cfg->setConfigEntry('passwd_guest_verifier_filter_class', 'CoreFramework\Filter\Verifier\User\PasswordGuestVerifierFilter'); + +// CFG: EMAIL-CHANGE-FILTER-CLASS +$cfg->setConfigEntry('email_change_filter_class', 'CoreFramework\Filter\Change\Email\EmailChangeFilter'); + +// CFG: PASSWORD-CHANGE-FILTER-CLASS +$cfg->setConfigEntry('password_change_filter_class', 'CoreFramework\Filter\Change\Password\PasswordChangeFilter'); + +// CFG: ACCOUNT-PASSWORD-FILTER-CLASS +$cfg->setConfigEntry('account_password_filter_class', 'CoreFramework\Filter\Verifier\Password\AccountPasswordVerifierFilter'); + +// CFG: USER-STATUS-FILTER-CLASS +$cfg->setConfigEntry('user_status_filter_class', 'CoreFramework\Filter\Verifier\User\UserStatusVerifierFilter'); + +// CFG: USER-UNCONFIRMED-FILTER-CLASS +$cfg->setConfigEntry('user_unconfirmed_filter_class', 'CoreFramework\Filter\Verifier\User\UserUnconfirmedVerifierFilter'); + +// CFG: CRYPTO-CLASS +$cfg->setConfigEntry('crypto_class', 'CoreFramework\Helper\Crypto\CryptoHelper'); + +// CFG: RNG-CLASS +$cfg->setConfigEntry('rng_class', 'CoreFramework\Crypto\RandomNumber\RandomNumberGenerator'); + +// CFG: USER-DB-WRAPPER-CLASS +$cfg->setConfigEntry('user_db_wrapper_class', 'CoreFramework\Wrapper\Database\User\UserDatabaseWrapper'); + +// CFG: NEWS-DB-WRAPPER-CLASS +$cfg->setConfigEntry('news_db_wrapper_class', 'CoreFramework\Wrapper\Database\News\NewsDatabaseWrapper'); + +// CFG: HTML-CMD-RESOLVER-CLASS +$cfg->setConfigEntry('html_cmd_resolver_class', 'CoreFramework\Resolver\Command\HtmlCommandResolver'); + +// CFG: HTML-CMD-LOGIN-RESOLVER-CLASS +$cfg->setConfigEntry('html_cmd_login_resolver_class', 'CoreFramework\Resolver\Command\HtmlCommandResolver'); + +// CFG: IMAGE-CMD-RESOLVER-CLASS +$cfg->setConfigEntry('image_cmd_resolver_class', 'CoreFramework\Resolver\Command\ImageCommandResolver'); + +// CFG: IMAGE-CMD-CODE-CAPTCHA-RESOLVER-CLASS +$cfg->setConfigEntry('image_cmd_code_captcha_resolver_class', 'CoreFramework\Resolver\Command\ImageCommandResolver'); + +// CFG: MAILER-CLASS +$cfg->setConfigEntry('mailer_class', 'CoreFramework\Mailer\Debug\DebugMailer'); + +// CFG: XML-PARSER-CLASS +$cfg->setConfigEntry('xml_parser_class', 'CoreFramework\Parser\Xml\XmlParser'); + +// CFG: DECO-COMPACTING-XML-PARSER-CLASS +$cfg->setConfigEntry('deco_compacting_xml_parser_class', 'CoreFramework\Parser\Xml\XmlCompactorDecorator'); + +// CFG: MATH-PRIME +$cfg->setConfigEntry('math_prime', 591623); + +// CFG: DATE-KEY +$cfg->setConfigEntry('date_key', date('d-m-Y (l-F-T)', time())); + +// CFG: SALT-LENGTH +$cfg->setConfigEntry('salt_length', 10); + +// CFG: RND-STR-LENGTH +$cfg->setConfigEntry('rnd_str_length', 128); + +// CFG: HASH-EXTRA-MASK +$cfg->setConfigEntry('hash_extra_mask', '%1s:%2s:%3s'); // 1=salt, 2=extra salt, 3=plain password/string + +// CFG: HASH-NORMAL-MASK +$cfg->setConfigEntry('hash_normal_mask', '%1s:%2s'); // 1=salt, 2=plain password/string + +// CFG: IS-SINGLE-SERVER +$cfg->setConfigEntry('is_single_server', 'Y'); + +// CFG: POST-REGISTRATION-CLASS +$cfg->setConfigEntry('post_registration_class', 'CoreFramework\Action\PostRegistration\Login\LoginAfterRegistrationAction'); + +// CFG: USER-CLASS +$cfg->setConfigEntry('user_class', 'CoreFramework\User\Login\Member'); + +// CFG: GUEST-CLASS +$cfg->setConfigEntry('guest_class', 'CoreFramework\User\Guest\Guest'); + +// CFG: COOKIE-EXPIRE +$cfg->setConfigEntry('cookie_expire', (60*60*2)); // Two hours! + +// CFG: COOKIE-PATH +$cfg->setConfigEntry('cookie_path', $cfg->detectScriptPath() . '/'); + +// CFG: COOKIE-DOMAIN +$cfg->setConfigEntry('cookie_domain', $cfg->detectDomain()); // Is mostly the same... + +// CFG: COOKIE-SSL +$cfg->setConfigEntry('cookie_ssl', $cfg->isHttpSecured()); + +// CFG: CRYPT-FIXED-SALT +$cfg->setConfigEntry('crypt_fixed_salt', 'N'); + +// CFG: DB-UPDATE-PRIMARY-FORCED +$cfg->setConfigEntry('db_update_primary_forced', 'Y'); + +// CFG: GERMAN-DATE-TIME +$cfg->setConfigEntry('german_date_time', "%3\$s.%2\$s.%1\$s, %4\$s:%5\$s:%6\$s"); + +// CFG: PRODUCT-INSTALL-MODE +$cfg->setConfigEntry('product_install_mode', 'debug'); + +// CFG: DECIMALS +$cfg->setConfigEntry('decimals', 3); + +// CFG: MENU-STACKER-CLASS +$cfg->setConfigEntry('menu_stacker_class', 'CoreFramework\Stacker\File\FiLoStacker'); + +// CFG: STACKER-GENERIC-MAX-SIZE +$cfg->setConfigEntry('stacker_generic_max_size', 100); + +// CFG: STACKER-CURRENT-NODE-MAX-SIZE +$cfg->setConfigEntry('stacker_current_node_max_size', 20); + +// CFG: LOCAL-FILE-DATABASE-CLASS +$cfg->setConfigEntry('local_file_database_class', 'CoreFramework\Database\Backend\Lfdb\CachedLocalFileDatabase'); + +// CFG: COMPRESSOR-CHANNEL-CLASS +$cfg->setConfigEntry('compressor_channel_class', 'CoreFramework\Middleware\Compressor\CompressorChannel'); + +// CFG: DEBUG-HTML-OUTPUT-TIMINGS +$cfg->setConfigEntry('debug_html_output_timings', 'N'); + +// CFG: DEBUG-CONSOLE-OUTPUT-TIMINGS +$cfg->setConfigEntry('debug_console_output_timings', 'Y'); + +// CFG: PROXY-HOST +$cfg->setConfigEntry('proxy_host', ''); + +// CFG: PROXY-PORT +$cfg->setConfigEntry('proxy_port', ''); + +// CFG: PROXY-USERNAME +$cfg->setConfigEntry('proxy_username', ''); + +// CFG: PROXY-PASSWORD +$cfg->setConfigEntry('proxy_password', ''); + +// CFG: PROXY-CONNECT-METHOD +$cfg->setConfigEntry('proxy_connect_method', 'Y'); + +// CFG: HOSTNAME-FILE +$cfg->setConfigEntry('hostname_file', '/etc/hostname'); + +// CFG: DATABASE-CACHE-ENABLED +$cfg->setConfigEntry('database_cache_enabled', FALSE); + +// CFG: DIRECTORY-CLASS +$cfg->setConfigEntry('directory_class', 'CoreFramework\Filesytem\Pointer\FrameworkDirectoryPointer'); + +// CFG: FILE-RAW-INPUT-CLASS +$cfg->setConfigEntry('file_raw_input_class', 'CoreFramework\Filesystem\Pointer\Input\FrameworkRawFileInputPointer'); + +// CFG: FILE-RAW-OUTPUT-CLASS +$cfg->setConfigEntry('file_raw_output_class', 'CoreFramework\Filesystem\Pointer\Output\FrameworkRawFileOutputPointer'); + +// CFG: FILE-RAW-INPUT-OUTPUT-CLASS +$cfg->setConfigEntry('file_raw_input_output_class', 'CoreFramework\Filesystem\Pointer\FrameworkFileInputOutputPointer'); + +// CFG: TEXT-FILE-INPUT-CLASS +$cfg->setConfigEntry('text_file_input_class', 'CoreFramework\Filesystem\Pointer\Input\FrameworkTextFileInputPointer'); + +// CFG: CSV-INPUT-FILE-CLASS +$cfg->setConfigEntry('csv_input_file_class', 'CoreFramework\Filesystem\Input\Csv\CsvInputFile'); + +// CFG: FILE-ITERATOR-CLASS +$cfg->setConfigEntry('file_iterator_class', 'CoreFramework\Iterator\File\FileIterator'); + +// CFG: FILE-STACK-PRE-ALLOCATE-ENABLED +$cfg->setConfigEntry('file_stack_pre_allocate_enabled', 'Y'); + +// CFG: FILE-STACK-PRE-ALLOCATE-COUNT +$cfg->setConfigEntry('file_stack_pre_allocate_count', 10000); + +// CFG: INDEX-INDEX-CLASS +$cfg->setConfigEntry('file_stack_index_class', 'CoreFramework\Index\Stack\FileStackIndex'); + +// CFG: INDEX-PRE-ALLOCATE-ENABLED +$cfg->setConfigEntry('index_pre_allocate_enabled', 'Y'); + +// CFG: INDEX-PRE-ALLOCATE-COUNT +$cfg->setConfigEntry('index_pre_allocate_count', 10000); + +// CFG: STACK-FILE-CLASS +$cfg->setConfigEntry('stack_file_class', 'CoreFramework\Filesystem\Stack\StackFile'); + +// CFG: INDEX-FILE-CLASS +$cfg->setConfigEntry('index_file_class', 'CoreFramework\Filesystem\Index\IndexFile'); + +// CFG: TASK-HANDLER-CLASS +$cfg->setConfigEntry('task_handler_class', 'CoreFramework\Handler\Task\TaskHandler'); + +// CFG: TASK-LIST-CLASS +$cfg->setConfigEntry('task_list_class', 'CoreFramework\Lists\Task\TaskList'); + +// CFG: LIST-GROUP-CLASS +$cfg->setConfigEntry('list_group_class', 'CoreFramework\Lists\Group\ListGroupList'); + +// CFG: DEFAULT-ITERATOR-CLASS +$cfg->setConfigEntry('default_iterator_class', 'CoreFramework\Iterator\DefaultIterator'); + +// CFG: ACTIVE-TASK-VISITOR-CLASS +$cfg->setConfigEntry('active_task_visitor_class', 'CoreFramework\Visitor\Task\Active\ActiveTaskVisitor'); + +// CFG: IDLE-TASK-CLASS +$cfg->setConfigEntry('idle_task_class', 'CoreFramework\Task\IdleLoop\IdleLoopTask'); + +// CFG: TASK-IDLE-LOOP-STARTUP-DELAY +$cfg->setConfigEntry('task_idle_loop_startup_delay', 0); + +// CFG: TASK-IDLE-LOOP-INTERVAL-DELAY +$cfg->setConfigEntry('task_idle_loop_interval_delay', 0); + +// CFG: TASK-IDLE-LOOP-MAX-RUNS +$cfg->setConfigEntry('task_idle_loop_max_runs', 0); + +// CFG: IDLE-LOOP-TIME (5 milli seconds) +$cfg->setConfigEntry('idle_loop_time', 5); + +// CFG: SHUTDOWN-TASK-VISITOR-CLASS +$cfg->setConfigEntry('shutdown_task_visitor_class', 'CoreFramework\Visitor\Task\Shutdown\ShutdownTaskVisitor'); + +// CFG: DEFAULT-IMAGE-COMMAND +$cfg->setConfigEntry('default_image_command', 'build'); + +// CFG: DEFAULT-IMAGE-CONTROLLER +$cfg->setConfigEntry('default_image_controller', 'build'); + +// CFG: MENU-TEMPLATE-CLASS +$cfg->setConfigEntry('menu_template_class', 'CoreFramework\Template\Engine\MenuTemplateEngine'); + +// CFG: MENU-TEMPLATE-EXTENSION +$cfg->setConfigEntry('menu_template_extension', '.xml'); + +// CFG: FEATURE-FUSE-CLASS +$cfg->setConfigEntry('feature_fuse_class', 'CoreFramework\Feature\Fuse\FuseFeature'); + +// CFG: TEMP-FILE-PATH +$cfg->setConfigEntry('temp_file_path', sys_get_temp_dir()); + +// CFG: IPC-SOCKET-FILE-NAME +$cfg->setConfigEntry('ipc_socket_file_name', 'php_ipc_socket'); + +// CFG: EXTENSION-SCRYPT-LOADED (By default scrypt is assumed absent and later tested being there) +$cfg->setConfigEntry('extension_scrypt_loaded', FALSE); + +// CFG: EXTENSION-UUID-LOADED (By default uuid is assumed absent and later tested being there) +$cfg->setConfigEntry('extension_uuid_loaded', FALSE); + +// Remove config from this name-space. Don't worry, no configuration is cleared. +unset($cfg); diff --git a/framework/config.php b/framework/config.php deleted file mode 100644 index 28803fef..00000000 --- a/framework/config.php +++ /dev/null @@ -1,476 +0,0 @@ - - * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2017 Core Developer Team - * @license GNU GPL 3.0 or any newer version - * @link http://www.shipsimu.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 . - */ - -// Load very basic classes, required to bootstrap -require(ApplicationEntryPoint::detectCorePath() . '/framework/main/interfaces/class_FrameworkInterface.php'); -require(ApplicationEntryPoint::detectCorePath() . '/framework/main/interfaces/registry/class_Registerable.php'); -require(ApplicationEntryPoint::detectCorePath() . '/framework/config/class_FrameworkConfiguration.php'); - -// Get a new configuration instance -$cfg = FrameworkConfiguration::getSelfInstance(); - -// CFG: SERVER-PATH -$cfg->setConfigEntry('base_path', ApplicationEntryPoint::detectCorePath() . '/'); - -// CFG: BASE-URL -$cfg->setConfigEntry('base_url', $cfg->detectBaseUrl()); - -// CFG: DATABASE-TYPE -$cfg->setConfigEntry('db_type', 'lfdb'); - -// CFG: LOCAL-DB-PATH -$cfg->setConfigEntry('local_db_path', $cfg->getConfigEntry('base_path') . 'db/'); - -// CFG: TIME-ZONE -$cfg->setDefaultTimezone('Europe/Berlin'); - -// CFG: MAGIC-QUOTES-RUNTIME -// @DEPRECATED As PHP is deprecating this -$cfg->setMagicQuotesRuntime(FALSE); - -// CFG: CLASS-PREFIX -$cfg->setConfigEntry('class_prefix', 'class_'); - -// CFG: CLASS-SUFFIX -$cfg->setConfigEntry('class_suffix', '.php'); - -// CFG: RAW-TEMPLATE-EXTENSION -$cfg->setConfigEntry('raw_template_extension', '.tpl'); - -// CFG: CODE-TEMPLATE-EXTENSION -$cfg->setConfigEntry('code_template_extension', '.ctp'); - -// CFG: SELECTOR-PATH -$cfg->setConfigEntry('selector_path', 'selector'); - -// CFG: LAUNCH-METHOD -$cfg->setConfigEntry('entry_method', 'entryPoint'); - -// CFG: TEMPLATE-BASE-PATH -$cfg->setConfigEntry('tpl_base_path', 'templates/'); - -// CFG: LANGUAGE-BASE-PATH -$cfg->setConfigEntry('lang_base_path', 'framework/language/'); - -// CFG: COMPRESSOR-BASE-PATH -$cfg->setConfigEntry('compressor_base_path', 'framework/main/classes/compressor/'); - -// CFG: APPLICATION-BASE-PATH -$cfg->setConfigEntry('application_base_path', 'application/'); - -// CFG: APPLICATION-PATH -$cfg->setConfigEntry('application_path', $cfg->getConfigEntry('base_path') . $cfg->getConfigEntry('application_base_path')); - -// CFG: COMPILE-OUTPUT-PATH -$cfg->setConfigEntry('compile_output_path', 'templates/_compiled/'); - -// CFG: HTML-TEMPLATE-CLASS -$cfg->setConfigEntry('html_template_class', 'CoreFramework\Template\Engine\HtmlTemplateEngine'); - -// CFG: DECO-XML-REWRITER-TEMPLATE-CLASS -$cfg->setConfigEntry('deco_xml_rewriter_template_class', 'CoreFramework\Template\Xml\XmlRewriterTemplateDecorator'); - -// CFG: DEBUG-HTML-CLASS -$cfg->setConfigEntry('debug_html_class', 'CoreFramework\Output\Debug\DebugWebOutput'); - -// CFG: DEBUG-CONSOLE-CLASS -$cfg->setConfigEntry('debug_console_class', 'CoreFramework\Debug\Output\DebugConsoleOutput'); - -// CFG: DEFAULT-LANGUAGE -$cfg->setConfigEntry('default_lang', 'de'); // A two-char language string: de for german, en for english and so on - -// CFG: HTML-TEMPLATE-TYPE -$cfg->setConfigEntry('html_template_type', 'html'); - -// CFG: EMAIL-TEMPLATE-TYPE -$cfg->setConfigEntry('email_template_type', 'emails'); - -// CFG: CODE-HTML-TEMPLATE-TYPE -$cfg->setConfigEntry('code_html_template_type', 'code'); - -// CFG: CODE-CONSOLE-TEMPLATE-TYPE -$cfg->setConfigEntry('code_console_template_type', 'xml'); - -// CFG: IMAGE-TEMPLATE-TYPE -$cfg->setConfigEntry('image_template_type', 'image'); - -// CFG: MENU-TEMPLATE-TYPE -$cfg->setConfigEntry('menu_template_type', 'menu'); - -// CFG: OUTPUT-CLASS -$cfg->setConfigEntry('output_class', 'CoreFramework\Output\WebOutput'); - -// CFG: LANGUAGE-SYSTEM-CLASS -$cfg->setConfigEntry('language_system_class', 'CoreFramework\Localization\LanguageSystem'); - -// CFG: SELECTOR-TEMPLATE-PREFIX -$cfg->setConfigEntry('tpl_selector_prefix', 'selector'); - -// CFG: WEB-CONTENT-TYPE -$cfg->setConfigEntry('web_content_type', 'text/html'); - -// CFG: VALID-TEMPLATE-VARIABLE -$cfg->setConfigEntry('tpl_valid_var', 'content'); - -// CFG: META-AUTHOR -$cfg->setConfigEntry('meta_author', 'Your-name-here'); - -// CFG: META-PUBLISHER -$cfg->setConfigEntry('meta_publisher', 'Your-name-here'); - -// CFG: META-KEYWORDS -$cfg->setConfigEntry('meta_keywords', 'test,test,test'); - -// CFG: META-DESCRIPTION -$cfg->setConfigEntry('meta_description', 'A description for your website'); - -// CFG: SELECTOR-MAIN-TEMPLATE -$cfg->setConfigEntry('selector_main_tpl', 'selector_main'); - -// CFG: SELECTOR-APPS-TEMPLATE -$cfg->setConfigEntry('selector_apps_tpl', 'selector_apps'); - -// CFG: SELECTOR-NAME -$cfg->setConfigEntry('selector_name', 'selector'); - -// CFG: DEFAULT-APPLICATION -$cfg->setConfigEntry('default_application', 'selector'); - -// CFG: VERBOSE-LEVEL -$cfg->setConfigEntry('verbose_level', 0); - -// CFG: CACHE-CLASS -$cfg->setConfigEntry('cache_class', 'CoreFramework\Cache\Memory\MemoryCache'); - -// CFG: SEARCH-CRITERIA-CLASS -$cfg->setConfigEntry('search_criteria_class', 'CoreFramework\Criteria\Search\SearchCriteria'); - -// CFG: DATASET-CRITERIA-CLASS -$cfg->setConfigEntry('dataset_criteria_class', 'CoreFramework\Criteria\DataSet\DataSetCriteria'); - -// CFG: UPDATE-CRITERIA-CLASS -$cfg->setConfigEntry('update_criteria_class', 'CoreFramework\Criteria\Update\UpdateCriteria'); - -// CFG: FILE-IO-CLASS -$cfg->setConfigEntry('file_io_class', 'CoreFramework\Handler\Filesystem\FileIoHandler'); - -// CFG: DATABASE-RESULT-CLASS -$cfg->setConfigEntry('database_result_class', 'CoreFramework\Result\Database\CachedDatabaseResult'); - -// CFG: FILTER-CHAIN-CLASS -$cfg->setConfigEntry('filter_chain_class', 'CoreFramework\Chain\Filter\FilterChain'); - -// CFG: FILE-INPUT-CLASS -$cfg->setConfigEntry('file_input_class', 'CoreFramework\Stream\Filesystem\FileIoStream'); - -// CFG: FILE-OUTPUT-CLASS -$cfg->setConfigEntry('file_output_class', 'CoreFramework\Stream\Filesystem\FileIoStream'); - -// CFG: EMAIL-VALIDATOR-FILTER-CLASS -$cfg->setConfigEntry('email_validator_filter_class', 'CoreFramework\Filter\Validator\Email\EmailValidatorFilter'); - -// CFG: USERNAME-VALIDATOR-FILTER-CLASS -$cfg->setConfigEntry('username_validator_filter_class', 'CoreFramework\Filter\Validator\Username\UserNameValidatorFilter'); - -// CFG: USERNAME-IS-GUEST-FILTER-CLASS -$cfg->setConfigEntry('username_is_guest_filter_class', 'CoreFramework\Filter\User\Username\UserNameIsGuestFilter'); - -// CFG: PASSWORD-VALIDATOR-FILTER-CLASS -$cfg->setConfigEntry('password_validator_filter_class', 'CoreFramework\Filter\Validator\Password\PasswordValidatorFilter'); - -// CFG: RULES-ACCEPTED-FILTER-CLASS -$cfg->setConfigEntry('rules_accepted_filter_class', 'CoreFramework\Filter\RulesCheckbox\RulesAcceptedFilter'); - -// CFG: USERNAME-VERIFIER-FILTER-CLASS -$cfg->setConfigEntry('username_verifier_filter_class', 'CoreFramework\Filter\Verifier\User\UserNameVerifierFilter'); - -// CFG: USER-GUEST-VERIFIER-FILTER-CLASS -$cfg->setConfigEntry('user_guest_verifier_filter_class', 'CoreFramework\Filter\Verifier\User\UserGuestVerifierFilter'); - -// CFG: EMAIL-VERIFIER-FILTER-CLASS -$cfg->setConfigEntry('email_verifier_filter_class', 'CoreFramework\Filter\Verifier\Email\EmailVerifierFilter'); - -// CFG: PASSWORD-VERIFIER-FILTER-CLASS -$cfg->setConfigEntry('password_verifier_filter_class', 'CoreFramework\Filter\Verifier\Password\PasswordVerifierFilter'); - -// CFG: PASSWD-GUEST-VERIFIER-FILTER-CLASS -$cfg->setConfigEntry('passwd_guest_verifier_filter_class', 'CoreFramework\Filter\Verifier\User\PasswordGuestVerifierFilter'); - -// CFG: EMAIL-CHANGE-FILTER-CLASS -$cfg->setConfigEntry('email_change_filter_class', 'CoreFramework\Filter\Change\Email\EmailChangeFilter'); - -// CFG: PASSWORD-CHANGE-FILTER-CLASS -$cfg->setConfigEntry('password_change_filter_class', 'CoreFramework\Filter\Change\Password\PasswordChangeFilter'); - -// CFG: ACCOUNT-PASSWORD-FILTER-CLASS -$cfg->setConfigEntry('account_password_filter_class', 'CoreFramework\Filter\Verifier\Password\AccountPasswordVerifierFilter'); - -// CFG: USER-STATUS-FILTER-CLASS -$cfg->setConfigEntry('user_status_filter_class', 'CoreFramework\Filter\Verifier\User\UserStatusVerifierFilter'); - -// CFG: USER-UNCONFIRMED-FILTER-CLASS -$cfg->setConfigEntry('user_unconfirmed_filter_class', 'CoreFramework\Filter\Verifier\User\UserUnconfirmedVerifierFilter'); - -// CFG: CRYPTO-CLASS -$cfg->setConfigEntry('crypto_class', 'CoreFramework\Helper\Crypto\CryptoHelper'); - -// CFG: RNG-CLASS -$cfg->setConfigEntry('rng_class', 'CoreFramework\Crypto\RandomNumber\RandomNumberGenerator'); - -// CFG: USER-DB-WRAPPER-CLASS -$cfg->setConfigEntry('user_db_wrapper_class', 'CoreFramework\Wrapper\Database\User\UserDatabaseWrapper'); - -// CFG: NEWS-DB-WRAPPER-CLASS -$cfg->setConfigEntry('news_db_wrapper_class', 'CoreFramework\Wrapper\Database\News\NewsDatabaseWrapper'); - -// CFG: HTML-CMD-RESOLVER-CLASS -$cfg->setConfigEntry('html_cmd_resolver_class', 'CoreFramework\Resolver\Command\HtmlCommandResolver'); - -// CFG: HTML-CMD-LOGIN-RESOLVER-CLASS -$cfg->setConfigEntry('html_cmd_login_resolver_class', 'CoreFramework\Resolver\Command\HtmlCommandResolver'); - -// CFG: IMAGE-CMD-RESOLVER-CLASS -$cfg->setConfigEntry('image_cmd_resolver_class', 'CoreFramework\Resolver\Command\ImageCommandResolver'); - -// CFG: IMAGE-CMD-CODE-CAPTCHA-RESOLVER-CLASS -$cfg->setConfigEntry('image_cmd_code_captcha_resolver_class', 'CoreFramework\Resolver\Command\ImageCommandResolver'); - -// CFG: MAILER-CLASS -$cfg->setConfigEntry('mailer_class', 'CoreFramework\Mailer\Debug\DebugMailer'); - -// CFG: XML-PARSER-CLASS -$cfg->setConfigEntry('xml_parser_class', 'CoreFramework\Parser\Xml\XmlParser'); - -// CFG: DECO-COMPACTING-XML-PARSER-CLASS -$cfg->setConfigEntry('deco_compacting_xml_parser_class', 'CoreFramework\Parser\Xml\XmlCompactorDecorator'); - -// CFG: MATH-PRIME -$cfg->setConfigEntry('math_prime', 591623); - -// CFG: DATE-KEY -$cfg->setConfigEntry('date_key', date('d-m-Y (l-F-T)', time())); - -// CFG: SALT-LENGTH -$cfg->setConfigEntry('salt_length', 10); - -// CFG: RND-STR-LENGTH -$cfg->setConfigEntry('rnd_str_length', 128); - -// CFG: HASH-EXTRA-MASK -$cfg->setConfigEntry('hash_extra_mask', '%1s:%2s:%3s'); // 1=salt, 2=extra salt, 3=plain password/string - -// CFG: HASH-NORMAL-MASK -$cfg->setConfigEntry('hash_normal_mask', '%1s:%2s'); // 1=salt, 2=plain password/string - -// CFG: IS-SINGLE-SERVER -$cfg->setConfigEntry('is_single_server', 'Y'); - -// CFG: POST-REGISTRATION-CLASS -$cfg->setConfigEntry('post_registration_class', 'CoreFramework\Action\PostRegistration\Login\LoginAfterRegistrationAction'); - -// CFG: USER-CLASS -$cfg->setConfigEntry('user_class', 'CoreFramework\User\Login\Member'); - -// CFG: GUEST-CLASS -$cfg->setConfigEntry('guest_class', 'CoreFramework\User\Guest\Guest'); - -// CFG: COOKIE-EXPIRE -$cfg->setConfigEntry('cookie_expire', (60*60*2)); // Two hours! - -// CFG: COOKIE-PATH -$cfg->setConfigEntry('cookie_path', $cfg->detectScriptPath() . '/'); - -// CFG: COOKIE-DOMAIN -$cfg->setConfigEntry('cookie_domain', $cfg->detectDomain()); // Is mostly the same... - -// CFG: COOKIE-SSL -$cfg->setConfigEntry('cookie_ssl', $cfg->isHttpSecured()); - -// CFG: CRYPT-FIXED-SALT -$cfg->setConfigEntry('crypt_fixed_salt', 'N'); - -// CFG: DB-UPDATE-PRIMARY-FORCED -$cfg->setConfigEntry('db_update_primary_forced', 'Y'); - -// CFG: GERMAN-DATE-TIME -$cfg->setConfigEntry('german_date_time', "%3\$s.%2\$s.%1\$s, %4\$s:%5\$s:%6\$s"); - -// CFG: PRODUCT-INSTALL-MODE -$cfg->setConfigEntry('product_install_mode', 'debug'); - -// CFG: DECIMALS -$cfg->setConfigEntry('decimals', 3); - -// CFG: MENU-STACKER-CLASS -$cfg->setConfigEntry('menu_stacker_class', 'CoreFramework\Stacker\File\FiLoStacker'); - -// CFG: STACKER-GENERIC-MAX-SIZE -$cfg->setConfigEntry('stacker_generic_max_size', 100); - -// CFG: STACKER-CURRENT-NODE-MAX-SIZE -$cfg->setConfigEntry('stacker_current_node_max_size', 20); - -// CFG: LOCAL-FILE-DATABASE-CLASS -$cfg->setConfigEntry('local_file_database_class', 'CoreFramework\Database\Backend\Lfdb\CachedLocalFileDatabase'); - -// CFG: COMPRESSOR-CHANNEL-CLASS -$cfg->setConfigEntry('compressor_channel_class', 'CoreFramework\Middleware\Compressor\CompressorChannel'); - -// CFG: DEBUG-HTML-OUTPUT-TIMINGS -$cfg->setConfigEntry('debug_html_output_timings', 'N'); - -// CFG: DEBUG-CONSOLE-OUTPUT-TIMINGS -$cfg->setConfigEntry('debug_console_output_timings', 'Y'); - -// CFG: PROXY-HOST -$cfg->setConfigEntry('proxy_host', ''); - -// CFG: PROXY-PORT -$cfg->setConfigEntry('proxy_port', ''); - -// CFG: PROXY-USERNAME -$cfg->setConfigEntry('proxy_username', ''); - -// CFG: PROXY-PASSWORD -$cfg->setConfigEntry('proxy_password', ''); - -// CFG: PROXY-CONNECT-METHOD -$cfg->setConfigEntry('proxy_connect_method', 'Y'); - -// CFG: HOSTNAME-FILE -$cfg->setConfigEntry('hostname_file', '/etc/hostname'); - -// CFG: DATABASE-CACHE-ENABLED -$cfg->setConfigEntry('database_cache_enabled', FALSE); - -// CFG: DIRECTORY-CLASS -$cfg->setConfigEntry('directory_class', 'CoreFramework\Filesytem\Pointer\FrameworkDirectoryPointer'); - -// CFG: FILE-RAW-INPUT-CLASS -$cfg->setConfigEntry('file_raw_input_class', 'CoreFramework\Filesystem\Pointer\Input\FrameworkRawFileInputPointer'); - -// CFG: FILE-RAW-OUTPUT-CLASS -$cfg->setConfigEntry('file_raw_output_class', 'CoreFramework\Filesystem\Pointer\Output\FrameworkRawFileOutputPointer'); - -// CFG: FILE-RAW-INPUT-OUTPUT-CLASS -$cfg->setConfigEntry('file_raw_input_output_class', 'CoreFramework\Filesystem\Pointer\FrameworkFileInputOutputPointer'); - -// CFG: TEXT-FILE-INPUT-CLASS -$cfg->setConfigEntry('text_file_input_class', 'CoreFramework\Filesystem\Pointer\Input\FrameworkTextFileInputPointer'); - -// CFG: CSV-INPUT-FILE-CLASS -$cfg->setConfigEntry('csv_input_file_class', 'CoreFramework\Filesystem\Input\Csv\CsvInputFile'); - -// CFG: FILE-ITERATOR-CLASS -$cfg->setConfigEntry('file_iterator_class', 'CoreFramework\Iterator\File\FileIterator'); - -// CFG: FILE-STACK-PRE-ALLOCATE-ENABLED -$cfg->setConfigEntry('file_stack_pre_allocate_enabled', 'Y'); - -// CFG: FILE-STACK-PRE-ALLOCATE-COUNT -$cfg->setConfigEntry('file_stack_pre_allocate_count', 10000); - -// CFG: INDEX-INDEX-CLASS -$cfg->setConfigEntry('file_stack_index_class', 'CoreFramework\Index\Stack\FileStackIndex'); - -// CFG: INDEX-PRE-ALLOCATE-ENABLED -$cfg->setConfigEntry('index_pre_allocate_enabled', 'Y'); - -// CFG: INDEX-PRE-ALLOCATE-COUNT -$cfg->setConfigEntry('index_pre_allocate_count', 10000); - -// CFG: STACK-FILE-CLASS -$cfg->setConfigEntry('stack_file_class', 'CoreFramework\Filesystem\Stack\StackFile'); - -// CFG: INDEX-FILE-CLASS -$cfg->setConfigEntry('index_file_class', 'CoreFramework\Filesystem\Index\IndexFile'); - -// CFG: TASK-HANDLER-CLASS -$cfg->setConfigEntry('task_handler_class', 'CoreFramework\Handler\Task\TaskHandler'); - -// CFG: TASK-LIST-CLASS -$cfg->setConfigEntry('task_list_class', 'CoreFramework\Lists\Task\TaskList'); - -// CFG: LIST-GROUP-CLASS -$cfg->setConfigEntry('list_group_class', 'CoreFramework\Lists\Group\ListGroupList'); - -// CFG: DEFAULT-ITERATOR-CLASS -$cfg->setConfigEntry('default_iterator_class', 'CoreFramework\Iterator\DefaultIterator'); - -// CFG: ACTIVE-TASK-VISITOR-CLASS -$cfg->setConfigEntry('active_task_visitor_class', 'CoreFramework\Visitor\Task\Active\ActiveTaskVisitor'); - -// CFG: IDLE-TASK-CLASS -$cfg->setConfigEntry('idle_task_class', 'CoreFramework\Task\IdleLoop\IdleLoopTask'); - -// CFG: TASK-IDLE-LOOP-STARTUP-DELAY -$cfg->setConfigEntry('task_idle_loop_startup_delay', 0); - -// CFG: TASK-IDLE-LOOP-INTERVAL-DELAY -$cfg->setConfigEntry('task_idle_loop_interval_delay', 0); - -// CFG: TASK-IDLE-LOOP-MAX-RUNS -$cfg->setConfigEntry('task_idle_loop_max_runs', 0); - -// CFG: IDLE-LOOP-TIME (5 milli seconds) -$cfg->setConfigEntry('idle_loop_time', 5); - -// CFG: SHUTDOWN-TASK-VISITOR-CLASS -$cfg->setConfigEntry('shutdown_task_visitor_class', 'CoreFramework\Visitor\Task\Shutdown\ShutdownTaskVisitor'); - -// CFG: DEFAULT-IMAGE-COMMAND -$cfg->setConfigEntry('default_image_command', 'build'); - -// CFG: DEFAULT-IMAGE-CONTROLLER -$cfg->setConfigEntry('default_image_controller', 'build'); - -// CFG: MENU-TEMPLATE-CLASS -$cfg->setConfigEntry('menu_template_class', 'CoreFramework\Template\Engine\MenuTemplateEngine'); - -// CFG: MENU-TEMPLATE-EXTENSION -$cfg->setConfigEntry('menu_template_extension', '.xml'); - -// CFG: FEATURE-FUSE-CLASS -$cfg->setConfigEntry('feature_fuse_class', 'CoreFramework\Feature\Fuse\FuseFeature'); - -// CFG: TEMP-FILE-PATH -$cfg->setConfigEntry('temp_file_path', sys_get_temp_dir()); - -// CFG: IPC-SOCKET-FILE-NAME -$cfg->setConfigEntry('ipc_socket_file_name', 'php_ipc_socket'); - -// CFG: EXTENSION-SCRYPT-LOADED (By default scrypt is assumed absent and later tested being there) -$cfg->setConfigEntry('extension_scrypt_loaded', FALSE); - -// CFG: EXTENSION-UUID-LOADED (By default uuid is assumed absent and later tested being there) -$cfg->setConfigEntry('extension_uuid_loaded', FALSE); - -// Remove config from this name-space. Don't worry, no configuration is cleared. -unset($cfg); diff --git a/framework/database.php b/framework/database.php index 6249535f..2a13ed54 100644 --- a/framework/database.php +++ b/framework/database.php @@ -2,6 +2,7 @@ // Import framework stuff use CoreFramework\Configuration\FrameworkConfiguration; use CoreFramework\Connection\Database\DatabaseConnection; +use CoreFramework\EntryPoint\ApplicationEntryPoint; use CoreFramework\Object\BaseFrameworkSystem; use CoreFramework\Middleware\Debug\DebugMiddleware; @@ -35,9 +36,9 @@ $databaseInstance = NULL; // Generate FQFN for the database layer $fqfn = sprintf( - '%sframework/database/lib-%s.php', - FrameworkConfiguration::getSelfInstance()->getConfigEntry('base_path'), - FrameworkConfiguration::getSelfInstance()->getConfigEntry('db_type') + '%sdatabase/lib-%s.php', + FrameworkConfiguration::getSelfInstance()->getConfigEntry('framework_base_path'), + FrameworkConfiguration::getSelfInstance()->getConfigEntry('database_type') ); // Load the database layer include @@ -47,7 +48,7 @@ if (BaseFrameworkSystem::isReadableFile($fqfn)) { } else { // Layer is missing! ApplicationEntryPoint::app_exit(sprintf('[Main:] Database layer is missing! (%s) -> R.I.P.', - FrameworkConfiguration::getSelfInstance()->getConfigEntry('db_type') + FrameworkConfiguration::getSelfInstance()->getConfigEntry('database_type') )); } diff --git a/framework/includes.php b/framework/includes.php index 806be049..3764ca73 100644 --- a/framework/includes.php +++ b/framework/includes.php @@ -29,7 +29,7 @@ use CoreFramework\Loader\ClassLoader; */ // Include the class loader function -require(FrameworkConfiguration::getSelfInstance()->getConfigEntry('base_path') . 'framework/loader/class_ClassLoader.php'); +require(FrameworkConfiguration::getSelfInstance()->getConfigEntry('framework_base_path') . 'loader/class_ClassLoader.php'); /* * Shall we include additional configs where you can configure some things? diff --git a/framework/loader/class_ClassLoader.php b/framework/loader/class_ClassLoader.php index 05603620..bc37b2ad 100644 --- a/framework/loader/class_ClassLoader.php +++ b/framework/loader/class_ClassLoader.php @@ -4,7 +4,6 @@ namespace CoreFramework\Loader; // Import framework stuff use CoreFramework\Configuration\FrameworkConfiguration; -use CoreFramework\EntryPoint\ApplicationEntryPoint; use CoreFramework\Object\BaseFrameworkSystem; // Import SPL stuff @@ -217,8 +216,8 @@ class ClassLoader { // Generate full path from it $pathName = realpath(sprintf( - '%s/framework/main/%s/', - $cfg->getConfigEntry('base_path'), + '%smain/%s/', + $cfg->getConfigEntry('framework_base_path'), $shortPath )); @@ -265,7 +264,7 @@ class ClassLoader { // Create path name $pathName = realpath(sprintf( '%s/%s/%s', - $cfg->getConfigEntry('application_path'), + $cfg->getConfigEntry('application_base_path'), $cfg->getConfigEntry('app_name'), $shortPath )); @@ -304,7 +303,7 @@ class ClassLoader { // Create path name $pathName = realpath(sprintf( '%s/%s', - $cfg->getConfigEntry('base_path'), + $cfg->getConfigEntry('framework_base_path'), $shortPath )); @@ -374,7 +373,7 @@ 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 'base_path' constant for all classes + * @param $basePath The relative base path to 'framework_base_path' constant for all classes * @param $ignoreList An optional list (array forced) of directory and file names which shall be ignored * @return void */ @@ -465,7 +464,7 @@ class ClassLoader { $this->prefix = 'config-'; // Set base directory - $basePath = $this->configInstance->getConfigEntry('base_path') . 'framework/config/'; + $basePath = $this->configInstance->getConfigEntry('framework_base_path') . 'config/'; // Load all classes from the config directory $this->scanClassPath($basePath); @@ -489,8 +488,8 @@ class ClassLoader { // Construct the FQFN for the cache if (!defined('DEVELOPER')) { - $this->listCacheFQFN = $this->configInstance->getConfigEntry('local_db_path') . 'list-' . $this->configInstance->getConfigEntry('app_name') . '.cache'; - $this->classCacheFQFN = $this->configInstance->getConfigEntry('local_db_path') . 'class-' . $this->configInstance->getConfigEntry('app_name') . '.cache'; + $this->listCacheFQFN = $this->configInstance->getConfigEntry('local_database_path') . 'list-' . $this->configInstance->getConfigEntry('app_name') . '.cache'; + $this->classCacheFQFN = $this->configInstance->getConfigEntry('local_database_path') . 'class-' . $this->configInstance->getConfigEntry('app_name') . '.cache'; } // END - if // Set suffix and prefix from configuration diff --git a/framework/main/classes/database/backend/class_CachedLocalFileDatabase.php b/framework/main/classes/database/backend/class_CachedLocalFileDatabase.php index fac9b9ea..a2f65b40 100644 --- a/framework/main/classes/database/backend/class_CachedLocalFileDatabase.php +++ b/framework/main/classes/database/backend/class_CachedLocalFileDatabase.php @@ -257,7 +257,7 @@ class CachedLocalFileDatabase extends BaseDatabaseBackend implements DatabaseBac */ private function generateFqfnFromDataSet (Criteria $dataSetInstance, $rowName) { // This is the FQFN - $fqfn = $this->getConfigInstance()->getConfigEntry('local_db_path') . $dataSetInstance->getTableName() . '/' . $rowName . '.' . $this->getFileExtension(); + $fqfn = $this->getConfigInstance()->getConfigEntry('local_database_path') . $dataSetInstance->getTableName() . '/' . $rowName . '.' . $this->getFileExtension(); // Return it return $fqfn; @@ -359,7 +359,7 @@ class CachedLocalFileDatabase extends BaseDatabaseBackend implements DatabaseBac $resultData = NULL; // Create full path name - $pathName = $this->getConfigInstance()->getConfigEntry('local_db_path') . $tableName . '/'; + $pathName = $this->getConfigInstance()->getConfigEntry('local_database_path') . $tableName . '/'; /* * A 'select' query is not that easy on local files, so first try to @@ -502,7 +502,7 @@ class CachedLocalFileDatabase extends BaseDatabaseBackend implements DatabaseBac */ public function queryUpdateDataSet (StoreableCriteria $dataSetInstance) { // Create full path name - $pathName = $this->getConfigInstance()->getConfigEntry('local_db_path') . $dataSetInstance->getTableName() . '/'; + $pathName = $this->getConfigInstance()->getConfigEntry('local_database_path') . $dataSetInstance->getTableName() . '/'; // Try all the requests try { @@ -646,7 +646,7 @@ class CachedLocalFileDatabase extends BaseDatabaseBackend implements DatabaseBac //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DATABASE: tableName=' . $tableName . ' - CALLED!'); // Create full path name - $pathName = $this->getConfigInstance()->getConfigEntry('local_db_path') . $tableName . '/'; + $pathName = $this->getConfigInstance()->getConfigEntry('local_database_path') . $tableName . '/'; // Try all the requests try { diff --git a/framework/main/classes/factories/stacks/class_FileStackFactory.php b/framework/main/classes/factories/stacks/class_FileStackFactory.php index 4394ab4c..957810fb 100644 --- a/framework/main/classes/factories/stacks/class_FileStackFactory.php +++ b/framework/main/classes/factories/stacks/class_FileStackFactory.php @@ -50,7 +50,7 @@ class FileStackFactory extends ObjectFactory { public static final function createFileStackInstance ($prefix, $stackName) { // Construct file stack name $stackFileName = sprintf('%s%s/%s.%s', - FrameworkConfiguration::getSelfInstance()->getConfigEntry('base_path'), + FrameworkConfiguration::getSelfInstance()->getConfigEntry('framework_base_path'), FrameworkConfiguration::getSelfInstance()->getConfigEntry('base_file_stacks_path'), $stackName, FrameworkConfiguration::getSelfInstance()->getConfigEntry('file_stacks_extension') diff --git a/framework/main/classes/language/class_LanguageSystem.php b/framework/main/classes/language/class_LanguageSystem.php index 0c2875ac..6e775009 100644 --- a/framework/main/classes/language/class_LanguageSystem.php +++ b/framework/main/classes/language/class_LanguageSystem.php @@ -85,10 +85,9 @@ class LanguageSystem extends BaseFrameworkSystem implements ManageableLanguage, $applicationInstance = Registry::getRegistry()->getInstance('app'); // 2) Try to build it - $languageBasePath = sprintf('%sapplication/%s/language/', - $langInstance->getConfigInstance()->getConfigEntry('base_path'), - // Don't allow any underscores/dashes in application names - str_replace(array('_', '-'), array('', ''), $applicationInstance->getAppShortName()) + $languageBasePath = sprintf('%s%s/language/', + $langInstance->getConfigInstance()->getConfigEntry('application_base_path'), + $applicationInstance->getAppShortName() ); } // END - if diff --git a/framework/main/classes/template/class_BaseTemplateEngine.php b/framework/main/classes/template/class_BaseTemplateEngine.php index 9cb1411b..cb071257 100644 --- a/framework/main/classes/template/class_BaseTemplateEngine.php +++ b/framework/main/classes/template/class_BaseTemplateEngine.php @@ -690,7 +690,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem { * template paths comes from an older time. */ $fqfn = sprintf('%s%s%s%s/%s%s', - $this->getConfigInstance()->getConfigEntry('base_path'), + $this->getConfigInstance()->getConfigEntry('application_base_path'), $this->getTemplateBasePath(), $this->getGenericBasePath(), $this->getTemplateType(), diff --git a/framework/main/classes/template/console/class_ConsoleTemplateEngine.php b/framework/main/classes/template/console/class_ConsoleTemplateEngine.php index e6305d81..0464ce97 100644 --- a/framework/main/classes/template/console/class_ConsoleTemplateEngine.php +++ b/framework/main/classes/template/console/class_ConsoleTemplateEngine.php @@ -62,7 +62,7 @@ class ConsoleTemplateEngine extends BaseTemplateEngine implements CompileableTem $applicationInstance = Registry::getRegistry()->getInstance('app'); // Determine base path - $templateBasePath = $templateInstance->getConfigInstance()->getConfigEntry('application_base_path') . $applicationInstance->getRequestInstance()->getRequestElement('app') . '/'; + $templateBasePath = $templateInstance->getConfigInstance()->getConfigEntry('application_base_path') . $applicationInstance->getAppShortName(). '/'; // Is the base path valid? if (empty($templateBasePath)) { @@ -87,7 +87,10 @@ class ConsoleTemplateEngine extends BaseTemplateEngine implements CompileableTem $templateInstance->setCodeTemplateExtension($templateInstance->getConfigInstance()->getConfigEntry('code_template_extension')); // Absolute output path for compiled templates - $templateInstance->setCompileOutputPath($templateInstance->getConfigInstance()->getConfigEntry('base_path') . $templateInstance->getConfigInstance()->getConfigEntry('compile_output_path')); + $templateInstance->setCompileOutputPath(sprintf('%s%s/', + $templateBasePath, + $templateInstance->getConfigInstance()->getConfigEntry('compile_output_path') + )); // Return the prepared instance return $templateInstance; diff --git a/framework/main/classes/template/html/class_HtmlTemplateEngine.php b/framework/main/classes/template/html/class_HtmlTemplateEngine.php index 1149efff..763d88c2 100644 --- a/framework/main/classes/template/html/class_HtmlTemplateEngine.php +++ b/framework/main/classes/template/html/class_HtmlTemplateEngine.php @@ -62,7 +62,7 @@ class HtmlTemplateEngine extends BaseTemplateEngine implements CompileableTempla $applicationInstance = Registry::getRegistry()->getInstance('app'); // Determine base path - $templateBasePath = $templateInstance->getConfigInstance()->getConfigEntry('application_base_path') . $applicationInstance->getRequestInstance()->getRequestElement('app') . '/'; + $templateBasePath = $templateInstance->getConfigInstance()->getConfigEntry('application_base_path') . $applicationInstance->getAppShortName(). '/'; // Is the base path valid? if (empty($templateBasePath)) { @@ -87,7 +87,10 @@ class HtmlTemplateEngine extends BaseTemplateEngine implements CompileableTempla $templateInstance->setCodeTemplateExtension($templateInstance->getConfigInstance()->getConfigEntry('code_template_extension')); // Absolute output path for compiled templates - $templateInstance->setCompileOutputPath($templateInstance->getConfigInstance()->getConfigEntry('base_path') . $templateInstance->getConfigInstance()->getConfigEntry('compile_output_path')); + $templateInstance->setCompileOutputPath(sprintf('%s%s/', + $templateBasePath, + $templateInstance->getConfigInstance()->getConfigEntry('compile_output_path') + )); // Return the prepared instance return $templateInstance; diff --git a/framework/main/classes/template/image/class_ImageTemplateEngine.php b/framework/main/classes/template/image/class_ImageTemplateEngine.php index 9f4cd8a9..42660810 100644 --- a/framework/main/classes/template/image/class_ImageTemplateEngine.php +++ b/framework/main/classes/template/image/class_ImageTemplateEngine.php @@ -98,7 +98,7 @@ class ImageTemplateEngine extends BaseTemplateEngine implements CompileableTempl $applicationInstance = Registry::getRegistry()->getInstance('app'); // Determine base path - $templateBasePath = $templateInstance->getConfigInstance()->getConfigEntry('application_base_path') . $applicationInstance->getRequestInstance()->getRequestElement('app') . '/'; + $templateBasePath = $templateInstance->getConfigInstance()->getConfigEntry('application_base_path') . $applicationInstance->getAppShortName(). '/'; // Is the base path valid? if (empty($templateBasePath)) { @@ -123,7 +123,10 @@ class ImageTemplateEngine extends BaseTemplateEngine implements CompileableTempl $templateInstance->setCodeTemplateExtension($templateInstance->getConfigInstance()->getConfigEntry('code_template_extension')); // Absolute output path for compiled templates - $templateInstance->setCompileOutputPath($templateInstance->getConfigInstance()->getConfigEntry('base_path') . $templateInstance->getConfigInstance()->getConfigEntry('compile_output_path')); + $templateInstance->setCompileOutputPath(sprintf('%s%s/', + $templateBasePath, + $templateInstance->getConfigInstance()->getConfigEntry('compile_output_path') + )); // Return the prepared instance return $templateInstance; @@ -474,7 +477,7 @@ class ImageTemplateEngine extends BaseTemplateEngine implements CompileableTempl public function getImageCacheFqfn () { // Get the FQFN ready $fqfn = sprintf('%s%s%s/%s.%s', - $this->getConfigInstance()->getConfigEntry('base_path'), + $this->getConfigInstance()->getConfigEntry('framework_base_path'), $this->getGenericBasePath(), 'images/_cache', md5( diff --git a/framework/main/classes/template/mail/class_MailTemplateEngine.php b/framework/main/classes/template/mail/class_MailTemplateEngine.php index 7ff55f30..763d4602 100644 --- a/framework/main/classes/template/mail/class_MailTemplateEngine.php +++ b/framework/main/classes/template/mail/class_MailTemplateEngine.php @@ -92,7 +92,7 @@ class MailTemplateEngine extends BaseTemplateEngine implements CompileableTempla $applicationInstance = Registry::getRegistry()->getInstance('app'); // Determine base path - $templateBasePath = $templateInstance->getConfigInstance()->getConfigEntry('application_base_path') . $applicationInstance->getRequestInstance()->getRequestElement('app') . '/'; + $templateBasePath = $templateInstance->getConfigInstance()->getConfigEntry('application_base_path') . $applicationInstance->getAppShortName(). '/'; // Is the base path valid? if (empty($templateBasePath)) { @@ -117,7 +117,10 @@ class MailTemplateEngine extends BaseTemplateEngine implements CompileableTempla $templateInstance->setCodeTemplateExtension($templateInstance->getConfigInstance()->getConfigEntry('code_template_extension')); // Absolute output path for compiled templates - $templateInstance->setCompileOutputPath($templateInstance->getConfigInstance()->getConfigEntry('base_path') . $templateInstance->getConfigInstance()->getConfigEntry('compile_output_path')); + $templateInstance->setCompileOutputPath(sprintf('%s%s/', + $templateBasePath, + $templateInstance->getConfigInstance()->getConfigEntry('compile_output_path') + )); // Return the prepared instance return $templateInstance; diff --git a/framework/main/classes/template/menu/class_MenuTemplateEngine.php b/framework/main/classes/template/menu/class_MenuTemplateEngine.php index c5601b4c..316f1518 100644 --- a/framework/main/classes/template/menu/class_MenuTemplateEngine.php +++ b/framework/main/classes/template/menu/class_MenuTemplateEngine.php @@ -151,7 +151,7 @@ class MenuTemplateEngine extends BaseTemplateEngine implements CompileableTempla $applicationInstance = Registry::getRegistry()->getInstance('app'); // Determine base path - $templateBasePath = $templateInstance->getConfigInstance()->getConfigEntry('application_base_path') . $applicationInstance->getRequestInstance()->getRequestElement('app') . '/'; + $templateBasePath = $templateInstance->getConfigInstance()->getConfigEntry('application_base_path') . $applicationInstance->getAppShortName(). '/'; // Is the base path valid? if (empty($templateBasePath)) { @@ -176,7 +176,10 @@ class MenuTemplateEngine extends BaseTemplateEngine implements CompileableTempla $templateInstance->setCodeTemplateExtension($templateInstance->getConfigInstance()->getConfigEntry('menu_template_extension')); // Absolute output path for compiled templates - $templateInstance->setCompileOutputPath($templateInstance->getConfigInstance()->getConfigEntry('base_path') . $templateInstance->getConfigInstance()->getConfigEntry('compile_output_path')); + $templateInstance->setCompileOutputPath(sprintf('%s%s/', + $templateBasePath, + $templateInstance->getConfigInstance()->getConfigEntry('compile_output_path') + )); // Set the menu instance $templateInstance->setMenuInstance($menuInstance); @@ -866,11 +869,13 @@ class MenuTemplateEngine extends BaseTemplateEngine implements CompileableTempla * @return $fqfn Full-qualified file name of the menu cache */ public function getMenuCacheFqfn () { + // Get the application instance from registry + $applicationInstance = Registry::getRegistry()->getInstance('app'); + // Get the FQFN ready - $fqfn = sprintf('%s%s%s/%s.%s', - $this->getConfigInstance()->getConfigEntry('base_path'), - $this->getGenericBasePath(), - 'menus/_cache', + $fqfn = sprintf('%s%smenus/_cache/%s.%s', + $this->getConfigInstance()->getConfigEntry('application_base_path'), + $applicationInstance->getAppShortName(), md5( $this->getMenuInstance()->getMenuName() . ':' . $this->__toString() . ':' . diff --git a/framework/main/middleware/compressor/class_CompressorChannel.php b/framework/main/middleware/compressor/class_CompressorChannel.php index 1e7bf82a..0baffa55 100644 --- a/framework/main/middleware/compressor/class_CompressorChannel.php +++ b/framework/main/middleware/compressor/class_CompressorChannel.php @@ -62,7 +62,7 @@ class CompressorChannel extends BaseMiddleware implements Registerable { ) { // Init base directory $baseDir = - $compressorInstance->getConfigInstance()->getConfigEntry('base_path') . + $compressorInstance->getConfigInstance()->getConfigEntry('framework_base_path') . $compressorInstance->getConfigInstance()->getConfigEntry('compressor_base_path'); // Get a directory pointer diff --git a/framework/selector.php b/framework/selector.php index 59abbe55..abedae92 100644 --- a/framework/selector.php +++ b/framework/selector.php @@ -41,7 +41,7 @@ $configAppIncludes = array( ); // Cache base path/file here -$basePathFile = FrameworkConfiguration::getSelfInstance()->getConfigEntry('application_path') . FrameworkConfiguration::getSelfInstance()->getConfigEntry('app_name'); +$basePathFile = FrameworkConfiguration::getSelfInstance()->getConfigEntry('application_base_path') . FrameworkConfiguration::getSelfInstance()->getConfigEntry('app_name'); // Is the directory there? if (!is_dir($basePathFile)) { diff --git a/index.php b/index.php index e058edad..ecf66b48 100644 --- a/index.php +++ b/index.php @@ -10,6 +10,9 @@ use CoreFramework\Localization\LanguageSystem; use CoreFramework\Loader\ClassLoader; use CoreFramework\Generic\FrameworkException; +// Import SPL stuff +use \Exception; + /** * The main class with the entry point to the whole application. This class * "emulates" Java's entry point call. Additionally it covers local @@ -39,9 +42,9 @@ use CoreFramework\Generic\FrameworkException; */ final class ApplicationEntryPoint { /** - * Core path + * Framework path */ - private static $corePath = ''; + private static $frameworkPath = ''; /** * The application's emergency exit @@ -177,18 +180,18 @@ final class ApplicationEntryPoint { } /** - * Determines the correct absolute path for all includes only once per run. - * Other calls of this method are being "cached". This is done by checking - * a small list of common paths where the framework can reside and check if - * framework/config.php can be found. + * Determines the correct absolute path for the framework. A set of common + * paths is being tested (first most common for applications, second when + * core tests are being executed and third/forth if the framework has been + * cloned there). * - * @return $corePath Base path (core) for all includes + * @return $frameworkPath Path for framework */ - protected static final function detectCorePath () { + public static final function detectFrameworkPath () { // Is it not set? - if (empty(self::$corePath)) { + if (empty(self::$frameworkPath)) { // Auto-detect core path (first application-common) - foreach (array('core', '.') as $possiblePath) { + foreach (array('core', '.', '/usr/local/share/php/core', '/usr/share/php/core') as $possiblePath) { // Create full path for testing $realPath = realpath($possiblePath); @@ -201,9 +204,9 @@ final class ApplicationEntryPoint { continue; } // END - if - // First create full-qualified file name (FQFN) to framework/config.php + // First create full-qualified file name (FQFN) to framework/config.inc.php $fqfn = sprintf( - '%s%sframework%sconfig.php', + '%s%sframework%sconfig.inc.php', $realPath, DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR, @@ -211,21 +214,27 @@ final class ApplicationEntryPoint { ); // Debug message - //* NOISY-DEBUG: */ printf('[%s:%d]: fqfn=%s' . PHP_EOL, __METHOD__, __LINE__, $fqfn); + /* NOISY-DEBUG: */ printf('[%s:%d]: fqfn=%s' . PHP_EOL, __METHOD__, __LINE__, $fqfn); // Is it readable? if (is_readable($fqfn)) { // Found one - self::$corePath = $realPath; + self::$frameworkPath = $realPath . '/framework/'; // Abort here break; } // END - if } // END - foreach + + // Able to find? + if (!is_dir(self::$frameworkPath)) { + // Is no directory + throw new Exception('Cannot find framework.'); + } // END - if } // END - if // Return it - return self::$corePath; + return self::$frameworkPath; } /** @@ -237,22 +246,11 @@ final class ApplicationEntryPoint { * @return void */ public static final function main () { - // Load config file, this no longer provides $cfg - require(self::detectCorePath() . '/framework/config.php'); + // Load bootstrap file + require(self::detectFrameworkPath() . 'bootstrap/bootstrap.inc.php'); // Get a new configuration instance $cfg = FrameworkConfiguration::getSelfInstance(); - - // Load bootstrap class - require($cfg->getConfigEntry('base_path') . 'framework/bootstrap/class_BootstrapFramework.php'); - - // ----- Below is deprecated ----- - - // Load all include files - require($cfg->getConfigEntry('base_path') . 'framework/includes.php'); - - // Include the application selector - require($cfg->getConfigEntry('base_path') . 'framework/selector.php'); } } diff --git a/tests/ConfigTest.php b/tests/ConfigTest.php index 6e2c34b8..968452a5 100644 --- a/tests/ConfigTest.php +++ b/tests/ConfigTest.php @@ -8,10 +8,10 @@ print (basename(__FILE__).": Init...\n"); require(dirname(dirname(__FILE__)) . '/framework/config.php'); // Load all include files -require($cfg->getConfigEntry('base_path') . 'framework/includes.php'); +require($cfg->getConfigEntry('framework_base_path') . 'includes.php'); // Load all game classes -require($cfg->getConfigEntry('base_path') . 'framework/classes.php'); +require($cfg->getConfigEntry('framework_base_path') . 'classes.php'); // Set default application FrameworkConfiguration::getInstance()->setConfigEntry('default_application', 'shipsimu'); diff --git a/tests/RegistryTest.php b/tests/RegistryTest.php index 7031b2a3..846ec55c 100644 --- a/tests/RegistryTest.php +++ b/tests/RegistryTest.php @@ -8,10 +8,10 @@ print (basename(__FILE__).": Init...\n"); require(dirname(dirname(__FILE__)) . '/framework/config.php'); // Load all include files -require($cfg->getConfigEntry('base_path') . 'framework/includes.php'); +require($cfg->getConfigEntry('framework_base_path') . 'includes.php'); // Load all game classes -require($cfg->getConfigEntry('base_path') . 'framework/classes.php'); +require($cfg->getConfigEntry('framework_base_path') . 'classes.php'); // Set default application FrameworkConfiguration::getInstance()->setConfigEntry('default_application', 'shipsimu'); diff --git a/tests/RequestTest.php b/tests/RequestTest.php index a32dfe78..80d78e47 100644 --- a/tests/RequestTest.php +++ b/tests/RequestTest.php @@ -8,10 +8,10 @@ print (basename(__FILE__).": Init...\n"); require(dirname(dirname(__FILE__)) . '/framework/config.php'); // Load all include files -require($cfg->getConfigEntry('base_path') . 'framework/includes.php'); +require($cfg->getConfigEntry('framework_base_path') . 'includes.php'); // Load all game classes -require($cfg->getConfigEntry('base_path') . 'framework/classes.php'); +require($cfg->getConfigEntry('framework_base_path') . 'classes.php'); // Set default application FrameworkConfiguration::getInstance()->setConfigEntry('default_application', 'shipsimu'); diff --git a/tests/Test.php b/tests/Test.php index 078f0bb7..2e8e6565 100644 --- a/tests/Test.php +++ b/tests/Test.php @@ -8,10 +8,10 @@ print (basename(__FILE__).": Init...\n"); require(dirname(dirname(__FILE__)) . '/framework/config.php'); // Load all include files -require($cfg->getConfigEntry('base_path') . 'framework/includes.php'); +require($cfg->getConfigEntry('framework_base_path') . 'includes.php'); // Load all game classes -require($cfg->getConfigEntry('base_path') . 'framework/classes.php'); +require($cfg->getConfigEntry('framework_base_path') . 'classes.php'); // Set default application FrameworkConfiguration::getInstance()->setConfigEntry('default_application', 'shipsimu'); diff --git a/tests/old/contract-test.php b/tests/old/contract-test.php index 9a1d55cc..b4de26a7 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__))) . '/framework/config.php'); // Load all include files -require($cfg->getConfigEntry('base_path') . 'framework/includes.php'); +require($cfg->getConfigEntry('framework_base_path') . 'includes.php'); // Load all game classes -require($cfg->getConfigEntry('base_path') . 'framework/classes.php'); +require($cfg->getConfigEntry('framework_base_path') . 'classes.php'); // Load file I/O handler -require($cfg->getConfigEntry('base_path') . 'framework/file_io.php'); +require($cfg->getConfigEntry('framework_base_path') . 'file_io.php'); // Load database layer -require($cfg->getConfigEntry('base_path') . 'framework/database.php'); +require($cfg->getConfigEntry('framework_base_path') . 'database.php'); // Set default application FrameworkConfiguration::getInstance()->setConfigEntry('default_application', 'shipsimu'); $application = 'shipsimu'; // Load more includes -require($cfg->getConfigEntry('base_path') . 'application/shipsimu/loader.php'); +require($cfg->getConfigEntry('root_base_path') . 'application/shipsimu/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 b72865d4..ef18401a 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__))) . '/framework/config.php'); // Load all include files -require($cfg->getConfigEntry('base_path') . 'framework/includes.php'); +require($cfg->getConfigEntry('framework_base_path') . 'includes.php'); // Load all game classes -require($cfg->getConfigEntry('base_path') . 'framework/classes.php'); +require($cfg->getConfigEntry('framework_base_path') . 'classes.php'); // Load file I/O handler -require($cfg->getConfigEntry('base_path') . 'framework/file_io.php'); +require($cfg->getConfigEntry('framework_base_path') . 'file_io.php'); // Load database layer -require($cfg->getConfigEntry('base_path') . 'framework/database.php'); +require($cfg->getConfigEntry('framework_base_path') . 'database.php'); // Set default application FrameworkConfiguration::getInstance()->setConfigEntry('default_application', 'shipsimu'); $application = 'shipsimu'; // Load more includes -require($cfg->getConfigEntry('base_path') . 'application/shipsimu/loader.php'); +require($cfg->getConfigEntry('root_base_path') . 'application/shipsimu/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 be1271b0..df2ef254 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__))) . '/framework/config.php'); // Load all include files -require($cfg->getConfigEntry('base_path') . 'framework/includes.php'); +require($cfg->getConfigEntry('framework_base_path') . 'includes.php'); // Load all game classes -require($cfg->getConfigEntry('base_path') . 'framework/classes.php'); +require($cfg->getConfigEntry('framework_base_path') . 'classes.php'); // Load file I/O handler -require($cfg->getConfigEntry('base_path') . 'framework/file_io.php'); +require($cfg->getConfigEntry('framework_base_path') . 'file_io.php'); // Load database layer -require($cfg->getConfigEntry('base_path') . 'framework/database.php'); +require($cfg->getConfigEntry('framework_base_path') . 'database.php'); // Set default application FrameworkConfiguration::getInstance()->setConfigEntry('default_application', 'shipsimu'); $application = 'shipsimu'; // Load more includes -require($cfg->getConfigEntry('base_path') . 'application/shipsimu/loader.php'); +require($cfg->getConfigEntry('root_base_path') . 'application/shipsimu/loader.php'); // Wir tun hier so, als waere schon das Reederei-Objekt generiert und wir wollen // jetzt die Personalliste wiederherstellen