Rewrite continued:
authorRoland Häder <roland@mxchange.org>
Thu, 18 May 2017 20:23:46 +0000 (22:23 +0200)
committerRoland Häder <roland@mxchange.org>
Thu, 18 May 2017 20:33:46 +0000 (22:33 +0200)
- the framework now attempts to initialize the application more OOP-ed
- this is done by calling 3 simple methods:
  + FrameworkBootstrap::initFramework();
  + FrameworkBootstrap::prepareApplication();
  + FrameworkBootstrap::startApplication();
- initFramework: 3 simple steps again:
  + scanFrameworkClasses: scans for framework-related classes, interfaces and
    exceptions
  + determineRequestType: determines request-type (console, html) and loads all
    given parameter into the initialized request class. It also initializes the
    response instance
  + validateApplicationParameter: validates the parameter 'app' if it is there
    and points to a valid application (very basic check, more later on)
- prepareApplication: Prepares detected application by attempting to load all
  required include files and only optional if present. Please note that some
  files are now deprecated and should be ported to the new methods (see below)
- startApplication: Starts the application by calling 3 methods:
  + setupApplicationData: replacement for data.php, sets all application's data.
    Please don't set any configuration stuff here, this is still done in
    config.php!
  + initApplication: Calls some additional methods to initialize application.
    Here is a good place to init database instance by calling the shiny new
    method initDatabaseInstance().
  + launchApplication: Still old method name which starts the application.
    Please remove any request/response-init stuff from here as it is now
    generically done in FrameworkBootstrap
- include files in framework/database/ are now all deprecated
- renamed framework/config.inc.php -> framework/config-global.php
- PrimeraPortal's API is history, so let us remove the obsolete file here, too
- some "contrib" files updated
- updated TODOs.txt
- moved rand.php to contrib/ folder

Signed-off-by: Roland Häder <roland@mxchange.org>
162 files changed:
application/tests/class_ApplicationHelper.php
application/tests/data.php
application/tests/exceptions.php
application/tests/init.php
application/tests/rand.php [deleted file]
application/tests/starter.php
contrib/benchmarks/array_serialization.php
contrib/chash/chash.php
contrib/rand.php [new file with mode: 0644]
docs/TODOs.txt
framework/bootstrap/bootstrap.inc.php
framework/bootstrap/class_FrameworkBootstrap.php
framework/config-global.php [new file with mode: 0644]
framework/config.inc.php [deleted file]
framework/config/class_FrameworkConfiguration.php
framework/database.php
framework/database/lib-lfdb.php
framework/includes.php
framework/loader/class_ClassLoader.php
framework/main/classes/auth/class_CookieAuth.php
framework/main/classes/cache/class_MemoryCache.php
framework/main/classes/class_BaseFrameworkSystem.php
framework/main/classes/client/http/class_HttpClient.p
framework/main/classes/client/http/class_HttpClient.ph
framework/main/classes/client/http/class_HttpClient.php
framework/main/classes/commands/class_BaseCommand.php
framework/main/classes/commands/html/class_HtmlConfirmCommand.php
framework/main/classes/commands/html/class_HtmlHomeCommand.php
framework/main/classes/commands/html/class_HtmlLoginAreaCommand.php
framework/main/classes/commands/html/class_HtmlLoginCommand.php
framework/main/classes/commands/html/class_HtmlLoginFailedCommand.php
framework/main/classes/commands/html/class_HtmlLogoutCommand.php
framework/main/classes/commands/html/class_HtmlLogoutDoneCommand.php
framework/main/classes/commands/html/class_HtmlProblemCommand.php
framework/main/classes/commands/html/class_HtmlRegisterCommand.php
framework/main/classes/commands/html/class_HtmlResendLinkCommand.php
framework/main/classes/commands/html/class_HtmlStatusCommand.php
framework/main/classes/commands/image/class_ImageCodeCaptchaCommand.php
framework/main/classes/compressor/class_Bzip2Compressor.php
framework/main/classes/console/class_ConsoleTools.php
framework/main/classes/container/socket/class_SocketContainer.php
framework/main/classes/criteria/class_BaseCriteria.php
framework/main/classes/criteria/search/class_SearchCriteria.php
framework/main/classes/crypto/class_CryptoHelper.php
framework/main/classes/database/backend/class_CachedLocalFileDatabase.php
framework/main/classes/database/class_BaseDatabaseWrapper.php
framework/main/classes/database/result/class_CachedDatabaseResult.php
framework/main/classes/decorator/template/class_XmlRewriterTemplateDecorator.php
framework/main/classes/factories/client/class_ClientFactory.php
framework/main/classes/factories/xml/class_XmlTemplateEngineFactory.php
framework/main/classes/feature/class_
framework/main/classes/feature/class_FrameworkFeature.php
framework/main/classes/feature/fuse/class_FuseFeature.php
framework/main/classes/file_directories/binary/class_BaseBinaryFile.php
framework/main/classes/file_directories/binary/index/class_IndexFile.php
framework/main/classes/file_directories/class_BaseAbstractFile.php
framework/main/classes/file_directories/directory/class_FrameworkDirectoryPointer.php
framework/main/classes/file_directories/input/raw/class_FrameworkRawFileInputPointer.php
framework/main/classes/file_directories/input/text/class_FrameworkTextFileInputPointer.php
framework/main/classes/file_directories/io/class_FrameworkFileInputOutputPointer.php
framework/main/classes/file_directories/output/raw/class_FrameworkRawFileOutputPointer.php
framework/main/classes/file_directories/output/text/class_FrameworkTextFileOutputPointer.php
framework/main/classes/file_directories/text/input/csv/class_CsvInputFile.php
framework/main/classes/filter/auth/class_UserAuthFilter.php
framework/main/classes/filter/change/class_EmailChangeFilter.php
framework/main/classes/filter/change/class_PasswordChangeFilter.php
framework/main/classes/filter/checkboxes/class_RulesAcceptedFilter.php
framework/main/classes/filter/crypto/class_CaptchaEncryptFilter.php
framework/main/classes/filter/payment/class_PaymentDiscoveryFilter.php
framework/main/classes/filter/validator/class_EmailValidatorFilter.php
framework/main/classes/filter/validator/class_PasswordValidatorFilter.php
framework/main/classes/filter/validator/class_UserNameValidatorFilter.php
framework/main/classes/filter/verifier/class_AccountPasswordVerifierFilter.php
framework/main/classes/filter/verifier/class_ConfirmCodeVerifierFilter.php
framework/main/classes/filter/verifier/class_GraphicalCodeCaptchaVerifierFilter.php
framework/main/classes/filter/verifier/class_PasswordGuestVerifierFilter.php
framework/main/classes/filter/verifier/class_PasswordVerifierFilter.php
framework/main/classes/filter/verifier/class_UserGuestVerifierFilter.php
framework/main/classes/filter/verifier/class_UserNameVerifierFilter.php
framework/main/classes/filter/verifier/class_UserStatusVerifierFilter.php
framework/main/classes/filter/verifier/class_UserUnconfirmedVerifierFilter.php
framework/main/classes/handler/tasks/class_TaskHandler.php
framework/main/classes/helper/class_BaseHelper.php
framework/main/classes/helper/html/forms/class_HtmlFormHelper.php
framework/main/classes/helper/html/links/class_HtmlLinkHelper.php
framework/main/classes/images/class_BaseImage.php
framework/main/classes/images/extended/class_PngImage.php
framework/main/classes/index/class_BaseIndex.php
framework/main/classes/iterator/file/class_FileIterator.php
framework/main/classes/listener/class_BaseListener.php
framework/main/classes/listener/socket/class_SocketFileListener.php
framework/main/classes/lists/class_BaseList.php
framework/main/classes/mailer/debug/class_DebugMailer.php
framework/main/classes/menu/class_BaseMenu.php
framework/main/classes/output/class_
framework/main/classes/output/console/class_ConsoleOutput.php
framework/main/classes/output/debug/class_BaseDebugOutput.php
framework/main/classes/output/debug/console/class_DebugConsoleOutput.php
framework/main/classes/output/debug/error/class_DebugErrorLogOutput.php
framework/main/classes/output/debug/web/class_DebugWebOutput.php
framework/main/classes/output/web/class_WebOutput.php
framework/main/classes/parser/xml/class_XmlParser.php
framework/main/classes/points/class_UserPoints.php
framework/main/classes/reader/class_ConsoleNewsReader.php
framework/main/classes/reader/class_DefaultNewsReader.php
framework/main/classes/registration/class_BaseRegistration.php
framework/main/classes/registry/class_BaseRegistry.php
framework/main/classes/request/class_
framework/main/classes/request/class_BaseRequest.php
framework/main/classes/request/console/class_ConsoleRequest.php
framework/main/classes/request/html/class_HtmlRequest.php
framework/main/classes/resolver/action/class_BaseActionResolver.php
framework/main/classes/resolver/action/html/class_HtmlActionResolver.php
framework/main/classes/resolver/class_
framework/main/classes/resolver/command/class_BaseCommandResolver.php
framework/main/classes/resolver/command/console/class_ConsoleCommandResolver.php
framework/main/classes/resolver/command/html/class_Html
framework/main/classes/resolver/command/html/class_HtmlCommandResolver.php
framework/main/classes/resolver/command/image/class_ImageCommandResolver.php
framework/main/classes/resolver/controller/class_BaseControllerResolver.php
framework/main/classes/resolver/controller/console/class_ConsoleControllerResolver.php
framework/main/classes/resolver/controller/html/class_HtmlControllerResolver.php
framework/main/classes/resolver/controller/image/class_ImageControllerResolver.php
framework/main/classes/response/class_BaseResponse.php
framework/main/classes/response/console/class_ConsoleResponse.php
framework/main/classes/response/html/class_HtmlResponse.php
framework/main/classes/response/image/class_ImageResponse.php
framework/main/classes/rng/class_RandomNumberGenerator.php
framework/main/classes/scrypt/class_Scrypt.php
framework/main/classes/stacker/class_BaseStacker.php
framework/main/classes/stacker/file/class_BaseFileStack.php
framework/main/classes/template/class_BaseTemplateEngine.php
framework/main/classes/template/menu/class_MenuTemplateEngine.php
framework/main/classes/user/class_BaseUser.php
framework/main/classes/user/guest/class_Guest.php
framework/main/classes/user/member/class_Member.php
framework/main/exceptions/class_FrameworkException.php
framework/main/exceptions/dns/.htaccess [new file with mode: 0644]
framework/main/exceptions/dns/class_UnknownHostnameException.php [new file with mode: 0644]
framework/main/exceptions/helper/class_InvalidFormNameException.php
framework/main/exceptions/main/class_InvalidCommandInstanceException.php
framework/main/interfaces/application/class_ManageableApplication.php
framework/main/interfaces/block/class_Block.php
framework/main/interfaces/criteria/class_Criteria.php
framework/main/interfaces/crypto/class_Cryptable.php
framework/main/interfaces/debug/class_Debugger.php
framework/main/interfaces/io/output/class_OutputStreamer.php
framework/main/interfaces/io/pointer/class_OutputPointer.php
framework/main/interfaces/io/pointer/io/class_InputOutputPointer.php
framework/main/interfaces/iterator/class_SeekableWritableFileIterator.php
framework/main/interfaces/registry/socket/class_RegisterableSocket.php
framework/main/interfaces/request/class_Requestable.php
framework/main/interfaces/response/class_Responseable.php
framework/main/interfaces/template/class_CompileableTemplate.php
framework/main/middleware/debug/class_DebugMiddleware.php
framework/main/tests/resolver/command/console/class_TestsConsoleCommandResolver.php
framework/main/tests/resolver/controller/class_TestsConsoleControllerResolver.php
framework/main/third_party/api/primusportal/.htaccess [deleted file]
framework/main/third_party/api/primusportal/class_PrimeraApi.php [deleted file]
framework/main/third_party/api/wernisportal/class_WernisApi.php
framework/selector.php
index.php

index 5d3c60d..6b234b4 100644 (file)
@@ -1,11 +1,14 @@
 <?php
-// Own namespace
+// Must be this namespace, else the launcher cannot find the class.
 namespace CoreFramework\Helper\Application;
 
 // Import framework stuff
+use CoreFramework\Bootstrap\FrameworkBootstrap;
+use CoreFramework\Configuration\FrameworkConfiguration;
+use CoreFramework\Factory\ObjectFactory;
+use CoreFramework\Loader\ClassLoader;
 use CoreFramework\Manager\ManageableApplication;
 use CoreFramework\Object\BaseFrameworkSystem;
-use CoreFramework\Factory\ObjectFactory;
 use CoreFramework\Registry\Registerable;
 use CoreFramework\Registry\Registry;
 use CoreFramework\Template\CompileableTemplate;
@@ -155,37 +158,54 @@ class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplica
        }
 
        /**
-        * Launches the test suite
+        * 1) Setups application data
+        *
+        * @return      void
+        */
+       public function setupApplicationData () {
+               // Set all application data
+               $this->setAppName('Unit tests and more');
+               $this->setAppVersion('0.0.0');
+               $this->setAppShortName('tests');
+       }
+
+       /**
+        * 2) Does initial stuff before starting the application
         *
         * @return      void
         */
-       public final function entryPoint () {
-               // Set this application in registry
-               Registry::getRegistry()->addInstance('app', $this);
+       public function initApplication () {
+               // Get config instance
+               $cfg = FrameworkConfiguration::getSelfInstance();
 
-               // Default response is console
-               $response = self::getResponseTypeFromSystem();
-               $responseType = self::getResponseTypeFromSystem();
+               // Initialize output system
+               self::createDebugInstance('ApplicationHelper');
 
-               // Create a new request object
-               $requestInstance = ObjectFactory::createObjectByName(sprintf('CoreFramework\Request\%sRequest', self::convertToClassName($response)));
+               /*
+                * This application needs a database connection then simply call init
+                * method.
+                */
+               FrameworkBootstrap::initDatabaseInstance();
 
-               // Remember request instance here
-               $this->setRequestInstance($requestInstance);
+               // Register core tests
+               ClassLoader::registerTestsPath('framework/main/tests');
 
-               // Do we have another response?
-               if ($requestInstance->isRequestElementSet('request')) {
-                       // Then use it
-                       $response = strtolower($requestInstance->getRequestElement('request'));
-                       $responseType = $response;
-               } // END - if
+               // Register own tests
+               ClassLoader::registerTestsPath('application/tests/tests');
 
-               // ... and a new response object
-               $responseClass = sprintf('CoreFramework\Response\%sResponse', self::convertToClassName($response));
-               $responseInstance = ObjectFactory::createObjectByName($responseClass, array($this));
+               // Scan for them now
+               ClassLoader::scanTestsClasses();
+       }
 
-               // Remember response instance here
-               $this->setResponseInstance($responseInstance);
+       /**
+        * 3) Launches the application
+        *
+        * @return      void
+        */
+       public function launchApplication () {
+               // Get request/response instances
+               $requestInstance  = FrameworkBootstrap::getRequestInstance();
+               $responseInstance = FrameworkBootstrap::getResponseInstance();
 
                // Get the parameter from the request
                $commandName = $requestInstance->getRequestElement('command');
@@ -205,7 +225,7 @@ class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplica
                        self::convertToClassName(sprintf(
                                '%s_%s_controller_resolver',
                                $this->getAppShortName(),
-                               $responseType
+                               FrameworkBootstrap::getRequestTypeFromSystem()
                        ))
                );
                $resolverInstance = ObjectFactory::createObjectByName($resolverClass, array($commandName, $this));
@@ -242,7 +262,7 @@ class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplica
         * @return      $masterTemplateName             Name of the master template
         */
        public function buildMasterTemplateName () {
-               return 'node_main';
+               return 'tests_main';
        }
 
        /**
index e1fd323..7d6dcee 100644 (file)
@@ -1,37 +1,2 @@
 <?php
-/**
- * Application data
- *
- * Please remember that this include file is being loaded *before* the class
- * loader is loading classes from "exceptions", "interfaces" and "main"!
- *
- * @author             Roland Haeder <webmaster@shipsimu.org>
- * @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 <http://www.gnu.org/licenses/>.
- */
-
-// Get an instance of the helper
-$app = call_user_func_array(
-       array('CoreFramework\Helper\Application\ApplicationHelper', 'getSelfInstance'),
-       array()
-);
-
-// Set application name and version
-$app->setAppName('Unit tests and more');
-$app->setAppVersion('0.0.0');
-$app->setAppShortName('tests');
+// @DEPRECATED
index 7248c82..ed82414 100644 (file)
@@ -89,7 +89,7 @@ Backtrace:
                print($message);
        } elseif (is_object($exceptionInstance)) {
                // Output more details
-               printf('exceptionInstance=%s', print_r($exceptionInstance, TRUE));
+               printf('exceptionInstance=%s', print_r($exceptionInstance, true));
        } else {
                /*
                 * Invalid exception instance detected! Do *only* throw exceptions that
@@ -101,7 +101,7 @@ Backtrace:
 }
 
 // Error handler
-function __errorHandler ($errno, $errstr, $errfile, $errline, array $errcontext) {
+function test_error_handler ($errno, $errstr, $errfile, $errline, array $errcontext) {
        // Construct the message
        $message = sprintf('File: %s, Line: %s, Code: %s, Message: %s',
                basename($errfile),
@@ -115,7 +115,7 @@ function __errorHandler ($errno, $errstr, $errfile, $errline, array $errcontext)
 } // END - function
 
 // Assertion handler
-function __assertHandler ($file, $line, $code) {
+function test_assert_handler ($file, $line, $code) {
        // Empty code?
        if ($code === '') {
                $code = '<em>Unknown</em>';
@@ -136,14 +136,14 @@ function __assertHandler ($file, $line, $code) {
 } // END - function
 
 // Set error handler
-//set_error_handler('__errorHandler');
+//set_error_handler('test_error_handler');
 
 // Set the new handler
 set_exception_handler('tests_exception_handler');
 
 // Init assert handling
-assert_options(ASSERT_ACTIVE    , TRUE);
-assert_options(ASSERT_WARNING   , FALSE);
-assert_options(ASSERT_BAIL      , TRUE);
-assert_options(ASSERT_QUIET_EVAL, FALSE);
-assert_options(ASSERT_CALLBACK  , '__assertHandler');
+assert_options(ASSERT_ACTIVE    , true);
+assert_options(ASSERT_WARNING   , false);
+assert_options(ASSERT_BAIL      , true);
+assert_options(ASSERT_QUIET_EVAL, false);
+assert_options(ASSERT_CALLBACK  , 'test_assert_handler');
index 6266e1c..7d6dcee 100644 (file)
@@ -1,51 +1,2 @@
 <?php
-// Import framework stuff
-use CoreFramework\Configuration\FrameworkConfiguration;
-use CoreFramework\Helper\Application\ApplicationHelper;
-use CoreFramework\Loader\ClassLoader;
-
-/**
- * Application initializer
- *
- * @author             Roland Haeder <webmaster@shipsimu.org>
- * @version            0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2017 Core Developer Team
- * @license            GNU GPL 3.0 or any newer version
- *
- * 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 <http://www.gnu.org/licenses/>.
- */
-
-// Scan for application's classes, exceptions and interfaces
-ClassLoader::scanApplicationClasses();
-
-// Get config instance
-$cfg = FrameworkConfiguration::getSelfInstance();
-
-// Initialize output system
-ApplicationHelper::createDebugInstance('ApplicationHelper');
-
-/*
- * This application needs a database connection then we have to simply include
- * the framework/database.php script
- */
-require $cfg->getConfigEntry('framework_base_path') . 'database.php';
-
-// Register core tests
-ClassLoader::registerTestsPath('framework/main/tests');
-
-// Register own tests
-ClassLoader::registerTestsPath('application/tests/tests');
-
-// Scan for them now
-ClassLoader::scanTestsClasses();
+// @DEPRECATED
diff --git a/application/tests/rand.php b/application/tests/rand.php
deleted file mode 100644 (file)
index ddd36e6..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-<?php
-$rands = array();
-$max_iter = 500000;
-$max_rand = 200000;
-
-print 'max_iter=' . $max_iter . ',max_rand=' . $max_rand . PHP_EOL;
-
-for ($idx = 0; $idx < $max_iter; $idx++) {
-       $number = mt_rand(0, $max_rand);
-       if (isset($rands['mt_rand'][$number])) {
-               $rands['mt_rand'][$number]++;
-       } else {
-               $rands['mt_rand'][$number] = 1;
-       }
-
-       $number = rand(0, $max_rand);
-       if (isset($rands['rand'][$number])) {
-               $rands['rand'][$number]++;
-       } else {
-               $rands['rand'][$number] = 1;
-       }
-}
-
-print 'mt_rand=' . count($rands['mt_rand']) . PHP_EOL;
-print 'rand=' . count($rands['rand']) . PHP_EOL;
index 377f446..7d6dcee 100644 (file)
@@ -1,57 +1,2 @@
 <?php
-// Import framework stuff
-use CoreFramework\Configuration\FrameworkConfiguration;
-
-/**
- * The application launcher
- *
- * @author             Roland Haeder <webmaster@shipsimu.org>
- * @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 <http://www.gnu.org/licenses/>.
- */
-
-// Is there an application helper instance? We need the method main() for
-// maining the application
-$app = call_user_func_array(
-       array(
-               'CoreFramework\Helper\Application\ApplicationHelper', 'getSelfInstance'
-       ), array()
-);
-
-// Some sanity checks
-if ((empty($app)) || (is_null($app))) {
-       // Something went wrong!
-       ApplicationEntryPoint::app_exit(sprintf("[Main:] The application <span class=\"app_name\">%s</span> could not be launched because the helper class <span class=\"class_name\">%s</span> is not loaded.",
-               $application,
-               'CoreFramework\Helper\Application\ApplicationHelper'
-       ));
-} elseif (!is_object($app)) {
-       // No object!
-       ApplicationEntryPoint::app_exit(sprintf("[Main:] The application <span class=\"app_name\">%s</span> could not be launched because &#39;app&#39; is not an object.",
-               $application
-       ));
-} elseif (!method_exists($app, FrameworkConfiguration::getSelfInstance()->getConfigEntry('entry_method'))) {
-       // Method not found!
-       ApplicationEntryPoint::app_exit(sprintf("[Main:] The application <span class=\"app_name\">%s</span> could not be launched because the method <span class=\"method_name\">%s</span> is missing.",
-               $application,
-               FrameworkConfiguration::getSelfInstance()->getConfigEntry('entry_method')
-       ));
-}
-
-// Call user function
-call_user_func_array(array($app, FrameworkConfiguration::getSelfInstance()->getConfigEntry('entry_method')), array());
+// @DEPRECATED
index 588af61..cb7864a 100644 (file)
@@ -18,18 +18,18 @@ $array = array(
 
 // Now test with serialize()
 print 'serialize() ...' . PHP_EOL;
-$time = microtime(TRUE);
+$time = microtime(true);
 for ($idx = 0; $idx < $iter; $idx++) {
        $serialized = serialize($array);
 }
-$diff1 = microtime(TRUE) - $time;
+$diff1 = microtime(true) - $time;
 
 // Now test with json_encode()
 print 'json_encode() ...' . PHP_EOL;
-$time = microtime(TRUE);
+$time = microtime(true);
 for ($idx = 0; $idx < $iter; $idx++) {
        $json_encoded = json_encode($array);
 }
-$diff2 = microtime(TRUE) - $time;
+$diff2 = microtime(true) - $time;
 
 print 'diff1=' . $diff1 . ',diff2=' . $diff2 . PHP_EOL;
index 41af8db..1c4965c 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 error_reporting(E_ALL | E_STRICT);
 
-define('START_TIME'            , microtime(TRUE));
+define('START_TIME'            , microtime(true));
 define('CHECK_POINT'           , 'chash.pos');
 
 // Hashes needed to complete a "block"
@@ -248,7 +248,7 @@ function flushCheckPointFile ($hash) {
        print ('FLUSHING: Writing ' . count($GLOBALS['found_hashes']) . ' blocks ...' . PHP_EOL);
 
        // Start timer
-       $timer = microtime(TRUE);
+       $timer = microtime(true);
 
        // Flush data
        file_put_contents(
@@ -266,7 +266,7 @@ function flushCheckPointFile ($hash) {
        );
 
        // Set time
-       $GLOBALS['time_flush'] = microtime(TRUE);
+       $GLOBALS['time_flush'] = microtime(true);
        print ('FLUSHING: Took ' . ($GLOBALS['time_flush'] - $timer) . ' seconds.' . PHP_EOL);
 }
 
@@ -295,7 +295,7 @@ function addFoundHash ($hash) {
        print ('FOUND: hash=' . $hash . ',nonce=' . $GLOBALS['nonce'] . ',total_found=' . $GLOBALS['total_found'] . PHP_EOL);
 
        // Set time as a new hash was found
-       $GLOBALS['found_time'] = microtime(TRUE);
+       $GLOBALS['found_time'] = microtime(true);
 
        // Flush check-point file after new hash is found
        flushCheckPointFile($hash);
@@ -375,9 +375,9 @@ $GLOBALS['genesis_hash'] = $GLOBALS['modula_hash'];
 $GLOBALS['root_hash']    = $GLOBALS['modula_hash'];
 
 // Output results
-print ('hashes=' . print_r($gensisHashes, TRUE));
-print ('modulaHashes=' . print_r($modulaHashes, TRUE));
-print ('sqrtHashes=' . print_r($sqrtHashes, TRUE));
+print ('hashes=' . print_r($gensisHashes, true));
+print ('modulaHashes=' . print_r($modulaHashes, true));
+print ('sqrtHashes=' . print_r($sqrtHashes, true));
 print ('modulaHash=' . $GLOBALS['modula_hash'] . PHP_EOL);
 
 // Total reward + hashes
@@ -385,7 +385,7 @@ $GLOBALS['total_reward']   = 0;
 $GLOBALS['total_hashes']   = 0;
 $GLOBALS['total_found']    = 0;
 $GLOBALS['total_blocks']   = 0;
-$GLOBALS['found_time']     = microtime(TRUE);
+$GLOBALS['found_time']     = microtime(true);
 
 // Is the check point there?
 if (is_readable(CHECK_POINT)) {
@@ -422,13 +422,13 @@ print ('nonce=' . $GLOBALS['nonce'] . PHP_EOL);
 print ('found=' . count($GLOBALS['found_hashes'][$GLOBALS['total_blocks']]) . PHP_EOL);
 
 // Start "mining"
-while (TRUE) {
+while (true) {
        // Init hash-per-block counter and hashrate
        $GLOBALS['hashes_block'] = 0;
        $hashrate = 0;
 
        // Wait for block_size iterations (= found hashes). This is one block
-       $timeBlock   = microtime(TRUE);
+       $timeBlock   = microtime(true);
        $timeDisplay = $timeBlock;
        $GLOBALS['time_flush'] = $timeBlock;
 
@@ -447,7 +447,7 @@ while (TRUE) {
                $GLOBALS['iteration_second'] = 0;
 
                // Now start the "mining" ...
-               $timeHash = microtime(TRUE);
+               $timeHash = microtime(true);
                while ($sumNonce < $GLOBALS['sum_modula']) {
                        // Calculate new nonce
                        calculateNonce();
@@ -459,7 +459,7 @@ while (TRUE) {
                        $sumNonce  = calculateSumFromHash($nonceHash);
 
                        // Time spend in loop
-                       $testTime = abs(microtime(TRUE) - $timeDisplay);
+                       $testTime = abs(microtime(true) - $timeDisplay);
 
                        // Calculate hashrate/sec
                        $hashrate = 1 / $testTime * $GLOBALS['iteration_second'] * $GLOBALS['hash_cycles'];
@@ -470,12 +470,12 @@ while (TRUE) {
                                print ('hashrate=' . round($hashrate) . ' hashes/sec,iterSecond=' . $GLOBALS['iteration_second'] . ' iterations/sec' . PHP_EOL);
 
                                // Reset timer
-                               $timeDisplay = microtime(TRUE);
+                               $timeDisplay = microtime(true);
                                $GLOBALS['iteration_second']  = 0;
                        } // END - if
 
                        // Time spend from last flush
-                       $testTime = abs(microtime(TRUE) - $GLOBALS['time_flush']);
+                       $testTime = abs(microtime(true) - $GLOBALS['time_flush']);
 
                        // Only once per 10 seconds
                        if ($testTime >= $GLOBALS['flush_file_time']) {
@@ -484,7 +484,7 @@ while (TRUE) {
                        } // END - if
 
                        // Time spend from last found block
-                       $testTime = abs(microtime(TRUE) - $GLOBALS['found_time']);
+                       $testTime = abs(microtime(true) - $GLOBALS['found_time']);
 
                        // Is the last found time to far away?
                        if ($testTime >= $GLOBALS['restart_search_time']) {
@@ -501,7 +501,7 @@ while (TRUE) {
                                        foreach ($block as $hash) {
                                                if (!isset($hash['root_hash'])) {
                                                        // Bad file
-                                                       die('INCONSISTENCY: hash=' . print_r($hash, TRUE));
+                                                       die('INCONSISTENCY: hash=' . print_r($hash, true));
                                                } // END - if
 
                                                if (isset($rootHashes[$hash['root_hash']])) {
@@ -544,7 +544,7 @@ while (TRUE) {
                                                        print ('idx=' . $idx . ',modulaHash=' . $GLOBALS['root_hash'] . ' - Is now new root hash!' . PHP_EOL);
 
                                                        // Reset "found time" (when a hash was found)
-                                                       $GLOBALS['found_time'] = microtime(TRUE);
+                                                       $GLOBALS['found_time'] = microtime(true);
 
                                                        // Re-initialize nonce
                                                        initNonce();
@@ -568,7 +568,7 @@ while (TRUE) {
                // If the iteration is zero, then no hash is found
                if ($GLOBALS['iteration'] == 0) {
                        // Bad hash found
-                       $timeBadHashes += abs(microtime(TRUE) - $timeHash);
+                       $timeBadHashes += abs(microtime(true) - $timeHash);
 
                        // And next round
                        print('BAD:nonce=' . $GLOBALS['nonce'] . PHP_EOL);
@@ -586,7 +586,7 @@ while (TRUE) {
        } // END - while
 
        // Time taken for one
-       $timeBlock = abs(microtime(TRUE) - $timeBlock);
+       $timeBlock = abs(microtime(true) - $timeBlock);
 
        // Calculate reward
        $reward = abs($timeBlock - $timeBadHashes) / $hashrate * $GLOBALS['hashes_block'] / $GLOBALS['block_size'] * 1000;
@@ -610,7 +610,7 @@ while (TRUE) {
        $blockValue = $GLOBALS['total_reward'] / $GLOBALS['total_blocks'] * $GLOBALS['total_hashes'] / ($GLOBALS['block_size'] * $GLOBALS['total_blocks']);
 
        // Calculate reward per hour (= 3600 seconds)
-       $rewardPerHour = $GLOBALS['total_reward'] / abs(microtime(TRUE) - START_TIME) * 3600;
+       $rewardPerHour = $GLOBALS['total_reward'] / abs(microtime(true) - START_TIME) * 3600;
 
        print ('totalReward=' . $GLOBALS['total_reward'] . ',blockValue=' . $blockValue . ',rewardPerHour=' . $rewardPerHour . PHP_EOL);
 } // END - while
diff --git a/contrib/rand.php b/contrib/rand.php
new file mode 100644 (file)
index 0000000..ddd36e6
--- /dev/null
@@ -0,0 +1,25 @@
+<?php
+$rands = array();
+$max_iter = 500000;
+$max_rand = 200000;
+
+print 'max_iter=' . $max_iter . ',max_rand=' . $max_rand . PHP_EOL;
+
+for ($idx = 0; $idx < $max_iter; $idx++) {
+       $number = mt_rand(0, $max_rand);
+       if (isset($rands['mt_rand'][$number])) {
+               $rands['mt_rand'][$number]++;
+       } else {
+               $rands['mt_rand'][$number] = 1;
+       }
+
+       $number = rand(0, $max_rand);
+       if (isset($rands['rand'][$number])) {
+               $rands['rand'][$number]++;
+       } else {
+               $rands['rand'][$number] = 1;
+       }
+}
+
+print 'mt_rand=' . count($rands['mt_rand']) . PHP_EOL;
+print 'rand=' . count($rands['rand']) . PHP_EOL;
index 61d9b7a..9401e78 100644 (file)
 ### WARNING: THIS FILE IS AUTO-GENERATED BY ./contrib/todo-builder.sh ###
 ### DO NOT EDIT THIS FILE. ###
-./application/tests/class_ApplicationHelper.php:237:    * @todo        Nothing to add?
-./inc/config/class_FrameworkConfiguration.php:116:      * @todo        This method encapsulates a deprecated PHP function and should be deprecated, too.
-./inc/config/class_FrameworkConfiguration.php:227:      * @todo        We have to add some more entries from $_SERVER here
-./inc/database.php:11: * @todo         Minimize these includes
-./inc/database.php:51:// @TODO Rewrite this
-./inc/includes.php:11: * @todo         Minimize these includes
-./inc/includes.php:37:// @TODO This makes the core depending on the SPL. But it should be installed anyway.
-./inc/includes.php:41:// @TODO Find a nicer OOP-ed way for this
-./inc/loader/class_ClassLoader.php:319:                        /* @TODO: Do not exit here. */
-./inc/main/classes/class_BaseFrameworkSystem.php:2133:                 // @TODO Move the constant to e.g. BaseDatabaseResult when there is a non-cached database result available
-./inc/main/classes/class_BaseFrameworkSystem.php:2248:  * @todo        Write a logging mechanism for productive mode
-./inc/main/classes/class_BaseFrameworkSystem.php:2263:                 // @TODO Finish this part!
-./inc/main/classes/class_BaseFrameworkSystem.php:308:  // @todo Try to clean these constants up
-./inc/main/classes/class_BaseFrameworkSystem.php:3291:  * @todo        Improve documentation
-./inc/main/classes/class_BaseFrameworkSystem.php:3453:  * @todo        Move all this socket-related stuff into own class, most of it resides in BaseListener
-./inc/main/classes/class_BaseFrameworkSystem.php:550:          // @TODO __CLASS__ does always return BaseFrameworkSystem but not the extending (=child) class
-./inc/main/classes/class_BaseFrameworkSystem.php:654:   * @todo        SearchableResult and UpdateableResult shall have a super interface to use here
-./inc/main/classes/commands/console/class_ConsoleFuseCommand.php:72:           // @TODO Unfinished
-./inc/main/classes/commands/html/class_HtmlLoginAreaCommand.php:64:     * @todo        Add some stuff here: Some personal data, app/game related data
-./inc/main/classes/commands/html/class_HtmlProblemCommand.php:58:       * @todo        0% done
-./inc/main/classes/commands/html/class_HtmlStatusCommand.php:58:        * @todo        0% done
-./inc/main/classes/console/class_ConsoleTools.php:268:  * @todo        This should be moved out to an external class, e.g. HttpClient
-./inc/main/classes/console/class_ConsoleTools.php:269:  * @todo        Make IP, host name, port and script name configurable
-./inc/main/classes/console/class_ConsoleTools.php:276:         // @TODO Add some DNS caching here
-./inc/main/classes/console/class_ConsoleTools.php:45:   * @todo        We should connect this to a caching class to cache DNS requests
-./inc/main/classes/console/class_ConsoleTools.php:58:          // @TODO Here should the cacher be implemented
-./inc/main/classes/controller/console/class_ConsoleDefaultController.php:10: * @todo           This controller shall still provide some headlines for sidebars
-./inc/main/classes/controller/html/class_HtmlConfirmController.php:40:  * @todo        Add some filters to this controller
-./inc/main/classes/controller/html/class_HtmlDefaultController.php:10: * @todo         This controller shall still provide some headlines for sidebars
-./inc/main/classes/controller/html/class_HtmlLoginController.php:41:    * @todo        Add some filters to this controller
-./inc/main/classes/controller/html/class_HtmlLogoutController.php:10: * @todo          This controller shall still provide some headlines for sidebars
-./inc/main/classes/controller/html/class_HtmlLogoutDoneController.php:40:       * @todo        Add some filters to this controller
-./inc/main/classes/controller/html/class_HtmlProblemController.php:40:  * @todo        Add some filters to this controller
-./inc/main/classes/controller/html/class_HtmlRegisterController.php:40:         * @todo        Add some filters to this controller
-./inc/main/classes/controller/html/class_HtmlStatusController.php:10: * @todo          This controller shall still provide some headlines for sidebars
-./inc/main/classes/controller/html/login/class_HtmlLoginAreaController.php:40:  * @todo        Add some morer filters to this controller
-./inc/main/classes/criteria/dataset/class_DataSetCriteria.php:150:                     // @TODO Issue a warning
-./inc/main/classes/criteria/search/class_SearchCriteria.php:102:        * @todo        Find a nice casting here. (int) allows until and including 32766.
-./inc/main/classes/criteria/search/class_SearchCriteria.php:70:         * @todo        Find a nice casting here. (int) allows until and including 32766.
-./inc/main/classes/database/backend/class_CachedLocalFileDatabase.php:327:      * @todo        Do some checks on the database directory and files here
-./inc/main/classes/database/backend/class_CachedLocalFileDatabase.php:616:      * @todo        Add more generic non-public data for removal
-./inc/main/classes/database/class_BaseDatabaseWrapper.php:204:         // @TODO Minor: Update above comment to e.g. BaseDatabaseResult
-./inc/main/classes/database/frontend/class_NewsDatabaseWrapper.php:10: * @todo         Add missing own interface for public methods
-./inc/main/classes/database/frontend/class_PaymentsDatabaseWrapper.php:10: * @todo             Add missing own interface for public methods
-./inc/main/classes/database/result/class_CachedDatabaseResult.php:244:  * @todo        0% done
-./inc/main/classes/database/result/class_CachedDatabaseResult.php:398:  * @todo        Find a caching way without modifying the result array
-./inc/main/classes/decorator/template/class_XmlRewriterTemplateDecorator.php:407:       * @todo        Find something useful with this!
-./inc/main/classes/discovery/payment/class_LocalPaymentDiscovery.php:85:        * @todo        0% done
-./inc/main/classes/factories/logger/class_LoggerFactory.php:46:                // @TODO Unfinished work
-./inc/main/classes/factories/login/class_LoginFactory.php:39:   * @return      $loginInstance          An instance of a login helper (@TODO Use actual interface name)
-./inc/main/classes/factories/user/class_UserFactory.php:39:     * @return      $userInstance           An instance of a user class (@TODO use actual interface name)
-./inc/main/classes/feature/fuse/class_FuseFeature.php:52:       * @todo        0% done
-./inc/main/classes/file_directories/binary/class_BaseBinaryFile.php:848:               // @TODO Unfinished
-./inc/main/classes/file_directories/class_BaseAbstractFile.php:154:     * @todo        Handle seekStatus
-./inc/main/classes/file_directories/class_BaseFileIo.php:171:   * @todo        Handle seekStatus
-./inc/main/classes/file_directories/directory/class_FrameworkDirectoryPointer.php:68:   * @todo        Get rid of inConstructor, could be old-lost code.
-./inc/main/classes/file_directories/io_stream/class_FileIoStream.php:264:       * @todo        0% done
-./inc/main/classes/file_directories/io_stream/class_FileIoStream.php:74:        * @todo        This method needs heavy rewrite
-./inc/main/classes/filter/change/class_EmailChangeFilter.php:55:        * @todo        Implement email change of the user here. HINT: Use the User class!
-./inc/main/classes/filter/change/class_PasswordChangeFilter.php:55:     * @todo        Finished updating user password hash here. HINT: Use the User class again.
-./inc/main/classes/filter/news/class_NewsProcessFilter.php:55:  * @todo        Unfinished stub, add functionality here
-./inc/main/classes/filter/payment/class_PaymentDiscoveryFilter.php:97:  * @todo        0% done
-./inc/main/classes/filter/update/class_UserUpdateFilter.php:55:         * @todo        Add more user updates here
-./inc/main/classes/filter/verifier/class_AccountPasswordVerifierFilter.php:57:  * @todo        Rewrite handling of different password fields
-./inc/main/classes/handler/class_BaseHandler.php:66:    * @todo        Rewrite this to use DHT
-./inc/main/classes/handler/raw_data/network/class_BaseRawDataHandler.php:149:   * @todo        This method will be moved to a better place
-./inc/main/classes/handler/tasks/class_TaskHandler.php:142:            // @TODO Messurement can be added around this call
-./inc/main/classes/helper/class_BaseHelper.php:183:     * @todo        Rewrite this method using a helper class for filtering data
-./inc/main/classes/helper/class_BaseHelper.php:212:                    // @TODO Try to log it here
-./inc/main/classes/helper/class_BaseHelper.php:478:                    $this->debugOutput('[' . __METHOD__ . ':' . __LINE__ . '] fieldName=' . $fieldName . ' is not set! - @TODO');
-./inc/main/classes/helper/html/forms/class_HtmlFormHelper.php:102:      * @todo        Add some unique PIN here to bypass problems with some browser and/or extensions
-./inc/main/classes/helper/html/forms/class_HtmlFormHelper.php:621:      * @todo        Add checking if sub option is already added
-./inc/main/classes/helper/html/forms/class_HtmlFormHelper.php:649:      * @todo        Add checking if sub option is already added
-./inc/main/classes/helper/html/forms/class_HtmlFormHelper.php:683:                     // @TODO We need to log this later
-./inc/main/classes/helper/html/forms/class_HtmlFormHelper.php:852:      * @todo        Implement check if rules have been changed
-./inc/main/classes/helper/html/links/class_HtmlLinkHelper.php:184:      * @todo        Completely unimplemented
-./inc/main/classes/images/class_BaseImage.php:172:      * @todo        Find something usefull for this method.
-./inc/main/classes/images/class_BaseImage.php:182:      * @todo        Find something usefull for this method.
-./inc/main/classes/images/class_BaseImage.php:192:      * @todo        Find something usefull for this method.
-./inc/main/classes/images/class_BaseImage.php:202:      * @todo        Find something usefull for this method.
-./inc/main/classes/images/class_BaseImage.php:212:      * @todo        Find something usefull for this method.
-./inc/main/classes/images/class_BaseImage.php:231:      * @todo        Find something usefull for this method.
-./inc/main/classes/images/class_BaseImage.php:250:      * @todo        Find something usefull for this method.
-./inc/main/classes/images/class_BaseImage.php:261:      * @todo        Find something usefull for this method.
-./inc/main/classes/images/class_BaseImage.php:271:      * @todo        Find something usefull for this method.
-./inc/main/classes/index/class_BaseIndex.php:150:       * @todo        Currently the index file is not cached, please implement a memory-handling class and if enough RAM is found, cache the whole index file.
-./inc/main/classes/listener/class_BaseListener.php:346:                                // @TODO On some systems it is 134, on some 107?
-./inc/main/classes/listener/class_BaseListener.php:519:                        // @TODO Does this work on Windozer boxes???
-./inc/main/classes/lists/class_BaseList.php:305:                       // @TODO Extend this somehow?
-./inc/main/classes/lists/groups/class_ListGroupList.php:61:     * @todo        0% done
-./inc/main/classes/mailer/debug/class_DebugMailer.php:124:      * @todo        0% done
-./inc/main/classes/menu/class_BaseMenu.php:65:                 // Log exception @TODO Maybe to intrusive?
-./inc/main/classes/output/console/class_ConsoleOutput.php:56:          // @TODO Need to rewrite this to $requestInstance->addHeader()
-./inc/main/classes/parser/xml/class_XmlParser.php:79:                  // @TODO We need to find a fallback solution here
-./inc/main/classes/points/class_UserPoints.php:100:     * @todo        Finish loading part of points
-./inc/main/classes/request/console/class_ConsoleRequest.php:112:               // @TODO Can't this be 'CONSOLE' ?
-./inc/main/classes/request/html/class_HtmlRequest.php:10: * @todo              Move out the cookie part to a seperate class, e.g. Cookie
-./inc/main/classes/response/html/class_HtmlResponse.php:83:     * @todo        Encryption of cookie data not yet supported.
-./inc/main/classes/response/html/class_HtmlResponse.php:84:     * @todo        Why are these parameters conflicting?
-./inc/main/classes/response/html/class_HtmlResponse.php:85:     * @todo        If the return statement is removed and setcookie() commented out,
-./inc/main/classes/response/html/class_HtmlResponse.php:86:     * @todo        this will send only one cookie out, the first one.
-./inc/main/classes/response/image/class_ImageResponse.php:79:          // @TODO Please fix this
-./inc/main/classes/response/image/class_ImageResponse.php:95:   * @todo        Encryption of cookie data not yet supported.
-./inc/main/classes/response/image/class_ImageResponse.php:96:   * @todo        Why are these parameters conflicting?
-./inc/main/classes/response/image/class_ImageResponse.php:97:   * @todo        If the return statement is removed and setcookie() commented out,
-./inc/main/classes/response/image/class_ImageResponse.php:98:   * @todo        this will send only one cookie out, the first one.
-./inc/main/classes/rng/class_RandomNumberGenerator.php:175:     * @todo        I had a better random number generator here but now it is somewhere lost :(
-./inc/main/classes/rng/class_RandomNumberGenerator.php:97:      * @todo        Add site key for stronger salt!
-./inc/main/classes/stacker/file/class_BaseFileStack.php:162:    * @todo        Currently the stack file is not cached, please implement a memory-handling class and if enough RAM is found, cache the whole stack file.
-./inc/main/classes/stacker/file/class_BaseFileStack.php:337:           // @TODO Please implement this, returning FALSE
-./inc/main/classes/stacker/file/class_BaseFileStack.php:60:     * @todo        To hard assertions here, better rewrite them to exceptions
-./inc/main/classes/template/class_BaseTemplateEngine.php:1064:                 // @TODO This silent abort should be logged, maybe.
-./inc/main/classes/template/class_BaseTemplateEngine.php:1072:                 // @TODO Old behaviour, will become obsolete!
-./inc/main/classes/template/class_BaseTemplateEngine.php:1075:                 // @TODO Yet another old way
-./inc/main/classes/template/class_BaseTemplateEngine.php:1298:  * @todo        Make this code some nicer...
-./inc/main/classes/template/class_BaseTemplateEngine.php:961:   * @todo        Unfinished work or don't die here.
-./inc/main/classes/template/class_BaseTemplateEngine.php:986:                          // @TODO Non-string found so we need some deeper analysis...
-./inc/main/classes/template/console/class_ConsoleTemplateEngine.php:10: * @todo                This template engine does not make use of setTemplateType()
-./inc/main/classes/template/image/class_ImageTemplateEngine.php:215:    * @todo        Find something usefull with this!
-./inc/main/classes/template/image/class_ImageTemplateEngine.php:235:    * @todo        Add cache creation here
-./inc/main/classes/template/mail/class_MailTemplateEngine.php:10: * @todo              This template engine does not make use of setTemplateType()
-./inc/main/classes/template/mail/class_MailTemplateEngine.php:228:      * @todo        Add cache creation here
-./inc/main/classes/template/mail/class_MailTemplateEngine.php:238:      * @todo        Should we call back the mailer class here?
-./inc/main/classes/template/mail/class_MailTemplateEngine.php:317:      * @todo        0% done
-./inc/main/classes/template/menu/class_MenuTemplateEngine.php:305:      * @todo        Find something useful with this!
-./inc/main/classes/template/menu/class_MenuTemplateEngine.php:351:      * @todo        Add cache creation here
-./inc/main/classes/user/class_BaseUser.php:309:         * @todo        Try to make this method more generic so we can move it in BaseFrameworkSystem
-./inc/main/classes/user/class_BaseUser.php:81:  * @todo        Find a way of casting here. "(int)" might destroy the user id > 32766
-./inc/main/classes/user/guest/class_Guest.php:46:       * @todo        Add more ways over creating user classes
-./inc/main/classes/user/member/class_Member.php:88:     * @todo        Add more ways over creating user classes
-./inc/main/exceptions/config/class_NoConfigEntryException.php:10: * @todo              Rename this class to NoFoundEntryException
-./inc/main/exceptions/main/class_MissingMethodException.php:13: * @todo                Try to rewrite user/guest login classes and mark this exception as deprecated
-./inc/main/interfaces/application/class_ManageableApplication.php:58:   * @todo        Nothing to add?
-./inc/main/interfaces/class_FrameworkInterface.php:11: * @todo         Find a better name for this interface
-./inc/main/interfaces/criteria/extended/class_LocalSearchCriteria.php:30:       * @todo        Find a nice casting here. (int) allows until and including 32766.
-./inc/main/interfaces/criteria/extended/class_LocalSearchCriteria.php:54:       * @todo        Find a nice casting here. (int) allows until and including 32766.
-./inc/main/interfaces/database/backend/class_DatabaseBackend.php:109:   * @todo        Add more generic non-data for removal
-./inc/main/interfaces/database/backend/class_DatabaseBackend.php:61:    * @todo        Do some checks on the database directory and files here
-./inc/main/interfaces/handler/task/class_HandleableTask.php:10: * @todo                HandleableDataSet looks strange here
-./inc/main/middleware/compressor/class_CompressorChannel.php:103:                      // @TODO Is there a configurable fall-back compressor needed, or is NullCompressor okay?
-./inc/main/middleware/debug/class_DebugMiddleware.php:118:                     // @TODO Initialization phase
-./inc/main/middleware/io/class_FileIoHandler.php:174:   * @todo        0% done
-./inc/main/third_party/api/wernisportal/class_WernisApi.php:10: * @todo                Out-dated since 0.6-BETA
-./inc/selector.php:11: * @todo         Minimize these includes
-./index.php:43:         * @todo        This method is old code and needs heavy rewrite and should be moved to ApplicationHelper
+./application/tests/class_ApplicationHelper.php:273:    * @todo        Nothing to add?
+./framework/config/class_FrameworkConfiguration.php:126:        * @todo        This method encapsulates a deprecated PHP function and should be deprecated, too.
+./framework/config/class_FrameworkConfiguration.php:251:        * @todo        Have to check some more entries from $_SERVER here
+./framework/loader/class_ClassLoader.php:232:                          // @TODO Throw exception instead of break
+./framework/loader/class_ClassLoader.php:423:                  /* @TODO: Do not exit here. */
+./framework/main/classes/cache/class_MemoryCache.php:17: * @todo               Rename to InProgressCache
+./framework/main/classes/class_BaseFrameworkSystem.php:2136:                   // @TODO Move the constant to e.g. BaseDatabaseResult when there is a non-cached database result available
+./framework/main/classes/class_BaseFrameworkSystem.php:2251:    * @todo        Write a logging mechanism for productive mode
+./framework/main/classes/class_BaseFrameworkSystem.php:2266:                   // @TODO Finish this part!
+./framework/main/classes/class_BaseFrameworkSystem.php:3266:    * @todo        Improve documentation
+./framework/main/classes/class_BaseFrameworkSystem.php:3376:    * @todo        Move all this socket-related stuff into own class, most of it resides in BaseListener
+./framework/main/classes/class_BaseFrameworkSystem.php:345:    // @todo Try to clean these constants up
+./framework/main/classes/class_BaseFrameworkSystem.php:590:            // @TODO __CLASS__ does always return BaseFrameworkSystem but not the extending (=child) class
+./framework/main/classes/class_BaseFrameworkSystem.php:694:     * @todo        SearchableResult and UpdateableResult shall have a super interface to use here
+./framework/main/classes/commands/console/class_ConsoleFuseCommand.php:83:             // @TODO Unfinished
+./framework/main/classes/commands/html/class_HtmlLoginAreaCommand.php:78:       * @todo        Add some stuff here: Some personal data, app/game related data
+./framework/main/classes/commands/html/class_HtmlProblemCommand.php:70:         * @todo        0% done
+./framework/main/classes/commands/html/class_HtmlStatusCommand.php:70:  * @todo        0% done
+./framework/main/classes/console/class_ConsoleTools.php:166:    * @todo        This should be connected to a caching class to cache DNS requests
+./framework/main/classes/console/class_ConsoleTools.php:191:           // @TODO Here should the cacher be implemented
+./framework/main/classes/console/class_ConsoleTools.php:289:    * @todo        This should be moved out to an external class, e.g. HttpClient
+./framework/main/classes/console/class_ConsoleTools.php:290:    * @todo        Make IP, host name, port and script name configurable
+./framework/main/classes/console/class_ConsoleTools.php:297:           // @TODO Add some DNS caching here
+./framework/main/classes/controller/console/class_ConsoleDefaultController.php:19: * @todo             This controller shall still provide some headlines for sidebars
+./framework/main/classes/controller/html/class_HtmlConfirmController.php:50:    * @todo        Add some filters to this controller
+./framework/main/classes/controller/html/class_HtmlDefaultController.php:20: * @todo           This controller shall still provide some headlines for sidebars
+./framework/main/classes/controller/html/class_HtmlLoginController.php:51:      * @todo        Add some filters to this controller
+./framework/main/classes/controller/html/class_HtmlLogoutController.php:21: * @todo            This controller shall still provide some headlines for sidebars
+./framework/main/classes/controller/html/class_HtmlLogoutDoneController.php:50:         * @todo        Add some filters to this controller
+./framework/main/classes/controller/html/class_HtmlProblemController.php:50:    * @todo        Add some filters to this controller
+./framework/main/classes/controller/html/class_HtmlRegisterController.php:50:   * @todo        Add some filters to this controller
+./framework/main/classes/controller/html/class_HtmlStatusController.php:20: * @todo            This controller shall still provide some headlines for sidebars
+./framework/main/classes/controller/html/login/class_HtmlLoginAreaController.php:51:    * @todo        Add some morer filters to this controller
+./framework/main/classes/criteria/dataset/class_DataSetCriteria.php:157:                       // @TODO Issue a warning
+./framework/main/classes/criteria/search/class_SearchCriteria.php:109:  * @todo        Find a nice casting here. (int) allows until and including 32766.
+./framework/main/classes/criteria/search/class_SearchCriteria.php:77:   * @todo        Find a nice casting here. (int) allows until and including 32766.
+./framework/main/classes/database/backend/class_CachedLocalFileDatabase.php:339:        * @todo        Do some checks on the database directory and files here
+./framework/main/classes/database/backend/class_CachedLocalFileDatabase.php:628:        * @todo        Add more generic non-public data for removal
+./framework/main/classes/database/class_BaseDatabaseWrapper.php:214:           // @TODO Minor: Update above comment to e.g. BaseDatabaseResult
+./framework/main/classes/database/frontend/class_NewsDatabaseWrapper.php:17: * @todo           Add missing own interface for public methods
+./framework/main/classes/database/frontend/class_PaymentsDatabaseWrapper.php:16: * @todo               Add missing own interface for public methods
+./framework/main/classes/database/result/class_CachedDatabaseResult.php:260:    * @todo        0% done
+./framework/main/classes/database/result/class_CachedDatabaseResult.php:414:    * @todo        Find a caching way without modifying the result array
+./framework/main/classes/decorator/template/class_XmlRewriterTemplateDecorator.php:415:         * @todo        Find something useful with this!
+./framework/main/classes/discovery/payment/class_LocalPaymentDiscovery.php:95:  * @todo        0% done
+./framework/main/classes/factories/logger/class_LoggerFactory.php:53:          // @TODO Unfinished work
+./framework/main/classes/factories/login/class_LoginFactory.php:47:     * @return      $loginInstance          An instance of a login helper (@TODO Use actual interface name)
+./framework/main/classes/factories/user/class_UserFactory.php:48:       * @return      $userInstance           An instance of a user class (@TODO use actual interface name)
+./framework/main/classes/feature/fuse/class_FuseFeature.php:59:         * @todo        0% done
+./framework/main/classes/file_directories/binary/class_BaseBinaryFile.php:856:         // @TODO Unfinished
+./framework/main/classes/file_directories/class_BaseAbstractFile.php:162:       * @todo        Handle seekStatus
+./framework/main/classes/file_directories/class_BaseFileIo.php:180:     * @todo        Handle seekStatus
+./framework/main/classes/file_directories/directory/class_FrameworkDirectoryPointer.php:78:     * @todo        Get rid of inConstructor, could be old-lost code.
+./framework/main/classes/file_directories/io_stream/class_FileIoStream.php:273:         * @todo        0% done
+./framework/main/classes/file_directories/io_stream/class_FileIoStream.php:83:  * @todo        This method needs heavy rewrite
+./framework/main/classes/filter/change/class_EmailChangeFilter.php:65:  * @todo        Implement email change of the user here. HINT: Use the User class!
+./framework/main/classes/filter/change/class_PasswordChangeFilter.php:65:       * @todo        Finished updating user password hash here. HINT: Use the User class again.
+./framework/main/classes/filter/news/class_NewsProcessFilter.php:64:    * @todo        Unfinished stub, add functionality here
+./framework/main/classes/filter/payment/class_PaymentDiscoveryFilter.php:111:   * @todo        0% done
+./framework/main/classes/filter/update/class_UserUpdateFilter.php:65:   * @todo        Add more user updates here
+./framework/main/classes/filter/verifier/class_AccountPasswordVerifierFilter.php:69:    * @todo        Rewrite handling of different password fields
+./framework/main/classes/filter/verifier/class_EmailVerifierFilter.php:64:      * @todo        0% done
+./framework/main/classes/handler/class_BaseHandler.php:74:      * @todo        Rewrite this to use DHT
+./framework/main/classes/handler/raw_data/network/class_BaseRawDataHandler.php:156:     * @todo        This method will be moved to a better place
+./framework/main/classes/handler/tasks/class_TaskHandler.php:153:              // @TODO Messurement can be added around this call
+./framework/main/classes/helper/class_BaseHelper.php:193:       * @todo        Rewrite this method using a helper class for filtering data
+./framework/main/classes/helper/class_BaseHelper.php:222:                      // @TODO Try to log it here
+./framework/main/classes/helper/class_BaseHelper.php:488:                      $this->debugOutput('[' . __METHOD__ . ':' . __LINE__ . '] fieldName=' . $fieldName . ' is not set! - @TODO');
+./framework/main/classes/helper/html/forms/class_HtmlFormHelper.php:113:        * @todo        Add some unique PIN here to bypass problems with some browser and/or extensions
+./framework/main/classes/helper/html/forms/class_HtmlFormHelper.php:632:        * @todo        Add checking if sub option is already added
+./framework/main/classes/helper/html/forms/class_HtmlFormHelper.php:660:        * @todo        Add checking if sub option is already added
+./framework/main/classes/helper/html/forms/class_HtmlFormHelper.php:694:                       // @TODO We need to log this later
+./framework/main/classes/helper/html/forms/class_HtmlFormHelper.php:863:        * @todo        Implement check if rules have been changed
+./framework/main/classes/helper/html/links/class_HtmlLinkHelper.php:194:        * @todo        Completely unimplemented
+./framework/main/classes/images/class_BaseImage.php:179:        * @todo        Find something usefull for this method.
+./framework/main/classes/images/class_BaseImage.php:189:        * @todo        Find something usefull for this method.
+./framework/main/classes/images/class_BaseImage.php:199:        * @todo        Find something usefull for this method.
+./framework/main/classes/images/class_BaseImage.php:209:        * @todo        Find something usefull for this method.
+./framework/main/classes/images/class_BaseImage.php:219:        * @todo        Find something usefull for this method.
+./framework/main/classes/images/class_BaseImage.php:238:        * @todo        Find something usefull for this method.
+./framework/main/classes/images/class_BaseImage.php:257:        * @todo        Find something usefull for this method.
+./framework/main/classes/images/class_BaseImage.php:268:        * @todo        Find something usefull for this method.
+./framework/main/classes/images/class_BaseImage.php:278:        * @todo        Find something usefull for this method.
+./framework/main/classes/index/class_BaseIndex.php:159:         * @todo        Currently the index file is not cached, please implement a memory-handling class and if enough RAM is found, cache the whole index file.
+./framework/main/classes/listener/class_BaseListener.php:356:                          // @TODO On some systems it is 134, on some 107?
+./framework/main/classes/listener/class_BaseListener.php:529:                  // @TODO Does this work on Windozer boxes???
+./framework/main/classes/lists/class_BaseList.php:318:                 // @TODO Extend this somehow?
+./framework/main/classes/lists/groups/class_ListGroupList.php:68:       * @todo        0% done
+./framework/main/classes/mailer/debug/class_DebugMailer.php:137:        * @todo        0% done
+./framework/main/classes/menu/class_BaseMenu.php:75:                   // Log exception @TODO Maybe to intrusive?
+./framework/main/classes/output/console/class_ConsoleOutput.php:64:            // @TODO Need to rewrite this to $requestInstance->addHeader()
+./framework/main/classes/parser/xml/class_XmlParser.php:87:                    // @TODO We need to find a fallback solution here
+./framework/main/classes/points/class_UserPoints.php:112:       * @todo        Finish loading part of points
+./framework/main/classes/points/class_UserPoints.php:184:       * @todo        $requestInstance is currently unused
+./framework/main/classes/request/console/class_ConsoleRequest.php:118:         // @TODO Can't this be 'CONSOLE' ?
+./framework/main/classes/request/html/class_HtmlRequest.php:16: * @todo                Move out the cookie part to a seperate class, e.g. Cookie
+./framework/main/classes/response/html/class_HtmlResponse.php:80:       * @todo        Encryption of cookie data not yet supported.
+./framework/main/classes/response/html/class_HtmlResponse.php:81:       * @todo        Why are these parameters conflicting?
+./framework/main/classes/response/html/class_HtmlResponse.php:82:       * @todo        If the return statement is removed and setcookie() commented out,
+./framework/main/classes/response/html/class_HtmlResponse.php:83:       * @todo        this will send only one cookie out, the first one.
+./framework/main/classes/response/image/class_ImageResponse.php:76:            // @TODO Please fix this
+./framework/main/classes/response/image/class_ImageResponse.php:92:     * @todo        Encryption of cookie data not yet supported.
+./framework/main/classes/response/image/class_ImageResponse.php:93:     * @todo        Why are these parameters conflicting?
+./framework/main/classes/response/image/class_ImageResponse.php:94:     * @todo        If the return statement is removed and setcookie() commented out,
+./framework/main/classes/response/image/class_ImageResponse.php:95:     * @todo        this will send only one cookie out, the first one.
+./framework/main/classes/rng/class_RandomNumberGenerator.php:104:       * @todo        Add site key for stronger salt!
+./framework/main/classes/rng/class_RandomNumberGenerator.php:182:       * @todo        I had a better random number generator here but now it is somewhere lost :(
+./framework/main/classes/stacker/file/class_BaseFileStack.php:170:      * @todo        Currently the stack file is not cached, please implement a memory-handling class and if enough RAM is found, cache the whole stack file.
+./framework/main/classes/stacker/file/class_BaseFileStack.php:345:             // @TODO Please implement this, returning false
+./framework/main/classes/stacker/file/class_BaseFileStack.php:68:       * @todo        To hard assertions here, better rewrite them to exceptions
+./framework/main/classes/streams/crypto/class_McryptStream.php:16: * @todo             mcrypt will become deprecated, rewrite to OpenSSL
+./framework/main/classes/template/class_BaseTemplateEngine.php:1065:                   // @TODO This silent abort should be logged, maybe.
+./framework/main/classes/template/class_BaseTemplateEngine.php:1073:                   // @TODO Old behaviour, will become obsolete!
+./framework/main/classes/template/class_BaseTemplateEngine.php:1076:                   // @TODO Yet another old way
+./framework/main/classes/template/class_BaseTemplateEngine.php:1299:    * @todo        Make this code some nicer...
+./framework/main/classes/template/class_BaseTemplateEngine.php:962:     * @todo        Unfinished work or don't die here.
+./framework/main/classes/template/class_BaseTemplateEngine.php:987:                            // @TODO Non-string found so we need some deeper analysis...
+./framework/main/classes/template/console/class_ConsoleTemplateEngine.php:21: * @todo          This template engine does not make use of setTemplateType()
+./framework/main/classes/template/image/class_ImageTemplateEngine.php:231:      * @todo        Find something usefull with this!
+./framework/main/classes/template/image/class_ImageTemplateEngine.php:251:      * @todo        Add cache creation here
+./framework/main/classes/template/mail/class_MailTemplateEngine.php:244:        * @todo        Add cache creation here
+./framework/main/classes/template/mail/class_MailTemplateEngine.php:24: * @todo                This template engine does not make use of setTemplateType()
+./framework/main/classes/template/mail/class_MailTemplateEngine.php:254:        * @todo        Should we call back the mailer class here?
+./framework/main/classes/template/mail/class_MailTemplateEngine.php:333:        * @todo        0% done
+./framework/main/classes/template/menu/class_MenuTemplateEngine.php:319:        * @todo        Find something useful with this!
+./framework/main/classes/template/menu/class_MenuTemplateEngine.php:365:        * @todo        Add cache creation here
+./framework/main/classes/user/class_BaseUser.php:320:   * @todo        Try to make this method more generic so we can move it in BaseFrameworkSystem
+./framework/main/classes/user/class_BaseUser.php:92:    * @todo        Find a way of casting here. "(int)" might destroy the user id > 32766
+./framework/main/classes/user/guest/class_Guest.php:55:         * @todo        Add more ways over creating user classes
+./framework/main/classes/user/member/class_Member.php:98:       * @todo        Add more ways over creating user classes
+./framework/main/exceptions/compressor/class_MismatchingCompressorsException.php:16: * @todo           Rename to CompressorMismatchException
+./framework/main/exceptions/config/class_ConfigValueTypeUnsupportedException.php:18: * @todo           These are invalid argument exceptions
+./framework/main/exceptions/config/class_NoConfigEntryException.php:16: * @todo                Rename this class to NoFoundEntryException
+./framework/main/exceptions/language/class_LanguagePathIsNoDirectoryException.php:16: * @todo          Don't use this anymore
+./framework/main/exceptions/main/class_MissingMethodException.php:19: * @todo          Try to rewrite user/guest login classes and mark this exception as deprecated
+./framework/main/exceptions/socket/class_NoSocketErrorDetectedException.php:15: * @todo                Those are logic exceptions and should be rewritten
+./framework/main/exceptions/user/class_UserNoGuestException.php:17: * @todo            Better rename this
+./framework/main/interfaces/application/class_ManageableApplication.php:79:     * @todo        Nothing to add?
+./framework/main/interfaces/class_FrameworkInterface.php:14: * @todo           Find a better name for this interface
+./framework/main/interfaces/criteria/extended/class_LocalSearchCriteria.php:36:         * @todo        Find a nice casting here. (int) allows until and including 32766.
+./framework/main/interfaces/criteria/extended/class_LocalSearchCriteria.php:60:         * @todo        Find a nice casting here. (int) allows until and including 32766.
+./framework/main/interfaces/database/backend/class_DatabaseBackend.php:117:     * @todo        Add more generic non-data for removal
+./framework/main/interfaces/database/backend/class_DatabaseBackend.php:69:      * @todo        Do some checks on the database directory and files here
+./framework/main/interfaces/handler/task/class_HandleableTask.php:18: * @todo          HandleableDataSet looks strange here
+./framework/main/interfaces/visitor/decorator/class_DecoratorVisitor.php:37:    * @todo        Find interface for this type-hint (only interface/array as type-hints rule)
+./framework/main/middleware/compressor/class_CompressorChannel.php:121:                        // @TODO Is there a configurable fall-back compressor needed, or is NullCompressor okay?
+./framework/main/middleware/database/class_DatabaseConnection.php:70:   * @todo        $debugInstance is currently not used
+./framework/main/middleware/debug/class_DebugMiddleware.php:128:                       // @TODO Initialization phase
+./framework/main/middleware/io/class_FileIoHandler.php:185:     * @todo        0% done
+./framework/main/tests/filter/tests/configuration/classes/class_TestConfigurationLoadableClassesFilter.php:66:  * @todo        0% done
+./framework/main/tests/filter/tests/requirements/class_TestsPhpRequirementsFilter.php:63:       * @todo        0% done
+./framework/main/third_party/api/wernisportal/class_WernisApi.php:16: * @todo          Out-dated since 0.6-BETA
+./index.php:58:         * @todo        This method is old code and needs heavy rewrite and should be moved to ApplicationHelper
 ### ### DEPRECATION FOLLOWS: ### ###
-./inc/classes.php:2:// @DEPRECATED
-./inc/database.php:10: * @deprecated
-./inc/includes.php:10: * @deprecated
-./inc/main/classes/class_BaseFrameworkSystem.php:1882:  * @deprecated  Not fully, as the new Logger facilities are not finished yet.
-./inc/main/exceptions/main/class_MissingMethodException.php:14: * @deprecated  Please do no longer use this exception
-./inc/main/middleware/debug/class_DebugMiddleware.php:12: * @deprecated        See LoggerFactory for a more flexible approach
-./inc/selector.php:10: * @deprecated
+./application/tests/data.php:2:// @DEPRECATED
+./application/tests/init.php:2:// @DEPRECATED
+./application/tests/loader.php:2:// @DEPRECATED
+./application/tests/starter.php:2:// @DEPRECATED
+./framework/classes.php:2:// @DEPRECATED
+./framework/config/config-hubmaster.php:2:// @DEPRECATED
+./framework/config-global.php:54:// @DEPRECATED As PHP is deprecating this
+./framework/database/lib-lfdb.php:2:// @DEPRECATED
+./framework/database.php:2:// @DEPRECATED
+./framework/includes.php:2:// @DEPRECATED
+./framework/main/classes/class_BaseFrameworkSystem.php:1885:    * @deprecated  Not fully, as the new Logger facilities are not finished yet.
+./framework/main/exceptions/base64/class_Base64EncodingBadException.php:17: * @deprecated      Don't use this anymore
+./framework/main/exceptions/base64/class_Base64EncodingModuloException.php:16: * @deprecated   Don't use this anymore
+./framework/main/exceptions/crypto/class_EncryptInvalidLengthException.php:17: * @deprecated   Don't use this anymore
+./framework/main/exceptions/crypto/class_EncryptMissingException.php:17: * @deprecated Don't use this anymore
+./framework/main/exceptions/database/local_file/class_SavePathIsEmptyException.php:16: * @deprecated   Please don't use this anymore.
+./framework/main/exceptions/database/local_file/class_SavePathIsNoDirectoryException.php:13: * @deprecated     Don't use this
+./framework/main/exceptions/database/local_file/class_SavePathReadProtectedException.php:13: * @deprecated     Please don't use this
+./framework/main/exceptions/database/local_file/class_SavePathWriteProtectedException.php:13: * @deprecated    Please don't use this
+./framework/main/exceptions/file_directory/class_FileIsEmptyException.php:16: * @deprecated    Don't use this anymore
+./framework/main/exceptions/file_directory/class_FileReadProtectedException.php:16: * @deprecated      Don't read this anymore
+./framework/main/exceptions/file_directory/class_FileWriteProtectedException.php:16: * @deprecated     Don't use this anymore
+./framework/main/exceptions/file_directory/class_InvalidDataLengthException.php:16: * @deprecated      Don't use this anymore
+./framework/main/exceptions/file_directory/class_InvalidMD5ChecksumException.php:16: * @deprecated     Don't use this anymore
+./framework/main/exceptions/file_directory/class_PathIsNoDirectoryException.php:16: * @deprecated      Don't use this anymore
+./framework/main/exceptions/file_directory/class_PathReadProtectedException.php:16: * @deprecated      Don't use this anymore
+./framework/main/exceptions/file_directory/class_PathWriteProtectedException.php:16: * @deprecated     Don't use this anymore
+./framework/main/exceptions/filter/class_InvalidFilterChainException.php:16: * @deprecated     Don't use this anymore
+./framework/main/exceptions/helper/class_FormClosedException.php:17: * @deprecated     Don't use this anymore
+./framework/main/exceptions/helper/class_FormGroupClosedException.php:16: * @deprecated        Don't use this anymore
+./framework/main/exceptions/helper/class_FormOpenedException.php:17: * @deprecated     Don't use this anymore
+./framework/main/exceptions/helper/class_HelperGroupAlreadyCreatedException.php:16: * @deprecated      Don't use this anymore
+./framework/main/exceptions/helper/class_HelperNoPreviousOpenedSubGroupException.php:16: * @deprecated Don't use this anymore
+./framework/main/exceptions/helper/class_HelperSubGroupAlreadyCreatedException.php:16: * @deprecated   Don't use this anymore
+./framework/main/exceptions/helper/class_InvalidFormNameException.php:16: * @deprecated        Don't use this anymore
+./framework/main/exceptions/helper/class_NoGroupOpenedException.php:16: * @deprecated  Don't use this anymore
+./framework/main/exceptions/helper/class_UserInstanceMissingException.php:16: * @deprecated    Don't use this anymore
+./framework/main/exceptions/language/class_InvalidLanguagePathStringException.php:16: * @deprecated    Don't use this anymore
+./framework/main/exceptions/language/class_LanguagePathReadProtectedException.php:16: * @deprecated    Don't use this anymore
+./framework/main/exceptions/main/class_DimNotFoundInArrayException.php:16: * @deprecated       Please don't use this anymore
+./framework/main/exceptions/main/class_InvalidArrayCountException.php:16: * @deprecated        Don't use this anymore
+./framework/main/exceptions/main/class_InvalidClassNameException.php:16: * @deprecated Don't use this anymore
+./framework/main/exceptions/main/class_InvalidCommandInstanceException.php:2:// @DEPRECATED
+./framework/main/exceptions/main/class_InvalidObjectException.php:17: * @deprecated    Don't use this anymore
+./framework/main/exceptions/main/class_MissingDecimalsThousandsSeparatorException.php:16: * @deprecated        Don't use this anymore
+./framework/main/exceptions/main/class_MissingMethodException.php:20: * @deprecated    Please do no longer use this exception
+./framework/main/exceptions/main/class_VariableIsNotSetException.php:16: * @deprecated Don't use this anymore
+./framework/main/exceptions/socket/class_SocketAlreadyRegisteredException.php:14: * @deprecated        Don't use this anymore
+./framework/main/exceptions/stacker/class_EmptyStackerException.php:16: * @deprecated  Don't use this anymore
+./framework/main/exceptions/template/class_BasePathIsEmptyException.php:2:// @DEPRECATED
+./framework/main/exceptions/template/class_BasePathReadProtectedException.php:16: * @deprecated        Don't use this anymore
+./framework/main/exceptions/template/class_InvalidBasePathStringException.php:2:// @DEPRECATED
+./framework/main/exceptions/template/class_NoVariableException.php:16: * @deprecated   Don't use this anymore
+./framework/main/exceptions/template/class_UnexpectedTemplateTypeException.php:16: * @deprecated       Don't use this anymore
+./framework/main/middleware/debug/class_DebugMiddleware.php:22: * @deprecated  See LoggerFactory for a more flexible approach
+./framework/selector.php:2:// @DEPRECATED
index 848e689..6611496 100644 (file)
@@ -26,7 +26,7 @@ use CoreFramework\Bootstrap\FrameworkBootstrap;
  */
 
 // Load very basic classes, required to bootstrap
-require __DIR__ . '/class_FrameworkBootstrap.php';
+require sprintf('%s%sclass_FrameworkBootstrap.php', __DIR__, DIRECTORY_SEPARATOR);
 
 // Bootstrap framework
 FrameworkBootstrap::doBootstrap();
index 460c984..317bf5d 100644 (file)
@@ -3,7 +3,22 @@
 namespace CoreFramework\Bootstrap;
 
 // Import framework stuff
+use CoreFramework\Configuration\FrameworkConfiguration;
+use CoreFramework\Connection\Database\DatabaseConnection;
+use CoreFramework\Connector\Database\DatabaseConnector;
 use CoreFramework\EntryPoint\ApplicationEntryPoint;
+use CoreFramework\Factory\ObjectFactory;
+use CoreFramework\Helper\Application\ApplicationHelper;
+use CoreFramework\Loader\ClassLoader;
+use CoreFramework\Manager\ManageableApplication;
+use CoreFramework\Middleware\Debug\DebugMiddleware;
+use CoreFramework\Object\BaseFrameworkSystem;
+use CoreFramework\Registry\Registry;
+use CoreFramework\Request\Requestable;
+use CoreFramework\Response\Responseable;
+
+// Import SPL stuff
+use \BadMethodCallException;
 
 /**
  * A framework-bootstrap class which helps the frameworks to bootstrap ... ;-)
@@ -28,6 +43,42 @@ use CoreFramework\EntryPoint\ApplicationEntryPoint;
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
 final class FrameworkBootstrap {
+
+       /**
+        * Instance of a Requestable class
+        */
+       private static $requestInstance = NULL;
+
+       /**
+        * Instance of a Responseable class
+        */
+       private static $responseInstance = NULL;
+
+       /*
+        * Includes applications may have. They will be tried in the given order,
+        * some will become soon deprecated.
+        */
+       private static $configAppIncludes = array(
+               // The ApplicationHelper class (required)
+               'class_ApplicationHelper' => 'required',
+               // Some debugging stuff (optional but can be committed)
+               'debug'                   => 'optional',
+               // Application's exception handler (optional but can be committed)
+               'exceptions'              => 'optional',
+               // Application's configuration file (committed, non-local specific)
+               'config'                  => 'required',
+               // Local configuration file (optional, not committed, listed in .gitignore)
+               'config-local'            => 'optional',
+               // Application data (deprecated)
+               'data'                    => 'deprecated',
+               // Application loader (deprecated)
+               'loader'                  => 'deprecated',
+               // Application initializer (deprecated)
+               'init'                    => 'deprecated',
+               // Application starter (deprecated)
+               'starter'                 => 'deprecated',
+       );
+
        /**
         * Private constructor, no instance is needed from this class as only
         * static methods exist.
@@ -37,33 +88,418 @@ final class FrameworkBootstrap {
        }
 
        /**
+        * Getter for request instance
+        *
+        * @return      $requestInstance        An instance of a Requestable class
+        */
+       public static function getRequestInstance () {
+               return self::$requestInstance;
+       }
+
+       /**
+        * Getter for response instance
+        *
+        * @return      $responseInstance       An instance of a Responseable class
+        */
+       public static function getResponseInstance () {
+               return self::$responseInstance;
+       }
+
+       /**
+        * "Getter" to get response/request type from analysis of the system.
+        *
+        * @return      $requestType    Analyzed request type
+        */
+       public static function getRequestTypeFromSystem () {
+               // Default is console
+               $requestType = 'console';
+
+               // Is 'HTTP_HOST' set?
+               if (isset($_SERVER['HTTP_HOST'])) {
+                       // Then it is a HTML response/request.
+                       $requestType = 'html';
+               } // END - if
+
+               // Return it
+               return $requestType;
+       }
+
+       /**
+        * Checks whether the given file/path is in open_basedir(). This does not
+        * gurantee that the file is actually readable and/or writeable. If you need
+        * such gurantee then please use isReadableFile() instead.
+        *
+        * @param       $filePathName   Name of the file/path to be checked
+        * @return      $isReachable    Whether it is within open_basedir()
+        */
+       public static function isReachableFilePath ($filePathName) {
+               // Is not reachable by default
+               $isReachable = false;
+
+               // Get open_basedir parameter
+               $openBaseDir = ini_get('open_basedir');
+
+               // Is it set?
+               if (!empty($openBaseDir)) {
+                       // Check all entries
+                       foreach (explode(PATH_SEPARATOR, $openBaseDir) as $dir) {
+                               // Check on existence
+                               if (substr($filePathName, 0, strlen($dir)) == $dir) {
+                                       // Is reachable
+                                       $isReachable = true;
+                               } // END - if
+                       } // END - foreach
+               } else {
+                       // If open_basedir is not set, all is allowed
+                       $isReachable = true;
+               }
+
+               // Return status
+               return $isReachable;
+       }
+
+       /**
+        * Checks whether the give file is within open_basedir() (done by
+        * isReachableFilePath()), is actually a file and is readable.
+        *
+        * @param       $fileName               Name of the file to be checked
+        * @return      $isReadable             Whether the file is readable (and therefor exists)
+        */
+       public static function isReadableFile ($fileName) {
+               // Default is not readable
+               $isReadable = false;
+
+               // Is within parameters, so check if it is a file and readable
+               $isReadable = (
+                       (
+                               self::isReachableFilePath($fileName)
+                       ) && (
+                               file_exists($fileName)
+                       ) && (
+                               is_file($fileName)
+                       ) && (
+                               is_readable($fileName)
+                       ) && (
+                               filesize($fileName) > 100
+                       )
+               );
+
+               // Return status
+               return $isReadable;
+       }
+
+       /**
+        * Loads given include file
+        *
+        * @param       $fqfn   Include's FQFN
+        * @return      void
+        * @throws      InvalidArgumentException        If $fqfn was not found or not readable or deprecated
+        */
+       public static function loadInclude ($fqfn) {
+               // Trace message
+               //* NOISY-DEBUG: */ printf('[%s:%d]: fqfn=%s - CALLED!' . PHP_EOL, __METHOD__, __LINE__, $fqfn);
+
+               // Should be there ...
+               if (!self::isReadableFile($fqfn)) {
+                       // Abort here
+                       throw new InvalidArgumentException(sprintf('Cannot find fqfn=%s.', $fqfn));
+               } // END - if
+
+               // Load it
+               require $fqfn;
+
+               // Trace message
+               //* NOISY-DEBUG: */ printf('[%s:%d]: EXIT!' . PHP_EOL, __METHOD__, __LINE__);
+       }
+
+       /**
         * 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';
+               self::loadInclude(sprintf('%smain%sinterfaces%sclass_FrameworkInterface.php', ApplicationEntryPoint::detectFrameworkPath(), DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR));
+               self::loadInclude(sprintf('%smain%sinterfaces%sregistry%sclass_Registerable.php', ApplicationEntryPoint::detectFrameworkPath(), DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR));
+               self::loadInclude(sprintf('%sconfig%sclass_FrameworkConfiguration.php', ApplicationEntryPoint::detectFrameworkPath(), DIRECTORY_SEPARATOR));
+
+               // Load global configuration
+               self::loadInclude(sprintf('%s%s', ApplicationEntryPoint::detectFrameworkPath(), 'config-global.php'));
+       }
+
+       /**
+        * Initializes the framework by scanning for all framework-relevant
+        * classes, interfaces and exception. Then determine the request type and
+        * initialize a Requestable instance which will then contain all request
+        * parameter, also from CLI. Next step is to validate the application
+        * (very basic).
+        *
+        * @return      void
+        */
+       public static function initFramework () {
+               /**
+                * 1) Load class loader and scan framework classes, interfaces and
+                *    exceptions.
+                */
+               self::scanFrameworkClasses();
+
+               /*
+                * 2) Determine the request type, console or web and store request and
+                *    response here. This also initializes the request instance will
+                *    all given parameters (see doc-tag for possible sources of
+                *    parameters).
+                */
+               self::determineRequestType();
+
+               /*
+                * 3) Now, that there are all request parameters being available, check
+                *    if 'app' is supplied. If it is not found, abort execution, if
+                *    found, continue below with next step.
+                */
+               self::validateApplicationParameter();
+       }
+
+       /**
+        * Initializes the detected application. This may fail if required files
+        * are not found in the application's base path (not to be confused with
+        * 'application_base_path' which only points to /some/foo/application/.
+        *
+        * @return      void
+        */
+       public static function prepareApplication () {
+               // Configuration entry 'detected_app_name' must be set, get it here, including full path
+               $application = FrameworkConfiguration::getSelfInstance()->getConfigEntry('detected_app_name');
+               $fullPath    = FrameworkConfiguration::getSelfInstance()->getConfigEntry('detected_full_app_path');
+
+               /*
+                * Now check and load all files, found deprecated files will throw a
+                * warning at the user.
+                */
+               foreach (self::$configAppIncludes as $fileName => $status) {
+                       // Construct FQFN
+                       $fqfn = sprintf('%s%s.php', $fullPath, $fileName);
+
+                       // Determine if this file is wanted/readable/deprecated
+                       if (($status == 'required') && (!self::isReadableFile($fqfn))) {
+                               // Nope, required file cannot be found/read from
+                               ApplicationEntryPoint::app_exit(sprintf('Application "%s" does not have required file "%s.php". Please add it.', $application, $fileName));
+                       } elseif ((file_exists($fqfn)) && (!is_readable($fqfn))) {
+                               // Found, not readable file
+                               ApplicationEntryPoint::app_exit(sprintf('File "%s.php" from application "%s" cannot be read. Please fix CHMOD.', $fileName, $application));
+                       } elseif (($status != 'required') && (!self::isReadableFile($fqfn))) {
+                               // Not found but optional/deprecated file, skip it
+                               continue;
+                       }
+
+                       // Is the file deprecated?
+                       if ($status == 'deprecated') {
+                               // Issue warning
+                               trigger_error(sprintf('Deprecated file "%s.php" found, will not load it to avoid problems. Please remove it from your application "%s" to avoid this warning.', $fileName, $application), E_USER_WARNING);
+
+                               // Skip loading deprecated file
+                               continue;
+                       } // END - if
+
+                       // Load it
+                       self::loadInclude($fqfn);
+               } // END - foreach
+
+               // Scan for application's classes, exceptions and interfaces
+               ClassLoader::scanApplicationClasses();
+       }
+
+       /**
+        * Starts a fully initialized application, the class ApplicationHelper must
+        * be loaded at this point.
+        *
+        * @return      void
+        */
+       public static function startApplication () {
+               // Configuration entry 'detected_app_name' must be set, get it here
+               $application = FrameworkConfiguration::getSelfInstance()->getConfigEntry('detected_app_name');
+
+               // Is there an application helper instance?
+               $applicationInstance = call_user_func_array(
+                       array(
+                               'CoreFramework\Helper\Application\ApplicationHelper', 'getSelfInstance'
+                       ), array()
+               );
+
+               // Some sanity checks
+               if ((empty($applicationInstance)) || (is_null($applicationInstance))) {
+                       // Something went wrong!
+                       ApplicationEntryPoint::app_exit(sprintf("[Main:] The application <span class=\"app_name\">%s</span> could not be launched because the helper class <span class=\"class_name\">%s</span> is not loaded.",
+                               $application,
+                               'CoreFramework\Helper\Application\ApplicationHelper'
+                       ));
+               } elseif (!is_object($applicationInstance)) {
+                       // No object!
+                       ApplicationEntryPoint::app_exit(sprintf("[Main:] The application <span class=\"app_name\">%s</span> could not be launched because &#39;app&#39; is not an object (%s).",
+                               $application,
+                               gettype($applicationInstance)
+                       ));
+               } elseif (!($applicationInstance instanceof ManageableApplication)) {
+                       // Missing interface
+                       ApplicationEntryPoint::app_exit(sprintf("[Main:] The application <span class=\"app_name\">%s</span> could not be launched because &#39;app&#39; is lacking required interface ManageableApplication.",
+                               $application
+                       ));
+               }
+
+               // Set it in registry
+               Registry::getRegistry()->addInstance('app', $applicationInstance);
+
+               // Now call all methods in one go
+               foreach (array('setupApplicationData', 'initApplication', 'launchApplication') as $methodName) {
+                       // Debug message
+                       //* NOISY-DEBUG: */ printf('[%s:%d]: Calling methodName=%s ...' . PHP_EOL, __METHOD__, __LINE__, $methodName);
+
+                       // Call method
+                       call_user_func(array($applicationInstance, $methodName));
+               } // END - if
+       }
+
+       /**
+        * Initializes database instance, no need to double-call this method
+        *
+        * @return      void
+        */
+       public static function initDatabaseInstance () {
+               // Get application instance
+               $applicationInstance = ApplicationHelper::getSelfInstance();
+
+               // Is the database instance already set?
+               if ($applicationInstance instanceof DatabaseConnector) {
+                       // Yes, then abort here
+                       throw new BadMethodCallException('Method called twice.');
+               } // END - if
+
+               // Initialize database layer
+               $databaseInstance = ObjectFactory::createObjectByConfiguredName(FrameworkConfiguration::getSelfInstance()->getConfigEntry('database_type') . '_class');
+
+               // Prepare database instance
+               $connectionInstance = DatabaseConnection::createDatabaseConnection(DebugMiddleware::getSelfInstance(), $databaseInstance);
+
+               // Set it in application helper
+               $applicationInstance->setDatabaseInstance($connectionInstance);
+       }
+
+       /**
+        * 1) Loads class scanner and scans all framework's classes and interfaces.
+        * This method also registers the class loader's method autoLoad() for the
+        * SPL auto-load feature. Remember that you can register additional methods
+        * (not functions, please) for other libraries.
+        *
+        * Yes, I know about Composer, but I like to keep my class loader around.
+        * You can always use mine as long as your classes have a namespace
+        * according naming-convention: Vendor\Project\Group[\SubGroup]
+        *
+        * @return      void
+        */
+       private static function scanFrameworkClasses () {
+               // Include the class loader function
+               require FrameworkConfiguration::getSelfInstance()->getConfigEntry('framework_base_path') . 'loader/class_ClassLoader.php';
+
+               // Register auto-load function with the SPL
+               spl_autoload_register('CoreFramework\Loader\ClassLoader::autoLoad');
+
+               // Scan for all framework classes, exceptions and interfaces
+               ClassLoader::scanFrameworkClasses();
+       }
+
+       /**
+        * 2) Determines request/response type and stores the created
+        * request/response instances in this object for later usage.
+        *
+        * @return      void
+        */
+       private static function determineRequestType () {
+               // Determine request type
+               $request = self::getRequestTypeFromSystem();
+               $requestType = self::getRequestTypeFromSystem();
+
+               // Create a new request object
+               $requestInstance = ObjectFactory::createObjectByName(sprintf('CoreFramework\Request\%sRequest', BaseFrameworkSystem::convertToClassName($request)));
+
+               // Remember request instance here
+               self::setRequestInstance($requestInstance);
+
+               // Do we have another response?
+               if ($requestInstance->isRequestElementSet('request')) {
+                       // Then use it
+                       $request = strtolower($requestInstance->getRequestElement('request'));
+                       $requestType = $request;
+               } // END - if
+
+               // ... and a new response object
+               $responseClass = sprintf('CoreFramework\Response\%sResponse', BaseFrameworkSystem::convertToClassName($request));
+               $responseInstance = ObjectFactory::createObjectByName($responseClass);
 
-               // Load main configuration
-               require ApplicationEntryPoint::detectFrameworkPath() . 'config.inc.php';
+               // Remember response instance here
+               self::setResponseInstance($responseInstance);
        }
 
        /**
-        * Parses all parameters, like $_GET, $_POST, $_COOKIE and also "emulated"
-        * from command-line. Accepted CLI parameters are in following forms:
+        * 3) Validate parameter 'app' if it is set and the application is there.
         *
-        * --foo=bar - parameter 'foo' gets value "bar" (string)
-        * --enable-foo=true - parameter 'enableFoo' gets value true (boolean)
-        * --baz=123 - parameter 'baz' get value 123 (integer)
+        * @return      void
+        */
+       private static function validateApplicationParameter () {
+               // Is the parameter set?
+               if (!self::getRequestInstance()->isRequestElementSet('app')) {
+                       /*
+                        * Don't continue here, the application 'selector' is no longer
+                        * supported and only existed as an idea to select the proper
+                        * application (by user).
+                        */
+                       ApplicationEntryPoint::app_exit('No application specified. Please provide a parameter "app" and retry.');
+               } // END - if
+
+               // Get it for local usage
+               $application = self::getRequestInstance()->getRequestElement('app');
+
+               // Secure it, by keeping out tags
+               $application = htmlentities(strip_tags($application), ENT_QUOTES);
+
+               // Secure it a little more with a reg.exp.
+               $application = preg_replace('/([^a-z0-9_-])+/i', '', $application);
+
+               // Construct FQPN (Full-Qualified Path Name) for ApplicationHelper class
+               $applicationPath = sprintf(
+                       '%s%s%s',
+                       FrameworkConfiguration::getSelfInstance()->getConfigEntry('application_base_path'),
+                       $application,
+                       DIRECTORY_SEPARATOR
+               );
+
+               // Full path for application
+               // Is the path there? This secures a bit the parameter (from untrusted source).
+               if ((!is_dir($applicationPath)) || (!is_readable($applicationPath))) {
+                       // Not found or not readable
+                       ApplicationEntryPoint::app_exit(sprintf('Application "%s" not found.', $application));
+               } // END - if
+
+               // Set the detected application's name and full path for later usage
+               FrameworkConfiguration::getSelfInstance()->setConfigEntry('detected_full_app_path', $applicationPath);
+               FrameworkConfiguration::getSelfInstance()->setConfigEntry('detected_app_name'     , $application);
+       }
+       /**
+        * Setter for request instance
         *
-        * The same also works without 2 dashes as it was possible before:
+        * @param       $requestInstance        An instance of a Requestable class
+        * @return      void
+        */
+       private static function setRequestInstance (Requestable $requestInstance) {
+               self::$requestInstance = $requestInstance;
+       }
+
+       /**
+        * Setter for response instance
         *
-        * app=tests - launches application 'tests' (parameter 'app' gets string value "tests")
+        * @param       $responseInstance       An instance of a Responseable class
+        * @return      void
         */
-       public static function parseParameters () {
+       private static function setResponseInstance (Responseable $responseInstance) {
+               self::$responseInstance = $responseInstance;
        }
 
 }
diff --git a/framework/config-global.php b/framework/config-global.php
new file mode 100644 (file)
index 0000000..f11a27e
--- /dev/null
@@ -0,0 +1,469 @@
+<?php
+// Import framework stuff
+use CoreFramework\Configuration\FrameworkConfiguration;
+use CoreFramework\Bootstrap\FrameworkBootstrap;
+use CoreFramework\EntryPoint\ApplicationEntryPoint;
+
+/**
+ * General configuration. Do not touch this file! If you need different settings
+ * create a config-local.php in this directory at and set your changed
+ * configuration entries there.
+ *
+ * @author             Roland Haeder <webmaster@shipsimu.org>
+ * @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 <http://www.gnu.org/licenses/>.
+ */
+
+// Get a new configuration instance
+$cfg = FrameworkConfiguration::getSelfInstance();
+
+// CFG: ROOT-BASE-PATH
+$cfg->setConfigEntry('root_base_path', ApplicationEntryPoint::getRootPath() . '/');
+
+// 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', 'local_file_database');
+
+// 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: 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', $cfg->getConfigEntry('root_base_path') . 'application/');
+
+// 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.inc.php b/framework/config.inc.php
deleted file mode 100644 (file)
index e0498c6..0000000
+++ /dev/null
@@ -1,472 +0,0 @@
-<?php
-// Import framework stuff
-use CoreFramework\Configuration\FrameworkConfiguration;
-use CoreFramework\Bootstrap\FrameworkBootstrap;
-use CoreFramework\EntryPoint\ApplicationEntryPoint;
-
-/**
- * General configuration. Do not touch this file! If you need different settings
- * create a config-local.php in this directory at and set your changed
- * configuration entries there.
- *
- * @author             Roland Haeder <webmaster@shipsimu.org>
- * @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 <http://www.gnu.org/licenses/>.
- */
-
-// Get a new configuration instance
-$cfg = FrameworkConfiguration::getSelfInstance();
-
-// CFG: ROOT-BASE-PATH
-$cfg->setConfigEntry('root_base_path', ApplicationEntryPoint::getRootPath() . '/');
-
-// 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', $cfg->getConfigEntry('root_base_path') . 'application/');
-
-// 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);
index 733ba9e..f7a48ec 100644 (file)
@@ -3,6 +3,8 @@
 namespace CoreFramework\Configuration;
 
 // Import framework stuff
+use CoreFramework\Console\Tools\ConsoleTools;
+use CoreFramework\Dns\UnknownHostnameException;
 use CoreFramework\Generic\FrameworkInterface;
 use CoreFramework\Generic\NullPointerException;
 use CoreFramework\Registry\Registerable;
@@ -245,7 +247,8 @@ class FrameworkConfiguration implements Registerable {
         * Detects the server address (SERVER_ADDR) and set it in configuration
         *
         * @return      $serverAddress  The detected server address
-        * @todo        We have to add some more entries from $_SERVER here
+        * @throws      UnknownHostnameException        If SERVER_NAME cannot be resolved to an IP address
+        * @todo        Have to check some more entries from $_SERVER here
         */
        public function detectServerAddress () {
                // Is the entry set?
@@ -254,6 +257,21 @@ class FrameworkConfiguration implements Registerable {
                        if (isset($_SERVER['SERVER_ADDR'])) {
                                // Set it from $_SERVER
                                $this->setServerAddress($_SERVER['SERVER_ADDR']);
+                       } elseif (isset($_SERVER['SERVER_NAME'])) {
+                               // Resolve IP address
+                               $serverIp = ConsoleTools::resolveIpAddress($_SERVER['SERVER_NAME']);
+
+                               // Is it valid?
+                               if ($serverIp === false) {
+                                       /*
+                                        * Why is gethostbyname() returning the host name and not
+                                        * false as many other PHP functions are doing? ;-(
+                                        */
+                                       throw new UnknownHostnameException(sprintf('Cannot resolve "%s" to an IP address. Please fix your setup.', $_SERVER['SERVER_NAME']));
+                               } // END - if
+
+                               // Al fine, set it
+                               $this->setServerAddress($serverIp);
                        } elseif (class_exists('ConsoleTools')) {
                                // Run auto-detecting through console tools lib
                                ConsoleTools::acquireSelfIPAddress();
@@ -289,20 +307,20 @@ class FrameworkConfiguration implements Registerable {
        /**
         * Detects the HTTPS flag
         *
-        * @return      $https  The detected HTTPS flag or null if failed
+        * @return      $isSecured      The detected HTTPS flag or null if failed
         */
        public function detectHttpSecured () {
                // Default is null
-               $https = NULL;
+               $isSecured = NULL;
 
                // Is HTTPS set?
                if ($this->isHttpSecured()) {
                        // Then use it
-                       $https = $_SERVER['HTTPS'];
+                       $isSecured = $_SERVER['HTTPS'];
                } // END - if
 
                // Return it
-               return $https;
+               return $isSecured;
        }
 
        /**
@@ -383,7 +401,7 @@ class FrameworkConfiguration implements Registerable {
         * @throws      NullPointerException    If the result instance is null
         */
        public final function getField ($fieldName) {
-               // Our super interface "FrameworkInterface" requires this
+               // The super interface "FrameworkInterface" requires this
                throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
        }
 
@@ -395,7 +413,7 @@ class FrameworkConfiguration implements Registerable {
         * @throws      NullPointerException    If the result instance is null
         */
        public function isFieldSet ($fieldName) {
-               // Our super interface "FrameworkInterface" requires this
+               // The super interface "FrameworkInterface" requires this
                throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
        }
 
@@ -418,9 +436,9 @@ class FrameworkConfiguration implements Registerable {
        public function equals (FrameworkInterface $objectInstance) {
                // Now test it
                $equals = ((
-                       $this->__toString() == $objectInstance->__toString()
+                       $this->__toString() === $objectInstance->__toString()
                ) && (
-                       $this->hashCode() == $objectInstance->hashCode()
+                       $this->hashCode() === $objectInstance->hashCode()
                ));
 
                // Return the result
index fe39b3b..7d6dcee 100644 (file)
@@ -1,65 +1,2 @@
 <?php
-// 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;
-
-/**
- * Initializes the database layer
- *
- * @author             Roland Haeder <webmaster@shipsimu.org>
- * @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
- * @deprecated
- * @todo               Minimize these includes
- *
- * 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 <http://www.gnu.org/licenses/>.
- */
-
-// Initialize database layer
-$databaseInstance = NULL;
-
-// Generate FQFN for the database layer
-$fqfn = sprintf(
-       '%sdatabase/lib-%s.php',
-       FrameworkConfiguration::getSelfInstance()->getConfigEntry('framework_base_path'),
-       FrameworkConfiguration::getSelfInstance()->getConfigEntry('database_type')
-);
-
-// Load the database layer include
-if (BaseFrameworkSystem::isReadableFile($fqfn)) {
-       // Load the layer
-       require $fqfn;
-} else {
-       // Layer is missing!
-       ApplicationEntryPoint::app_exit(sprintf('[Main:] Database layer is missing! (%s) -&gt; R.I.P.',
-               FrameworkConfiguration::getSelfInstance()->getConfigEntry('database_type')
-       ));
-}
-
-// Clean it up
-unset($fqfn);
-
-// Prepare database instance
-$connectionInstance = DatabaseConnection::createDatabaseConnection(DebugMiddleware::getSelfInstance(), $databaseInstance);
-
-// Is the app variable there and valid?
-// @TODO Rewrite this
-if (is_object($app)) {
-       $app->setDatabaseInstance($connectionInstance);
-} // END - if
+// @DEPRECATED
index b365a9f..7d6dcee 100644 (file)
@@ -1,29 +1,2 @@
 <?php
-// Import framework stuff
-use CoreFramework\Factory\ObjectFactory;
-
-/**
- * Initializes the local file database class
- *
- * @author             Roland Haeder <webmaster@shipsimu.org>
- * @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 <http://www.gnu.org/licenses/>.
- */
-
-// For testing purposes we use a local file database
-$databaseInstance = ObjectFactory::createObjectByConfiguredName('local_file_database_class');
+// @DEPRECATED
index ceaab36..7d6dcee 100644 (file)
@@ -1,75 +1,2 @@
 <?php
-// Import framework stuff
-use CoreFramework\Configuration\FrameworkConfiguration;
-use CoreFramework\Loader\ClassLoader;
-
-/**
- * Loads more include files by using the generic class loader
- *
- * @author             Roland Haeder <webmaster@shipsimu.org>
- * @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
- * @deprecated
- * @todo               Minimize these includes
- *
- * 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 <http://www.gnu.org/licenses/>.
- */
-
-// Include the class loader function
-require FrameworkConfiguration::getSelfInstance()->getConfigEntry('framework_base_path') . 'loader/class_ClassLoader.php';
-
-/*
- * Shall we include additional configs where you can configure some things?
- * Then load matching config file.
- */
-ClassLoader::getSelfInstance()->loadExtraConfigs();
-
-// Register auto-load function with the SPL
-// @TODO This makes the core depending on the SPL. But it should be installed anyway.
-spl_autoload_register('CoreFramework\Loader\ClassLoader::autoLoad');
-
-// Does the user has an application specified?
-// @TODO Find a nicer OOP-ed way for this
-if (!empty($_GET['app'])) {
-       // Set the application from string
-       $application = (string) $_GET['app'];
-} elseif (!empty($_SERVER['argv'][1])) {
-       // Set the application from string
-       $application = (string) $_SERVER['argv'][1];
-       $app = explode('=', trim($application));
-       if ($app[0] == 'app') {
-               // Application is valid!
-               $application = trim($app[1]);
-       } else {
-               // Invalid entry found, first must be "app"!
-               $application = FrameworkConfiguration::getSelfInstance()->getConfigEntry('default_application');
-       }
-} else {
-       // Set the "application selector" application
-       $application = FrameworkConfiguration::getSelfInstance()->getConfigEntry('default_application');
-}
-
-// Secure it, by keeping out tags
-$application = htmlentities(strip_tags($application), ENT_QUOTES);
-
-// Secure it a little more with a reg.exp.
-$application = preg_replace('/([^a-z0-9_-])+/i', '', $application);
-
-// Set the application name for later usage
-FrameworkConfiguration::getSelfInstance()->setConfigEntry('app_name', $application);
-
-// Scan for all framework classes, exceptions and interfaces
-ClassLoader::scanFrameworkClasses();
+// @DEPRECATED
index 939d355..211aded 100644 (file)
@@ -3,8 +3,8 @@
 namespace CoreFramework\Loader;
 
 // Import framework stuff
+use CoreFramework\Bootstrap\FrameworkBootstrap;
 use CoreFramework\Configuration\FrameworkConfiguration;
-use CoreFramework\Object\BaseFrameworkSystem;
 
 // Import SPL stuff
 use \InvalidArgumentException;
@@ -85,19 +85,19 @@ class ClassLoader {
        private $ignoreList = array();
 
        /**
-        * Debug this class loader? (TRUE = yes, FALSE = no)
+        * Debug this class loader? (true = yes, false = no)
         */
-       private $debug = FALSE;
+       private $debug = false;
 
        /**
         * Whether the file list is cached
         */
-       private $listCached = FALSE;
+       private $listCached = false;
 
        /**
         * Wethe class content has been cached
         */
-       private $classesCached = FALSE;
+       private $classesCached = false;
 
        /**
         * Filename for the list cache
@@ -117,7 +117,7 @@ class ClassLoader {
        /**
         * By default the class loader is strict with naming-convention check
         */
-       private static $strictNamingConventionCheck = TRUE;
+       private static $strictNamingConventionCheck = true;
 
        /**
         * Framework/application paths for classes, etc.
@@ -157,14 +157,14 @@ class ClassLoader {
                } // END - if
 
                // Skip here if already cached
-               if ($this->listCached === FALSE) {
+               if ($this->listCached === false) {
                        // Writes the cache file of our list away
                        $cacheContent = json_encode($this->foundClasses);
                        file_put_contents($this->listCacheFQFN, $cacheContent);
                } // END - if
 
                // Skip here if already cached
-               if ($this->classesCached === FALSE) {
+               if ($this->classesCached === false) {
                        // Generate a full-cache of all classes
                        $cacheContent = '';
                        foreach (array_keys($this->loadedClasses) as $fqfn) {
@@ -224,7 +224,7 @@ class ClassLoader {
                        // Debug message
                        //* NOISY-DEBUG: */ printf('[%s:%d]: pathName=%s' . PHP_EOL, __METHOD__, __LINE__, $pathName);
 
-                       // Is it not FALSE and accessible?
+                       // Is it not false and accessible?
                        if (is_bool($pathName)) {
                                // Skip this
                                continue;
@@ -265,7 +265,7 @@ class ClassLoader {
                        $pathName = realpath(sprintf(
                                '%s/%s/%s',
                                $cfg->getConfigEntry('application_base_path'),
-                               $cfg->getConfigEntry('app_name'),
+                               $cfg->getConfigEntry('detected_app_name'),
                                $shortPath
                        ));
 
@@ -300,18 +300,24 @@ class ClassLoader {
                        // Debug message
                        //* NOISY-DEBUG: */ printf('[%s:%d]: shortPath=%s' . PHP_EOL, __METHOD__, __LINE__, $shortPath);
 
-                       // Create path name
-                       $pathName = realpath(sprintf(
+                       // Construct path name
+                       $pathName = sprintf(
                                '%s/%s',
-                               $cfg->getConfigEntry('framework_base_path'),
+                               $cfg->getConfigEntry('root_base_path'),
                                $shortPath
-                       ));
+                       );
 
                        // Debug message
-                       //* NOISY-DEBUG: */ printf('[%s:%d]: pathName[%s]=%s' . PHP_EOL, __METHOD__, __LINE__, gettype($pathName), $pathName);
+                       //* NOISY-DEBUG: */ printf('[%s:%d]: pathName[%s]=%s - BEFORE!' . PHP_EOL, __METHOD__, __LINE__, gettype($pathName), $pathName);
+
+                       // Try to find it
+                       $pathName = realpath($pathName);
+
+                       // Debug message
+                       //* NOISY-DEBUG: */ printf('[%s:%d]: pathName[%s]=%s - AFTER!' . PHP_EOL, __METHOD__, __LINE__, gettype($pathName), $pathName);
 
                        // Is the path readable?
-                       if (is_dir($pathName)) {
+                       if ((is_dir($pathName)) && (is_readable($pathName))) {
                                // Try to load the application classes
                                ClassLoader::getSelfInstance()->scanClassPath($pathName);
                        } // END - if
@@ -327,7 +333,7 @@ class ClassLoader {
         * @param       $strictNamingConventionCheck    Whether to strictly check naming-convention
         * @return      void
         */
-       public static function enableStrictNamingConventionCheck ($strictNamingConventionCheck = TRUE) {
+       public static function enableStrictNamingConventionCheck ($strictNamingConventionCheck = true) {
                self::$strictNamingConventionCheck = $strictNamingConventionCheck;
        }
 
@@ -339,8 +345,14 @@ class ClassLoader {
         * @return      void
         */
        public static function registerTestsPath ($relativePath) {
+               // Trace message
+               //* NOISY-DEBUG: */ printf('[%s:%d]: relativePath=%s - CALLED!' . PHP_EOL, __METHOD__, __LINE__, $relativePath);
+
                // "Register" it
                self::$testPaths[$relativePath] = $relativePath;
+
+               // Trace message
+               //* NOISY-DEBUG: */ printf('[%s:%d]: EXIT!' . PHP_EOL, __METHOD__, __LINE__);
        }
 
        /**
@@ -350,8 +362,14 @@ class ClassLoader {
         * @return      void
         */
        public static function autoLoad ($className) {
+               // Trace message
+               //* NOISY-DEBUG: */ printf('[%s:%d]: className=%s - CALLED!' . PHP_EOL, __METHOD__, __LINE__, $className);
+
                // Try to include this class
                self::getSelfInstance()->loadClassFile($className);
+
+               // Trace message
+               //* NOISY-DEBUG: */ printf('[%s:%d]: EXIT!' . PHP_EOL, __METHOD__, __LINE__);
        }
 
        /**
@@ -379,7 +397,7 @@ class ClassLoader {
         */
        public function scanClassPath ($basePath, array $ignoreList = array() ) {
                // Is a list has been restored from cache, don't read it again
-               if ($this->listCached === TRUE) {
+               if ($this->listCached === true) {
                        // Abort here
                        return;
                } // END - if
@@ -400,8 +418,8 @@ class ClassLoader {
                 */
                $basePath2 = realpath($basePath);
 
-               // If the basePath is FALSE it is invalid
-               if ($basePath2 === FALSE) {
+               // If the basePath is false it is invalid
+               if ($basePath2 === false) {
                        /* @TODO: Do not exit here. */
                        exit(__METHOD__ . ': Cannot read ' . $basePath . ' !' . PHP_EOL);
                } else {
@@ -452,31 +470,6 @@ class ClassLoader {
        }
 
        /**
-        * Load extra config files
-        *
-        * @return      void
-        */
-       public function loadExtraConfigs () {
-               // Backup old prefix
-               $oldPrefix = $this->prefix;
-
-               // Set new prefix (temporary!)
-               $this->prefix = 'config-';
-
-               // Set base directory
-               $basePath = $this->configInstance->getConfigEntry('framework_base_path') . 'config/';
-
-               // Load all classes from the config directory
-               $this->scanClassPath($basePath);
-
-               // Include these extra configs now
-               $this->includeExtraConfigs();
-
-               // Set back the old prefix
-               $this->prefix = $oldPrefix;
-       }
-
-       /**
         * Initializes our loader class
         *
         * @param       $configInstance Configuration class instance
@@ -488,8 +481,8 @@ class ClassLoader {
 
                // Construct the FQFN for the cache
                if (!defined('DEVELOPER')) {
-                       $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';
+                       $this->listCacheFQFN  = $this->configInstance->getConfigEntry('local_database_path') . 'list-' . $this->configInstance->getConfigEntry('detected_app_name') . '.cache';
+                       $this->classCacheFQFN = $this->configInstance->getConfigEntry('local_database_path') . 'class-' . $this->configInstance->getConfigEntry('detected_app_name') . '.cache';
                } // END - if
 
                // Set suffix and prefix from configuration
@@ -505,7 +498,7 @@ class ClassLoader {
                } // END - if
 
                // IS the cache there?
-               if (BaseFrameworkSystem::isReadableFile($this->listCacheFQFN)) {
+               if (FrameworkBootstrap::isReadableFile($this->listCacheFQFN)) {
                        // Get content
                        $cacheContent = file_get_contents($this->listCacheFQFN);
 
@@ -513,16 +506,16 @@ class ClassLoader {
                        $this->foundClasses = json_decode($cacheContent);
 
                        // List has been restored from cache!
-                       $this->listCached = TRUE;
+                       $this->listCached = true;
                } // END - if
 
                // Does the class cache exist?
-               if (BaseFrameworkSystem::isReadableFile($this->listCacheFQFN)) {
+               if (FrameworkBootstrap::isReadableFile($this->listCacheFQFN)) {
                        // Then include it
-                       require $this->classCacheFQFN;
+                       FrameworkBootstrap::loadInclude($this->classCacheFQFN);
 
                        // Mark the class cache as loaded
-                       $this->classesCached = TRUE;
+                       $this->classesCached = true;
                } // END - if
        }
 
@@ -543,7 +536,7 @@ class ClassLoader {
                $classNameParts = explode("\\", $className);
 
                // At least 3 parts should be there
-               if ((self::$strictNamingConventionCheck === TRUE) && (count($classNameParts) < 3)) {
+               if ((self::$strictNamingConventionCheck === true) && (count($classNameParts) < 3)) {
                        // Namespace scheme is: Project\Package[\SubPackage...]
                        throw new InvalidArgumentException(sprintf('Class name "%s" is not conform to naming-convention: Project\Package[\SubPackage...]\SomeFooBar', $className));
                } // END - if
@@ -559,14 +552,14 @@ class ClassLoader {
                if ((isset($this->foundClasses[$fileName])) && (!isset($this->loadedClasses[$this->foundClasses[$fileName]]))) {
                        // File is found and not loaded so load it only once
                        //* NOISY-DEBUG: */ printf('[%s:%d] LOAD: %s - START' . PHP_EOL, __METHOD__, __LINE__, $fileName);
-                       require $this->foundClasses[$fileName];
+                       FrameworkBootstrap::loadInclude($this->foundClasses[$fileName]);
                        //* NOISY-DEBUG: */ printf('[%s:%d] LOAD: %s - END' . PHP_EOL, __METHOD__, __LINE__, $fileName);
 
                        // Count this loaded class/interface/exception
                        $this->total++;
 
                        // Mark this class as loaded for other purposes than loading it.
-                       $this->loadedClasses[$this->foundClasses[$fileName]] = TRUE;
+                       $this->loadedClasses[$this->foundClasses[$fileName]] = true;
 
                        // Remove it from classes list so it won't be found twice.
                        //* NOISY-DEBUG: */ printf('[%s:%d] UNSET: %s' . PHP_EOL, __METHOD__, __LINE__, $fileName);
@@ -575,8 +568,8 @@ class ClassLoader {
                        // Developer mode excludes caching (better debugging)
                        if (!defined('DEVELOPER')) {
                                // Reset cache
-                               //* NOISY-DEBUG: */ printf('[%s:%d] classesCached=FALSE' . PHP_EOL, __METHOD__, __LINE__);
-                               $this->classesCached = FALSE;
+                               //* NOISY-DEBUG: */ printf('[%s:%d] classesCached=false' . PHP_EOL, __METHOD__, __LINE__);
+                               $this->classesCached = false;
                        } // END - if
                } else {
                        // Not found
@@ -585,28 +578,6 @@ class ClassLoader {
        }
 
        /**
-        * Includes all extra config files
-        *
-        * @return      void
-        */
-       private function includeExtraConfigs () {
-               // Run through all class names (should not be much)
-               foreach ($this->foundClasses as $fileName => $fqfn) {
-                       // Is this a config?
-                       if (substr($fileName, 0, strlen($this->prefix)) == $this->prefix) {
-                               // Then include it
-                               //* NOISY-DEBUG: */ printf('[%s:%d] LOAD: %s - START' . PHP_EOL, __METHOD__, __LINE__, $fileName);
-                               require $fqfn;
-                               //* NOISY-DEBUG: */ printf('[%s:%d] LOAD: %s - END' . PHP_EOL, __METHOD__, __LINE__, $fileName);
-
-                               // Remove it from the list
-                               //* NOISY-DEBUG: */ printf('[%s:%d] UNSET: %s' . PHP_EOL, __METHOD__, __LINE__, $fileName);
-                               unset($this->foundClasses[$fileName]);
-                       } // END - if
-               } // END - foreach
-       }
-
-       /**
         * Getter for total include counter
         *
         * @return      $total  Total loaded include files
index a98999f..f1c38e4 100644 (file)
@@ -3,6 +3,7 @@
 namespace CoreFramework\Auth;
 
 // Import framework stuff
+use CoreFramework\Bootstrap\FrameworkBootstrap;
 use CoreFramework\Object\BaseFrameworkSystem;
 use CoreFramework\Registry\Registerable;
 use CoreFramework\Response\Responseable;
@@ -50,9 +51,6 @@ class CookieAuth extends BaseFrameworkSystem implements Authorizeable, Registera
                // Get a new instance
                $loginInstance = new CookieAuth();
 
-               // Set the response instance
-               $loginInstance->setResponseInstance($responseInstance);
-
                // Return the prepared instance
                return $loginInstance;
        }
@@ -64,7 +62,7 @@ class CookieAuth extends BaseFrameworkSystem implements Authorizeable, Registera
         * @return      void
         */
        public function setUserAuth ($userName) {
-               $this->getResponseInstance()->addCookie('username', $userName);
+               FrameworkBootstrap::getResponseInstance()->addCookie('username', $userName);
        }
 
        /**
@@ -74,7 +72,7 @@ class CookieAuth extends BaseFrameworkSystem implements Authorizeable, Registera
         * @return      void
         */
        public function setPasswordAuth ($passHash) {
-               $this->getResponseInstance()->addCookie('u_hash', $passHash);
+               FrameworkBootstrap::getResponseInstance()->addCookie('u_hash', $passHash);
        }
 
        /**
@@ -84,7 +82,7 @@ class CookieAuth extends BaseFrameworkSystem implements Authorizeable, Registera
         */
        public function getUserAuth () {
                // Get the username from cookie
-               $userName = $this->getRequestInstance()->readCookie('username');
+               $userName = FrameworkBootstrap::getRequestInstance()->readCookie('username');
 
                // Return the username
                return $userName;
@@ -97,7 +95,7 @@ class CookieAuth extends BaseFrameworkSystem implements Authorizeable, Registera
         */
        public function getPasswordAuth () {
                // Get the username from cookie
-               $passHash = $this->getRequestInstance()->readCookie('u_hash');
+               $passHash = FrameworkBootstrap::getRequestInstance()->readCookie('u_hash');
 
                // Return the username
                return $passHash;
@@ -110,8 +108,8 @@ class CookieAuth extends BaseFrameworkSystem implements Authorizeable, Registera
         */
        public function destroyAuthData () {
                // Expire both cookies
-               $this->getResponseInstance()->expireCookie('username');
-               $this->getResponseInstance()->expireCookie('u_hash');
+               FrameworkBootstrap::getResponseInstance()->expireCookie('username');
+               FrameworkBootstrap::getResponseInstance()->expireCookie('u_hash');
        }
 
        /**
@@ -120,8 +118,8 @@ class CookieAuth extends BaseFrameworkSystem implements Authorizeable, Registera
         * @return      void
         */
        public function updateAuthData () {
-               $this->getResponseInstance()->refreshCookie('username');
-               $this->getResponseInstance()->refreshCookie('u_hash');
+               FrameworkBootstrap::getResponseInstance()->refreshCookie('username');
+               FrameworkBootstrap::getResponseInstance()->refreshCookie('u_hash');
        }
 
 }
index c23851e..9966c07 100644 (file)
@@ -84,7 +84,7 @@ class MemoryCache extends BaseFrameworkSystem implements Cacheable {
                $exists = $this->dataCache->offsetExists($offset);
 
                // So look for array element?
-               if (($exists === TRUE) && (!is_null($arrayElement))) {
+               if (($exists === true) && (!is_null($arrayElement))) {
                        // Get it
                        $array = $this->offsetGet($offset);
 
@@ -94,7 +94,7 @@ class MemoryCache extends BaseFrameworkSystem implements Cacheable {
                                $exists = (count($array[$arrayElement]) >= $minimumCount);
                        } else {
                                // Not found
-                               $exists = FALSE;
+                               $exists = false;
                        }
                } // END - if
 
index 1df1074..248da12 100644 (file)
@@ -3,6 +3,7 @@
 namespace CoreFramework\Object;
 
 // Import framework stuff
+use CoreFramework\Bootstrap\FrameworkBootstrap;
 use CoreFramework\Compressor\Compressor;
 use CoreFramework\Configuration\FrameworkConfiguration;
 use CoreFramework\Connection\Database\DatabaseConnection;
@@ -30,11 +31,9 @@ use CoreFramework\Middleware\Debug\DebugMiddleware;
 use CoreFramework\Parser\Parseable;
 use CoreFramework\Registry\Register;
 use CoreFramework\Registry\Registry;
-use CoreFramework\Request\Requestable;
 use CoreFramework\Resolver\Resolver;
 use CoreFramework\Result\Database\CachedDatabaseResult;
 use CoreFramework\Result\Search\SearchableResult;
-use CoreFramework\Response\Responseable;
 use CoreFramework\Stacker\Stackable;
 use CoreFramework\Stream\Output\OutputStreamer;
 use CoreFramework\Template\CompileableTemplate;
@@ -82,16 +81,6 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
        private $realClass = 'BaseFrameworkSystem';
 
        /**
-        * Instance of a Requestable class
-        */
-       private $requestInstance = NULL;
-
-       /**
-        * Instance of a Responseable class
-        */
-       private $responseInstance = NULL;
-
-       /**
         * Search criteria instance
         */
        private $searchInstance = NULL;
@@ -289,7 +278,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
        /**
         * Socket resource
         */
-       private $socketResource = FALSE;
+       private $socketResource = false;
 
        /**
         * Regular expression to use for validation
@@ -347,7 +336,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         *
         * The integer size is 4 bytes on 32-bit and 8 bytes on a 64-bit system.
         */
-       private $archArrayElement = FALSE;
+       private $archArrayElement = false;
 
        /***********************
         * Exception codes.... *
@@ -481,10 +470,10 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                        $this->setConfigInstance(FrameworkConfiguration::getSelfInstance());
                } // END - if
 
-               // Is the startup time set? (0 cannot be TRUE anymore)
+               // Is the startup time set? (0 cannot be true anymore)
                if (self::$startupTime == 0) {
                        // Then set it
-                       self::$startupTime = microtime(TRUE);
+                       self::$startupTime = microtime(true);
                } // END - if
 
                // Set array element
@@ -573,12 +562,12 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
 
                                        // Is an other object, maybe no __toString() available
                                        $argsString .= $reflection->getName();
-                               } elseif ($arg === TRUE) {
-                                       // ... is boolean 'TRUE'
-                                       $argsString .= 'TRUE';
-                               } elseif ($arg === FALSE) {
-                                       // ... is boolean 'FALSE'
-                                       $argsString .= 'FALSE';
+                               } elseif ($arg === true) {
+                                       // ... is boolean 'true'
+                                       $argsString .= 'true';
+                               } elseif ($arg === false) {
+                                       // ... is boolean 'false'
+                                       $argsString .= 'false';
                                }
 
                                // Comma for next one
@@ -628,7 +617,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                $this->debugBackTrace(sprintf('Tried to set a missing field. name=%s, value[%s]=%s',
                        $name,
                        gettype($value),
-                       print_r($value, TRUE)
+                       print_r($value, true)
                ));
        }
 
@@ -906,7 +895,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         * @return      $applicationInstance    An instance of a manageable application helper class
         */
        protected final function getApplicationInstance () {
-               $applicationInstance = Registry::getRegistry()->getInstance('application');
+               $applicationInstance = Registry::getRegistry()->getInstance('app');
                return $applicationInstance;
        }
 
@@ -921,44 +910,6 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
        }
 
        /**
-        * Setter for request instance
-        *
-        * @param       $requestInstance        An instance of a Requestable class
-        * @return      void
-        */
-       public final function setRequestInstance (Requestable $requestInstance) {
-               $this->requestInstance = $requestInstance;
-       }
-
-       /**
-        * Getter for request instance
-        *
-        * @return      $requestInstance        An instance of a Requestable class
-        */
-       public final function getRequestInstance () {
-               return $this->requestInstance;
-       }
-
-       /**
-        * Setter for response instance
-        *
-        * @param       $responseInstance       An instance of a Responseable class
-        * @return      void
-        */
-       public final function setResponseInstance (Responseable $responseInstance) {
-               $this->responseInstance = $responseInstance;
-       }
-
-       /**
-        * Getter for response instance
-        *
-        * @return      $responseInstance       An instance of a Responseable class
-        */
-       public final function getResponseInstance () {
-               return $this->responseInstance;
-       }
-
-       /**
         * Private getter for language instance
         *
         * @return      $langInstance   An instance to the language sub-system
@@ -1792,7 +1743,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                // Is the application instance set?
                if (is_null($applicationInstance)) {
                        // Get the current instance
-                       $applicationInstance = $this->getApplicationInstance();
+                       $applicationInstance = Registry::getRegistry()->getInstance('app');
 
                        // Still null?
                        if (is_null($applicationInstance)) {
@@ -1831,7 +1782,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                $content .= sprintf('<pre>%s</pre>',
                        trim(
                                htmlentities(
-                                       print_r($this, TRUE)
+                                       print_r($this, true)
                                )
                        )
                );
@@ -1905,10 +1856,10 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         * Outputs a debug backtrace and stops further script execution
         *
         * @param       $message        An optional message to output
-        * @param       $doExit         Whether exit the program (TRUE is default)
+        * @param       $doExit         Whether exit the program (true is default)
         * @return      void
         */
-       public function debugBackTrace ($message = '', $doExit = TRUE) {
+       public function debugBackTrace ($message = '', $doExit = true) {
                // Sorry, there is no other way getting this nice backtrace
                if (!empty($message)) {
                        // Output message
@@ -1920,7 +1871,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                print('</pre>');
 
                // Exit program?
-               if ($doExit === TRUE) {
+               if ($doExit === true) {
                        exit();
                } // END - if
        }
@@ -1942,7 +1893,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                        // Try it
                        try {
                                // Get a debugger instance
-                               $debugInstance = DebugMiddleware::createDebugMiddleware(FrameworkConfiguration::getSelfInstance()->getConfigEntry('debug_' . self::getResponseTypeFromSystem() . '_class'), $className);
+                               $debugInstance = DebugMiddleware::createDebugMiddleware(FrameworkConfiguration::getSelfInstance()->getConfigEntry('debug_' . FrameworkBootstrap::getRequestTypeFromSystem() . '_class'), $className);
                        } catch (NullPointerException $e) {
                                // Didn't work, no instance there
                                exit(sprintf('Cannot create debugInstance! Exception=%s,message=%s,className=%s,lineNumber=%d' . PHP_EOL, $e->__toString(), $e->getMessage(), $className, $lineNumber));
@@ -1980,10 +1931,10 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         *
         * @param       $message        Message we shall send out...
         * @param       $doPrint        Whether print or die here (default: print)
-        * @paran       $stripTags      Whether to strip tags (default: FALSE)
+        * @paran       $stripTags      Whether to strip tags (default: false)
         * @return      void
         */
-       public function debugOutput ($message, $doPrint = TRUE, $stripTags = FALSE) {
+       public function debugOutput ($message, $doPrint = true, $stripTags = false) {
                // Set debug instance to NULL
                $debugInstance = NULL;
 
@@ -2000,19 +1951,19 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                        // Use debug output handler
                        $debugInstance->output($message, $stripTags);
 
-                       if ($doPrint === FALSE) {
+                       if ($doPrint === false) {
                                // Die here if not printed
                                exit();
                        } // END - if
                } else {
                        // Are debug times enabled?
-                       if ($this->getConfigInstance()->getConfigEntry('debug_' . self::getResponseTypeFromSystem() . '_output_timings') == 'Y') {
+                       if ($this->getConfigInstance()->getConfigEntry('debug_' . FrameworkBootstrap::getRequestTypeFromSystem() . '_output_timings') == 'Y') {
                                // Prepent it
                                $message = $this->getPrintableExecutionTime() . $message;
                        } // END - if
 
                        // Put directly out
-                       if ($doPrint === TRUE) {
+                       if ($doPrint === true) {
                                // Print message
                                $this->outputLine($message);
                        } else {
@@ -2181,7 +2132,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                $this->getResultInstance()->rewind();
 
                // Do we have an entry?
-               if ($this->getResultInstance()->valid() === FALSE) {
+               if ($this->getResultInstance()->valid() === false) {
                        // @TODO Move the constant to e.g. BaseDatabaseResult when there is a non-cached database result available
                        throw new InvalidDatabaseResultException(array($this, $this->getResultInstance()), CachedDatabaseResult::EXCEPTION_INVALID_DATABASE_RESULT);
                } // END - if
@@ -2218,7 +2169,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
 
                // Get current array
                $fieldArray = $resultInstance->current();
-               //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput($fieldName.':<pre>'.print_r($fieldArray, TRUE).'</pre>');
+               //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput($fieldName.':<pre>'.print_r($fieldArray, true).'</pre>');
 
                // Convert dashes to underscore
                $fieldName2 = self::convertDashesToUnderscores($fieldName);
@@ -2229,7 +2180,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                        $fieldValue = $fieldArray[$fieldName2];
                } elseif (defined('DEVELOPER')) {
                        // Missing field entry, may require debugging
-                       self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']:fieldArray<pre>=' . print_r($fieldArray, TRUE) . '</pre>,fieldName=' . $fieldName . ' not found!');
+                       self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']:fieldArray<pre>=' . print_r($fieldArray, true) . '</pre>,fieldName=' . $fieldName . ' not found!');
                } else {
                        // Missing field entry, may require debugging
                        self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']:fieldName=' . $fieldName . ' not found!');
@@ -2258,7 +2209,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
 
                // Get current array
                $fieldArray = $resultInstance->current();
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . $this->__toString() . ':' . __LINE__ . '] fieldName=' . $fieldName . ',fieldArray=<pre>'.print_r($fieldArray, TRUE).'</pre>');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . $this->__toString() . ':' . __LINE__ . '] fieldName=' . $fieldName . ',fieldArray=<pre>'.print_r($fieldArray, true).'</pre>');
 
                // Convert dashes to underscore
                $fieldName = self::convertDashesToUnderscores($fieldName);
@@ -2339,7 +2290,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         */
        public function getMilliTime () {
                // Get the time of day as float
-               $milliTime = gettimeofday(TRUE);
+               $milliTime = gettimeofday(true);
 
                // Return it
                return $milliTime;
@@ -2352,7 +2303,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         */
        public function idle ($milliSeconds) {
                // Sleep is fine by default
-               $hasSlept = TRUE;
+               $hasSlept = true;
 
                // Idle so long with found function
                if (function_exists('time_sleep_until')) {
@@ -2518,35 +2469,13 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         */
        protected function isBase64Encoded ($encodedData) {
                // Determine it
-               $isBase64 = (@base64_decode($encodedData, TRUE) !== FALSE);
+               $isBase64 = (@base64_decode($encodedData, true) !== false);
 
                // Return it
                return $isBase64;
        }
 
        /**
-        * "Getter" to get response/request type from analysis of the system.
-        *
-        * @return      $responseType   Analyzed response type
-        */
-       protected static function getResponseTypeFromSystem () {
-               // Default is console
-               $responseType = 'console';
-
-               // Is 'HTTP_HOST' set?
-               if (isset($_SERVER['HTTP_HOST'])) {
-                       /*
-                        * Then it is a HTML response/request as RSS and so on may be
-                        * transfered over HTTP as well.
-                        */
-                       $responseType = 'html';
-               } // END - if
-
-               // Return it
-               return $responseType;
-       }
-
-       /**
         * Gets a cache key from Criteria instance
         *
         * @param       $criteriaInstance       An instance of a Criteria class
@@ -2581,7 +2510,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         */
        protected function getPrintableExecutionTime () {
                // Caculate the execution time
-               $executionTime = microtime(TRUE) - $this->getStartupTime();
+               $executionTime = microtime(true) - $this->getStartupTime();
 
                // Pack it in nice braces
                $executionTime = sprintf('[ %01.5f ] ', $executionTime);
@@ -2630,18 +2559,18 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         * @param       $assertMismatch         Whether to assert mismatches
         * @return      $ret            The (hopefully) secured numbered value
         */
-       public function bigintval ($num, $castValue = TRUE, $assertMismatch = FALSE) {
+       public function bigintval ($num, $castValue = true, $assertMismatch = false) {
                // Filter all numbers out
                $ret = preg_replace('/[^0123456789]/', '', $num);
 
                // Shall we cast?
-               if ($castValue === TRUE) {
+               if ($castValue === true) {
                        // Cast to biggest numeric type
                        $ret = (double) $ret;
                } // END - if
 
                // Assert only if requested
-               if ($assertMismatch === TRUE) {
+               if ($assertMismatch === true) {
                        // Has the whole value changed?
                        assert(('' . $ret . '' != '' . $num . '') && (!is_null($num)));
                } // END - if
@@ -2657,12 +2586,12 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         * @param       $assertMismatch         Whether to assert mismatches
         * @return      $ret    The (hopefully) secured hext-numbered value
         */
-       public function hexval ($num, $assertMismatch = FALSE) {
+       public function hexval ($num, $assertMismatch = false) {
                // Filter all numbers out
                $ret = preg_replace('/[^0123456789abcdefABCDEF]/', '', $num);
 
                // Assert only if requested
-               if ($assertMismatch === TRUE) {
+               if ($assertMismatch === true) {
                        // Has the whole value changed?
                        assert(('' . $ret . '' != '' . $num . '') && (!is_null($num)));
                } // END - if
@@ -2758,7 +2687,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                } // END - if
 
                // Debug message
-               //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',value=' . print_r($this->genericArray[$keyGroup][$subGroup], TRUE));
+               //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',value=' . print_r($this->genericArray[$keyGroup][$subGroup], true));
 
                // Return it
                return $this->genericArray[$keyGroup][$subGroup];
@@ -2808,7 +2737,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         */
        protected final function appendStringToGenericArrayKey ($keyGroup, $subGroup, $key, $value, $appendGlue = '') {
                // Debug message
-               //* NOISY-DEBUG: */ if (!is_object($value)) $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key . ',value[' . gettype($value) . ']=' . print_r($value, TRUE) . ',appendGlue=' . $appendGlue);
+               //* NOISY-DEBUG: */ if (!is_object($value)) $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key . ',value[' . gettype($value) . ']=' . print_r($value, true) . ',appendGlue=' . $appendGlue);
 
                // Is it already there?
                if ($this->isGenericArrayKeySet($keyGroup, $subGroup, $key)) {
@@ -2832,7 +2761,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         */
        protected final function appendStringToGenericArrayElement ($keyGroup, $subGroup, $key, $element, $value, $appendGlue = '') {
                // Debug message
-               //* NOISY-DEBUG: */ if (!is_object($value)) $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key . ',element=' . $element . ',value[' . gettype($value) . ']=' . print_r($value, TRUE) . ',appendGlue=' . $appendGlue);
+               //* NOISY-DEBUG: */ if (!is_object($value)) $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key . ',element=' . $element . ',value[' . gettype($value) . ']=' . print_r($value, true) . ',appendGlue=' . $appendGlue);
 
                // Is it already there?
                if ($this->isGenericArrayElementSet($keyGroup, $subGroup, $key, $element)) {
@@ -2856,7 +2785,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         */
        protected final function setStringGenericArrayElement ($keyGroup, $subGroup, $key, $element, $value, $appendGlue = '') {
                // Debug message
-               //* NOISY-DEBUG: */ if (!is_object($value)) $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key . ',element=' . $element . ',value[' . gettype($value) . ']=' . print_r($value, TRUE) . ',appendGlue=' . $appendGlue);
+               //* NOISY-DEBUG: */ if (!is_object($value)) $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key . ',element=' . $element . ',value[' . gettype($value) . ']=' . print_r($value, true) . ',appendGlue=' . $appendGlue);
 
                // Set it
                $this->genericArray[$keyGroup][$subGroup][$key][$element] = (string) $value;
@@ -2871,12 +2800,12 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         * @param       $forceInit      Optionally force initialization
         * @return      void
         */
-       protected final function initGenericArrayGroup ($keyGroup, $subGroup, $forceInit = FALSE) {
+       protected final function initGenericArrayGroup ($keyGroup, $subGroup, $forceInit = false) {
                // Debug message
                //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',forceInit=' . intval($forceInit));
 
                // Is it already set?
-               if (($forceInit === FALSE) && ($this->isGenericArrayGroupSet($keyGroup, $subGroup))) {
+               if (($forceInit === false) && ($this->isGenericArrayGroupSet($keyGroup, $subGroup))) {
                        // Already initialized
                        trigger_error(__METHOD__ . ':keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ' already initialized.');
                        exit;
@@ -2895,12 +2824,12 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         * @param       $forceInit      Optionally force initialization
         * @return      void
         */
-       protected final function initGenericArrayKey ($keyGroup, $subGroup, $key, $forceInit = FALSE) {
+       protected final function initGenericArrayKey ($keyGroup, $subGroup, $key, $forceInit = false) {
                // Debug message
                //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key . ',forceInit=' . intval($forceInit));
 
                // Is it already set?
-               if (($forceInit === FALSE) && ($this->isGenericArrayKeySet($keyGroup, $subGroup, $key))) {
+               if (($forceInit === false) && ($this->isGenericArrayKeySet($keyGroup, $subGroup, $key))) {
                        // Already initialized
                        trigger_error(__METHOD__ . ':keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key . ' already initialized.');
                        exit;
@@ -2920,12 +2849,12 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         * @param       $forceInit      Optionally force initialization
         * @return      void
         */
-       protected final function initGenericArrayElement ($keyGroup, $subGroup, $key, $element, $forceInit = FALSE) {
+       protected final function initGenericArrayElement ($keyGroup, $subGroup, $key, $element, $forceInit = false) {
                // Debug message
                //* NOISY-DEBUG: */ $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key . ',element=' . $element . ',forceInit=' . intval($forceInit));
 
                // Is it already set?
-               if (($forceInit === FALSE) && ($this->isGenericArrayElementSet($keyGroup, $subGroup, $key, $element))) {
+               if (($forceInit === false) && ($this->isGenericArrayElementSet($keyGroup, $subGroup, $key, $element))) {
                        // Already initialized
                        trigger_error(__METHOD__ . ':keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key . ',element=' . $element . ' already initialized.');
                        exit;
@@ -2946,7 +2875,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         */
        protected final function pushValueToGenericArrayKey ($keyGroup, $subGroup, $key, $value) {
                // Debug message
-               //* NOISY-DEBUG: */ if (!is_object($value)) $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key . ',value[' . gettype($value) . ']=' . print_r($value, TRUE));
+               //* NOISY-DEBUG: */ if (!is_object($value)) $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key . ',value[' . gettype($value) . ']=' . print_r($value, true));
 
                // Is it set?
                if (!$this->isGenericArrayKeySet($keyGroup, $subGroup, $key)) {
@@ -2958,7 +2887,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                $count = array_push($this->genericArray[$keyGroup][$subGroup][$key], $value);
 
                // Return count
-               //* DEBUG: */ print(__METHOD__ . ': genericArray=' . print_r($this->genericArray[$keyGroup][$subGroup][$key], TRUE));
+               //* DEBUG: */ print(__METHOD__ . ': genericArray=' . print_r($this->genericArray[$keyGroup][$subGroup][$key], true));
                //* DEBUG: */ print(__METHOD__ . ': count=' . $count . PHP_EOL);
                return $count;
        }
@@ -2975,7 +2904,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         */
        protected final function pushValueToGenericArrayElement ($keyGroup, $subGroup, $key, $element, $value) {
                // Debug message
-               //* NOISY-DEBUG: */ if (!is_object($value)) $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key . ',element=' . $element . ',value[' . gettype($value) . ']=' . print_r($value, TRUE));
+               //* NOISY-DEBUG: */ if (!is_object($value)) $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key . ',element=' . $element . ',value[' . gettype($value) . ']=' . print_r($value, true));
 
                // Is it set?
                if (!$this->isGenericArrayElementSet($keyGroup, $subGroup, $key, $element)) {
@@ -2987,7 +2916,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                $count = array_push($this->genericArray[$keyGroup][$subGroup][$key][$element], $value);
 
                // Return count
-               //* DEBUG: */ print(__METHOD__ . ': genericArray=' . print_r($this->genericArray[$keyGroup][$subGroup][$key], TRUE));
+               //* DEBUG: */ print(__METHOD__ . ': genericArray=' . print_r($this->genericArray[$keyGroup][$subGroup][$key], true));
                //* DEBUG: */ print(__METHOD__ . ': count=' . $count . PHP_EOL);
                return $count;
        }
@@ -3015,8 +2944,8 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                $value = array_pop($this->genericArray[$keyGroup][$subGroup][$key]);
 
                // Return value
-               //* DEBUG: */ print(__METHOD__ . ': genericArray=' . print_r($this->genericArray[$keyGroup][$subGroup][$key], TRUE));
-               //* DEBUG: */ print(__METHOD__ . ': value[' . gettype($value) . ']=' . print_r($value, TRUE) . PHP_EOL);
+               //* DEBUG: */ print(__METHOD__ . ': genericArray=' . print_r($this->genericArray[$keyGroup][$subGroup][$key], true));
+               //* DEBUG: */ print(__METHOD__ . ': value[' . gettype($value) . ']=' . print_r($value, true) . PHP_EOL);
                return $value;
        }
 
@@ -3043,8 +2972,8 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                $value = array_shift($this->genericArray[$keyGroup][$subGroup][$key]);
 
                // Return value
-               //* DEBUG: */ print(__METHOD__ . ': genericArray=' . print_r($this->genericArray[$keyGroup][$subGroup][$key], TRUE));
-               //* DEBUG: */ print(__METHOD__ . ': value[' . gettype($value) . ']=' . print_r($value, TRUE) . PHP_EOL);
+               //* DEBUG: */ print(__METHOD__ . ': genericArray=' . print_r($this->genericArray[$keyGroup][$subGroup][$key], true));
+               //* DEBUG: */ print(__METHOD__ . ': value[' . gettype($value) . ']=' . print_r($value, true) . PHP_EOL);
                return $value;
        }
 
@@ -3168,7 +3097,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         */
        protected final function setGenericArrayKey ($keyGroup, $subGroup, $key, $value) {
                // Debug message
-               //* NOISY-DEBUG: */ if (!is_object($value)) $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key . ',value[' . gettype($value) . ']=' . print_r($value, TRUE));
+               //* NOISY-DEBUG: */ if (!is_object($value)) $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key . ',value[' . gettype($value) . ']=' . print_r($value, true));
 
                // Set value here
                $this->genericArray[$keyGroup][$subGroup][$key] = $value;
@@ -3209,7 +3138,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
         */
        protected final function setGenericArrayElement ($keyGroup, $subGroup, $key, $element, $value) {
                // Debug message
-               //* NOISY-DEBUG: */ if (!is_object($value)) $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key . ',element=' . $element . ',value[' . gettype($value) . ']=' . print_r($value, TRUE));
+               //* NOISY-DEBUG: */ if (!is_object($value)) $this->outputLine('[' . __METHOD__ . ':' . __LINE__ . '] keyGroup=' . $keyGroup . ',subGroup=' . $subGroup . ',key=' . $key . ',element=' . $element . ',value[' . gettype($value) . ']=' . print_r($value, true));
 
                // Then set it
                $this->genericArray[$keyGroup][$subGroup][$key][$element] = $value;
@@ -3285,12 +3214,6 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                // Get application instance
                $applicationInstance = Registry::getRegistry()->getInstance('app');
 
-               // Is this a response instance?
-               if ($this instanceof Responseable) {
-                       // Then set it in application instance
-                       $applicationInstance->setResponseInstance($this);
-               } // END - if
-
                // Init web output instance
                $outputInstance = ObjectFactory::createObjectByConfiguredName('output_class', array($applicationInstance));
 
@@ -3299,7 +3222,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
        }
 
        /**
-        * Translates boolean TRUE to 'Y' and FALSE to 'N'
+        * Translates boolean true to 'Y' and false to 'N'
         *
         * @param       $boolean                Boolean value
         * @return      $translated             Translated boolean value
@@ -3309,7 +3232,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                assert(is_bool($boolean));
 
                // "Translate" it
-               $translated = ($boolean === TRUE) ? 'Y' : 'N';
+               $translated = ($boolean === true) ? 'Y' : 'N';
 
                // ... and return it
                return $translated;
@@ -3384,58 +3307,6 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
        }
 
        /**
-        * Checks whether the given file/path is in open_basedir(). This does not
-        * gurantee that the file is actually readable and/or writeable. If you need
-        * such gurantee then please use isReadableFile() instead.
-        *
-        * @param       $filePathName   Name of the file/path to be checked
-        * @return      $isReachable    Whether it is within open_basedir()
-        */
-       protected static function isReachableFilePath ($filePathName) {
-               // Is not reachable by default
-               $isReachable = FALSE;
-
-               // Get open_basedir parameter
-               $openBaseDir = ini_get('open_basedir');
-
-               // Is it set?
-               if (!empty($openBaseDir)) {
-                       // Check all entries
-                       foreach (explode(PATH_SEPARATOR, $openBaseDir) as $dir) {
-                               // Check on existence
-                               if (substr($filePathName, 0, strlen($dir)) == $dir) {
-                                       // Is reachable
-                                       $isReachable = TRUE;
-                               } // END - if
-                       } // END - foreach
-               } else {
-                       // If open_basedir is not set, all is allowed
-                       $isReachable = TRUE;
-               }
-
-               // Return status
-               return $isReachable;
-       }
-
-       /**
-        * Checks whether the give file is within open_basedir() (done by
-        * isReachableFilePath()), is actually a file and is readable.
-        *
-        * @param       $fileName               Name of the file to be checked
-        * @return      $isReadable             Whether the file is readable (and therefor exists)
-        */
-       public static function isReadableFile ($fileName) {
-               // Default is not readable
-               $isReadable = FALSE;
-
-               // Is within parameters, so check if it is a file and readable
-               $isReadable = ((self::isReachableFilePath($fileName)) && (file_exists($fileName)) && (is_file($fileName)) && (is_readable($fileName)));
-
-               // Return status
-               return $isReadable;
-       }
-
-       /**
         * Creates a full-qualified file name (FQFN) for given file name by adding
         * a configured temporary file path to it.
         *
@@ -3458,7 +3329,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                $fqfn = $basePath . '/' . $fileName;
 
                // Is it reachable?
-               if (!self::isReachableFilePath($fqfn)) {
+               if (!FrameworkBootstrap::isReachableFilePath($fqfn)) {
                        // Not reachable
                        throw new FileIoException($fqfn, self::EXCEPTION_FILE_NOT_REACHABLE);
                } // END - if
@@ -3512,7 +3383,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                } // END - if
 
                // Check socket array, 1st element is mostly IP address (or file name), 2nd is port number
-               //* DEBUG-DIE: */ die(__METHOD__ . ':socketData=' . print_r($socketData, TRUE));
+               //* DEBUG-DIE: */ die(__METHOD__ . ':socketData=' . print_r($socketData, true));
                assert(isset($socketData[0]));
                assert(isset($socketData[1]));
 
index c8222de..98e50d0 100644 (file)
@@ -3,9 +3,11 @@
                // @TODO Add some DNS caching here
 
                // Open connection
-               if ($helperInstance->isProxyUsed() === TRUE) {
+               if ($helperInstance->isProxyUsed() === true) {
                        // Resolve hostname into IP address
-                       $ip = $helperInstance->resolveIpAddress($helperInstance->getConfigInstance()->getConfigEntry('proxy_host'));
+                       $ip = ConsoleTools::resolveIpAddress($helperInstance->getConfigInstance()->getConfigEntry('proxy_host'));
+
+                       // @TODO Handle $ip = false
 
                        // Connect to host through proxy connection
                        $socketResource = fsockopen($ip, $helperInstance->getConfigInstance()->getConfigEntry('proxy_port'), $errorNo, $errorStr, 30);
index 76a3113..db79276 100644 (file)
                // @TODO Add some DNS caching here
 
                // Open connection
-               if ($helperInstance->isProxyUsed() === TRUE) {
+               if ($helperInstance->isProxyUsed() === true) {
                        // Resolve hostname into IP address
-                       $ip = $helperInstance->resolveIpAddress($helperInstance->getConfigInstance()->getConfigEntry('proxy_host'));
+                       $ip = ConsoleTools::resolveIpAddress($helperInstance->getConfigInstance()->getConfigEntry('proxy_host'));
+
+                       // @TODO Handle $ip = false
 
                        // Connect to host through proxy connection
                        $socketResource = fsockopen($ip, $helperInstance->getConfigInstance()->getConfigEntry('proxy_port'), $errorNo, $errorStr, 30);
                } // END - if
 
                // Prepare the GET request
-               $request  = 'GET ' . ($helperInstance->isProxyUsed() === TRUE ? 'http://shipsimu.org' : '') . '/ip.php HTTP/1.0' . self::HTTP_EOL;
+               $request  = 'GET ' . ($helperInstance->isProxyUsed() === true ? 'http://shipsimu.org' : '') . '/ip.php HTTP/1.0' . self::HTTP_EOL;
                $request .= 'Host: shipsimu.org' . self::HTTP_EOL;
                $request .= 'User-Agent: ' . $this->getUserAgent() . self::HTTP_EOL;
                $request .= 'Connection: close' . self::HTTP_EOL;
 
                // Do we use proxy?
-               if ($helperInstance->isProxyUsed() === TRUE) {
+               if ($helperInstance->isProxyUsed() === true) {
                        // CONNECT method?
                        if ($helperInstance->getConfigInstance()->getConfigEntry('proxy_connect_method') == 'Y') {
                                // Setup proxy tunnel
@@ -55,7 +57,7 @@
                                // If the response is invalid, abort
                                if ((count($response) == 3) && (empty($response[0])) && (empty($response[1])) && (empty($response[2]))) {
                                        // Invalid response!
-                                       $helperInstance->debugBackTrace('Proxy tunnel not working: response=' . print_r($response, TRUE));
+                                       $helperInstance->debugBackTrace('Proxy tunnel not working: response=' . print_r($response, true));
                                } // END - if
                        } else {
                                // Add header for proxy
index 1c89e94..688c9d3 100644 (file)
@@ -48,7 +48,7 @@ class HttpClient extends BaseClient implements Client {
         * @param       $socketResource         Resource of a socket (optional)
         * @return      $clientInstance         An instance of a Client class
         */
-       public final static function createHttpClient ($socketResouce = FALSE) {
+       public final static function createHttpClient ($socketResouce = false) {
                // Get a new instance
                $clientInstance = new HttpClient();
 
index 3feb617..020f8fa 100644 (file)
@@ -5,6 +5,7 @@ namespace CoreFramework\Command;
 // Import framework stuff
 use CoreFramework\Factory\ObjectFactory;
 use CoreFramework\Object\BaseFrameworkSystem;
+use CoreFramework\Registry\Registry;
 use CoreFramework\Request\Requestable;
 use CoreFramework\Response\Responseable;
 
@@ -55,7 +56,7 @@ class BaseCommand extends BaseFrameworkSystem {
                assert(!$requestInstance->isPostRequestMethod());
 
                // Get the application instance
-               $applicationInstance = $this->getResolverInstance()->getApplicationInstance();
+               $applicationInstance = Registry::getRegistry()->getInstance('app');
 
                // Prepare a template instance
                $templateInstance = $this->prepareTemplateInstance($applicationInstance);
index ac5fc6b..9ad5288 100644 (file)
@@ -73,7 +73,7 @@ class HtmlConfirmCommand extends BaseCommand implements Commandable {
         */
        public function execute (Requestable $requestInstance, Responseable $responseInstance) {
                // Get the application instance
-               $applicationInstance = $this->getResolverInstance()->getApplicationInstance();
+               $applicationInstance = Registry::getRegistry()->getInstance('app');
 
                // Prepare a template instance
                $templateInstance = $this->prepareTemplateInstance($applicationInstance);
index 6f8be22..3dd9aa7 100644 (file)
@@ -7,6 +7,7 @@ use CoreFramework\Command\BaseCommand;
 use CoreFramework\Command\Commandable;
 use CoreFramework\Controller\Controller;
 use CoreFramework\Factory\ObjectFactory;
+use CoreFramework\Registry\Registry;
 use CoreFramework\Request\Requestable;
 use CoreFramework\Resolver\Command\CommandResolver;
 use CoreFramework\Response\Responseable;
@@ -70,7 +71,7 @@ class HtmlHomeCommand extends BaseCommand implements Commandable {
         */
        public function execute (Requestable $requestInstance, Responseable $responseInstance) {
                // Get the application instance
-               $applicationInstance = $this->getResolverInstance()->getApplicationInstance();
+               $applicationInstance = Registry::getRegistry()->getInstance('app');
 
                // Prepare a template instance
                $templateInstance = $this->prepareTemplateInstance($applicationInstance);
index 1058830..399de5b 100644 (file)
@@ -98,7 +98,7 @@ class HtmlLoginAreaCommand extends BaseCommand implements Commandable {
                } // END - if
 
                // Get the application instance
-               $applicationInstance = $this->getResolverInstance()->getApplicationInstance();
+               $applicationInstance = Registry::getRegistry()->getInstance('app');
 
                // Prepare a template instance
                $templateInstance = $this->prepareTemplateInstance($applicationInstance);
@@ -197,7 +197,7 @@ class HtmlLoginAreaCommand extends BaseCommand implements Commandable {
                } // END - if
 
                // Get application instance
-               $applicationInstance = $this->getResolverInstance()->getApplicationInstance();
+               $applicationInstance = Registry::getRegistry()->getInstance('app');
 
                // Get a resolver
                $actionResolver = HtmlActionResolver::createHtmlActionResolver($this->actionName, $applicationInstance);
index 2ab7b0e..064b242 100644 (file)
@@ -7,7 +7,6 @@ use CoreFramework\Command\BaseCommand;
 use CoreFramework\Command\Commandable;
 use CoreFramework\Controller\Controller;
 use CoreFramework\Factory\ObjectFactory;
-use CoreFramework\Registry\Registerable;
 use CoreFramework\Registry\Registry;
 use CoreFramework\Request\Requestable;
 use CoreFramework\Resolver\Command\CommandResolver;
@@ -35,7 +34,7 @@ use CoreFramework\Response\Responseable;
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
-class HtmlLoginCommand extends BaseCommand implements Commandable, Registerable {
+class HtmlLoginCommand extends BaseCommand implements Commandable {
        /**
         * Protected constructor
         *
@@ -75,7 +74,7 @@ class HtmlLoginCommand extends BaseCommand implements Commandable, Registerable
                Registry::getRegistry()->addInstance('extra', $this);
 
                // Get the application instance
-               $applicationInstance = $this->getResolverInstance()->getApplicationInstance();
+               $applicationInstance = Registry::getRegistry()->getInstance('app');
 
                // Prepare a template instance
                $templateInstance = $this->prepareTemplateInstance($applicationInstance);
index aa4def2..906eb22 100644 (file)
@@ -7,6 +7,7 @@ use CoreFramework\Command\BaseCommand;
 use CoreFramework\Command\Commandable;
 use CoreFramework\Controller\Controller;
 use CoreFramework\Factory\ObjectFactory;
+use CoreFramework\Registry\Registry;
 use CoreFramework\Request\Requestable;
 use CoreFramework\Resolver\Command\CommandResolver;
 use CoreFramework\Response\Responseable;
@@ -70,7 +71,7 @@ class HtmlLoginFailedCommand extends BaseCommand implements Commandable {
         */
        public function execute (Requestable $requestInstance, Responseable $responseInstance) {
                // Get the application instance
-               $applicationInstance = $this->getResolverInstance()->getApplicationInstance();
+               $applicationInstance = Registry::getRegistry()->getInstance('app');
 
                // Prepare a template instance
                $templateInstance = $this->prepareTemplateInstance($applicationInstance);
index 9225d79..58d5147 100644 (file)
@@ -7,6 +7,7 @@ use CoreFramework\Command\BaseCommand;
 use CoreFramework\Command\Commandable;
 use CoreFramework\Controller\Controller;
 use CoreFramework\Factory\ObjectFactory;
+use CoreFramework\Registry\Registry;
 use CoreFramework\Request\Requestable;
 use CoreFramework\Resolver\Command\CommandResolver;
 use CoreFramework\Response\Responseable;
@@ -72,9 +73,6 @@ class HtmlLogoutCommand extends BaseCommand implements Commandable {
                // Get an auth instance for checking and updating the auth cookies
                $authInstance = ObjectFactory::createObjectByConfiguredName('auth_method_class', array($responseInstance));
 
-               // Set request instance
-               $authInstance->setRequestInstance($requestInstance);
-
                // Destroy the auth data
                $authInstance->destroyAuthData();
 
index fabe633..7614be1 100644 (file)
@@ -7,6 +7,7 @@ use CoreFramework\Command\BaseCommand;
 use CoreFramework\Command\Commandable;
 use CoreFramework\Controller\Controller;
 use CoreFramework\Factory\ObjectFactory;
+use CoreFramework\Registry\Registry;
 use CoreFramework\Request\Requestable;
 use CoreFramework\Resolver\Command\CommandResolver;
 use CoreFramework\Response\Responseable;
@@ -70,7 +71,7 @@ class HtmlLogoutDoneCommand extends BaseCommand implements Commandable {
         */
        public function execute (Requestable $requestInstance, Responseable $responseInstance) {
                // Get the application instance
-               $applicationInstance = $this->getResolverInstance()->getApplicationInstance();
+               $applicationInstance = Registry::getRegistry()->getInstance('app');
 
                // Prepare a template instance
                $templateInstance = $this->prepareTemplateInstance($applicationInstance);
index 520f65b..3759f98 100644 (file)
@@ -6,6 +6,7 @@ namespace CoreFramework\Command\Failed;
 use CoreFramework\Command\BaseCommand;
 use CoreFramework\Command\Commandable;
 use CoreFramework\Controller\Controller;
+use CoreFramework\Registry\Registry;
 use CoreFramework\Request\Requestable;
 use CoreFramework\Resolver\Command\CommandResolver;
 use CoreFramework\Response\Responseable;
index 4198c32..214e18f 100644 (file)
@@ -7,7 +7,6 @@ use CoreFramework\Command\BaseCommand;
 use CoreFramework\Command\Commandable;
 use CoreFramework\Controller\Controller;
 use CoreFramework\Factory\ObjectFactory;
-use CoreFramework\Registry\Registerable;
 use CoreFramework\Registry\Registry;
 use CoreFramework\Request\Requestable;
 use CoreFramework\Resolver\Command\CommandResolver;
@@ -35,7 +34,7 @@ use CoreFramework\Response\Responseable;
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
-class HtmlRegisterCommand extends BaseCommand implements Commandable, Registerable {
+class HtmlRegisterCommand extends BaseCommand implements Commandable {
        /**
         * Protected constructor
         *
@@ -75,7 +74,7 @@ class HtmlRegisterCommand extends BaseCommand implements Commandable, Registerab
                Registry::getRegistry()->addInstance('extra', $this);
 
                // Get the application instance
-               $applicationInstance = $this->getResolverInstance()->getApplicationInstance();
+               $applicationInstance = Registry::getRegistry()->getInstance('app');
 
                // Prepare a template instance
                $templateInstance = $this->prepareTemplateInstance($applicationInstance);
index 25b9f00..d19d9c2 100644 (file)
@@ -75,7 +75,7 @@ class HtmlResendLinkCommand extends BaseCommand implements Commandable {
                $userInstance = Registry::getRegistry()->getInstance('user');
 
                // Get an application instance
-               $applicationInstance = $this->getResolverInstance()->getApplicationInstance();
+               $applicationInstance = Registry::getRegistry()->getInstance('app');
 
                // Get a RNG instance (Random Number Generator)
                $rngInstance = ObjectFactory::createObjectByConfiguredName('rng_class');
index 5b50a77..ae1325b 100644 (file)
@@ -71,7 +71,7 @@ class HtmlStatusCommand extends BaseCommand implements Commandable {
         */
        public function execute (Requestable $requestInstance, Responseable $responseInstance) {
                // Get the application instance
-               $applicationInstance = $this->getResolverInstance()->getApplicationInstance();
+               $applicationInstance = Registry::getRegistry()->getInstance('app');
 
                // Prepare a template instance
                $templateInstance = $this->prepareTemplateInstance($applicationInstance);
index a0e329d..b61bcfd 100644 (file)
@@ -6,6 +6,7 @@ namespace CoreFramework\Command\Captcha;
 use CoreFramework\Command\BaseCommand;
 use CoreFramework\Command\Commandable;
 use CoreFramework\Controller\Controller;
+use CoreFramework\Registry\Registry;
 use CoreFramework\Request\Requestable;
 use CoreFramework\Resolver\Command\CommandResolver;
 use CoreFramework\Response\Responseable;
@@ -72,7 +73,7 @@ class ImageCodeCaptchaCommand extends BaseCommand implements Commandable {
                $decryptedCode = $requestInstance->getRequestElement('decrypted');
 
                // Get the application instance
-               $applicationInstance = $this->getResolverInstance()->getApplicationInstance();
+               $applicationInstance = Registry::getRegistry()->getInstance('app');
 
                // Prepare a template instance
                $templateInstance = $this->prepareTemplateInstance($applicationInstance);
index 3708da8..16bffd4 100644 (file)
@@ -89,7 +89,7 @@ class Bzip2Compressor extends BaseFrameworkSystem implements Compressor {
                } // END - if
 
                // Decompress it
-               $streamData = bzdecompress($streamData, TRUE);
+               $streamData = bzdecompress($streamData, true);
 
                // Return the decompressed stream
                return $streamData;
index 84b72f8..a2f6233 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 // Own namespace
-namespace CoreFramework\Tools;
+namespace CoreFramework\Console\Tools;
 
 // Import framework stuff
 use CoreFramework\Configuration\FrameworkConfiguration;
@@ -46,50 +46,6 @@ class ConsoleTools extends BaseFrameworkSystem {
        }
 
        /**
-        * Tries to resolve an IP address from given hostname. Currently only IPv
-        * addresses are resolved.
-        *
-        * @param       $hostname       Host name we shall resolve
-        * @return      $ip                     IP address resolved from host name
-        * @todo        We should connect this to a caching class to cache DNS requests
-        */
-       protected function resolveIpAddress ($hostname) {
-               // Debug message
-               self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:] Host name to resolve is: %s',
-                       $this->__toString(),
-                       $hostname
-               ));
-
-               // Default is an invalid one
-               $ip = '0.0.0.0';
-
-               // Resolve it
-               // @TODO Here should the cacher be implemented
-               $ipResolved = gethostbyname($hostname);
-
-               // Was it fine?
-               if (($ipResolved !== FALSE) && ($ipResolved != $hostname)) {
-                       // Okay, this works!
-                       $ip = $ipResolved;
-
-                       // Debug message
-                       self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:] Resolved IP address is: %s',
-                               $this->__toString(),
-                               $ip
-                       ));
-               } else {
-                       // Problem while resolving IP address
-                       self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:] Problem resolving IP address for host %s. Please check your /etc/hosts file.',
-                               $this->__toString(),
-                               $hostname
-                       ));
-               }
-
-               // Return resolved IP
-               return $ip;
-       }
-
-       /**
         * Checks wether proxy configuration is used
         *
         * @return      $isUsed         Wether proxy is used
@@ -180,7 +136,7 @@ class ConsoleTools extends BaseFrameworkSystem {
                        } // END - if
 
                        // Has an equals sign?
-                       if (strpos($line, '=') !== FALSE) {
+                       if (strpos($line, '=') !== false) {
                                // Then "explode" it again, right part is hostname in quotes
                                $hostData = explode('=', $line);
 
@@ -202,14 +158,70 @@ class ConsoleTools extends BaseFrameworkSystem {
        }
 
        /**
+        * Tries to resolve an IP address from given hostname. Currently only IPv
+        * addresses are resolved.
+        *
+        * @param       $hostname       Host name we shall resolve
+        * @return      $ipAddress      IPv4 address resolved from host name
+        * @todo        This should be connected to a caching class to cache DNS requests
+        */
+       public static function resolveIpAddress ($hostname) {
+               // Debug message
+               self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:] Host name to resolve is: %s',
+                       __CLASS__,
+                       $hostname
+               ));
+
+               // Default is false
+               $ipAddress = false;
+
+               // Is a dot at the end?
+               if (substr($hostname, -1, 1) != '.') {
+                       /*
+                        * Then append it to prevent lookup of invalid host names through
+                        * all search-domains. This will greatly improve lookup performance
+                        * and has no disadvantages for anybody. A dot at the end of a
+                        * domain btw means full-qualified domain, do not prepend to any
+                        * other domain, basically.
+                        */
+                       $hostname .= '.';
+               } // END - if
+
+               // Resolve it
+               // @TODO Here should the cacher be implemented
+               $ipResolved = gethostbyname($hostname);
+
+               // Was it fine?
+               if (($ipResolved !== false) && ($ipResolved != $hostname)) {
+                       // Okay, this works!
+                       $ipAddress = $ipResolved;
+
+                       // Debug message
+                       self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:] Resolved IP address is: %s',
+                               __CLASS__,
+                               $ipAddress
+                       ));
+               } else {
+                       // Problem while resolving IP address
+                       self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:] Problem resolving IP address for host %s. Please check your /etc/hosts file.',
+                               __CLASS__,
+                               $hostname
+                       ));
+               }
+
+               // Return resolved IP
+               return $ipAddress;
+       }
+
+       /**
         * Aquires the IP address of this host by reading the /etc/hostname file
         * and solving it. It is now stored in configuration
         *
-        * @return      $ip             Aquired IP address
+        * @return      $ipAddress      Aquired IPv4 address
         */
        public static function acquireSelfIPAddress () {
                // Local IP by default
-               $ip = '127.0.0.1';
+               $ipAddress = '127.0.0.1';
 
                // Get a new instance
                $helperInstance = new ConsoleTools();
@@ -228,15 +240,15 @@ class ConsoleTools extends BaseFrameworkSystem {
                        $hostname = $helperInstance->extractHostnameFromRawData($rawData);
 
                        // Resolve the IP number
-                       $ip = $helperInstance->resolveIpAddress($hostname);
+                       $ipAddress = self::resolveIpAddress($hostname);
                } catch (FileNotFoundException $e) {
                        // Fall-back to 'SESSION_SVR' which found on my Sun Station
                        if (isset($_SERVER['SESSION_SVR'])) {
                                // Resolve it
-                               $ip = $helperInstance->resolveIpAddress($_SERVER['SESSION_SVR']);
+                               $ipAddress = self::resolveIpAddress($_SERVER['SESSION_SVR']);
                        } elseif (isset($_SERVER['COMPUTERNAME'])) {
-                               // May happen on some XP systems, so also try this
-                               $ip = $helperInstance->resolveIpAddress($_SERVER['COMPUTERNAME']);
+                               // May happen on some Windows XP systems, so also try this
+                               $ipAddress = self::resolveIpAddress($_SERVER['COMPUTERNAME']);
                        } else {
                                // Could not find our hostname
                                self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:] WARNING: Cannot resolve my own IP address.',
@@ -254,10 +266,10 @@ class ConsoleTools extends BaseFrameworkSystem {
                }
 
                // Set it in configuration
-               FrameworkConfiguration::getSelfInstance()->setServerAddress($ip);
+               FrameworkConfiguration::getSelfInstance()->setServerAddress($ipAddress);
 
                // Return it
-               return $ip;
+               return $ipAddress;
        }
 
        /**
@@ -285,12 +297,12 @@ class ConsoleTools extends BaseFrameworkSystem {
                // @TODO Add some DNS caching here
 
                // Open connection
-               if ($helperInstance->isProxyUsed() === TRUE) {
+               if ($helperInstance->isProxyUsed() === true) {
                        // Resolve hostname into IP address
-                       $ip = $helperInstance->resolveIpAddress($helperInstance->getConfigInstance()->getConfigEntry('proxy_host'));
+                       $ipAddress = self::resolveIpAddress($helperInstance->getConfigInstance()->getConfigEntry('proxy_host'));
 
                        // Connect to host through proxy connection
-                       $socketResource = fsockopen($ip, $helperInstance->getConfigInstance()->getConfigEntry('proxy_port'), $errorNo, $errorStr, 30);
+                       $socketResource = fsockopen($ipAddress, $helperInstance->getConfigInstance()->getConfigEntry('proxy_port'), $errorNo, $errorStr, 30);
                } else {
                        // Connect to host directly
                        $socketResource = fsockopen('188.138.90.169', 80, $errorNo, $errorStr, 30);
@@ -303,13 +315,13 @@ class ConsoleTools extends BaseFrameworkSystem {
                } // END - if
 
                // Prepare the GET request
-               $request  = 'GET ' . ($helperInstance->isProxyUsed() === TRUE ? 'http://shipsimu.org' : '') . '/ip.php HTTP/1.0' . self::HTTP_EOL;
+               $request  = 'GET ' . ($helperInstance->isProxyUsed() === true ? 'http://shipsimu.org' : '') . '/ip.php HTTP/1.0' . self::HTTP_EOL;
                $request .= 'Host: shipsimu.org' . self::HTTP_EOL;
                $request .= 'User-Agent: ' . self::HTTP_USER_AGENT . self::HTTP_EOL;
                $request .= 'Connection: close' . self::HTTP_EOL;
 
                // Do we use proxy?
-               if ($helperInstance->isProxyUsed() === TRUE) {
+               if ($helperInstance->isProxyUsed() === true) {
                        // CONNECT method?
                        if ($helperInstance->getConfigInstance()->getConfigEntry('proxy_connect_method') == 'Y') {
                                // Setup proxy tunnel
@@ -318,7 +330,7 @@ class ConsoleTools extends BaseFrameworkSystem {
                                // If the response is invalid, abort
                                if ((count($response) == 3) && (empty($response[0])) && (empty($response[1])) && (empty($response[2]))) {
                                        // Invalid response!
-                                       $helperInstance->debugBackTrace('Proxy tunnel not working: response=' . print_r($response, TRUE));
+                                       $helperInstance->debugBackTrace('Proxy tunnel not working: response=' . print_r($response, true));
                                } // END - if
                        } else {
                                // Add header for proxy
@@ -397,7 +409,7 @@ class ConsoleTools extends BaseFrameworkSystem {
                $type = 'console';
 
                // Now, do we have a request method, or query string set?
-               if ((isset($_SERVER['REQUEST_METHOD'])) || (isset($_SERVER['QUERY_STRING']))) {
+               if (self::analyzeEnvironmentForType() == 'http') {
                        // Possibly HTTP request
                        $type = 'web';
                } // END - if
index fa1d2aa..b3c66ca 100644 (file)
@@ -56,7 +56,7 @@ class SocketContainer extends BaseContainer implements Registerable {
                unset($packageData[NetworkPackage::PACKAGE_DATA_HASH]);
 
                // Debug message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-CONTAINER[' . __METHOD__ . ':' . __LINE__ . ']:socketResource=' . $socketResource . ',packageData='.print_r($packageData, TRUE));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-CONTAINER[' . __METHOD__ . ':' . __LINE__ . ']:socketResource=' . $socketResource . ',packageData='.print_r($packageData, true));
 
                // Is the info instance set?
                if ($infoInstance instanceof ShareableInfo) {
@@ -104,7 +104,7 @@ class SocketContainer extends BaseContainer implements Registerable {
                $packageData = $this->getPackageData();
 
                // Debug message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-CONTAINER[' . __METHOD__ . ':' . __LINE__ . ']: unl=' . $unl . ',packageData=' . print_r($packageData, TRUE));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-CONTAINER[' . __METHOD__ . ':' . __LINE__ . ']: unl=' . $unl . ',packageData=' . print_r($packageData, true));
 
                // So, does both match?
                $matches = ((isset($packageData[NetworkPackage::PACKAGE_DATA_RECIPIENT])) && ($packageData[NetworkPackage::PACKAGE_DATA_RECIPIENT] === $unl));
index 3fa951d..7073abb 100644 (file)
@@ -60,7 +60,7 @@ class BaseCriteria extends BaseFrameworkSystem implements Criteria {
         */
        public function isKeySet ($criteriaType, $criteriaKey) {
                // Make sure no 'my-' or 'my_' passes this point
-               assert((strpos($criteriaKey, 'my-') === FALSE) && (strpos($criteriaKey, 'my_') === FALSE));
+               assert((strpos($criteriaKey, 'my-') === false) && (strpos($criteriaKey, 'my_') === false));
 
                // Determine it
                $isSet = $this->isGenericArrayElementSet('criteria', $criteriaType, 'entries', $criteriaKey);
@@ -146,7 +146,7 @@ class BaseCriteria extends BaseFrameworkSystem implements Criteria {
         */
        public final function unsetCriteria ($criteriaKey) {
                // Make sure no 'my-' or 'my_' passes this point
-               assert((strpos($criteriaKey, 'my-') === FALSE) && (strpos($criteriaKey, 'my_') === FALSE));
+               assert((strpos($criteriaKey, 'my-') === false) && (strpos($criteriaKey, 'my_') === false));
 
                // Convert dashes to underscore
                $criteriaKey = self::convertDashesToUnderscores($criteriaKey);
@@ -172,7 +172,7 @@ class BaseCriteria extends BaseFrameworkSystem implements Criteria {
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(strtoupper($criteriaType) . '-CRITERIA[' . __METHOD__ . ':' . __LINE__ . ']: criteriaKey=' . $criteriaKey . ',criteriaValue=' . $criteriaValue . ',criteriaType=' . $criteriaType . ' - CALLED!');
 
                // Make sure no 'my-' or 'my_' passes this point
-               assert((strpos($criteriaKey, 'my-') === FALSE) && (strpos($criteriaKey, 'my_') === FALSE) && (!is_bool($criteriaValue)));
+               assert((strpos($criteriaKey, 'my-') === false) && (strpos($criteriaKey, 'my_') === false) && (!is_bool($criteriaValue)));
 
                // Convert dashes to underscore
                $criteriaKey = self::convertDashesToUnderscores($criteriaKey);
@@ -198,7 +198,7 @@ class BaseCriteria extends BaseFrameworkSystem implements Criteria {
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(strtoupper($criteriaType) . '-CRITERIA[' . __METHOD__ . ':' . __LINE__ . ']: criteriaKey=' . $criteriaKey . ',criteriaValue=' . $criteriaValue . ',criteriaType=' . $criteriaType . ' - CALLED!');
 
                // Make sure no 'my-' or 'my_' passes this point
-               assert((strpos($criteriaKey, 'my-') === FALSE) && (strpos($criteriaKey, 'my_') === FALSE) && (!is_bool($criteriaValue)));
+               assert((strpos($criteriaKey, 'my-') === false) && (strpos($criteriaKey, 'my_') === false) && (!is_bool($criteriaValue)));
 
                // Convert dashes to underscore
                $criteriaKey = self::convertDashesToUnderscores($criteriaKey);
@@ -220,7 +220,7 @@ class BaseCriteria extends BaseFrameworkSystem implements Criteria {
         */
        public final function addChoiceCriteria ($criteriaKey, $criteriaValue) {
                // Make sure no 'my-' or 'my_' passes this point
-               assert((strpos($criteriaKey, 'my-') === FALSE) && (strpos($criteriaKey, 'my_') === FALSE) && (!is_bool($criteriaValue)));
+               assert((strpos($criteriaKey, 'my-') === false) && (strpos($criteriaKey, 'my_') === false) && (!is_bool($criteriaValue)));
 
                // Debug message
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(strtoupper($criteriaType) . '(' . $this->__toString() . ')-CRITERIA[' . __METHOD__ . ':' . __LINE__ . ']: criteriaKey=' . $criteriaKey . ',criteriaValue=' . $criteriaValue);
@@ -257,18 +257,18 @@ class BaseCriteria extends BaseFrameworkSystem implements Criteria {
        }
 
        /**
-        * Get criteria element or FALSE if not found
+        * Get criteria element or false if not found
         *
         * @param       $criteriaKey    The requested criteria key
         * @param       $criteriaType   Type of this criteria, can be one of 'default' (default), 'choice' or 'exclude'
-        * @return      $value                  Whether the value of the critera or FALSE
+        * @return      $value                  Whether the value of the critera or false
         */
        public function getCriteriaElemnent ($criteriaKey, $criteriaType = 'default') {
                // Debug message
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(strtoupper($criteriaType) . '-CRITERIA[' . __METHOD__ . ':' . __LINE__ . ']: criteriaKey=' . $criteriaKey . ',criteriaType=' . $criteriaType . ' - CALLED!');
 
                // Make sure no 'my-' or 'my_' passes this point
-               assert((strpos($criteriaKey, 'my-') === FALSE) && (strpos($criteriaKey, 'my_') === FALSE));
+               assert((strpos($criteriaKey, 'my-') === false) && (strpos($criteriaKey, 'my_') === false));
 
                // Convert dashes to underscore
                $criteriaKey = self::convertDashesToUnderscores($criteriaKey);
@@ -277,7 +277,7 @@ class BaseCriteria extends BaseFrameworkSystem implements Criteria {
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(strtoupper($criteriaType) . '-CRITERIA[' . __METHOD__ . ':' . __LINE__ . ']: criteriaKey=' . $criteriaKey . ',criteria()=' . $this->countGenericArrayGroup('criteria', $criteriaType));
 
                // Default is not found
-               $value = FALSE;
+               $value = false;
 
                // Is the criteria there?
                if ($this->isKeySet($criteriaType, $criteriaKey)) {
@@ -293,10 +293,10 @@ class BaseCriteria extends BaseFrameworkSystem implements Criteria {
        }
 
        /**
-        * Get criteria element or FALSE if not found for 'choice' type
+        * Get criteria element or false if not found for 'choice' type
         *
         * @param       $criteriaKey    The requested criteria key
-        * @return      $value                  Whether the value of the critera or FALSE
+        * @return      $value                  Whether the value of the critera or false
         */
        public function getCriteriaChoiceElemnent ($criteriaKey) {
                // Call inner method
@@ -304,10 +304,10 @@ class BaseCriteria extends BaseFrameworkSystem implements Criteria {
        }
 
        /**
-        * Get criteria element or FALSE if not found for 'exclude' type
+        * Get criteria element or false if not found for 'exclude' type
         *
         * @param       $criteriaKey    The requested criteria key
-        * @return      $value                  Whether the value of the critera or FALSE
+        * @return      $value                  Whether the value of the critera or false
         */
        public function getCriteriaExcludeElemnent ($criteriaKey) {
                // Call inner method
@@ -323,13 +323,13 @@ class BaseCriteria extends BaseFrameworkSystem implements Criteria {
         */
        public function ifEntryMatches (array $entryArray, $criteriaType = 'default') {
                // First nothing matches and nothing is counted
-               $matches = FALSE;
+               $matches = false;
                $counted = 0;
 
                // Walk through all entries
                foreach ($entryArray as $key => $entry) {
                        // Make sure no 'my-' or 'my_' passes this point
-                       assert((strpos($key, 'my-') === FALSE) && (strpos($key, 'my_') === FALSE));
+                       assert((strpos($key, 'my-') === false) && (strpos($key, 'my_') === false));
 
                        // Convert dashes to underscore
                        $key = self::convertDashesToUnderscores($key);
@@ -337,7 +337,7 @@ class BaseCriteria extends BaseFrameworkSystem implements Criteria {
                        // Then walk through all search criteria
                        foreach ($this->getGenericArrayKey('criteria', $criteriaType, 'entries') as $criteriaKey => $criteriaValue) {
                                // Make sure no 'my-' or 'my_' passes this point
-                               assert((strpos($criteriaKey, 'my-') === FALSE) && (strpos($criteriaKey, 'my_') === FALSE) && (!is_bool($criteriaValue)));
+                               assert((strpos($criteriaKey, 'my-') === false) && (strpos($criteriaKey, 'my_') === false) && (!is_bool($criteriaValue)));
 
                                // Convert dashes to underscore
                                $criteriaKey = self::convertDashesToUnderscores($criteriaKey);
@@ -399,7 +399,7 @@ class BaseCriteria extends BaseFrameworkSystem implements Criteria {
                // Now walk through all criterias
                foreach ($this->getGenericArrayKey('criteria', $criteriaType, 'entries') as $criteriaKey => $criteriaValue) {
                        // Make sure no 'my-' or 'my_' passes this point
-                       assert((strpos($criteriaKey, 'my-') === FALSE) && (strpos($criteriaKey, 'my_') === FALSE) && (!is_bool($criteriaValue)));
+                       assert((strpos($criteriaKey, 'my-') === false) && (strpos($criteriaKey, 'my_') === false) && (!is_bool($criteriaValue)));
 
                        // $criteriaValue cannot be an array
                        assert(!is_array($criteriaValue));
index 58e0b5e..e6f71ea 100644 (file)
@@ -147,7 +147,7 @@ class SearchCriteria extends BaseCriteria implements LocalSearchCriteria {
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SEARCH-CRITERIA[' . __METHOD__ . ':' . __LINE__ . ']: getCriteriaElement(' . $key . ')[' . gettype($searchDefault) . ']=' . $searchDefault);
 
                // 'default' check
-               $isMatching = (((($searchDefault !== FALSE) && ($searchDefault == $value)) || ((is_null($searchDefault)) && (is_null($value)))) || ($searchDefault === FALSE));
+               $isMatching = (((($searchDefault !== false) && ($searchDefault == $value)) || ((is_null($searchDefault)) && (is_null($value)))) || ($searchDefault === false));
 
                // Debug message
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SEARCH-CRITERIA[' . __METHOD__ . ':' . __LINE__ . ']: getCriteriaElement(' . $key . ')[' . gettype($searchDefault) . ']=' . $searchDefault . ',isMatching=' . intval($isMatching));
@@ -155,16 +155,16 @@ class SearchCriteria extends BaseCriteria implements LocalSearchCriteria {
                // Get 'choice' search value (can be NULL or $separator-separated string)
                $searchChoice = $this->getCriteriaChoiceElemnent($key);
 
-               // May be FALSE or array
-               assert(($searchChoice === FALSE) || (is_array($searchChoice)));
+               // May be false or array
+               assert(($searchChoice === false) || (is_array($searchChoice)));
 
                // Debug message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SEARCH-CRITERIA[' . __METHOD__ . ':' . __LINE__ . ']: getCriteriaChoiceElement(' . $key . ')[' . gettype($searchChoice) . ']=' . print_r($searchChoice, TRUE));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SEARCH-CRITERIA[' . __METHOD__ . ':' . __LINE__ . ']: getCriteriaChoiceElement(' . $key . ')[' . gettype($searchChoice) . ']=' . print_r($searchChoice, true));
 
                // 'choice' check
                if ((is_array($searchChoice)) && (count($valueArray) == 1)) {
                        // $value is a single-search value, so use in_array()
-                       $isMatching = ((($isMatching === TRUE) || (($searchDefault === FALSE) && (!is_null($value)))) && (in_array($value, $searchChoice)));
+                       $isMatching = ((($isMatching === true) || (($searchDefault === false) && (!is_null($value)))) && (in_array($value, $searchChoice)));
 
                        // Debug message
                        //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SEARCH-CRITERIA[' . __METHOD__ . ':' . __LINE__ . ']: getCriteriaChoiceElement(' . $key . ')[]=' . gettype($searchChoice) . ',value[' . gettype($value) . ']=' . $value . ',isMatching=' . intval($isMatching) . ' - SINGLE-MATCH');
@@ -173,14 +173,14 @@ class SearchCriteria extends BaseCriteria implements LocalSearchCriteria {
                        //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SEARCH-CRITERIA[' . __METHOD__ . ':' . __LINE__ . ']: getCriteriaChoiceElement(' . $key . ')[]=' . gettype($searchChoice) . ',valueArray()=' . count($valueArray) . ',isMatching=' . intval($isMatching));
 
                        // $value is choice-search value, so check all entries
-                       $isMatching = (($isMatching === TRUE) || (($searchDefault === FALSE) && (!is_null($value))));
+                       $isMatching = (($isMatching === true) || (($searchDefault === false) && (!is_null($value))));
                        $idx = 0;
                        foreach ($valueArray as $idx => $match) {
                                // Debug message
                                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SEARCH-CRITERIA[' . __METHOD__ . ':' . __LINE__ . ']: match=' . $match . ',count(searchChoice)=' . count($searchChoice));
 
                                // Is it found? (one is okay)
-                               $isMatching = (($isMatching === TRUE) && (in_array($match, $searchChoice)));
+                               $isMatching = (($isMatching === true) && (in_array($match, $searchChoice)));
 
                                // Debug message
                                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SEARCH-CRITERIA[' . __METHOD__ . ':' . __LINE__ . ']: match=' . $match . ',isMatching=' . intval($isMatching));
@@ -189,9 +189,9 @@ class SearchCriteria extends BaseCriteria implements LocalSearchCriteria {
                        // Debug message
                        //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SEARCH-CRITERIA[' . __METHOD__ . ':' . __LINE__ . ']: getCriteriaChoiceElement(' . $key . ')[]=' . gettype($searchChoice) . ',valueArray()=' . count($valueArray) . ',idx=' . $idx . ',isMatching=' . intval($isMatching) . ' - CHOICE-MATCH');
                } else {
-                       // Choice-match is FALSE
+                       // Choice-match is false
                        // Debug message
-                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SEARCH-CRITERIA[' . __METHOD__ . ':' . __LINE__ . ']: getCriteriaChoiceElement(' . $key . ')[]=' . gettype($searchChoice) . ',value[' . gettype($value) . ']=' . $value . ',isMatching=' . intval($isMatching) . ' - FALSE-MATCH');
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SEARCH-CRITERIA[' . __METHOD__ . ':' . __LINE__ . ']: getCriteriaChoiceElement(' . $key . ')[]=' . gettype($searchChoice) . ',value[' . gettype($value) . ']=' . $value . ',isMatching=' . intval($isMatching) . ' - false-MATCH');
                }
 
                // Debug message
@@ -207,16 +207,16 @@ class SearchCriteria extends BaseCriteria implements LocalSearchCriteria {
                $isMatching = (
                        (
                                (
-                                       $isMatching === TRUE
+                                       $isMatching === true
                                ) && (
-                                       $searchExclude === FALSE
+                                       $searchExclude === false
                                )
                        ) || (
                                (
                                        (
-                                               $isMatching === TRUE
+                                               $isMatching === true
                                        ) && (
-                                               $searchExclude !== FALSE
+                                               $searchExclude !== false
                                        ) && (
                                                $searchExclude !== $value
                                        )
index 9a31a26..b404317 100644 (file)
@@ -151,7 +151,7 @@ class CryptoHelper extends BaseFrameworkSystem implements Cryptable {
                $uuid = '';
 
                // Is the UUID extension loaded and enabled? (see pecl)
-               if ($this->getConfigInstance()->getConfigEntry('extension_uuid_loaded') === TRUE) {
+               if ($this->getConfigInstance()->getConfigEntry('extension_uuid_loaded') === true) {
                        // Then add it as well
                        $uuid = uuid_create();
                } // END - if
@@ -171,7 +171,7 @@ class CryptoHelper extends BaseFrameworkSystem implements Cryptable {
         * @param       $withFixed      Whether to include a fixed salt (not recommended in p2p applications)
         * @return      $hashed         The hashed and salted string
         */
-       public function hashString ($str, $oldHash = '', $withFixed = TRUE) {
+       public function hashString ($str, $oldHash = '', $withFixed = true) {
                // Cast the string
                $str = (string) $str;
 
@@ -189,7 +189,7 @@ class CryptoHelper extends BaseFrameworkSystem implements Cryptable {
 
                // Hash the password with salt
                //* DEBUG: */ echo "salt=".$salt."/plain=".$str."<br />\n";
-               if ($withFixed === TRUE) {
+               if ($withFixed === true) {
                        // Use additional fixed salt
                        $hashed = $salt . md5(sprintf($this->getConfigInstance()->getConfigEntry('hash_extra_mask'),
                                $salt,
index a2f65b4..2efa187 100644 (file)
@@ -58,7 +58,7 @@ class CachedLocalFileDatabase extends BaseDatabaseBackend implements DatabaseBac
        /**
         * Whether the "connection is already up
         */
-       private $alreadyConnected = FALSE;
+       private $alreadyConnected = false;
 
        /**
         * Table information array
@@ -189,11 +189,11 @@ class CachedLocalFileDatabase extends BaseDatabaseBackend implements DatabaseBac
                $serializedData = $this->getCompressorChannel()->getCompressor()->decompressStream($compressedData);
 
                // Unserialize it
-               $dataArray = json_decode($serializedData, TRUE);
+               $dataArray = json_decode($serializedData, true);
 
                // Debug message
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DATABASE: Read ' . count($dataArray) . ' elements from database file ' . $fqfn . '.');
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DATABASE: dataArray=' . print_r($dataArray, TRUE));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DATABASE: dataArray=' . print_r($dataArray, true));
 
                // Finally return it
                return $dataArray;
@@ -209,7 +209,7 @@ class CachedLocalFileDatabase extends BaseDatabaseBackend implements DatabaseBac
        private function writeDataArrayToFqfn ($fqfn, array $dataArray) {
                // Debug message
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DATABASE: Flushing ' . count($dataArray) . ' elements to database file ' . $fqfn . ' ...');
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DATABASE: dataArray=' . print_r($dataArray, TRUE));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DATABASE: dataArray=' . print_r($dataArray, true));
 
                // Serialize and compress it
                $compressedData = $this->getCompressorChannel()->getCompressor()->compressStream(json_encode($dataArray));
@@ -319,7 +319,7 @@ class CachedLocalFileDatabase extends BaseDatabaseBackend implements DatabaseBac
                $infoArray = $this->getContentsFromTableInfoFile($dataSetInstance);
 
                // Is the primary key there?
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DATABASE: tableInfo=' . print_r($this->tableInfo, TRUE));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DATABASE: tableInfo=' . print_r($this->tableInfo, true));
                if (!isset($this->tableInfo[$tableName]['primary'])) {
                        // Then create the info file
                        $this->createTableInfoFile($dataSetInstance);
@@ -393,12 +393,12 @@ class CachedLocalFileDatabase extends BaseDatabaseBackend implements DatabaseBac
 
                                // Read the file
                                $dataArray = $this->getDataArrayFromFile($pathName . $dataFile);
-                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DATABASE: dataFile=' . $dataFile . ',dataArray='.print_r($dataArray, TRUE));
+                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DATABASE: dataFile=' . $dataFile . ',dataArray='.print_r($dataArray, true));
 
                                // Is this an array?
                                if (is_array($dataArray)) {
                                        // Default is nothing found
-                                       $isFound = TRUE;
+                                       $isFound = true;
 
                                        // Search in the criteria with FMFW (First Matches, First Wins)
                                        foreach ($dataArray as $key => $value) {
@@ -406,13 +406,13 @@ class CachedLocalFileDatabase extends BaseDatabaseBackend implements DatabaseBac
                                                assert(!is_bool($value));
 
                                                // Found one entry?
-                                               $isFound = (($isFound === TRUE) && ($searchInstance->isCriteriaMatching($key, $value)));
+                                               $isFound = (($isFound === true) && ($searchInstance->isCriteriaMatching($key, $value)));
                                                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DATABASE: key=' . $key . ',value=' . $value . ',isFound=' . intval($isFound));
                                        } // END - foreach
 
                                        // Is all found?
                                        //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DATABASE: isFound=' . intval($isFound) . ',limitFound=' . $limitFound . ',limit=' . $searchInstance->getLimit());
-                                       if ($isFound === TRUE) {
+                                       if ($isFound === true) {
                                                // Shall we skip this entry?
                                                if ($searchInstance->getSkip() > 0) {
                                                        // We shall skip some entries
@@ -427,7 +427,7 @@ class CachedLocalFileDatabase extends BaseDatabaseBackend implements DatabaseBac
                                                $dataArray[$this->getIndexKey()] = $idx;
 
                                                // Entry found!
-                                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DATABASE: indexKey=' . $this->getIndexKey() . ',idx=' . $idx . ',dataArray=' . print_r($dataArray, TRUE));
+                                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DATABASE: indexKey=' . $this->getIndexKey() . ',idx=' . $idx . ',dataArray=' . print_r($dataArray, true));
                                                array_push($resultData[BaseDatabaseBackend::RESULT_INDEX_ROWS], $dataArray);
 
                                                // Count found entries up
@@ -531,12 +531,12 @@ class CachedLocalFileDatabase extends BaseDatabaseBackend implements DatabaseBac
 
                                // Open this file for reading
                                $dataArray = $this->getDataArrayFromFile($pathName . $dataFile);
-                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DATABASE: dataFile=' . $dataFile . ',dataArray='.print_r($dataArray, TRUE));
+                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DATABASE: dataFile=' . $dataFile . ',dataArray='.print_r($dataArray, true));
 
                                // Is this an array?
                                if (is_array($dataArray)) {
                                        // Default is nothing found
-                                       $isFound = TRUE;
+                                       $isFound = true;
 
                                        // Search in the criteria with FMFW (First Matches, First Wins)
                                        foreach ($dataArray as $key => $value) {
@@ -544,12 +544,12 @@ class CachedLocalFileDatabase extends BaseDatabaseBackend implements DatabaseBac
                                                assert(!is_bool($value));
 
                                                // Found one entry?
-                                               $isFound = (($isFound === TRUE) && ($searchInstance->isCriteriaMatching($key, $value)));
+                                               $isFound = (($isFound === true) && ($searchInstance->isCriteriaMatching($key, $value)));
                                        } // END - foreach
 
                                        // Is all found?
                                        //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DATABASE: isFound=' . intval($isFound));
-                                       if ($isFound === TRUE) {
+                                       if ($isFound === true) {
                                                // Shall we skip this entry?
                                                if ($searchInstance->getSkip() > 0) {
                                                        // We shall skip some entries
@@ -632,7 +632,7 @@ class CachedLocalFileDatabase extends BaseDatabaseBackend implements DatabaseBac
                unset($data[$this->indexKey]);
 
                // Return it
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DATABASE: data[' . gettype($data) . ']='.print_r($data, TRUE));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('DATABASE: data[' . gettype($data) . ']='.print_r($data, true));
                return $data;
        }
 
index edc28b9..dbf0872 100644 (file)
@@ -62,7 +62,7 @@ class BaseDatabaseWrapper extends BaseFrameworkSystem {
         */
        private final function initCacheInstance () {
                // Is the cache enabled?
-               if ($this->getConfigInstance()->getConfigEntry('database_cache_enabled') === TRUE) {
+               if ($this->getConfigInstance()->getConfigEntry('database_cache_enabled') === true) {
                        // Set the new instance
                        $this->cacheInstance = CacheFactory::getFactory()->createConfiguredCache();
                } // END - if
@@ -99,14 +99,14 @@ class BaseDatabaseWrapper extends BaseFrameworkSystem {
                $cacheKey = NULL;
 
                // Is cache enabled?
-               if ($this->getConfigInstance()->getConfigEntry('database_cache_enabled') === TRUE) {
+               if ($this->getConfigInstance()->getConfigEntry('database_cache_enabled') === true) {
                        // First get a key suitable for our cache and extend it with this class name
                        $cacheKey = $this->getCacheKeyByCriteria($dataSetInstance, $onlyKeys);
                        //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-WRAPPER: Using cache key ' . $cacheKey . ' for purging ...');
                } // END - if
 
                // Does this key exists in cache?
-               if (($this->getConfigInstance()->getConfigEntry('database_cache_enabled') === TRUE) && ($this->cacheInstance->offsetExists($cacheKey))) {
+               if (($this->getConfigInstance()->getConfigEntry('database_cache_enabled') === true) && ($this->cacheInstance->offsetExists($cacheKey))) {
                        // Purge the cache
                        $this->cacheInstance->purgeOffset($cacheKey);
                } // END - if
@@ -127,14 +127,14 @@ class BaseDatabaseWrapper extends BaseFrameworkSystem {
                $cacheKey = NULL;
 
                // Is cache enabled?
-               if ($this->getConfigInstance()->getConfigEntry('database_cache_enabled') === TRUE) {
+               if ($this->getConfigInstance()->getConfigEntry('database_cache_enabled') === true) {
                        // First get a key suitable for our cache and extend it with this class name
                        $cacheKey = $this->getCacheKeyByCriteria($dataSetInstance, $onlyKeys);
                        //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-WRAPPER: Using cache key ' . $cacheKey . ' for purging ...');
                } // END - if
 
                // Does this key exists in cache?
-               if (($this->getConfigInstance()->getConfigEntry('database_cache_enabled') === TRUE) && ($this->cacheInstance->offsetExists($cacheKey))) {
+               if (($this->getConfigInstance()->getConfigEntry('database_cache_enabled') === true) && ($this->cacheInstance->offsetExists($cacheKey))) {
                        // Purge the cache
                        $this->cacheInstance->purgeOffset($cacheKey);
                } // END - if
@@ -174,15 +174,15 @@ class BaseDatabaseWrapper extends BaseFrameworkSystem {
                $cacheKey = NULL;
 
                // Is the cache enabled?
-               if ($this->getConfigInstance()->getConfigEntry('database_cache_enabled') === TRUE) {
+               if ($this->getConfigInstance()->getConfigEntry('database_cache_enabled') === true) {
                        // First get a key suitable for our cache and extend it with this class name
                        $cacheKey = $this->getCacheKeyByCriteria($criteriaInstance, $onlyKeys);
                } // END - if
 
                // Does this key exists in cache?
-               if (($this->getConfigInstance()->getConfigEntry('database_cache_enabled') === TRUE) && ($this->cacheInstance->offsetExists($cacheKey, BaseDatabaseBackend::RESULT_INDEX_ROWS, 1))) {
+               if (($this->getConfigInstance()->getConfigEntry('database_cache_enabled') === true) && ($this->cacheInstance->offsetExists($cacheKey, BaseDatabaseBackend::RESULT_INDEX_ROWS, 1))) {
                        // Debug message
-                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-WRAPPER: Cache used for cacheKey=' . $cacheKey . ':' . print_r($this->cacheInstance->offsetGet($cacheKey), TRUE));
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-WRAPPER: Cache used for cacheKey=' . $cacheKey . ':' . print_r($this->cacheInstance->offsetGet($cacheKey), true));
 
                        // Then use this result
                        $result = $this->cacheInstance->offsetGet($cacheKey);
@@ -197,7 +197,7 @@ class BaseDatabaseWrapper extends BaseFrameworkSystem {
                        // Cache the result if not null
                        if (!is_null($result)) {
                                // Is cache enabled?
-                               if ($this->getConfigInstance()->getConfigEntry('database_cache_enabled') === TRUE) {
+                               if ($this->getConfigInstance()->getConfigEntry('database_cache_enabled') === true) {
                                        // A valid result has returned from the database layer
                                        $this->cacheInstance->offsetSet($cacheKey, $result);
                                } // END - if
index 9c2586c..17cf461 100644 (file)
@@ -140,14 +140,14 @@ class CachedDatabaseResult extends BaseDatabaseResult implements SearchableResul
         */
        public function next () {
                // Default is not valid
-               $nextValid = FALSE;
+               $nextValid = false;
 
                // Is the result valid?
                if ($this->valid()) {
                        // Next entry found, so count one up and cache it
                        $this->currentPos++;
                        $this->currentRow = $this->resultArray[BaseDatabaseBackend::RESULT_INDEX_ROWS][$this->currentPos];
-                       $nextValid = TRUE;
+                       $nextValid = true;
                } // END - if
 
                // Return the result
@@ -197,7 +197,7 @@ class CachedDatabaseResult extends BaseDatabaseResult implements SearchableResul
         */
        public function valid () {
                // By default nothing is valid
-               $isValid = FALSE;
+               $isValid = false;
 
                // Debug message
                //*NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . '] this->currentPos=' . $this->currentPos);
@@ -205,7 +205,7 @@ class CachedDatabaseResult extends BaseDatabaseResult implements SearchableResul
                // Check if all is fine ...
                if (($this->ifStatusIsOkay()) && (isset($this->resultArray[BaseDatabaseBackend::RESULT_INDEX_ROWS][($this->currentPos + 1)])) && (isset($this->resultArray[BaseDatabaseBackend::RESULT_INDEX_ROWS][0]))) {
                        // All fine!
-                       $isValid = TRUE;
+                       $isValid = true;
                } // END - if
 
                // Return the result
@@ -373,7 +373,7 @@ class CachedDatabaseResult extends BaseDatabaseResult implements SearchableResul
         */
        public function find ($key) {
                // By default nothing is found
-               $found = FALSE;
+               $found = false;
 
                // Rewind the pointer
                $this->rewind();
@@ -389,7 +389,7 @@ class CachedDatabaseResult extends BaseDatabaseResult implements SearchableResul
                        // Is the element there?
                        if (isset($currentEntry[$key])) {
                                // Okay, found!
-                               $found = TRUE;
+                               $found = true;
 
                                // So "cache" it
                                $this->foundValue = $currentEntry[$key];
index 9b4e6a0..a8b18f0 100644 (file)
@@ -66,7 +66,7 @@ class XmlRewriterTemplateDecorator extends BaseDecorator implements CompileableT
         * @param       $add            Whether add this group
         * @return      void
         */
-       public function setVariableGroup ($groupName, $add = TRUE) {
+       public function setVariableGroup ($groupName, $add = true) {
                // Call the inner class' method
                $this->getTemplateInstance()->setVariableGroup($groupName, $add);
        }
@@ -289,7 +289,7 @@ class XmlRewriterTemplateDecorator extends BaseDecorator implements CompileableT
         * @param       $setMatchAsCode         Sets $match if readVariable() returns empty result
         * @return      $rawCode                        Compile code with inserted variable value
         */
-       public function compileRawCode ($rawCode, $setMatchAsCode = FALSE) {
+       public function compileRawCode ($rawCode, $setMatchAsCode = false) {
                return $this->getTemplateInstance()->compileRawCode($rawCode, $setMatchAsCode);
        }
 
@@ -343,7 +343,7 @@ class XmlRewriterTemplateDecorator extends BaseDecorator implements CompileableT
         * @param       $languageSupport        New language support setting
         * @return      void
         */
-       public function enableLanguageSupport ($languageSupport = TRUE) {
+       public function enableLanguageSupport ($languageSupport = true) {
                // Call the inner class' method
                $this->getTemplateInstance()->enableLanguageSupport($languageSupport);
        }
@@ -364,7 +364,7 @@ class XmlRewriterTemplateDecorator extends BaseDecorator implements CompileableT
         * @param       $xmlCompacting  New XML compacting setting
         * @return      void
         */
-       public function enableXmlCompacting ($xmlCompacting = TRUE) {
+       public function enableXmlCompacting ($xmlCompacting = true) {
                // Call the inner class' method
                $this->getTemplateInstance()->enableXmlCompacting($xmlCompacting);
        }
index 38f1bf8..5da193d 100644 (file)
@@ -47,7 +47,7 @@ class ClientFactory extends ObjectFactory {
         * @param       $socketResource         A valid socket resource (optional)
         * @return      $clientInstance         An instance of the requested client
         */
-       public static final function createClientByProtocolInstance (HandleableProtocol $protocolInstance, $socketResource = FALSE) {
+       public static final function createClientByProtocolInstance (HandleableProtocol $protocolInstance, $socketResource = false) {
                // Default is NULL (to initialize variable)
                $clientInstance = NULL;
 
index 2b82f60..73d455e 100644 (file)
@@ -59,7 +59,7 @@ class XmlTemplateEngineFactory extends ObjectFactory {
                        $templateInstance = ObjectFactory::createObjectByConfiguredName($configEntry);
 
                        // Disable language support
-                       $templateInstance->enableLanguageSupport(FALSE);
+                       $templateInstance->enableLanguageSupport(false);
 
                        /*
                         * Enable compacting/rewriting of the  XML to save bandwidth from XML
index e999152..20a04fd 100644 (file)
@@ -60,7 +60,7 @@ class ???Feature extends BaseFeature implements Feature {
         */
        public function isFeatureAvailable () {
                // Default is not available
-               $isAvailable = FALSE;
+               $isAvailable = false;
 
                // Unfinished:
                $this->partialStub('Please implement this method.');
index 5ae3312..09fa826 100644 (file)
@@ -41,16 +41,16 @@ class FrameworkFeature extends BaseFrameworkSystem {
         * A typical available entry looks like this:
         *
         * array(
-        *     'is_enabled'   => TRUE,
-        *     'is_available' => TRUE,
+        *     'is_enabled'   => true,
+        *     'is_available' => true,
         *     'instance'     => SomeFeature Object
         * )
         *
         * And a typical disabled entry looks like this:
         *
         * array(
-        *     'is_enabled'   => FALSE,
-        *     'is_available' => FALSE,
+        *     'is_enabled'   => false,
+        *     'is_available' => false,
         *     'instance'     => NULL
         * )
         */
@@ -104,14 +104,14 @@ class FrameworkFeature extends BaseFrameworkSystem {
                // Is the cache set?
                if (!isset(self::$enabledFeatures[$featureName]['is_available'])) {
                        // Default is not available
-                       self::$enabledFeatures[$featureName]['is_available'] = FALSE;
+                       self::$enabledFeatures[$featureName]['is_available'] = false;
                        self::$enabledFeatures[$featureName]['instance']     = NULL;
 
                        // Is the feature enabled?
                        if (!self::isFeatureEnabled($featureName)) {
                                // Then it can't be available
                                self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d]: Feature "%s"is not enabled.', __METHOD__, __LINE__, $featureName));
-                               return FALSE;
+                               return false;
                        } // END - if
 
                        // Create config key (for feature class lookup)
@@ -154,7 +154,7 @@ class FrameworkFeature extends BaseFrameworkSystem {
        public static function callFeature ($featureName, $featureMethod, array $args = NULL) {
                /*
                 * Please make sure that isFeatureAvailable() has been called and it has
-                * returned TRUE before calling this method.
+                * returned true before calling this method.
                 */
                assert(self::isFeatureAvailable($featureName));
 
index 348fbf8..7c88644 100644 (file)
@@ -60,7 +60,7 @@ class FuseFeature extends BaseFeature implements Feature {
         */
        public function isFeatureAvailable () {
                // Default is not available
-               $isAvailable = FALSE;
+               $isAvailable = false;
 
                // Unfinished:
                $this->partialStub('Please implement this method.');
index fc4140c..e55a95f 100644 (file)
@@ -152,7 +152,7 @@ class BaseBinaryFile extends BaseAbstractFile {
                /* Only for debugging
                if (isset($this->gaps[0])) {
                        // Output first and last gap
-                       self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] this->gaps[0]=%s,this->gaps[%s]=%s', __METHOD__, __LINE__, print_r($this->gaps[0], TRUE), (count($this->gaps) - 1), print_r($this->gaps[count($this->gaps) - 1], TRUE)));
+                       self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] this->gaps[0]=%s,this->gaps[%s]=%s', __METHOD__, __LINE__, print_r($this->gaps[0], true), (count($this->gaps) - 1), print_r($this->gaps[count($this->gaps) - 1], true)));
                } // END - if
                */
 
@@ -318,7 +318,7 @@ class BaseBinaryFile extends BaseAbstractFile {
         */
        public static function isBlockSeparatorFound ($str) {
                // Determine it
-               $isFound = (strpos($str, chr(self::SEPARATOR_ENTRIES)) !== FALSE);
+               $isFound = (strpos($str, chr(self::SEPARATOR_ENTRIES)) !== false);
 
                // Return result
                return $isFound;
@@ -403,7 +403,7 @@ class BaseBinaryFile extends BaseAbstractFile {
         * @param       $flushHeader    Whether to flush the header (default: flush)
         * @return      void
         */
-       public function writeData ($seekPosition, $data, $flushHeader = TRUE) {
+       public function writeData ($seekPosition, $data, $flushHeader = true) {
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] seekPosition=%s,data()=%d - CALLED!', __METHOD__, __LINE__, $seekPosition, strlen($data)));
 
                // Write data at given position
@@ -416,7 +416,7 @@ class BaseBinaryFile extends BaseAbstractFile {
                $this->updateSeekPosition();
 
                // Flush the header?
-               if ($flushHeader === TRUE) {
+               if ($flushHeader === true) {
                        // Flush header
                        $this->flushFileHeader();
 
@@ -453,7 +453,7 @@ class BaseBinaryFile extends BaseAbstractFile {
       &