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 5d3c60dc181e9128c43d84e74161d168eb441f7e..6b234b436defa8a230624c09df15676c49ebe1b7 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 e1fd3230d90bfd093b9857452ea9ae6c720dfe6c..7d6dceec926b2c790d8a6cc64b29a822d57f79e9 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 7248c82c472815af3aadcddd9fc1707af648e611..ed824148ec45a4bd92b721e3b9400718d7f113fe 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 6266e1c81f5306cfbb42dde20b0fedf9cdbb5cc0..7d6dceec926b2c790d8a6cc64b29a822d57f79e9 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 377f446241dec0bae7abc0d9214f986ccabc7763..7d6dceec926b2c790d8a6cc64b29a822d57f79e9 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 588af616633a4706c1d87fa78616a7d8ade1d4d3..cb7864ac57dd8fead1b0be589b43ab6a3e01eb38 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 41af8db1c97077b765294049e5dbeb811a62e4e2..1c4965cb835d56892179bff65dea904f3627a106 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 61d9b7a5acc1ba991e076a07097eb91f8d491723..9401e784cb60f9af895a5f619b23af893b753b62 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 848e6898ffd80a234166cf3d4737123a81229986..6611496e7b976a6901b0444c7ad8925989c9d36c 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 460c984d6e7107dc5011a8a086b18c7ffe0db7c3..317bf5dd5716601e0242c433a2ef403492b6b54a 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.
@@ -36,6 +87,131 @@ final class FrameworkBootstrap {
                // Prevent making instances from this "utilities" class
        }
 
+       /**
+        * 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
         *
@@ -43,27 +219,287 @@ final class FrameworkBootstrap {
         */
        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 733ba9e17e1f47f9960ccaec9301dea350f618fe..f7a48ecef8fc1adaffcf78288f5c4604621d2172 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 fe39b3b0598b1daebe12ccabd809e862a523903f..7d6dceec926b2c790d8a6cc64b29a822d57f79e9 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 b365a9f3fa097581229bc34de09cff6063aeb09a..7d6dceec926b2c790d8a6cc64b29a822d57f79e9 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 ceaab36d3f475e30fcdf8ca146092ddf64e315ae..7d6dceec926b2c790d8a6cc64b29a822d57f79e9 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 939d3559db61dc439ffdd572eb669278849ee228..211aded9b438cf368bb4a67a3103ea62f265bc62 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 {
@@ -451,31 +469,6 @@ class ClassLoader {
                } // END - while
        }
 
-       /**
-        * 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
         *
@@ -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
@@ -584,28 +577,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
         *
index a98999f4c954eb7d7936d98db081612894b9e311..f1c38e4098e7fa8b47814c0a40b786082ea1dea1 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 c23851ee86d6310eaf3b8a6c0b49bc8c904e4a8f..9966c0731ade4c7d5a0b478dbe756119085883da 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 1df10748737ad3452a8c628772fee41d2f206030..248da1269eceeec71b5777527bbb9cb7113ed6bd 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;
@@ -81,16 +80,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
         */
@@ -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;
        }
 
@@ -920,44 +909,6 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                Registry::getRegistry()->addInstance('application', $applicationInstance);
        }
 
-       /**
-        * 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
         *
@@ -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,34 +2469,12 @@ 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
         *
@@ -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;
@@ -3383,58 +3306,6 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                return $packed;
        }
 
-       /**
-        * 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 c8222de76d10442ebb0e6a3a285e5c5801dada8d..98e50d0152612f4a2996fb085b8a6526d44fc2e7 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 76a311331ebe972fcb09402f26e97d95f5fa0bf1..db79276a083632009b5eb02cb44ae24a9ba58c34 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 1c89e94228d6ae1e3899a65bd482306842f8bf3b..688c9d30428cc99a3f31304c25c75294864743be 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 3feb617ec903652ad7ce6f752e2b4f59eafd989b..020f8fa07bdc49e410722baa524a9473d3f48966 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 ac5fc6bb28c3ddcf42767b47caca7481bc3cccf0..9ad5288525602c97c9dc5bb7da555f1abbc9838f 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 6f8be22d40bb4fd6f7d863acc11721b7fbc51119..3dd9aa7a0157cf3e0bafddb3b8c3f6957c2f905f 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 105883015a6d223a090cc8f2a5527cadf4fa2343..399de5b3f32f5bda6ce9c594b26d9619ac84ee88 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 2ab7b0e6ea63729aaf1d6a45f79c0c3088f11b52..064b2425fc78b8e9a1efbb5bccf6bfde948da582 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 aa4def2573e036e584982fa15a5967d3ca6a90ec..906eb22a3c42dec04ef235cb0f128f407bb6ab94 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 9225d79b4b01ffebcab088913286b6d18a5edd19..58d51479f9d9b548cd5d1bcc4c69665eb93b74ad 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 fabe63397fa875a1ea5b23c4038e6f943c123137..7614be1312a679ad312572a72aa54d2fdfed4b62 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 520f65bc2a50f6ee83fd7776fac8af7b00c7c9b1..3759f985ac36847758406671c49ef10c09016532 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 4198c3233df8d167137a1833cd494f2d5145249a..214e18fb9f982f399753911ed387b6afe60a62ce 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 25b9f004b2f8047c941ee3b83dd177eb783cce45..d19d9c24f9b93e014931e42b27db80976e690316 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 5b50a773e928ca3efa899505eda5b28c351cc99f..ae1325b4c918386975188e3c5bdee218bc5165df 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 a0e329df7a29311a2cd4ce7ab8b355b3b1e4f390..b61bcfddddfbb2d663393a2c95128a06ccfaafa6 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 3708da836647be8c645f46afd2169ba91ae145bb..16bffd47b21137ab1fbef2edec3c576381258b79 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 84b72f82ef4173aa999fd53ca3be74447e37c0a2..a2f62337ad9b26cc30ed5e9e66f30fb69431ebfb 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 // Own namespace
-namespace CoreFramework\Tools;
+namespace CoreFramework\Console\Tools;
 
 // Import framework stuff
 use CoreFramework\Configuration\FrameworkConfiguration;
@@ -45,50 +45,6 @@ class ConsoleTools extends BaseFrameworkSystem {
                parent::__construct(__CLASS__);
        }
 
-       /**
-        * 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
         *
@@ -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);
 
@@ -201,15 +157,71 @@ class ConsoleTools extends BaseFrameworkSystem {
                return $hostname;
        }
 
+       /**
+        * 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 fa1d2aab02eee6d45030c5dc494b270ec5a03cba..b3c66caa0e8e13db80b5321c78636b09cb6b0b68 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 3fa951dc6e7d782f906dc28295601681c434b3bd..7073abb63e54f551b2e14e9dc30154259f528bb2 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 58e0b5e7d5a5930b3392adf58f73168e3f7f69fb..e6f71ea23fffebb7fac2ff3406d5b7aabc55c4f2 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 9a31a2691de9604f22b30bd3a48771497c846885..b404317243265d7960599e4d6da74e96c109448d 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 a2f65b40110774aa5a1b2b2bb312b0e2ec1ea9ac..2efa187e04662eb14b58a28baa2983aeab1a3f81 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 edc28b9d4ff10676bb01c73faa4cc763463da03e..dbf0872ea591140b0dd0ba0acf175b4b16784aec 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 9c2586c974c5c222937514244de8a2b67e320b0f..17cf461da490feb49d07644b1048f4a4723e1006 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 9b4e6a036c91ca8a922b3e09c91be4806d1d4c16..a8b18f09f83797d4e81dad540f946f875bcc5a3b 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 38f1bf83686edcb28f3774f1cde0634da967afec..5da193dc851584269dec45a25d4ad0ae45d20603 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 2b82f60a0b7b1b2ff24ddd550df14f6e6d09e244..73d455eaac52052e739767cd46d223e4ae68b6d3 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 e9991521b819e5ffef7b84a94297b76d284d4b73..20a04fd7e279d518863d4e1f20533277d7d64640 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 5ae331275f674b30f873e943b807f9d7942fb95b..09fa8263f58fab5def63b829426108fb4251edfb 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 348fbf8b6603467f63a511119144a0f6ff98fc1e..7c88644b0b6b1622730edb647e420d48baa5f2f5 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 fc4140cdb3796689b172bc2df7c5a3b7fb8b82fc..e55a95fb78cd859d33abf41e6703369996f496e9 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 {
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] CALLED!', __METHOD__, __LINE__));
 
                // Default is not initialized
-               $isInitialized = FALSE;
+               $isInitialized = false;
 
                // Is the file initialized?
                if ($this->isFileInitialized()) {
@@ -471,7 +471,7 @@ class BaseBinaryFile extends BaseAbstractFile {
                        $this->readFileHeader();
 
                        // The above method does already check the header
-                       $isInitialized = TRUE;
+                       $isInitialized = true;
                } // END - if
 
                // Return result
@@ -487,12 +487,12 @@ class BaseBinaryFile extends BaseAbstractFile {
        public function isFileInitialized () {
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] CALLED!', __METHOD__, __LINE__));
 
-               // Get it from iterator which holds the pointer instance. If FALSE is returned
+               // Get it from iterator which holds the pointer instance. If false is returned
                $fileSize = $this->size();
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] fileSize=%s', __METHOD__, __LINE__, $fileSize));
 
                /*
-                * The returned file size should not be FALSE or NULL as this means
+                * The returned file size should not be false or NULL as this means
                 * that the pointer class does not work correctly.
                 */
                assert(is_int($fileSize));
@@ -754,7 +754,7 @@ class BaseBinaryFile extends BaseAbstractFile {
                $dataArray = explode(chr(self::SEPARATOR_ENTRIES), $data);
 
                // This array must contain two elements
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('dataArray=' . print_r($dataArray, TRUE));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('dataArray=' . print_r($dataArray, true));
                assert(count($dataArray) == 2);
 
                // Left part is the actual block, right one the back-buffer data
@@ -764,7 +764,7 @@ class BaseBinaryFile extends BaseAbstractFile {
 
        /**
         * Checks wether the current entry is valid (not at the end of the file).
-        * This method will return TRUE if an emptied (nulled) entry has been found.
+        * This method will return true if an emptied (nulled) entry has been found.
         *
         * @return      $isValid        Whether the next entry is valid
         */
index 1e4fa7a477ce9f48fa2457824dea8e35966af32e..3fa46515e300fb679cb38f0a52c819d1d44e7730 100644 (file)
@@ -69,7 +69,7 @@ class IndexFile extends BaseBinaryFile implements Block {
         * @throws      UnsupportedOperationException   If this method is called
         */
        public function writeValueToFile ($groupId, $value) {
-               self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . '] groupId=' . $groupId . ',value[' . gettype($value) . ']=' . print_r($value, TRUE));
+               self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . '] groupId=' . $groupId . ',value[' . gettype($value) . ']=' . print_r($value, true));
                throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
        }
 
index a702c683abf8f9a3c63bb25a155145de89adc8c8..b867067b0b821b0abd0bf586838a41e563b58935 100644 (file)
@@ -183,7 +183,7 @@ class BaseAbstractFile extends BaseFrameworkSystem implements FilePointer, Close
         * Write data to a file pointer
         *
         * @param       $dataStream             The data stream we shall write to the file
-        * @return      mixed                   Number of writes bytes or FALSE on error
+        * @return      mixed                   Number of writes bytes or false on error
         * @throws      NullPointerException    If the file pointer instance
         *                                                                      is not set by setPointer()
         * @throws      InvalidResourceException        If there is being set
index 8bcb3ccfc839d71c9721c61380b38cc5b7f15fba..64688af7ab1d674bff4d0da15e7a32a94dcf7ea3 100644 (file)
@@ -77,7 +77,7 @@ class FrameworkDirectoryPointer extends BaseFrameworkSystem implements Framework
         * @throws      PathReadProtectedException      If the provided path name is read-protected
         * @todo        Get rid of inConstructor, could be old-lost code.
         */
-       public static final function createFrameworkDirectoryPointer ($pathName, $inConstructor = FALSE) {
+       public static final function createFrameworkDirectoryPointer ($pathName, $inConstructor = false) {
                // Some pre-sanity checks...
                if (is_null($pathName)) {
                        // No pathname given
index a75f0ec4e628ac971a36fee7f1f129717e98e38e..e2f81c509e1ec66512c228af9e5c346f51e24aec 100644 (file)
@@ -3,6 +3,7 @@
 namespace CoreFramework\Filesystem\Pointer\Input;
 
 // Import framework stuff
+use CoreFramework\Bootstrap\FrameworkBootstrap;
 use CoreFramework\FileSystem\BaseFileIo;
 use CoreFramework\Filesystem\Pointer\InputPointer;
 use CoreFramework\Generic\NullPointerException;
@@ -57,20 +58,20 @@ class FrameworkRawFileInputPointer extends BaseFileIo implements InputPointer {
                if ((is_null($fileName)) || (empty($fileName))) {
                        // No filename given
                        throw new FileIsEmptyException(NULL, self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
-               } elseif (!BaseFrameworkSystem::isReachableFilePath($fileName)) {
+               } elseif (!FrameworkBootstrap::isReachableFilePath($fileName)) {
                        // File cannot be accessed (due to open_basedir restriction)
                        throw new FileIoException($fileName, self::EXCEPTION_FILE_NOT_REACHABLE);
-               } elseif ((!BaseFrameworkSystem::isReadableFile($fileName)) && (file_exists($fileName))) {
+               } elseif ((!FrameworkBootstrap::isReadableFile($fileName)) && (file_exists($fileName))) {
                        // File exists but cannot be read from
                        throw new FileReadProtectedException($fileName, self::EXCEPTION_FILE_CANNOT_BE_READ);
-               } elseif ((!BaseFrameworkSystem::isReadableFile($fileName)) && (!file_exists($fileName))) {
+               } elseif ((!FrameworkBootstrap::isReadableFile($fileName)) && (!file_exists($fileName))) {
                        // File does not exist
                        throw new FileNotFoundException($fileName, self::EXCEPTION_FILE_NOT_FOUND);
                }
 
                // Try to open a handler
                $filePointer = fopen($fileName, 'rb');
-               if ((is_null($filePointer)) || ($filePointer === FALSE)) {
+               if ((is_null($filePointer)) || ($filePointer === false)) {
                        // Something bad happend
                        throw new FileIoException($fileName, self::EXCEPTION_FILE_POINTER_INVALID);
                } // END - if
@@ -159,7 +160,7 @@ class FrameworkRawFileInputPointer extends BaseFileIo implements InputPointer {
 
        /**
         * Checks wether the current entry is valid (not at the end of the file).
-        * This method will return TRUE if an emptied (nulled) entry has been found.
+        * This method will return true if an emptied (nulled) entry has been found.
         *
         * @return      $isValid        Whether the next entry is valid
         * @throws      UnsupportedOperationException   If this method is called
index 5347f34d223da5a0028bcea0b3c7669aa0761d58..024ad4e0ff3026a09b666833656a1223ade164ef 100644 (file)
@@ -3,6 +3,7 @@
 namespace CoreFramework\Filesystem\Pointer\Input;
 
 // Import framework stuff
+use CoreFramework\Bootstrap\FrameworkBootstrap;
 use CoreFramework\FileSystem\BaseFileIo;
 use CoreFramework\Filesystem\Pointer\InputPointer;
 use CoreFramework\Generic\NullPointerException;
@@ -56,20 +57,20 @@ class FrameworkTextFileInputPointer extends BaseFileIo implements InputPointer {
                if ((is_null($fileName)) || (empty($fileName))) {
                        // No filename given
                        throw new FileIsEmptyException(NULL, self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
-               } elseif (!BaseFrameworkSystem::isReachableFilePath($fileName)) {
+               } elseif (!FrameworkBootstrap::isReachableFilePath($fileName)) {
                        // File cannot be reached
                        throw new FileIoException($fileName, self::EXCEPTION_FILE_NOT_REACHABLE);
-               } elseif ((!BaseFrameworkSystem::isReadableFile($fileName)) && (!file_exists($fileName))) {
+               } elseif ((!FrameworkBootstrap::isReadableFile($fileName)) && (!file_exists($fileName))) {
                        // File does not exist!
                        throw new FileNotFoundException($fileName, self::EXCEPTION_FILE_CANNOT_BE_READ);
-               } elseif ((!BaseFrameworkSystem::isReadableFile($fileName)) && (file_exists($fileName))) {
+               } elseif ((!FrameworkBootstrap::isReadableFile($fileName)) && (file_exists($fileName))) {
                        // File cannot be read from (but exists)
                        throw new FileReadProtectedException($fileName, self::EXCEPTION_FILE_CANNOT_BE_READ);
                }
 
                // Try to open a handler
                $filePointer = fopen($fileName, 'r');
-               if ((is_null($filePointer)) || ($filePointer === FALSE)) {
+               if ((is_null($filePointer)) || ($filePointer === false)) {
                        // Something bad happend
                        throw new FileIoException($fileName, self::EXCEPTION_FILE_POINTER_INVALID);
                } // END - if
@@ -161,7 +162,7 @@ class FrameworkTextFileInputPointer extends BaseFileIo implements InputPointer {
 
        /**
         * Checks wether the current entry is valid (not at the end of the file).
-        * This method will return TRUE if an emptied (nulled) entry has been found.
+        * This method will return true if an emptied (nulled) entry has been found.
         *
         * @return      $isValid        Whether the next entry is valid
         * @throws      UnsupportedOperationException   If this method is called
index ee070c7c570d0cc8df7339147d4a7055085c7d20..6e5814f9606ee7bf137d32cdccb5c9be421aa5a2 100644 (file)
@@ -3,6 +3,7 @@
 namespace CoreFramework\Filesystem\Pointer;
 
 // Import framework stuff
+use CoreFramework\Bootstrap\FrameworkBootstrap;
 use CoreFramework\FileSystem\BaseFileIo;
 use CoreFramework\Generic\NullPointerException;
 use CoreFramework\Object\BaseFrameworkSystem;
@@ -57,10 +58,10 @@ class FrameworkFileInputOutputPointer extends BaseFileIo implements InputOutputP
                if ((is_null($fileName)) || (empty($fileName))) {
                        // No filename given
                        throw new FileIsEmptyException(NULL, self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
-               } elseif (!BaseFrameworkSystem::isReachableFilePath($fileName)) {
+               } elseif (!FrameworkBootstrap::isReachableFilePath($fileName)) {
                        // File exists but cannot be read
                        throw new FileIoException($fileName, self::EXCEPTION_FILE_NOT_REACHABLE);
-               } elseif ((!BaseFrameworkSystem::isReadableFile($fileName)) && (file_exists($fileName))) {
+               } elseif ((!FrameworkBootstrap::isReadableFile($fileName)) && (file_exists($fileName))) {
                        // File exists but cannot be read
                        throw new FileReadProtectedException($fileName, self::EXCEPTION_FILE_CANNOT_BE_READ);
                } elseif ((file_exists($fileName)) && (!is_writable($fileName))) {
@@ -73,7 +74,7 @@ class FrameworkFileInputOutputPointer extends BaseFileIo implements InputOutputP
 
                // Try to open a handler
                $filePointer = fopen($fileName, 'c+b');
-               if ((is_null($filePointer)) || ($filePointer === FALSE)) {
+               if ((is_null($filePointer)) || ($filePointer === false)) {
                        // Something bad happend
                        throw new FileIoException($fileName, self::EXCEPTION_FILE_POINTER_INVALID);
                } // END - if
@@ -129,7 +130,7 @@ class FrameworkFileInputOutputPointer extends BaseFileIo implements InputOutputP
         * Write data to a file pointer
         *
         * @param       $dataStream             The data stream we shall write to the file
-        * @return      mixed                   Number of writes bytes or FALSE on error
+        * @return      mixed                   Number of writes bytes or false on error
         */
        public function writeToFile ($dataStream) {
                // Validate the pointer
@@ -144,7 +145,7 @@ class FrameworkFileInputOutputPointer extends BaseFileIo implements InputOutputP
         *
         * @param       $seekPosition   Seek position in file
         * @param       $data                   Data to be written
-        * @return      mixed                   Number of writes bytes or FALSE on error
+        * @return      mixed                   Number of writes bytes or false on error
         */
        public function writeAtPosition ($seekPosition, $data) {
                // First seek to it
@@ -239,7 +240,7 @@ class FrameworkFileInputOutputPointer extends BaseFileIo implements InputOutputP
 
        /**
         * Checks wether the current entry is valid (not at the end of the file).
-        * This method will return TRUE if an emptied (nulled) entry has been found.
+        * This method will return true if an emptied (nulled) entry has been found.
         *
         * @return      $isValid        Whether the next entry is valid
         * @throws      UnsupportedOperationException   If this method is called
index 893c4f56c8ea8927c83234b2a1945e146fde79c8..4be0c80828f9c991a17bf9be445179c64c11792c 100644 (file)
@@ -59,7 +59,7 @@ class FrameworkRawFileOutputPointer extends BaseFileIo implements OutputPointer
 
                // Try to open a handler
                $filePointer = @fopen($fileName, $mode);
-               if ((is_null($filePointer)) || ($filePointer === FALSE)) {
+               if ((is_null($filePointer)) || ($filePointer === false)) {
                        // Something bad happend
                        throw new FileIoException ($fileName, self::EXCEPTION_FILE_POINTER_INVALID);
                } // END - if
@@ -79,7 +79,7 @@ class FrameworkRawFileOutputPointer extends BaseFileIo implements OutputPointer
         * Write data to a file pointer
         *
         * @param       $dataStream             The data stream we shall write to the file
-        * @return      mixed                   Number of writes bytes or FALSE on error
+        * @return      mixed                   Number of writes bytes or false on error
         * @throws      NullPointerException    If the file pointer instance
         *                                                                      is not set by setPointer()
         * @throws      InvalidResourceException        If there is being set
@@ -115,7 +115,7 @@ class FrameworkRawFileOutputPointer extends BaseFileIo implements OutputPointer
         *
         * @param       $seekPosition   Seek position in file
         * @param       $data                   Data to be written
-        * @return      mixed                   Number of writes bytes or FALSE on error
+        * @return      mixed                   Number of writes bytes or false on error
         * @throws      UnsupportedOperationException   If this method is called
         */
        public function writeAtPosition ($seedPosition, $data) {
@@ -134,7 +134,7 @@ class FrameworkRawFileOutputPointer extends BaseFileIo implements OutputPointer
 
        /**
         * Checks wether the current entry is valid (not at the end of the file).
-        * This method will return TRUE if an emptied (nulled) entry has been found.
+        * This method will return true if an emptied (nulled) entry has been found.
         *
         * @return      $isValid        Whether the next entry is valid
         * @throws      UnsupportedOperationException   If this method is called
index f7e5b02557f25e5022ffb990876906626dd491b1..80a25a43a6c22af60ed6f720ab5fe536d31a1ef9 100644 (file)
@@ -59,7 +59,7 @@ class FrameworkTextFileOutputPointer extends BaseFileIo implements OutputPointer
 
                // Try to open a handler
                $filePointer = @fopen($fileName, $mode);
-               if ((is_null($filePointer)) || ($filePointer === FALSE)) {
+               if ((is_null($filePointer)) || ($filePointer === false)) {
                        // Something bad happend
                        throw new FileIoException ($fileName, self::EXCEPTION_FILE_POINTER_INVALID);
                } // END - if
@@ -79,7 +79,7 @@ class FrameworkTextFileOutputPointer extends BaseFileIo implements OutputPointer
         * Write data to a file pointer
         *
         * @param       $dataStream             The data stream we shall write to the file
-        * @return      mixed                   Number of writes bytes or FALSE on error
+        * @return      mixed                   Number of writes bytes or false on error
         * @throws      NullPointerException    If the file pointer instance
         *                                                                      is not set by setPointer()
         * @throws      InvalidResourceException        If there is being set
@@ -115,7 +115,7 @@ class FrameworkTextFileOutputPointer extends BaseFileIo implements OutputPointer
         *
         * @param       $seekPosition   Seek position in file
         * @param       $data                   Data to be written
-        * @return      mixed                   Number of writes bytes or FALSE on error
+        * @return      mixed                   Number of writes bytes or false on error
         * @throws      UnsupportedOperationException   If this method is called
         */
        public function writeAtPosition ($seedPosition, $data) {
@@ -134,7 +134,7 @@ class FrameworkTextFileOutputPointer extends BaseFileIo implements OutputPointer
 
        /**
         * Checks wether the current entry is valid (not at the end of the file).
-        * This method will return TRUE if an emptied (nulled) entry has been found.
+        * This method will return true if an emptied (nulled) entry has been found.
         *
         * @return      $isValid        Whether the next entry is valid
         * @throws      UnsupportedOperationException   If this method is called
index 93c9aec16c2511d26cbb3f059d71bf992dde65d0..16675fd6101cd455e3d041e3d78ccdf397a8de23 100644 (file)
@@ -102,7 +102,7 @@ class CsvInputFile extends BaseInputTextFile implements CsvInputStreamer {
                $lineArray = array();
 
                // Whether the parser reads a quoted string (which may contain the column separator again)
-               $isInQuotes = FALSE;
+               $isInQuotes = false;
 
                // Init column data
                $column = '';
@@ -116,7 +116,7 @@ class CsvInputFile extends BaseInputTextFile implements CsvInputStreamer {
                        //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] idx=%s,char=%s ...', __METHOD__, __LINE__, $idx, $char));
 
                        // Is the column separator found and not within quotes?
-                       if (($isInQuotes === FALSE) && ($char == $columnSeparator)) {
+                       if (($isInQuotes === false) && ($char == $columnSeparator)) {
                                // Debug message
                                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] Adding column=%s ...', __METHOD__, __LINE__, $column));
 
@@ -136,7 +136,7 @@ class CsvInputFile extends BaseInputTextFile implements CsvInputStreamer {
                                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] column=%s ...', __METHOD__, __LINE__, $column));
 
                                // $column must be empty at this point if we are at starting quote
-                               assert(($isInQuotes === TRUE) || (empty($column)));
+                               assert(($isInQuotes === true) || (empty($column)));
 
                                // Double-quote found, so flip variable
                                $isInQuotes = (!$isInQuotes);
index 63bcc49c3f58572d27062ea8fbc38e0e5a85c3f9..2f0b5539f44ae924d2bfe5926b2793ab447cb810 100644 (file)
@@ -92,9 +92,6 @@ class UserAuthFilter extends BaseFilter implements Filterable {
                // Then get an auth instance for checking and updating the auth cookies
                $authInstance = ObjectFactory::createObjectByName($this->authMethod, array($responseInstance));
 
-               // Set request instance
-               $authInstance->setRequestInstance($requestInstance);
-
                // Now, get the auth data for comparison
                $authLogin = $authInstance->getUserAuth();
                $authHash  = $authInstance->getPasswordAuth();
@@ -105,7 +102,7 @@ class UserAuthFilter extends BaseFilter implements Filterable {
                        $authInstance->destroyAuthData();
 
                        // Mark the request as invalid
-                       $requestInstance->requestIsValid(FALSE);
+                       $requestInstance->requestIsValid(false);
 
                        // Add fatal message
                        $responseInstance->addFatalMessage('auth_data_incomplete');
index 3347823de111394a57e785f1d0e12f71c6080399..632607d8ee528145b94bb38fee30e4fe37bdc866 100644 (file)
@@ -72,7 +72,7 @@ class EmailChangeFilter extends BaseFilter implements Filterable {
                // Is only first email set?
                if ((!empty($email1)) && (empty($email2))) {
                        // Request is invalid!
-                       $requestInstance->requestIsValid(FALSE);
+                       $requestInstance->requestIsValid(false);
 
                        // Email 2 is empty
                        $responseInstance->addFatalMessage('email2_empty');
@@ -84,7 +84,7 @@ class EmailChangeFilter extends BaseFilter implements Filterable {
                // Is only second email set?
                if ((empty($email1)) && (!empty($email2))) {
                        // Request is invalid!
-                       $requestInstance->requestIsValid(FALSE);
+                       $requestInstance->requestIsValid(false);
 
                        // Email 1 is empty
                        $responseInstance->addFatalMessage('email1_empty');
@@ -96,7 +96,7 @@ class EmailChangeFilter extends BaseFilter implements Filterable {
                // Do both match?
                if ($email1 != $email2) {
                        // Request is invalid!
-                       $requestInstance->requestIsValid(FALSE);
+                       $requestInstance->requestIsValid(false);
 
                        // Emails are mismatching
                        $responseInstance->addFatalMessage('emails_mismatch');
@@ -108,7 +108,7 @@ class EmailChangeFilter extends BaseFilter implements Filterable {
                // Are email and confirmation empty?
                if ((empty($email1)) && (empty($email2))) {
                        // No email change required!
-                       return TRUE;
+                       return true;
                } // END - if
 
                // Now, get a user instance for comparison
@@ -120,7 +120,7 @@ class EmailChangeFilter extends BaseFilter implements Filterable {
                // Are they different?
                if ($userEmail == $email1) {
                        // Nothing has been changed is fine...
-                       return TRUE;
+                       return true;
                } // END - if
 
                // Update the "new_email" field
index a3ccfb820d188df214af4a7900e687ae3c8754ea..0b6431696eb0d2faea26858cf5fb558884a0ff61 100644 (file)
@@ -73,7 +73,7 @@ class PasswordChangeFilter extends BaseFilter implements Filterable {
                // Is only first email set?
                if ((!empty($pass1)) && (empty($pass2))) {
                        // Request is invalid!
-                       $requestInstance->requestIsValid(FALSE);
+                       $requestInstance->requestIsValid(false);
 
                        // Email 2 is empty
                        $responseInstance->addFatalMessage('pass2_empty');
@@ -85,7 +85,7 @@ class PasswordChangeFilter extends BaseFilter implements Filterable {
                // Is only second pass set?
                if ((empty($pass1)) && (!empty($pass2))) {
                        // Request is invalid!
-                       $requestInstance->requestIsValid(FALSE);
+                       $requestInstance->requestIsValid(false);
 
                        // Email 1 is empty
                        $responseInstance->addFatalMessage('pass1_empty');
@@ -97,13 +97,13 @@ class PasswordChangeFilter extends BaseFilter implements Filterable {
                // Are password and confirmation empty?
                if ((empty($pass1)) && (empty($pass2))) {
                        // Don't change password here
-                       return TRUE;
+                       return true;
                } // END - if
 
                // Do both match?
                if ($pass1 != $pass2) {
                        // Request is invalid!
-                       $requestInstance->requestIsValid(FALSE);
+                       $requestInstance->requestIsValid(false);
 
                        // Emails are mismatching
                        $responseInstance->addFatalMessage('pass_mismatch');
index 3c9afa4382ae3e0fcf83f8b74489a6a1880caa75..1e2aac26da956ef2be920fd396a5db509a0c2c7b 100644 (file)
@@ -71,7 +71,7 @@ class RulesAcceptedFilter extends BaseFilter implements Filterable {
                // Was the "rules" value found in form? And is it set?
                if (is_null($rules)) {
                        // Not found in form so stop processing here
-                       $requestInstance->requestIsValid(FALSE);
+                       $requestInstance->requestIsValid(false);
 
                        // Add a message to the response
                        $responseInstance->addFatalMessage('rules_unchecked');
index b2eb002b0ad51ca31c22c34ddb1c7c3dcd8089fa..d7e408b2cc219e19e332f7b1abc8b221090e834f 100644 (file)
@@ -71,7 +71,7 @@ class CaptchaEncryptFilter extends BaseFilter implements Filterable {
                // Is it there?
                if (is_null($encryptRequest)) {
                        // Not found, so request is invalid
-                       $requestInstance->requestIsValid(FALSE);
+                       $requestInstance->requestIsValid(false);
 
                        // Throw exception
                        throw new EncryptMissingException($this, CryptoHelper::EXCEPTION_ENCRYPT_MISSING);
@@ -86,7 +86,7 @@ class CaptchaEncryptFilter extends BaseFilter implements Filterable {
                // Is it the expected length?
                if (strlen($decryptedString) != $this->getConfigInstance()->getConfigEntry('captcha_string_length')) {
                        // Not found, so request is invalid
-                       $requestInstance->requestIsValid(FALSE);
+                       $requestInstance->requestIsValid(false);
 
                        // Throw exception
                        throw new EncryptInvalidLengthException($this, CryptoHelper::EXCEPTION_ENCRYPT_INVALID);
index 2b98122f3e115adec7d47ad87fbf0164bcd12bc2..b9cab8880488f60dec524cec2716dcd7b7a3ea4e 100644 (file)
@@ -124,7 +124,7 @@ class PaymentDiscoveryFilter extends BaseFilter implements Filterable {
                        Registry::getRegistry()->addInstance('payments', $discoveryInstance);
                } catch (NoConfigEntryException $e) {
                        // Something bad happend
-                       $requestInstance->requestIsValid(FALSE);
+                       $requestInstance->requestIsValid(false);
 
                        // Add a message to the response
                        $responseInstance->addFatalMessage('payment_config_entry_error');
@@ -134,7 +134,7 @@ class PaymentDiscoveryFilter extends BaseFilter implements Filterable {
                        throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
                } catch (NoClassException $e) {
                        // Something bad happend
-                       $requestInstance->requestIsValid(FALSE);
+                       $requestInstance->requestIsValid(false);
 
                        // Add a message to the response
                        $responseInstance->addFatalMessage('payment_class_error');
index 1abdf68cb7b8bc9bfb5516687cf6724de421c74d..1bdd5631dc34f54a276a05d0271ad02e2261b989 100644 (file)
@@ -79,7 +79,7 @@ class EmailValidatorFilter extends BaseFilter implements Filterable {
                        // Is the email still not set?
                        if ((is_null($email1)) || (is_null($email2))) {
                                // Not found in form so stop the filtering process
-                               $requestInstance->requestIsValid(FALSE);
+                               $requestInstance->requestIsValid(false);
 
                                // Add a message to the response
                                $responseInstance->addFatalMessage('email_unset');
@@ -88,7 +88,7 @@ class EmailValidatorFilter extends BaseFilter implements Filterable {
                                throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
                        } elseif ((empty($email1)) || (empty($email2))) {
                                // Email is empty
-                               $requestInstance->requestIsValid(FALSE);
+                               $requestInstance->requestIsValid(false);
 
                                // Is the email empty?
                                if (empty($email1)) {
@@ -106,7 +106,7 @@ class EmailValidatorFilter extends BaseFilter implements Filterable {
                                throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
                        } elseif ($this->ifEmailIsTaken($email1)) {
                                // Email is already taken
-                               $requestInstance->requestIsValid(FALSE);
+                               $requestInstance->requestIsValid(false);
 
                                // Add a message to the response
                                $responseInstance->addFatalMessage('email_taken');
@@ -115,7 +115,7 @@ class EmailValidatorFilter extends BaseFilter implements Filterable {
                                throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
                        } elseif ($email1 != $email2) {
                                // Emails didn't match
-                               $requestInstance->requestIsValid(FALSE);
+                               $requestInstance->requestIsValid(false);
 
                                // Add a message to the response
                                $responseInstance->addFatalMessage('emails_mismatch');
@@ -125,7 +125,7 @@ class EmailValidatorFilter extends BaseFilter implements Filterable {
                        } // END - elseif
                } elseif (empty($email)) {
                        // Empty field!
-                       $requestInstance->requestIsValid(FALSE);
+                       $requestInstance->requestIsValid(false);
 
                        // Add a message to the response
                        $responseInstance->addFatalMessage('email_empty');
@@ -143,7 +143,7 @@ class EmailValidatorFilter extends BaseFilter implements Filterable {
         */
        private function ifEmailIsTaken ($email) {
                // Default is already taken
-               $alreadyTaken = TRUE;
+               $alreadyTaken = true;
 
                // Initialize instance
                $userInstance = NULL;
@@ -165,9 +165,9 @@ class EmailValidatorFilter extends BaseFilter implements Filterable {
                }
 
                // Does the email exist?
-               if ($userInstance->ifEmailAddressExists() === FALSE) {
+               if ($userInstance->ifEmailAddressExists() === false) {
                        // This email has not being used yet
-                       $alreadyTaken = FALSE;
+                       $alreadyTaken = false;
                }
 
                // Return the result
index 85c99897de7d46ab38083ee0ea31b50c520a4d2b..05295e674a6493f70872bf79708c716a4436269e 100644 (file)
@@ -71,7 +71,7 @@ class PasswordValidatorFilter extends BaseFilter implements Filterable {
                // Is the password still not set?
                if ((is_null($password1)) || (is_null($password2))) {
                        // Not found in form so stop the filtering process
-                       $requestInstance->requestIsValid(FALSE);
+                       $requestInstance->requestIsValid(false);
 
                        // Add a message to the response
                        $responseInstance->addFatalMessage('password_unset');
@@ -80,7 +80,7 @@ class PasswordValidatorFilter extends BaseFilter implements Filterable {
                        throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
                } elseif ((empty($password1)) || (empty($password2))) {
                        // Password is empty
-                       $requestInstance->requestIsValid(FALSE);
+                       $requestInstance->requestIsValid(false);
 
                        // Is the password empty?
                        if (empty($password1)) {
@@ -98,7 +98,7 @@ class PasswordValidatorFilter extends BaseFilter implements Filterable {
                        throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
                } elseif ($password1 != $password2) {
                        // Passwords didn't match
-                       $requestInstance->requestIsValid(FALSE);
+                       $requestInstance->requestIsValid(false);
 
                        // Add a message to the response
                        $responseInstance->addFatalMessage('pass_mismatch');
index dd0ea3262feb2412ad2be0b0efa4d4a8e64edb94..fafe694261048d6939ac1f24d4bf859ff9614311 100644 (file)
@@ -72,7 +72,7 @@ class UserNameValidatorFilter extends BaseFilter implements Filterable {
                // Is the username set?
                if (is_null($userName)) {
                        // Not found in form so stop the filtering process
-                       $requestInstance->requestIsValid(FALSE);
+                       $requestInstance->requestIsValid(false);
 
                        // Add a message to the response
                        $responseInstance->addFatalMessage('username_unset');
@@ -81,7 +81,7 @@ class UserNameValidatorFilter extends BaseFilter implements Filterable {
                        throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
                } elseif (empty($userName)) {
                        // Empty field!
-                       $requestInstance->requestIsValid(FALSE);
+                       $requestInstance->requestIsValid(false);
 
                        // Add a message to the response
                        $responseInstance->addFatalMessage('username_empty');
@@ -90,7 +90,7 @@ class UserNameValidatorFilter extends BaseFilter implements Filterable {
                        throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
                } elseif ($this->ifUserNameIsTaken($userName)) {
                        // Username is already taken
-                       $requestInstance->requestIsValid(FALSE);
+                       $requestInstance->requestIsValid(false);
 
                        // Add a message to the response
                        $responseInstance->addFatalMessage('username_taken');
@@ -108,7 +108,7 @@ class UserNameValidatorFilter extends BaseFilter implements Filterable {
         */
        private function ifUserNameIsTaken ($userName) {
                // Default is already taken
-               $alreadyTaken = TRUE;
+               $alreadyTaken = true;
 
                // Initialize instance
                $userInstance = NULL;
@@ -135,9 +135,9 @@ class UserNameValidatorFilter extends BaseFilter implements Filterable {
                }
 
                // Does the username exist?
-               if ((is_null($userInstance)) || ($userInstance->ifUsernameExists() === FALSE)) {
+               if ((is_null($userInstance)) || ($userInstance->ifUsernameExists() === false)) {
                        // This username is still available
-                       $alreadyTaken = FALSE;
+                       $alreadyTaken = false;
                } // END - if
 
                // Return the result
index 5b2cc16d062544e0d3b1459149305a9ce9bd299a..2741b3cda51045f1d2ab588c6cbe7515e7787c34 100644 (file)
@@ -80,7 +80,7 @@ class AccountPasswordVerifierFilter extends BaseFilter implements Filterable {
                        // Is the password still not set?
                        if (is_null($password)) {
                                // Not found in form so stop the filtering process
-                               $requestInstance->requestIsValid(FALSE);
+                               $requestInstance->requestIsValid(false);
 
                                // Add a message to the response
                                $responseInstance->addFatalMessage('password_unset');
@@ -92,7 +92,7 @@ class AccountPasswordVerifierFilter extends BaseFilter implements Filterable {
 
                if (empty($password)) {
                        // Password is empty
-                       $requestInstance->requestIsValid(FALSE);
+                       $requestInstance->requestIsValid(false);
 
                        // Add a message to the response
                        $responseInstance->addFatalMessage('password_empty');
index 70639077702c67c0b00c35976e61e0bb36ae0a87..bbc2f17d50d917a5bb9fcc6d2bb5e04c6f71e077 100644 (file)
@@ -71,7 +71,7 @@ class ConfirmCodeVerifierFilter extends BaseFilter implements Filterable {
                // Is this code set?
                if (is_null($confirmCode)) {
                        // Is not in request
-                       $requestInstance->requestIsValid(FALSE);
+                       $requestInstance->requestIsValid(false);
 
                        // Add a message to the response
                        $responseInstance->addFatalMessage('confirm_code_unset');
@@ -80,7 +80,7 @@ class ConfirmCodeVerifierFilter extends BaseFilter implements Filterable {
                        throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
                } elseif (empty($confirmCode)) {
                        // Email is empty
-                       $requestInstance->requestIsValid(FALSE);
+                       $requestInstance->requestIsValid(false);
 
                        // Add a message to the response
                        $responseInstance->addFatalMessage('confirm_code_empty');
@@ -98,7 +98,7 @@ class ConfirmCodeVerifierFilter extends BaseFilter implements Filterable {
                // Do we have the same code or different?
                if ($userCode != $confirmCode) {
                        // Email is empty
-                       $requestInstance->requestIsValid(FALSE);
+                       $requestInstance->requestIsValid(false);
 
                        // Redirect to error page
                        $responseInstance->redirectToConfiguredUrl('confirm_code_invalid');
index ce505afdecee8ffe7e9a43d5d487045ab58d21c0..eb0267cda7aa29aec11fec59bf4865bc13bf8bd5 100644 (file)
@@ -67,7 +67,7 @@ class GraphicalCodeCaptchaVerifierFilter extends BaseFilter implements Filterabl
                // Is the form set?
                if (($requestInstance->getRequestElement('command') !== 'do_form') ||  (!$requestInstance->isRequestElementSet('form'))) {
                        // Required field not set
-                       $requestInstance->requestIsValid(FALSE);
+                       $requestInstance->requestIsValid(false);
 
                        // Add fatal message
                        $responseInstance->addFatalMessage('command_form_invalid');
@@ -93,7 +93,7 @@ class GraphicalCodeCaptchaVerifierFilter extends BaseFilter implements Filterabl
                // Is this set?
                if (is_null($captchaCode)) {
                        // Not set so request is invalid
-                       $requestInstance->requestIsValid(FALSE);
+                       $requestInstance->requestIsValid(false);
 
                        // Add fatal message
                        $responseInstance->addFatalMessage('captcha_code_unset');
@@ -102,7 +102,7 @@ class GraphicalCodeCaptchaVerifierFilter extends BaseFilter implements Filterabl
                        throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
                } elseif (empty($captchaCode)) {
                        // Empty value so request is invalid
-                       $requestInstance->requestIsValid(FALSE);
+                       $requestInstance->requestIsValid(false);
 
                        // Add fatal message
                        $responseInstance->addFatalMessage('captcha_code_empty');
@@ -117,7 +117,7 @@ class GraphicalCodeCaptchaVerifierFilter extends BaseFilter implements Filterabl
                // Is this set?
                if (is_null($captchaHash)) {
                        // Not set so request is invalid
-                       $requestInstance->requestIsValid(FALSE);
+                       $requestInstance->requestIsValid(false);
 
                        // Add fatal message
                        $responseInstance->addFatalMessage('captcha_hash_unset');
@@ -126,7 +126,7 @@ class GraphicalCodeCaptchaVerifierFilter extends BaseFilter implements Filterabl
                        throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
                } elseif (empty($captchaHash)) {
                        // Empty value so request is invalid
-                       $requestInstance->requestIsValid(FALSE);
+                       $requestInstance->requestIsValid(false);
 
                        // Add fatal message
                        $responseInstance->addFatalMessage('captcha_hash_empty');
@@ -144,7 +144,7 @@ class GraphicalCodeCaptchaVerifierFilter extends BaseFilter implements Filterabl
                // Is this CAPTCHA valid?
                if ($hashedCode != $captchaHash) {
                        // Not the same so request is invalid
-                       $requestInstance->requestIsValid(FALSE);
+                       $requestInstance->requestIsValid(false);
 
                        // Add fatal message
                        $responseInstance->addFatalMessage('captcha_hash_mismatch');
index 48412df8f11aa5d4c15f8b07f54aec3288e1ba30..224f88b657413d62c949f0e2e828da730e57147b 100644 (file)
@@ -70,7 +70,7 @@ class PasswordGuestVerifierFilter extends BaseFilter implements Filterable {
                // Is the password still not set?
                if (is_null($password)) {
                        // Not found in form so stop the filtering process
-                       $requestInstance->requestIsValid(FALSE);
+                       $requestInstance->requestIsValid(false);
 
                        // Add a message to the response
                        $responseInstance->addFatalMessage('password_unset');
@@ -79,7 +79,7 @@ class PasswordGuestVerifierFilter extends BaseFilter implements Filterable {
                        throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
                } elseif (empty($password)) {
                        // Password is empty
-                       $requestInstance->requestIsValid(FALSE);
+                       $requestInstance->requestIsValid(false);
 
                        // Add a message to the response
                        $responseInstance->addFatalMessage('password_empty');
index 9fe3c0fc3f8aecd4d6eed27f79e2eee11a5fb8eb..b49cd20b50664d974248e768f376b2d117c8dcd5 100644 (file)
@@ -70,7 +70,7 @@ class PasswordVerifierFilter extends BaseFilter implements Filterable {
                // Is the password still not set?
                if (is_null($password)) {
                        // Not found in form so stop the filtering process
-                       $requestInstance->requestIsValid(FALSE);
+                       $requestInstance->requestIsValid(false);
 
                        // Add a message to the response
                        $responseInstance->addFatalMessage('password_unset');
@@ -79,7 +79,7 @@ class PasswordVerifierFilter extends BaseFilter implements Filterable {
                        throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
                } elseif (empty($password)) {
                        // Password is empty
-                       $requestInstance->requestIsValid(FALSE);
+                       $requestInstance->requestIsValid(false);
 
                        // Add a message to the response
                        $responseInstance->addFatalMessage('password_empty');
index ddea8b02beb1233a2d1a208a7d6ec33973cd1c9e..b442c4e741d144928ddeaa8619daadd207bd4dcd 100644 (file)
@@ -72,7 +72,7 @@ class UserGuestVerifierFilter extends BaseFilter implements Filterable {
                // Is the username set?
                if (is_null($userName)) {
                        // Not found in form so stop the filtering process
-                       $requestInstance->requestIsValid(FALSE);
+                       $requestInstance->requestIsValid(false);
 
                        // Add a message to the response
                        $responseInstance->addFatalMessage('username_guest_unset');
@@ -81,16 +81,16 @@ class UserGuestVerifierFilter extends BaseFilter implements Filterable {
                        throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
                } elseif (empty($userName)) {
                        // Empty field!
-                       $requestInstance->requestIsValid(FALSE);
+                       $requestInstance->requestIsValid(false);
 
                        // Add a message to the response
                        $responseInstance->addFatalMessage('username_guest_empty');
 
                        // Abort here
                        throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
-               } elseif ($this->ifUserGuestIsTaken($userName) === FALSE) {
+               } elseif ($this->ifUserGuestIsTaken($userName) === false) {
                        // Username is already taken
-                       $requestInstance->requestIsValid(FALSE);
+                       $requestInstance->requestIsValid(false);
 
                        // Add a message to the response
                        $responseInstance->addFatalMessage('username_guest_not_found');
@@ -111,7 +111,7 @@ class UserGuestVerifierFilter extends BaseFilter implements Filterable {
         */
        private function ifUserGuestIsTaken ($userName) {
                // Default is already taken
-               $alreadyTaken = TRUE;
+               $alreadyTaken = true;
 
                // Initialize instance
                $userInstance = NULL;
@@ -138,9 +138,9 @@ class UserGuestVerifierFilter extends BaseFilter implements Filterable {
                }
 
                // Does the username exist?
-               if ((is_null($userInstance)) || ($userInstance->ifUsernameExists() === FALSE)) {
+               if ((is_null($userInstance)) || ($userInstance->ifUsernameExists() === false)) {
                        // This username is still available
-                       $alreadyTaken = FALSE;
+                       $alreadyTaken = false;
                }
 
                // Return the result
index 4ee020815e0357521bb2ff10c9f90e69b832b445..3dd15d1bdf13a86d06c8e135447e76024ec59fd5 100644 (file)
@@ -72,7 +72,7 @@ class UserNameVerifierFilter extends BaseFilter implements Filterable {
                // Is the username set?
                if (is_null($userName)) {
                        // Not found in form so stop the filtering process
-                       $requestInstance->requestIsValid(FALSE);
+                       $requestInstance->requestIsValid(false);
 
                        // Add a message to the response
                        $responseInstance->addFatalMessage('username_unset');
@@ -81,16 +81,16 @@ class UserNameVerifierFilter extends BaseFilter implements Filterable {
                        throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
                } elseif (empty($userName)) {
                        // Empty field!
-                       $requestInstance->requestIsValid(FALSE);
+                       $requestInstance->requestIsValid(false);
 
                        // Add a message to the response
                        $responseInstance->addFatalMessage('username_empty');
 
                        // Abort here
                        throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED);
-               } elseif ($this->ifUserNameIsTaken($userName) === FALSE) {
+               } elseif ($this->ifUserNameIsTaken($userName) === false) {
                        // Username is already taken
-                       $requestInstance->requestIsValid(FALSE);
+                       $requestInstance->requestIsValid(false);
 
                        // Add a message to the response
                        $responseInstance->addFatalMessage('username_not_found');
@@ -108,7 +108,7 @@ class UserNameVerifierFilter extends BaseFilter implements Filterable {
         */
        private function ifUserNameIsTaken ($userName) {
                // Default is already taken
-               $alreadyTaken = TRUE;
+               $alreadyTaken = true;
 
                // Initialize instance
                $userInstance = NULL;
@@ -135,9 +135,9 @@ class UserNameVerifierFilter extends BaseFilter implements Filterable {
                }
 
                // Does the username exist?
-               if ((is_null($userInstance)) || ($userInstance->ifUsernameExists() === FALSE)) {
+               if ((is_null($userInstance)) || ($userInstance->ifUsernameExists() === false)) {
                        // This username is still available
-                       $alreadyTaken = FALSE;
+                       $alreadyTaken = false;
                } // END - if
 
                // Return the result
index 26a3544748b00d59d735b52af63f2a708b0019df..2118321c528521d43aacaeb718df08e1c93d8c71 100644 (file)
@@ -69,7 +69,7 @@ class UserStatusVerifierFilter extends BaseFilter implements Filterable {
                // Is the user account confirmed?
                if ((!$userInstance->isConfirmed()) && (!$userInstance->isGuest()) && ($requestInstance->getRequestElement('action') != $this->getConfigInstance()->getConfigEntry('action_status_problem'))) {
                        // Request is invalid!
-                       $requestInstance->requestIsValid(FALSE);
+                       $requestInstance->requestIsValid(false);
 
                        // Redirect to configured URL
                        $responseInstance->redirectToConfiguredUrl('login_user_status');
index 2acbb9290ed768b9a74c110c83845ebcacfdfd80..73ea3840915acb694f89fa02d7292185746346f9 100644 (file)
@@ -68,9 +68,9 @@ class UserUnconfirmedVerifierFilter extends BaseFilter implements Filterable {
                $userInstance = UserFactory::createUserByRequest($requestInstance);
 
                // Is the email address valid?
-               if ($userInstance->ifEmailAddressExists() === FALSE) {
+               if ($userInstance->ifEmailAddressExists() === false) {
                        // Request is invalid!
-                       $requestInstance->requestIsValid(FALSE);
+                       $requestInstance->requestIsValid(false);
 
                        // Redirect to configured URL
                        $responseInstance->redirectToConfiguredUrl('user_unconfirmed_email_missing');
@@ -82,7 +82,7 @@ class UserUnconfirmedVerifierFilter extends BaseFilter implements Filterable {
                // Is the user account confirmed?
                if ($userInstance->getField(UserDatabaseWrapper::DB_COLUMN_USER_STATUS) != $this->getConfigInstance()->getConfigEntry('user_status_unconfirmed')) {
                        // Request is invalid!
-                       $requestInstance->requestIsValid(FALSE);
+                       $requestInstance->requestIsValid(false);
 
                        // Redirect to configured URL
                        $responseInstance->redirectToConfiguredUrl('user_not_unconfirmed');
index b0fd94443fbd957133d0a68e47c5c66d454563c8..2c96d96acc2282add27511fa52b1a179c4db2b13 100644 (file)
@@ -91,7 +91,7 @@ class TaskHandler extends BaseHandler implements Registerable, HandleableTask {
         */
        private function executeCurrentTask () {
                // Update no task by default
-               $updateTask = FALSE;
+               $updateTask = false;
 
                // Is the current task valid?
                if (!$this->getListInstance()->getIterator()->valid()) {
@@ -103,7 +103,7 @@ class TaskHandler extends BaseHandler implements Registerable, HandleableTask {
                $currentTask = $this->getListInstance()->getIterator()->current();
 
                // Is the task not yet started?
-               if ($currentTask['task_started'] === FALSE) {
+               if ($currentTask['task_started'] === false) {
                        // Determine difference between current time and registration
                        $diff = ($this->getMilliTime() - $currentTask['task_registered']) * 1000;
 
@@ -115,8 +115,8 @@ class TaskHandler extends BaseHandler implements Registerable, HandleableTask {
                        } // END - if
 
                        // Launch the task and mark it as updated
-                       $currentTask['task_started'] = TRUE;
-                       $updateTask = TRUE;
+                       $currentTask['task_started'] = true;
+                       $updateTask = true;
 
                        // Debug message
                        self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TASK-HANDLER[' . __METHOD__ . ':' . __LINE__ . ']: Task ' . $currentTask['id'] . ' started with startup_delay=' . $currentTask['task_startup_delay'] . 'ms');
@@ -131,7 +131,7 @@ class TaskHandler extends BaseHandler implements Registerable, HandleableTask {
                // Is the interval delay reached?
                if ((($diff < $currentTask['task_interval_delay']) && ($currentTask['task_max_runs'] == 0)) || (($currentTask['task_max_runs'] > 0) && ($currentTask['task_total_runs'] == $currentTask['task_max_runs']))) {
                        // Should we update the task from startup?
-                       if ($updateTask === TRUE) {
+                       if ($updateTask === true) {
                                // Update the task before leaving
                                $this->updateTask($currentTask);
                        } // END - if
@@ -239,11 +239,11 @@ class TaskHandler extends BaseHandler implements Registerable, HandleableTask {
                        // Identifier for the generateHash() method
                        'id'                  => $taskName,
                        // Whether the task is started
-                       'task_started'        => FALSE,
+                       'task_started'        => false,
                        // Whether the task is paused (not yet implemented)
-                       'task_paused'         => FALSE,
+                       'task_paused'         => false,
                        // Whether the task can be paused (not yet implemented)
-                       'task_pauseable'      => TRUE,
+                       'task_pauseable'      => true,
                        // Timestamp of registration
                        'task_registered'     => $this->getMilliTime(),
                        // Last activity timestamp
index b0948b673255647635fc1834ba26749be5f1a690..bb38bacac3f661c4dcf58283b4bbed13a3c018b6 100644 (file)
@@ -266,7 +266,7 @@ class BaseHelper extends BaseFrameworkSystem {
 
                // Add the group to the stack
                $this->groups[$this->totalCounter] = $groupId;
-               $this->groups[$groupId]['opened']  = TRUE;
+               $this->groups[$groupId]['opened']  = true;
                $this->groups[$groupId]['content'] = sprintf(
                        '<!-- group %s opened (length: %s, tag: %s) //-->%s' . PHP_EOL,
                        $groupId,
@@ -296,7 +296,7 @@ class BaseHelper extends BaseFrameworkSystem {
                } // END - if
 
                // Check if any group was opened before
-               if ($this->ifGroupOpenedPreviously() === FALSE) {
+               if ($this->ifGroupOpenedPreviously() === false) {
                        // Then throw an exception
                        throw new HelperNoPreviousOpenedGroupException(array($this, $content), self::EXCEPTION_NO_PREVIOUS_SUB_GROUP_OPENED);
                } // END - if
@@ -322,7 +322,7 @@ class BaseHelper extends BaseFrameworkSystem {
                        $this->groups[$groupId]['tag'],
                        $content
                );
-               $this->groups[$groupId]['opened'] = FALSE;
+               $this->groups[$groupId]['opened'] = false;
 
                // Mark previous group as closed
                $this->setPreviousGroupId('');
@@ -353,7 +353,7 @@ class BaseHelper extends BaseFrameworkSystem {
 
                // Add the group to the stack
                $this->subGroups[$this->totalCounter] = $subGroupId;
-               $this->subGroups[$subGroupId]['opened']  = TRUE;
+               $this->subGroups[$subGroupId]['opened']  = true;
                $this->subGroups[$subGroupId]['content'] = sprintf("<!-- sub-group %s opened (length: %s, tag: %s) //-->%s\n", $subGroupId, strlen($content), $tag, $content);
                $this->subGroups[$subGroupId]['tag'] = $tag;
 
@@ -371,7 +371,7 @@ class BaseHelper extends BaseFrameworkSystem {
         */
        public function closePreviousSubGroupByContent ($content = '') {
                // Check if any sub group was opened before
-               if ($this->ifSubGroupOpenedPreviously() === FALSE) {
+               if ($this->ifSubGroupOpenedPreviously() === false) {
                        // Then throw an exception
                        throw new HelperNoPreviousOpenedSubGroupException(array($this, $content), self::EXCEPTION_NO_PREVIOUS_SUB_GROUP_OPENED);
                } // END - if
@@ -387,7 +387,7 @@ class BaseHelper extends BaseFrameworkSystem {
 
                // Add content to it and mark it as closed
                $this->subGroups[$subGroupId]['content'] .= sprintf('<!-- sub-group %s closed (length: %s, tag: %s) //-->%s' . PHP_EOL, $subGroupId, strlen($content), $this->subGroups[$subGroupId]['tag'], $content);
-               $this->subGroups[$subGroupId]['opened'] = FALSE
+               $this->subGroups[$subGroupId]['opened'] = false
                ;
 
                // Mark previous sub group as closed
@@ -416,12 +416,12 @@ class BaseHelper extends BaseFrameworkSystem {
                // Now "walk" through all groups and sub-groups
                for ($idx = 1; $idx <= $this->totalCounter; $idx++) {
                        // Is this a sub/group and is it closed?
-                       if ((isset($this->groups[$idx])) && ($this->groups[$this->groups[$idx]]['opened'] === FALSE)) {
+                       if ((isset($this->groups[$idx])) && ($this->groups[$this->groups[$idx]]['opened'] === false)) {
                                // Then add it's content
                                $groupContent = trim($this->groups[$this->groups[$idx]]['content']);
                                //* DEBUG: */ echo "group={$this->groups[$idx]},content=<pre>".htmlentities($groupContent)."</pre><br />\n";
                                $content .= $groupContent;
-                       } elseif ((isset($this->subGroups[$idx])) && ($this->subGroups[$this->subGroups[$idx]]['opened'] === FALSE)) {
+                       } elseif ((isset($this->subGroups[$idx])) && ($this->subGroups[$this->subGroups[$idx]]['opened'] === false)) {
                                // Then add it's content
                                $subGroupContent = $this->subGroups[$this->subGroups[$idx]]['content'];
                                //* DEBUG: */ echo "subgroup={$this->subGroups[$idx]},content=<pre>".htmlentities($subGroupContent)."</pre><br />\n";
@@ -451,7 +451,7 @@ class BaseHelper extends BaseFrameworkSystem {
         */
        protected function ifGroupIsOpened ($groupId) {
                // Is the group open?
-               $isOpened = ((isset($this->groups[$groupId])) && ($this->groups[$groupId]['opened'] === TRUE));
+               $isOpened = ((isset($this->groups[$groupId])) && ($this->groups[$groupId]['opened'] === true));
 
                // Return status
                return $isOpened;
index 4e6fbc47eda7f2406279028dc0d263f85b4cb52b..65e7f9c468ec0181a4485070c59b7bf26eb6ceb3 100644 (file)
@@ -34,10 +34,10 @@ use CoreFramework\Wrapper\Database\User\UserDatabaseWrapper;
  */
 class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
        /**
-        * Whether the form tag is opened (keep at FALSE or else your forms will
+        * Whether the form tag is opened (keep at false or else your forms will
         * never work!)
         */
-       private $formOpened = FALSE;
+       private $formOpened = false;
 
        /**
         * Name of the form
@@ -45,9 +45,9 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
        private $formName = '';
 
        /**
-        * Whether form tag is enabled (default: TRUE)
+        * Whether form tag is enabled (default: true)
         */
-       private $formEnabled = TRUE;
+       private $formEnabled = true;
 
        // Class Constants
        const EXCEPTION_FORM_NAME_INVALID       = 0x120;
@@ -74,7 +74,7 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @param       $withForm                       Whether include the form tag
         * @return      $helperInstance         A preparedf instance of this helper
         */
-       public static final function createHtmlFormHelper (CompileableTemplate $templateInstance, $formName, $formId = FALSE, $withForm = TRUE) {
+       public static final function createHtmlFormHelper (CompileableTemplate $templateInstance, $formName, $formId = false, $withForm = true) {
                // Get new instance
                $helperInstance = new HtmlFormHelper();
 
@@ -82,7 +82,7 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
                $helperInstance->setTemplateInstance($templateInstance);
 
                // Is the form id not set?
-               if ($formId === FALSE) {
+               if ($formId === false) {
                        // Use form id from form name
                        $formId = $formName;
                } // END - if
@@ -90,13 +90,13 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
                // Set form name
                $helperInstance->setFormName($formName);
 
-               // A form-less field may say 'FALSE' here...
-               if ($withForm === TRUE) {
+               // A form-less field may say 'false' here...
+               if ($withForm === true) {
                        // Create the form
                        $helperInstance->addFormTag($formName, $formId);
                } else {
                        // Disable form
-                       $helperInstance->enableForm(FALSE);
+                       $helperInstance->enableForm(false);
                }
 
                // Return the prepared instance
@@ -106,15 +106,15 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
        /**
         * Add the form tag or close it an already opened form tag
         *
-        * @param       $formName       Name of the form (default: FALSE)
-        * @param       $formId         Id of the form (attribute 'id'; default: FALSE)
+        * @param       $formName       Name of the form (default: false)
+        * @param       $formId         Id of the form (attribute 'id'; default: false)
         * @return      void
-        * @throws      InvalidFormNameException        If the form name is invalid ( = FALSE)
+        * @throws      InvalidFormNameException        If the form name is invalid ( = false)
         * @todo        Add some unique PIN here to bypass problems with some browser and/or extensions
         */
-       public function addFormTag ($formName = FALSE, $formId = FALSE) {
+       public function addFormTag ($formName = false, $formId = false) {
                // When the form is not yet opened at least form name must be valid
-               if (($this->formOpened === FALSE) && ($formName === FALSE)) {
+               if (($this->formOpened === false) && ($formName === false)) {
                        // Thrown an exception
                        throw new InvalidFormNameException ($this, self::EXCEPTION_FORM_NAME_INVALID);
                } // END - if
@@ -123,7 +123,7 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
                $formContent = '</form>';
 
                // Check whether we shall open or close the form
-               if (($this->formOpened === FALSE) && ($this->formEnabled === TRUE)) {
+               if (($this->formOpened === false) && ($this->formEnabled === true)) {
                        // Add HTML code
                        $formContent = sprintf("<form name=\"%s\" class=\"forms\" action=\"%s/%s\" method=\"%s\" target=\"%s\"",
                                $formName,
@@ -142,7 +142,7 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
                        $formContent .= '>';
 
                        // Open the form and remeber the form name
-                       $this->formOpened = TRUE;
+                       $this->formOpened = true;
 
                        // Add it to the content
                        $this->addHeaderContent($formContent);
@@ -157,7 +157,7 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
                        } // END - if
 
                        // Simply close it
-                       $this->formOpened = FALSE;
+                       $this->formOpened = false;
 
                        // Add it to the content
                        $this->addFooterContent($formContent);
@@ -175,7 +175,7 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         */
        public function addInputTextField ($fieldName, $fieldValue = '') {
                // Is the form opened?
-               if (($this->formOpened === FALSE) && ($this->formEnabled === TRUE)) {
+               if (($this->formOpened === false) && ($this->formEnabled === true)) {
                        // Throw an exception
                        throw new FormClosedException (array($this, $fieldName), self::EXCEPTION_CLOSED_FORM);
                } // END - if
@@ -217,7 +217,7 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         */
        public function addInputPasswordField ($fieldName, $fieldValue = '') {
                // Is the form opened?
-               if (($this->formOpened === FALSE) && ($this->formEnabled === TRUE)) {
+               if (($this->formOpened === false) && ($this->formEnabled === true)) {
                        // Throw an exception
                        throw new FormClosedException (array($this, $fieldName), self::EXCEPTION_CLOSED_FORM);
                } // END - if
@@ -244,7 +244,7 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         */
        public function addInputHiddenField ($fieldName, $fieldValue = '') {
                // Is the form opened?
-               if (($this->formOpened === FALSE) && ($this->formEnabled === TRUE)) {
+               if (($this->formOpened === false) && ($this->formEnabled === true)) {
                        // Throw an exception
                        throw new FormClosedException (array($this, $fieldName), self::EXCEPTION_CLOSED_FORM);
                } // END - if
@@ -299,16 +299,16 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @return      void
         * @throws      FormClosedException             If the form is not yet opened
         */
-       public function addInputCheckboxField ($fieldName, $fieldChecked = TRUE) {
+       public function addInputCheckboxField ($fieldName, $fieldChecked = true) {
                // Is the form opened?
-               if (($this->formOpened === FALSE) && ($this->formEnabled === TRUE)) {
+               if (($this->formOpened === false) && ($this->formEnabled === true)) {
                        // Throw an exception
                        throw new FormClosedException (array($this, $fieldName), self::EXCEPTION_CLOSED_FORM);
                } // END - if
 
                // Set whether the check box is checked...
                $checked = " checked=\"checked\"";
-               if ($fieldChecked === FALSE) $checked = ' ';
+               if ($fieldChecked === false) $checked = ' ';
 
                // Generate the content
                $inputContent = sprintf("<input type=\"checkbox\" name=\"%s\" class=\"checkbox %s_field\" value=\"1\"%s/>",
@@ -331,7 +331,7 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         */
        public function addInputResetButton ($buttonText) {
                // Is the form opened?
-               if (($this->formOpened === FALSE) && ($this->formEnabled === TRUE)) {
+               if (($this->formOpened === false) && ($this->formEnabled === true)) {
                        // Throw an exception
                        throw new FormClosedException (array($this, 'reset'), self::EXCEPTION_CLOSED_FORM);
                } // END - if
@@ -356,7 +356,7 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         */
        public function addInputSubmitButton ($buttonText) {
                // Is the form opened?
-               if (($this->formOpened === FALSE) && ($this->formEnabled === TRUE)) {
+               if (($this->formOpened === false) && ($this->formEnabled === true)) {
                        // Throw an exception
                        throw new FormClosedException (array($this, 'submit'), self::EXCEPTION_CLOSED_FORM);
                } // END - if
@@ -383,13 +383,13 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         */
        public function addFormGroup ($groupId = '', $groupText = '') {
                // Is a form opened?
-               if (($this->formOpened === FALSE) && ($this->formEnabled === TRUE)) {
+               if (($this->formOpened === false) && ($this->formEnabled === true)) {
                        // Throw exception here
                        throw new FormClosedException(array($this, $groupId), self::EXCEPTION_CLOSED_FORM);
                } // END - if
 
                // At least the group name should be set
-               if ((empty($groupId)) && ($this->ifGroupOpenedPreviously() === FALSE)) {
+               if ((empty($groupId)) && ($this->ifGroupOpenedPreviously() === false)) {
                        // Throw exception here
                        throw new EmptyVariableException(array($this, 'groupId'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
                } elseif (empty($groupId)) {
@@ -398,16 +398,16 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
                }
 
                // Same group to open?
-               if (($this->ifGroupOpenedPreviously() === FALSE) && ($groupId === $this->getPreviousGroupId())) {
+               if (($this->ifGroupOpenedPreviously() === false) && ($groupId === $this->getPreviousGroupId())) {
                        // Abort here silently
-                       return FALSE;
+                       return false;
                } // END - if
 
                // Initialize content with closing div by default
                $content = "    </div>\n</div><!-- Group - CLOSE //-->";
 
                // Is this group opened?
-               if ($this->ifGroupOpenedPreviously() === FALSE) {
+               if ($this->ifGroupOpenedPreviously() === false) {
                        // Begin the div/span blocks
                        $content = sprintf("<!-- Group %s - OPEN //-->
 <div class=\"group_box\" id=\"%s_group_box\">
@@ -458,13 +458,13 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         */
        public function addFormSubGroup ($subGroupId = '', $subGroupText = '') {
                // Is a group opened?
-               if ($this->ifGroupOpenedPreviously() === FALSE) {
+               if ($this->ifGroupOpenedPreviously() === false) {
                        // Throw exception here
                        throw new FormFormClosedException(array($this, $subGroupId), self::EXCEPTION_UNEXPECTED_CLOSED_GROUP);
                } // END - if
 
                // At least the sub group name should be set
-               if ((empty($subGroupId)) && ($this->ifSubGroupOpenedPreviously() === FALSE)) {
+               if ((empty($subGroupId)) && ($this->ifSubGroupOpenedPreviously() === false)) {
                        // Throw exception here
                        throw new EmptyVariableException(array($this, 'subGroupId'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
                } elseif (empty($subGroupId)) {
@@ -473,16 +473,16 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
                }
 
                // Same sub group to open?
-               if (($this->ifSubGroupOpenedPreviously() === FALSE) && ($subGroupId == $this->getPreviousSubGroupId())) {
+               if (($this->ifSubGroupOpenedPreviously() === false) && ($subGroupId == $this->getPreviousSubGroupId())) {
                        // Abort here silently
-                       return FALSE;
+                       return false;
                } // END - if
 
                // Initialize content with closing div by default
                $content = "    </div>\n</div><!-- Sub group- CLOSE //-->";
 
                // Is this group opened?
-               if ($this->ifSubGroupOpenedPreviously() === FALSE) {
+               if ($this->ifSubGroupOpenedPreviously() === false) {
                        // Begin the span block
                        $content = sprintf("<!-- Sub group %s - OPEN //-->
 <div class=\"subgroup_box\" id=\"%s_subgroup_box\">
@@ -524,7 +524,7 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         */
        public function addFieldText ($fieldName, $fieldText) {
                // Is the form opened?
-               if (($this->formOpened === FALSE) && ($this->formEnabled === TRUE)) {
+               if (($this->formOpened === false) && ($this->formEnabled === true)) {
                        // Throw an exception
                        throw new FormClosedException (array($this, $fieldName), self::EXCEPTION_CLOSED_FORM);
                } // END - if
@@ -558,7 +558,7 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         */
        public function addFormNote ($noteId, $formNotes) {
                // Is the form opened?
-               if (($this->formOpened === FALSE) && ($this->formEnabled === TRUE)) {
+               if (($this->formOpened === false) && ($this->formEnabled === true)) {
                        // Throw an exception
                        throw new FormClosedException (array($this, 'form_notes'), self::EXCEPTION_CLOSED_FORM);
                } // END - if
@@ -586,13 +586,13 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         */
        public function addInputSelectField ($selectId, $firstEntry) {
                // Is the form group opened?
-               if (($this->formOpened === FALSE) && ($this->formEnabled === TRUE)) {
+               if (($this->formOpened === false) && ($this->formEnabled === true)) {
                        // Throw an exception
                        throw new FormClosedException (array($this, 'form_notes'), self::EXCEPTION_CLOSED_FORM);
                } // END - if
 
                // Shall we close or open the sub group?
-               if (($this->ifSubGroupOpenedPreviously() === FALSE) && ($this->getPreviousSubGroupId() !== $selectId)) {
+               if (($this->ifSubGroupOpenedPreviously() === false) && ($this->getPreviousSubGroupId() !== $selectId)) {
                        // Initialize first entry (which might be non-selectable if content is provided
                        if (!empty($firstEntry)) {
                                // Add selection around it
@@ -633,7 +633,7 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         */
        public function addSelectSubOption ($subName, $subValue) {
                // Is there a sub group (shall be a selection box!)
-               if ($this->ifSubGroupOpenedPreviously() === FALSE) {
+               if ($this->ifSubGroupOpenedPreviously() === false) {
                        // Then throw an exception here
                        throw new HelperNoPreviousOpenedSubGroupException(array($this, $content), self::EXCEPTION_NO_PREVIOUS_SUB_GROUP_OPENED);
                } // END - if
@@ -661,7 +661,7 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         */
        public function addSelectOption ($optionName, $optionValue) {
                // Is there a sub group (shall be a selection box!)
-               if ($this->ifSubGroupOpenedPreviously() === FALSE) {
+               if ($this->ifSubGroupOpenedPreviously() === false) {
                        // Then throw an exception here
                        throw new HelperNoPreviousOpenedSubGroupException(array($this, $content), self::EXCEPTION_NO_PREVIOUS_SUB_GROUP_OPENED);
                } // END - if
@@ -713,7 +713,7 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @param       $formEnabled    Whether form is enabled or disabled
         * @return      void
         */
-       public final function enableForm ($formEnabled = TRUE) {
+       public final function enableForm ($formEnabled = true) {
                $this->formEnabled = (bool) $formEnabled;
        }
 
@@ -863,7 +863,7 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         * @todo        Implement check if rules have been changed
         */
        public function ifRulesHaveChanged () {
-               return FALSE;
+               return false;
        }
 
        /**
@@ -926,10 +926,10 @@ class HtmlFormHelper extends BaseHtmlHelper implements HelpableTemplate {
         */
        public function flushContent () {
                // Is the form still open?
-               if (($this->formOpened === TRUE) && ($this->formEnabled === TRUE)) {
+               if (($this->formOpened === true) && ($this->formEnabled === true)) {
                        // Close the form automatically
                        $this->addFormTag();
-               } elseif ($this->formEnabled === FALSE) {
+               } elseif ($this->formEnabled === false) {
                        if ($this->ifSubGroupOpenedPreviously()) {
                                // Close sub group
                                $this->addFormSubGroup();
index f38d05e21146e788f1f8212adf8677325bd81b44..b9df4c065b408badfb5ca07d69256aab9b523c07 100644 (file)
@@ -3,6 +3,7 @@
 namespace CoreFramework\Helper;
 
 // Import framework stuff
+use CoreFramework\Bootstrap\FrameworkBootstrap;
 use CoreFramework\Configuration\FrameworkConfiguration;
 use CoreFramework\Generic\NullPointerException;
 use CoreFramework\Registry\Registry;
@@ -84,7 +85,7 @@ class HtmlLinkHelper extends BaseHtmlHelper implements HelpableTemplate {
                $applicationInstance = Registry::getRegistry()->getInstance('application');
 
                // Get the request instance
-               $requestInstance = $applicationInstance->getRequestInstance();
+               $requestInstance = FrameworkBootstrap::getRequestInstance();
 
                // Sanity-check on it
                if (is_null($requestInstance)) {
@@ -249,7 +250,7 @@ class HtmlLinkHelper extends BaseHtmlHelper implements HelpableTemplate {
         */
        public function addLinkNote ($groupId, $groupNote, $groupCode = 'div') {
                // Check if a previous group was opened
-               if ($this->ifGroupOpenedPreviously() === FALSE) {
+               if ($this->ifGroupOpenedPreviously() === false) {
                        // No group was opened before!
                        throw new NoGroupOpenedException(array($this, $groupNote), self::EXCEPTION_GROUP_NOT_OPENED);
                } // END - if
@@ -282,7 +283,7 @@ class HtmlLinkHelper extends BaseHtmlHelper implements HelpableTemplate {
         */
        protected function addActionLink ($linkAction, $linkText, $linkTitle) {
                // Check if a previous group was opened
-               if ($this->ifGroupOpenedPreviously() === FALSE) {
+               if ($this->ifGroupOpenedPreviously() === false) {
                        // No group was opened before!
                        throw new NoGroupOpenedException(array($this, $linkAction . '(' . $linkText . ')'), self::EXCEPTION_GROUP_NOT_OPENED);
                } // END - if
index da592594346e7579bbdc25836013909678c894d2..a42c6c110403725b4ce46fbf3e20fa52d59c38f6 100644 (file)
@@ -528,7 +528,7 @@ class BaseImage extends BaseFrameworkSystem implements Registerable {
                                // Walk through all groups
                                foreach ($templateInstance->getVariableGroups() as $group => $set) {
                                        // Set the group
-                                       $templateInstance->setVariableGroup($group, FALSE);
+                                       $templateInstance->setVariableGroup($group, false);
 
                                        // Compile image string
                                        $imageString = $templateInstance->compileRawCode($this->getString());
index 39c87273ff5435c06664a4f576173ab7fb755c6d..fbf444ca187118c323e4a2b67e9cacd839dbc6bd 100644 (file)
@@ -3,7 +3,7 @@
 namespace CoreFramework\Image;
 
 // Import framework stuff
-use CoreFramework\Object\BaseFrameworkSystem;
+use CoreFramework\Bootstrap\FrameworkBootstrap;
 use CoreFramework\Template\CompileableTemplate;
 
 /**
@@ -72,7 +72,7 @@ class PngImage extends BaseImage {
                $cacheFile = $this->getTemplateInstance()->getImageCacheFqfn();
 
                // Does it exist?
-               if (BaseFrameworkSystem::isReadableFile($cacheFile)) {
+               if (FrameworkBootstrap::isReadableFile($cacheFile)) {
                        // Remove it
                        @unlink($cacheFile);
                } // END - if
index 514b00a8074b3571dd6ceaa96ce4401fe10de622..d44519f28a516fa3e527ccbec9a0ca9e920d64d1 100644 (file)
@@ -104,7 +104,7 @@ class BaseIndex extends BaseFrameworkSystem {
                $this->getIteratorInstance()->setHeader($header);
 
                // Check if the array has only 3 elements
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] header(%d)=%s', __METHOD__, __LINE__, count($header), print_r($header, TRUE)));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] header(%d)=%s', __METHOD__, __LINE__, count($header), print_r($header, true)));
                assert(count($header) == 2);
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] Passed assert().', __METHOD__, __LINE__));
 
@@ -146,7 +146,7 @@ class BaseIndex extends BaseFrameworkSystem {
                );
 
                // Write it to disk (header is always at seek position 0)
-               $this->getIteratorInstance()->writeData(0, $header, FALSE);
+               $this->getIteratorInstance()->writeData(0, $header, false);
 
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] EXIT!', __METHOD__, __LINE__));
        }
@@ -328,7 +328,7 @@ class BaseIndex extends BaseFrameworkSystem {
         * @return      void
         * @throws      UnsupportedOperationException   This method is not (and maybe never will be) supported
         */
-       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[]=%s,flushHeader=%d', __METHOD__, __LINE__, $seekPosition, gettype($data), intval($flushHeader)));
                throw new UnsupportedOperationException(array($this, __FUNCTION__, $this->getIteratorInstance()->getPointerInstance()), self::EXCEPTION_UNSPPORTED_OPERATION);
        }
@@ -342,7 +342,7 @@ class BaseIndex extends BaseFrameworkSystem {
         * @throws      UnsupportedOperationException   If this method is called
         */
        public function writeValueToFile ($groupId, $value) {
-               self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . '] groupId=' . $groupId . ',value[' . gettype($value) . ']=' . print_r($value, TRUE));
+               self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . '] groupId=' . $groupId . ',value[' . gettype($value) . ']=' . print_r($value, true));
                throw new UnsupportedOperationException(array($this, __FUNCTION__), self::EXCEPTION_UNSPPORTED_OPERATION);
        }
 
index 4006faa6be5084dd44a52a321882eafa44f0b706..1935b986a7e2bd47b444f83339d5422523427475 100644 (file)
@@ -100,7 +100,7 @@ class FileIterator extends BaseIterator implements SeekableWritableFileIterator
 
        /**
         * Checks wether the current entry is valid (not at the end of the file).
-        * This method will return TRUE if an emptied (nulled) entry has been found.
+        * This method will return true if an emptied (nulled) entry has been found.
         *
         * @return      $isValid        Whether the next entry is valid
         */
@@ -280,7 +280,7 @@ class FileIterator extends BaseIterator implements SeekableWritableFileIterator
         * @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) {
                // Call block instance
                $this->getBlockInstance()->writeData($seekPosition, $data, $flushHeader);
        }
index ae98d5bd4c2b7737c3aab74fc6597a931c9a5f96..9765ca6ffb0ba844e3175454c403619818b6ae04 100644 (file)
@@ -56,7 +56,7 @@ class BaseListener extends BaseFrameworkSystem implements Visitable {
        /**
         * Whether we are in blocking or non-blocking mode (default: non-blocking
         */
-       private $blockingMode = FALSE;
+       private $blockingMode = false;
 
        /**
         * A peer pool instance
@@ -85,7 +85,7 @@ class BaseListener extends BaseFrameworkSystem implements Visitable {
                $isServerSocket = ((is_resource($socketResource)) && (!@socket_getpeername($socketResource, $peerName)));
 
                // We need to clear the error here if it is a resource
-               if ($isServerSocket === TRUE) {
+               if ($isServerSocket === true) {
                        // Clear the error
                        //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('socketResource[]=' . gettype($socketResource));
                        socket_clear_error($socketResource);
@@ -494,14 +494,14 @@ class BaseListener extends BaseFrameworkSystem implements Visitable {
                // Some new peers found?
                if ($left < 1) {
                        // Debug message
-                       //* EXTREME-NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TCP-LISTENER[' . __METHOD__ . ':' . __LINE__ . ']: left=' . $left . ',serverSocket=' . $this->getSocketResource() . ',readers=' . print_r($readers, TRUE));
+                       //* EXTREME-NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TCP-LISTENER[' . __METHOD__ . ':' . __LINE__ . ']: left=' . $left . ',serverSocket=' . $this->getSocketResource() . ',readers=' . print_r($readers, true));
 
                        // Nothing new found
                        return;
                } // END - if
 
                // Debug message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TCP-LISTENER[' . __METHOD__ . ':' . __LINE__ . ']: serverSocket=' . $this->getSocketResource() . ',readers=' . print_r($readers, TRUE));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TCP-LISTENER[' . __METHOD__ . ':' . __LINE__ . ']: serverSocket=' . $this->getSocketResource() . ',readers=' . print_r($readers, true));
 
                // Do we have changed peers?
                if (in_array($this->getSocketResource(), $readers)) {
@@ -535,7 +535,7 @@ class BaseListener extends BaseFrameworkSystem implements Visitable {
                        // Output result (only for debugging!)
                        /*
                        $option = socket_get_option($newSocket, SOL_SOCKET, SO_RCVTIMEO);
-                       self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SO_RCVTIMEO[' . gettype($option) . ']=' . print_r($option, TRUE));
+                       self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SO_RCVTIMEO[' . gettype($option) . ']=' . print_r($option, true));
                        */
 
                        // Enable SO_OOBINLINE
index 7261b9fa9b4122cadd81ffc8215434da3fa071c5..645f853525bbc9751ae140ec2cd4f9dfb6e2dc8b 100644 (file)
@@ -3,6 +3,7 @@
 namespace CoreFramework\Listener\Socket;
 
 // Import framework stuff
+use CoreFramework\Bootstrap\FrameworkBootstrap;
 use CoreFramework\Factory\ObjectFactory;
 use CoreFramework\Listener\Listenable;
 
@@ -89,7 +90,7 @@ class SocketFileListener extends BaseListener implements Listenable {
                assert(!empty($socketFile));
 
                // Is the file there?
-               if ((self::isReachableFilePath($socketFile)) && (file_exists($socketFile))) {
+               if ((FrameworkBootstrap::isReachableFilePath($socketFile)) && (file_exists($socketFile))) {
                        // Old socket found
                        self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('SOCKET-FILE-LISTENER[' . __METHOD__ . ':' . __LINE__ . ']: WARNING: Old socket at ' . $socketFile . ' found. Will not start.');
 
index 3703aecc6bb6ff8e03a21b6ab65687cfb24619e7..8d79d1d6c3c70090be933403c05444383e04cfb4 100644 (file)
@@ -199,7 +199,7 @@ class BaseList extends BaseFrameworkSystem implements IteratorAggregate, Countab
                        if ($this->isHashValid($hash)) {
                                // Add it
                                array_push($array, $this->listEntries[$hash]);
-                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: hash=' . $hash . ',array(' . count($array) . ')=' . print_r($array, TRUE) . ' - ADDED!');
+                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: hash=' . $hash . ',array(' . count($array) . ')=' . print_r($array, true) . ' - ADDED!');
                        } // END - if
                } // END - foreach
 
@@ -232,7 +232,7 @@ class BaseList extends BaseFrameworkSystem implements IteratorAggregate, Countab
                $hash = $this->generateHash($groupName, $groupName, $entry);
 
                // Debug message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: this=' . $this->__toString() . ',groupName=' . $groupName . ',entry=' . print_r($entry, TRUE) . ', hash=' . $hash);
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: this=' . $this->__toString() . ',groupName=' . $groupName . ',entry=' . print_r($entry, true) . ', hash=' . $hash);
 
                // Add the hash to the index
                array_push($this->listIndex, $hash);
index b7781ca7d623cde641d50a7c415406c1ffac4cda..b3700931d03182b183f6c7eae446f91700053773 100644 (file)
@@ -3,11 +3,13 @@
 namespace CoreFramework\Mailer\Debug;
 
 // Import framework stuff
+use CoreFramework\Bootstrap\FrameworkBootstrap;
 use CoreFramework\Generic\NullPointerException;
 use CoreFramework\Mailer\BaseMailer;
 use CoreFramework\Mailer\DeliverableMail;
 use CoreFramework\Manager\Login\ManageableMember;
 use CoreFramework\Manager\ManageableApplication;
+use CoreFramework\Registry\Registry;
 use CoreFramework\Template\CompileableTemplate;
 
 /**
@@ -120,7 +122,7 @@ class DebugMailer extends BaseMailer implements DeliverableMail {
                                $templateInstance->renderXmlContent();
 
                                // Get responce instance
-                               $responseInstance = $this->getApplicationInstance()->getResponseInstance();
+                               $responseInstance = FrameworkBootstrap::getResponseInstance();
 
                                // Transfer the data to the response
                                $templateInstance->transferToResponse($responseInstance);
@@ -175,7 +177,7 @@ class DebugMailer extends BaseMailer implements DeliverableMail {
                $templateInstance->assignTemplateWithVariable('footer', 'footer');
 
                // Load the master template
-               $templateInstance->loadCodeTemplate($this->getApplicationInstance()->buildMasterTemplateName());
+               $templateInstance->loadCodeTemplate(Registry::getRegistry()->getInstance('app')->buildMasterTemplateName());
 
                // Then compile it again
                $templateInstance->compileVariables();
index fb309963cb7be42f42f50e74590187cb67da0db3..98de1ea73244d66f2f363cf4308e64d0b52983c0 100644 (file)
@@ -3,8 +3,10 @@
 namespace CoreFramework\Menu;
 
 // Import framework stuff
+use CoreFramework\Bootstrap\FrameworkBootstrap;
 use CoreFramework\Factory\ObjectFactory;
 use CoreFramework\Object\BaseFrameworkSystem;
+use CoreFramework\Registry\Registry;
 use CoreFramework\Template\CompileableTemplate;
 
 /**
@@ -58,12 +60,12 @@ class BaseMenu extends BaseFrameworkSystem {
                $templateInstance->loadMenuTemplate('generic_menu_entries');
 
                // Get the 'command' from request instance
-               $command = $this->getApplicationInstance()->getRequestInstance()->getRequestElement('command');
+               $command = FrameworkBootstrap::getRequestInstance()->getRequestElement('command');
 
                // If page is empty, choose default
                if (empty($command)) {
                        // Use default page as none has been specified
-                       $command = $this->getConfigInstance()->getConfigEntry('default_' . $this->getApplicationInstance()->getAppShortName() . '_' . self::getResponseTypeFromSystem() . '_command');
+                       $command = $this->getConfigInstance()->getConfigEntry('default_' . Registry::getRegistry()->getInstance('app')->getAppShortName() . '_' . FrameworkBootstrap::getRequestTypeFromSystem() . '_command');
                } // END - if
 
                // Load the menu template for this page
index d21367a4bc192693d94a8eb7d40b24eba073d668..dbca8d465c84861fcf98a0ade52224852b10ab19 100644 (file)
@@ -71,7 +71,7 @@ class ???Output extends BaseOutput implements OutputStreamer, Registerable {
         * @return      void
         * @todo        0% done
         */
-       public final function output ($outStream = FALSE, $stripTags = FALSE) {
+       public final function output ($outStream = false, $stripTags = false) {
                $this->partialStub('Please implement this method. outStream()=' . strlen($outStream) . ',stripTags=' . intval($stripTags));
        }
 
index d08c13242ebdf6df5590d51100cd044d88779bf2..86d3898c9771e478c4e88f24ba72efb00d73b31b 100644 (file)
@@ -95,7 +95,7 @@ class ConsoleOutput extends BaseOutput implements OutputStreamer {
         * @param       $stripTags      Whether HTML tags shall be stripped out
         * @return      void
         */
-       public final function output ($outStream = FALSE, $stripTags = FALSE) {
+       public final function output ($outStream = false, $stripTags = false) {
                print trim($outStream) . PHP_EOL;
        }
 
index 5c2083abe105fa6fcd8c2dcccfacbaa9c3c2c7cd..8b6a9de42b4030c4e8fa4f5e1ae729adbdb197bd 100644 (file)
@@ -31,7 +31,7 @@ class BaseDebugOutput extends BaseOutput {
        /**
         * Class name for this output class is being used for logging
         */
-       private $loggerClassName = FALSE;
+       private $loggerClassName = false;
 
        /**
         * Protected constructor
index 3b6dff705046d6c41bc8a2c2a63ec418f9f9b6a8..7ad5e973ce7eddbfd59b92eb3648bc3ec48cf310 100644 (file)
@@ -3,6 +3,7 @@
 namespace CoreFramework\Debug\Output;
 
 // Import framework stuff
+use CoreFramework\Bootstrap\FrameworkBootstrap;
 use CoreFramework\Debug\Debugger;
 use CoreFramework\Output\Debug\BaseDebugOutput;
 use CoreFramework\Registry\Registerable;
@@ -61,15 +62,15 @@ class DebugConsoleOutput extends BaseDebugOutput implements Debugger, OutputStre
         * @param       $stripTags      Whether HTML tags shall be stripped out
         * @return      void
         */
-       public final function outputStream ($output, $stripTags = FALSE) {
+       public final function outputStream ($output, $stripTags = false) {
                // Strip HTML tags out?
-               if ($stripTags === TRUE) {
+               if ($stripTags === true) {
                        // Prepare the output without HTML tags
                        $output = trim(html_entity_decode(strip_tags(stripslashes($output))));
                } // END - if
 
                // Are debug times enabled?
-               if ($this->getConfigInstance()->getConfigEntry('debug_' . self::getResponseTypeFromSystem() . '_output_timings') == 'Y') {
+               if ($this->getConfigInstance()->getConfigEntry('debug_' . FrameworkBootstrap::getRequestTypeFromSystem() . '_output_timings') == 'Y') {
                        // Output it first
                        $output = $this->getPrintableExecutionTime() . $output;
                } // END - if
@@ -85,9 +86,9 @@ class DebugConsoleOutput extends BaseDebugOutput implements Debugger, OutputStre
         * @param       $stripTags      Whether HTML tags shall be stripped out
         * @return      void
         */
-       public final function output ($outStream = FALSE, $stripTags = FALSE) {
+       public final function output ($outStream = false, $stripTags = false) {
                // Empty output will be silently ignored
-               if ($outStream !== FALSE) {
+               if ($outStream !== false) {
                        $this->outputStream($outStream, $stripTags);
                } // END - if
        }
index 2ea7da73535aca82765f6d9d4be5e2327910d575..b7aed9ab0604dcec1856b8f7882f810fc064b742 100644 (file)
@@ -60,7 +60,7 @@ class DebugErrorLogOutput extends BaseDebugOutput implements Debugger, OutputStr
         * @param       $stripTags      Whether HTML tags shall be stripped out
         * @return      void
         */
-       public final function outputStream ($output, $stripTags = FALSE) {
+       public final function outputStream ($output, $stripTags = false) {
                // Split multiple lines into and array to put them out line-by-line
                $errorLines = explode(chr(10), $output);
 
@@ -84,11 +84,11 @@ class DebugErrorLogOutput extends BaseDebugOutput implements Debugger, OutputStr
         * @param       $stripTags      Whether HTML tags shall be stripped out
         * @return      void
         */
-       public final function output ($outStream = FALSE, $stripTags = FALSE) {
+       public final function output ($outStream = false, $stripTags = false) {
                // Empty output will be silently ignored
-               if ($outStream !== FALSE) {
+               if ($outStream !== false) {
                        $this->outputStream($outStream);
-               }
+               } // END - if
        }
 
        /**
index 4093172adf8973ef9635b03b0129d0d075894cb8..f63c4d6fe61fdd80496d7ac6a74cb2c0133b9a68 100644 (file)
@@ -60,7 +60,7 @@ class DebugWebOutput extends BaseDebugOutput implements Debugger, OutputStreamer
         * @param       $stripTags      Whether HTML tags shall be stripped out
         * @return      void
         */
-       public final function outputStream ($output, $stripTags = FALSE) {
+       public final function outputStream ($output, $stripTags = false) {
                // Strip out <br />
                $output = str_replace('<br />', '', $output);
                print(stripslashes($output)."<br />\n");
@@ -73,9 +73,9 @@ class DebugWebOutput extends BaseDebugOutput implements Debugger, OutputStreamer
         * @param       $stripTags      Whether HTML tags shall be stripped out
         * @return      void
         */
-       public final function output ($outStream = FALSE, $stripTags = FALSE) {
+       public final function output ($outStream = false, $stripTags = false) {
                // Empty output will be silently ignored
-               if ($outStream !== FALSE) {
+               if ($outStream !== false) {
                        $this->outputStream($outStream, $stripTags);
                } // END - if
        }
index e1299ef1157f9f12a17dea3466789dcc4a937129..44803ff14c728e754e62506899e1fd0d1a3de6aa 100644 (file)
@@ -3,6 +3,7 @@
 namespace CoreFramework\Output;
 
 // Import framework stuff
+use CoreFramework\Bootstrap\FrameworkBootstrap;
 use CoreFramework\Manager\ManageableApplication;
 use CoreFramework\Output\BaseOutput;
 use CoreFramework\Registry\Registerable;
@@ -65,7 +66,7 @@ class WebOutput extends BaseOutput implements OutputStreamer, Registerable {
                        // Set the content type
                        if (!empty($contentType)) {
                                // Set the header
-                               $applicationInstance->getResponseInstance()->addHeader('Content-type', $contentType);
+                               FrameworkBootstrap::getResponseInstance()->addHeader('Content-type', $contentType);
                        } // END - if
                } // END - if
 
@@ -80,7 +81,7 @@ class WebOutput extends BaseOutput implements OutputStreamer, Registerable {
         * @param       $stripTags      Whether HTML tags shall be stripped out
         * @return      void
         */
-       public final function output ($outStream = FALSE, $stripTags = FALSE) {
+       public final function output ($outStream = false, $stripTags = false) {
                print(stripslashes($outStream));
        }
 
index 7a84119bb681156abd146a2f71273b96f5d387ca..cc05e946aa25ac82b5fec48e2a48dfb4951d607d 100644 (file)
@@ -92,7 +92,7 @@ class XmlParser extends BaseParser implements Parseable {
                $xmlParser = xml_parser_create();
 
                // Force case-folding to on
-               xml_parser_set_option($xmlParser, XML_OPTION_CASE_FOLDING, TRUE);
+               xml_parser_set_option($xmlParser, XML_OPTION_CASE_FOLDING, true);
 
                // Set UTF-8
                xml_parser_set_option($xmlParser, XML_OPTION_TARGET_ENCODING, 'UTF-8');
index 723fca00d7ac6d1774990f5ff59df9dd65f560fc..f3eb51e355bcab64c97b1b87dc23782af2d1ed52 100644 (file)
@@ -113,7 +113,7 @@ class UserPoints extends BaseFrameworkSystem implements Registerable, BookablePo
         */
        public function ifUserHasRequiredPoints ($action) {
                // Default is that everyone is poor... ;-)
-               $hasRequired = FALSE;
+               $hasRequired = false;
 
                // Get the required points entry
                $requiredPoints = $this->getConfigInstance()->getConfigEntry($action . '_action_points');
index f371a2bbc29308db51c858153a6533eb8135cf2f..d44d198dafd2dceeff4ce4091789b2ced057d468 100644 (file)
@@ -3,6 +3,7 @@
 namespace CoreFramework\Reader\News\Console;
 
 // Import framework stuff
+use CoreFramework\Bootstrap\FrameworkBootstrap;
 use CoreFramework\Factory\Database\Wrapper\DatabaseWrapperFactory;
 use CoreFramework\Factory\ObjectFactory;
 use CoreFramework\Object\BaseFrameworkSystem;
@@ -53,9 +54,6 @@ class ConsoleNewsReader extends BaseFrameworkSystem implements ReadableNews, Reg
                // Get a new instance
                $readerInstance = new ConsoleNewsReader();
 
-               // Set request instance
-               $readerInstance->setRequestInstance($requestInstance);
-
                // Return prepared instance
                return $readerInstance;
        }
@@ -68,7 +66,7 @@ class ConsoleNewsReader extends BaseFrameworkSystem implements ReadableNews, Reg
         */
        public function initializeReader () {
                // Get 'command' for saving some calls
-               $command = $this->getRequestInstance()->getRequestElement('command');
+               $command = FrameworkBootstrap::getRequestInstance()->getRequestElement('command');
 
                // First get a wrapper instance
                $wrapperInstance = DatabaseWrapperFactory::createWrapperByConfiguredName('news_db_wrapper_class');
index 0563672f8cdf76cce3d3f24649fb54cf5dbb6e70..f2188dac42172ea2d7d97650f4d4e50d1d185b9c 100644 (file)
@@ -3,6 +3,7 @@
 namespace CoreFramework\Reader\News;
 
 // Import framework stuff
+use CoreFramework\Bootstrap\FrameworkBootstrap;
 use CoreFramework\Factory\Database\Wrapper\DatabaseWrapperFactory;
 use CoreFramework\Factory\ObjectFactory;
 use CoreFramework\Object\BaseFrameworkSystem;
@@ -52,9 +53,6 @@ class DefaultNewsReader extends BaseFrameworkSystem implements ReadableNews, Reg
                // Get a new instance
                $readerInstance = new DefaultNewsReader();
 
-               // Set request instance
-               $readerInstance->setRequestInstance($requestInstance);
-
                // Return prepared instance
                return $readerInstance;
        }
@@ -67,7 +65,7 @@ class DefaultNewsReader extends BaseFrameworkSystem implements ReadableNews, Reg
         */
        public function initializeReader () {
                // Get 'command' for saving some calls
-               $command = $this->getRequestInstance()->getRequestElement('command');
+               $command = FrameworkBootstrap::getRequestInstance()->getRequestElement('command');
 
                // First get a wrapper instance
                $wrapperInstance = DatabaseWrapperFactory::createWrapperByConfiguredName('news_db_wrapper_class');
index db2ec310c00e49e8771f841de06dc47ebfc41f4c..f2a78f20abc01da93e4994d4ab87dbd70ece8a48 100644 (file)
@@ -3,6 +3,7 @@
 namespace CoreFramework\Registration;
 
 // Import framework stuff
+use CoreFramework\Bootstrap\FrameworkBootstrap;
 use CoreFramework\Factory\ObjectFactory;
 use CoreFramework\Filter\Filterable;
 use CoreFramework\Object\BaseFrameworkSystem;
@@ -91,7 +92,7 @@ class BaseRegistration extends BaseFrameworkSystem {
         */
        protected function executePreFilters () {
                // Execute all pre filters
-               $this->preRegistrationFilter->processFilters($this->getRequestInstance(), $this->getResponseInstance());
+               $this->preRegistrationFilter->processFilters(FrameworkBootstrap::getRequestInstance(), FrameworkBootstrap::getResponseInstance());
        }
 
        /**
@@ -101,7 +102,7 @@ class BaseRegistration extends BaseFrameworkSystem {
         */
        protected function executePostFilters () {
                // Execute all post filters
-               $this->postRegistrationFilter->processFilters($this->getRequestInstance(), $this->getResponseInstance());
+               $this->postRegistrationFilter->processFilters(FrameworkBootstrap::getRequestInstance(), FrameworkBootstrap::getResponseInstance());
        }
 
 }
index 9d47a9a1509a6a5bcacbbf4df83452215e7498c5..9a2af7497f87582b2d3fbe15d9fb2e7413911d06 100644 (file)
@@ -182,7 +182,7 @@ class BaseRegistry extends BaseFrameworkSystem implements Registerable {
                } // END - foreach
 
                // Debug message
-               //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('REGISTRY[' . __METHOD__ . ':' . __LINE__ . ']: Returning entry(' . count($entry) . ')=' . print_r($entry, TRUE));
+               //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('REGISTRY[' . __METHOD__ . ':' . __LINE__ . ']: Returning entry(' . count($entry) . ')=' . print_r($entry, true));
 
                // Return it
                return $entry;
index 10b6a14eb0bd84378f34b0b99376382102d42086..48b31ceab0c1b3bdcd83f51b37fb5ed703cf1ae1 100644 (file)
@@ -38,17 +38,17 @@ class ???Request extends BaseRequest implements Requestable {
        /**
         * Creates an instance of this class and prepares it a little
         *
-        * @return      $httpInstance   An instance of this class
+        * @return      $requestInstance        An instance of this class
         */
        public final static function create???Request () {
                // Create an instance
-               $httpInstance = new ???Request();
+               $requestInstance = new ???Request();
 
                // Prepare the HTTP request data for usage
-               $httpInstance->prepareRequestData();
+               $requestInstance->prepareRequestData();
 
                // Return the prepared instance
-               return $httpInstance;
+               return $requestInstance;
        }
 
        /**
@@ -57,7 +57,7 @@ class ???Request extends BaseRequest implements Requestable {
         * @return      void
         * @todo        Needs to be implemented
         */
-       public function prepareRequestData () {
+       protected function prepareRequestData () {
                $this->partialStub("Please implement this method.");
        }
 
index 49130652be6920de855df4fd326870ad81fc034d..eaff2be05e1d65a5ca1b98eb970cb323c8052c4a 100644 (file)
@@ -27,7 +27,7 @@ use CoreFramework\Object\BaseFrameworkSystem;
  * 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 BaseRequest extends BaseFrameworkSystem {
+abstract class BaseRequest extends BaseFrameworkSystem {
        /**
         * Array for the request data
         */
@@ -35,10 +35,10 @@ class BaseRequest extends BaseFrameworkSystem {
 
        /**
         * Whether this request is valid and can be further processed. The default is
-        * valid so make sure your intercepting filters sets this attribute to FALSE
+        * valid so make sure your intercepting filters sets this attribute to false
         * when they need to intercept the data flow.
         */
-       private $requestIsValid = TRUE;
+       private $requestIsValid = true;
 
        /**
         * Protected constructor
@@ -119,12 +119,12 @@ class BaseRequest extends BaseFrameworkSystem {
        }
 
        /**
-        * Sets whether the request was valid (default: TRUE)
+        * Sets whether the request was valid (default: true)
         *
         * @param       $isValid        Whether the request is valid
         * @return      void
         */
-       public final function requestIsValid ($isValid = TRUE) {
+       public final function requestIsValid ($isValid = true) {
                $this->requestIsValid = (bool) $isValid;
        }
 
index af8f3758a34258a1af4bd38504ded99da728bd68..e83970fec48fdacf672423c1e79d33033e58b458 100644 (file)
@@ -59,11 +59,11 @@ class ConsoleRequest extends BaseRequest implements Requestable {
         *
         * @return      void
         */
-       public function prepareRequestData () {
+       protected function prepareRequestData () {
                // 'argv' and 'argc' should be there
                if ((!isset($_SERVER['argv'])) || (!isset($_SERVER['argc']))) {
                        // Maybe not right PHP mode? (needs CLI?)
-                       trigger_error(sprintf('[%s:%d]: argv/argc not set: %s', __METHOD__, __LINE__, print_r($_SERVER, TRUE)), E_USER_ERROR);
+                       trigger_error(sprintf('[%s:%d]: argv/argc not set: %s', __METHOD__, __LINE__, print_r($_SERVER, true)), E_USER_ERROR);
                } // END - if
 
                // Get the "request data" from the command-line argument list
@@ -83,7 +83,7 @@ class ConsoleRequest extends BaseRequest implements Requestable {
 
                // Try to determine next parameters
                foreach ($args as $arg) {
-                       // Seperate arguemnt name from value
+                       // Seperate argument key from value
                        $argArray = explode('=', $arg);
 
                        // Is the second one set?
index db025f0df035d8e8abca2f7f285b8b305944982f..17ae9918527c73c63d589e7d34aa9dec16695d19 100644 (file)
@@ -92,7 +92,7 @@ class HtmlRequest extends BaseRequest implements Requestable {
         *
         * @return      void
         */
-       public function prepareRequestData () {
+       protected function prepareRequestData () {
                // Copy GET then POST data
                $this->setRequestData(array_merge($_GET, $_POST));
        }
index 238267b2e98d9c3e4921d0e0f4f59dc2ce9625e6..bec3e14bbbdf62c477bba2d741de0e70da83cb51 100644 (file)
@@ -75,7 +75,7 @@ class BaseActionResolver extends BaseResolver {
         */
        public function isActionValid ($namespace, $actionName) {
                // By default nothing shall be valid
-               $isValid = FALSE;
+               $isValid = false;
 
                // Is a action set?
                if (empty($namespace)) {
@@ -100,7 +100,7 @@ class BaseActionResolver extends BaseResolver {
                // Is this class already loaded?
                if (class_exists($this->getClassName())) {
                        // This class does exist. :-)
-                       $isValid = TRUE;
+                       $isValid = true;
                } // END - if
 
                // Set action name
index e27ff3f5994d1317b28f9cd01fcb2aa5a763848d..aaee84f4f7fec8fa221fa97141c18d19ab441476 100644 (file)
@@ -65,7 +65,7 @@ class HtmlActionResolver extends BaseActionResolver implements ActionResolver {
                if (empty($actionName)) {
                        // Then thrown an exception here
                        throw new EmptyVariableException(array($resolverInstance, 'defaultAction'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
-               } elseif ($resolverInstance->isActionValid($actionName) === FALSE) {
+               } elseif ($resolverInstance->isActionValid($actionName) === false) {
                        // Invalid action found
                        throw new InvalidActionException(array($resolverInstance, $actionName), self::EXCEPTION_INVALID_ACTION);
                }
@@ -102,7 +102,7 @@ class HtmlActionResolver extends BaseActionResolver implements ActionResolver {
                } // END - if
 
                // Check if action is valid
-               if ($this->isActionValid($actionName) === FALSE) {
+               if ($this->isActionValid($actionName) === false) {
                        // This action is invalid!
                        throw new InvalidActionException(array($this, $actionName), self::EXCEPTION_INVALID_ACTION);
                } // END - if
@@ -142,7 +142,7 @@ class HtmlActionResolver extends BaseActionResolver implements ActionResolver {
                } // END - if
 
                // Check if action is valid
-               if ($this->isActionValid($actionName) === FALSE) {
+               if ($this->isActionValid($actionName) === false) {
                        // This action is invalid!
                        throw new InvalidActionException(array($this, $actionName), self::EXCEPTION_INVALID_ACTION);
                } // END - if
index 317825e6704036bad88ef38b4d2b61d116b4260b..0547b94d0b2c0e549fcd8eb3462e2d8ca2f6db09 100644 (file)
@@ -52,7 +52,7 @@ class ???Resolver extends BaseResolver implements Resolver {
                if (empty($!!!Name)) {
                        // Then thrown an exception here
                        throw new EmptyVariableException(array($resolverInstance, 'default|||'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
-               } elseif ($resolverInstance->is|||Valid($!!!Name) === FALSE) {
+               } elseif ($resolverInstance->is|||Valid($!!!Name) === false) {
                        // Invalid action found
                        throw new Invalid|||Exception(array($resolverInstance, $!!!Name), self::EXCEPTION_INVALID_ACTION);
                }
@@ -87,7 +87,7 @@ class ???Resolver extends BaseResolver implements Resolver {
                if (empty($!!!Name)) $!!!Name = $this->getConfigInstance()->getConfigEntry('default_action');
 
                // Check if action is valid
-               if ($this->is|||Valid($!!!Name) === FALSE) {
+               if ($this->is|||Valid($!!!Name) === false) {
                        // This action is invalid!
                        throw new Invalid|||Exception(array($this, $!!!Name), self::EXCEPTION_INVALID_ACTION);
                } // END - if
@@ -127,7 +127,7 @@ class ???Resolver extends BaseResolver implements Resolver {
                } // END - if
 
                // Check if action is valid
-               if ($this->is|||Valid($!!!Name) === FALSE) {
+               if ($this->is|||Valid($!!!Name) === false) {
                        // This action is invalid!
                        throw new Invalid|||Exception(array($this, $!!!Name), self::EXCEPTION_INVALID_ACTION);
                } // END - if
index 7b77bdce213f53b12349fcc938f070b1a9e79c70..a6d015cc164e6c094c1068c246c22b7545ad64ef 100644 (file)
@@ -3,6 +3,7 @@
 namespace CoreFramework\Resolver\Command;
 
 // Import framework stuff
+use CoreFramework\Bootstrap\FrameworkBootstrap;
 use CoreFramework\Command\Commandable;
 use CoreFramework\Command\InvalidCommandException;
 use CoreFramework\Factory\ObjectFactory;
@@ -10,6 +11,9 @@ use CoreFramework\Generic\EmptyVariableException;
 use CoreFramework\Request\Requestable;
 use CoreFramework\Resolver\BaseResolver;
 
+// Import SPL stuff
+use \UnexpectedValueException;
+
 /**
  * A generic command resolver class
  *
@@ -86,10 +90,8 @@ class BaseCommandResolver extends BaseResolver {
         *
         * @param       $requestInstance        An instance of a Requestable class
         * @return      $commandInstance        An instance of the resolved command
-        * @throws      InvalidCommandException                         Thrown if $commandName is
-        *                                                                                              invalid
-        * @throws      InvalidCommandInstanceException         Thrown if $commandInstance
-        *                                                                                              is an invalid instance
+        * @throws      InvalidCommandException         Thrown if $commandName is invalid
+        * @throws      UnexpectedValueException        Thrown if $commandInstance is an invalid instance
         */
        public function resolveCommandByRequest (Requestable $requestInstance) {
                // Init variables
@@ -101,11 +103,11 @@ class BaseCommandResolver extends BaseResolver {
 
                // Is the command empty? Then fall back to default command
                if (empty($commandName)) {
-                       $commandName = $this->getConfigInstance()->getConfigEntry('default_' . self::getResponseTypeFromSystem() . '_command');
+                       $commandName = $this->getConfigInstance()->getConfigEntry('default_' . FrameworkBootstrap::getRequestTypeFromSystem() . '_command');
                } // END - if
 
                // Check if command is valid
-               if ($this->isCommandValid($this->getNamespace(), $commandName) === FALSE) {
+               if ($this->isCommandValid($this->getNamespace(), $commandName) === false) {
                        // This command is invalid!
                        throw new InvalidCommandException(array($this, $commandName), self::EXCEPTION_INVALID_COMMAND);
                } // END - if
@@ -116,7 +118,7 @@ class BaseCommandResolver extends BaseResolver {
                // And validate it
                if ((!is_object($commandInstance)) || (!$commandInstance instanceof Commandable)) {
                        // This command has an invalid instance!
-                       throw new InvalidCommandInstanceException(array($this, $commandName), self::EXCEPTION_INVALID_COMMAND);
+                       throw new UnexpectedValueException(sprintf('commandInstance for commandName=%s is not object (%s) or does not implement Commandable.', $commandName, gettype($commandInstance)), self::EXCEPTION_INVALID_COMMAND);
                } // END - if
 
                // Set last command
@@ -139,11 +141,11 @@ class BaseCommandResolver extends BaseResolver {
 
                // Is the command empty? Then fall back to default command
                if (empty($commandName)) {
-                       $commandName = $this->getConfigInstance()->getConfigEntry('default_' . self::getResponseTypeFromSystem() . '_command');
+                       $commandName = $this->getConfigInstance()->getConfigEntry('default_' . FrameworkBootstrap::getRequestTypeFromSystem() . '_command');
                } // END - if
 
                // Check if command is valid
-               if ($this->isCommandValid($commandName) === FALSE) {
+               if ($this->isCommandValid($commandName) === false) {
                        // This command is invalid!
                        throw new InvalidCommandException(array($this, $commandName), self::EXCEPTION_INVALID_COMMAND);
                } // END - if
@@ -165,7 +167,7 @@ class BaseCommandResolver extends BaseResolver {
         */
        protected function isCommandValid ($namespace, $commandName) {
                // By default nothing shall be valid
-               $isValid = FALSE;
+               $isValid = false;
 
                // Is namespace and command name set?
                if (empty($namespace)) {
@@ -190,7 +192,7 @@ class BaseCommandResolver extends BaseResolver {
                // Is this class already loaded?
                if (class_exists($this->getClassName())) {
                        // This class does exist. :-)
-                       $isValid = TRUE;
+                       $isValid = true;
                } // END - if
 
                // Set command name
index daadc60a7ad4d2ef4f45748e8bb161a7d533bb5c..17a29204ba334b9b5b74b9d9610a87a3bb418c20 100644 (file)
@@ -62,7 +62,7 @@ class ConsoleCommandResolver extends BaseCommandResolver implements CommandResol
                if (empty($commandName)) {
                        // Then thrown an exception here
                        throw new EmptyVariableException(array($resolverInstance, 'commandName'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
-               } elseif ($resolverInstance->isCommandValid($commandName) === FALSE) {
+               } elseif ($resolverInstance->isCommandValid($commandName) === false) {
                        // Invalid command found
                        throw new InvalidCommandException(array($resolverInstance, $commandName), self::EXCEPTION_INVALID_COMMAND);
                }
index 3a89a5111d2c13bb83676401ebccac7ee6afb63b..06160b66f9eb826379ccebc2ebb6d1487cb25d99 100644 (file)
@@ -57,7 +57,7 @@ class Html???CommandResolver extends BaseCommandResolver implements CommandResol
                if (empty($commandName)) {
                        // Then thrown an exception here
                        throw new EmptyVariableException(array($resolverInstance, 'commandName'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
-               } elseif ($resolverInstance->isCommandValid($commandName) === FALSE) {
+               } elseif ($resolverInstance->isCommandValid($commandName) === false) {
                        // Invalid command found
                        throw new InvalidCommandException(array($resolverInstance, $commandName), self::EXCEPTION_INVALID_COMMAND);
                }
index 8635e913bfcc4791cd14ed395daf5ce841f81173..2ed244b06d56092ff76fbae00e1d5d6ea26a1185 100644 (file)
@@ -66,7 +66,7 @@ class HtmlCommandResolver extends BaseCommandResolver implements CommandResolver
                if (empty($commandName)) {
                        // Then thrown an exception here
                        throw new EmptyVariableException(array($resolverInstance, 'commandName'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
-               } elseif ($resolverInstance->isCommandValid($commandName) === FALSE) {
+               } elseif ($resolverInstance->isCommandValid($commandName) === false) {
                        // Invalid command found
                        throw new InvalidCommandException(array($resolverInstance, $commandName), self::EXCEPTION_INVALID_COMMAND);
                }
index b62109c758d1190e9fca34cb8b25b5bf3aea6fe6..d053dc5213ca2089e51241e0161cc782f9c5bd32 100644 (file)
@@ -65,7 +65,7 @@ class ImageCommandResolver extends BaseCommandResolver implements CommandResolve
                if (empty($commandName)) {
                        // Then thrown an exception here
                        throw new EmptyVariableException(array($resolverInstance, 'commandName'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
-               } elseif ($resolverInstance->isCommandValid($commandName) === FALSE) {
+               } elseif ($resolverInstance->isCommandValid($commandName) === false) {
                        // Invalid command found
                        throw new InvalidCommandException(array($resolverInstance, $commandName), self::EXCEPTION_INVALID_COMMAND);
                }
index 3f906f9fd56e0765962c2f7ee479cc404033dce2..f2a3f3ec5e9dcd2d93ea173b998c3269858e7c87 100644 (file)
@@ -7,8 +7,10 @@ use CoreFramework\Controller\DefaultControllerException;
 use CoreFramework\Controller\Controller;
 use CoreFramework\Factory\ObjectFactory;
 use CoreFramework\Generic\EmptyVariableException;
+use CoreFramework\Registry\Registry;
 use CoreFramework\Resolver\BaseResolver;
 use CoreFramework\Resolver\Controller\ControllerResolver;
+
 /**
  * A generic controller resolver class
  *
@@ -109,7 +111,7 @@ class BaseControllerResolver extends BaseResolver {
                        $resolverConfigEntry,
                        array(
                                $controllerName,
-                               $this->getApplicationInstance()
+                               Registry::getRegistry()->getInstance('app')
                        )
                );
                $controllerInstance = ObjectFactory::createObjectByName(
@@ -132,7 +134,7 @@ class BaseControllerResolver extends BaseResolver {
         */
        protected function isControllerValid ($namespace, $controllerName) {
                // By default nothing shall be valid
-               $isValid = FALSE;
+               $isValid = false;
 
                // Is namespace and controller name set?
                if (empty($namespace)) {
@@ -162,11 +164,11 @@ class BaseControllerResolver extends BaseResolver {
                $this->setClassName($className);
 
                // Try it hard to get an controller
-               while ($isValid === FALSE) {
+               while ($isValid === false) {
                        // Is this class already loaded?
                        if (class_exists($this->getClassName())) {
                                // This class does exist. :-)
-                               $isValid = TRUE;
+                               $isValid = true;
                        } elseif ($this->getClassName() != $newsControllerName) {
                                // Set default controller
                                $this->setClassName($newsControllerName);
index 191e212ce0e0924a7fd656ba364010244f4a2276..61743b58181a96f5530f22c61648d3db9042f4e1 100644 (file)
@@ -63,7 +63,7 @@ class ConsoleControllerResolver extends BaseControllerResolver implements Contro
                if (empty($controllerName)) {
                        // Then thrown an exception here
                        throw new EmptyVariableException(array($resolverInstance, 'controllerName'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
-               } elseif ($resolverInstance->isControllerValid($namespace, $controllerName) === FALSE) {
+               } elseif ($resolverInstance->isControllerValid($namespace, $controllerName) === false) {
                        // Invalid controller found
                        throw new InvalidControllerException(array($resolverInstance, $controllerName), self::EXCEPTION_INVALID_CONTROLLER);
                }
index 6eeef5999cc21ed760eae5e3b48f3d1c10edd462..bf9de8f556e175e67ae68be574a0854b556c0587 100644 (file)
@@ -63,7 +63,7 @@ class HtmlControllerResolver extends BaseControllerResolver implements Controlle
                if (empty($controllerName)) {
                        // Then thrown an exception here
                        throw new EmptyVariableException(array($resolverInstance, 'controllerName'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
-               } elseif ($resolverInstance->isControllerValid($namespace, $controllerName) === FALSE) {
+               } elseif ($resolverInstance->isControllerValid($namespace, $controllerName) === false) {
                        // Invalid controller found
                        throw new InvalidControllerException(array($resolverInstance, $controllerName), self::EXCEPTION_INVALID_CONTROLLER);
                }
index 18016bb4793ffce3118473cab6f316b7c5512a7c..7ec7c537df3cd3178aa18cd397c2abbf1e3620c9 100644 (file)
@@ -63,7 +63,7 @@ class ImageControllerResolver extends BaseControllerResolver implements Controll
                if (empty($controllerName)) {
                        // Then thrown an exception here
                        throw new EmptyVariableException(array($resolverInstance, 'controllerName'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
-               } elseif ($resolverInstance->isControllerValid($namespace, $controllerName) === FALSE) {
+               } elseif ($resolverInstance->isControllerValid($namespace, $controllerName) === false) {
                        // Invalid controller found
                        throw new InvalidControllerException(array($resolverInstance, $controllerName), self::EXCEPTION_INVALID_CONTROLLER);
                }
index bb21e39197c9ad621be7acddd1b39e104059277e..f7bbb7815bdb2a147b9fcc1b5767e199a0be21dc 100644 (file)
@@ -151,8 +151,11 @@ class BaseResponse extends BaseFrameworkSystem {
         * @return      void
         */
        public final function addFatalMessage ($messageId) {
+               // Get application instance
+               $applicationInstance = Registry::getRegistry()->getInstance('app');
+
                // Adds the resolved message id to the fatal message list
-               $this->addFatalMessagePlain($this->getApplicationInstance()->getLanguageInstance()->getMessage($messageId));
+               $this->addFatalMessagePlain($applicationInstance()->getLanguageInstance()->getMessage($messageId));
        }
 
        /**
@@ -175,8 +178,12 @@ class BaseResponse extends BaseFrameworkSystem {
         * @throws      ResponseHeadersAlreadySentException             Thrown if headers are
         *                                                                                                      already sent
         */
-       public function flushBuffer ($force = FALSE) {
-               if ((headers_sent()) && ($force === FALSE)) {
+       public function flushBuffer ($force = false) {
+               // Get application instance
+               $applicationInstance = Registry::getRegistry()->getInstance('app');
+
+               // Headers already sent?
+               if ((headers_sent()) && ($force === false)) {
                        // Headers are already sent!
                        throw new ResponseHeadersAlreadySentException($this, self::EXCEPTION_HEADERS_ALREADY_SENT);
                } elseif (!headers_sent()) {
@@ -218,7 +225,7 @@ class BaseResponse extends BaseFrameworkSystem {
                        $this->getWebOutputInstance()->output($this->responseBody);
                } else {
                        // Display all error messages
-                       $this->getApplicationInstance()->handleFatalMessages($this->getGenericArrayKey('fatal_messages', 'generic', 'message'));
+                       $applicationInstance()->handleFatalMessages($this->getGenericArrayKey('fatal_messages', 'generic', 'message'));
 
                        // Send the error messages out to the world
                        $this->getWebOutputInstance()->output($this->responseBody);
index 10b064c42c3f8e7b2b7353c5e7ec1d161440f93a..5bb281cf26b3d4e3db8a5063a0efecf11ffc85aa 100644 (file)
@@ -3,7 +3,6 @@
 namespace CoreFramework\Response;
 
 // Import framework stuff
-use CoreFramework\Manager\ManageableApplication;
 use CoreFramework\Response\Responseable;
 
 /**
@@ -48,22 +47,12 @@ class ConsoleResponse extends BaseResponse implements Responseable {
        /**
         * Creates an object of this class
         *
-        * @param       $applicationInstance    An instance of a manageable application
-        * @return      $responseInstance               A prepared instance of this class
+        * @return      $responseInstance       A prepared instance of this class
         */
-       public static final function createConsoleResponse (ManageableApplication $applicationInstance) {
+       public static final function createConsoleResponse () {
                // Get a new instance
                $responseInstance = new ConsoleResponse();
 
-               // Set the application instance
-               $responseInstance->setApplicationInstance($applicationInstance);
-
-               // Initialize the template engine here
-               $responseInstance->initTemplateEngine($applicationInstance);
-
-               // Init web output instance
-               $responseInstance->initWebOutputInstance();
-
                // Return the prepared instance
                return $responseInstance;
        }
@@ -88,7 +77,7 @@ class ConsoleResponse extends BaseResponse implements Responseable {
         * @return      void
         * @throws      ResponseHeadersAlreadySentException             If headers are already sent
         */
-       public function addCookie ($cookieName, $cookieValue, $encrypted = FALSE, $expires = NULL) {
+       public function addCookie ($cookieName, $cookieValue, $encrypted = false, $expires = NULL) {
                //* DEBUG: */ echo $cookieName.'='.$cookieValue."<br />\n";
                $this->partialStub('Naturally unimplemented in console response.');
        }
@@ -133,7 +122,7 @@ class ConsoleResponse extends BaseResponse implements Responseable {
         * @return      void
         * @throws      ResponseHeadersAlreadySentException             Thrown if headers are already sent
         */
-       public function flushBuffer ($force = FALSE) {
+       public function flushBuffer ($force = false) {
                $this->partialStub('Please implement this class.');
        }
 
index 05d5e2bee7e763c01dcd790f69ad47f57d0a497a..ea3ca7183d3aae1e94bd46b208203a83dec1a445 100644 (file)
@@ -3,7 +3,7 @@
 namespace CoreFramework\Response;
 
 // Import framework stuff
-use CoreFramework\Manager\ManageableApplication;
+use CoreFramework\Registry\Registry;
 use CoreFramework\Response\Responseable;
 
 /**
@@ -42,28 +42,18 @@ class HtmlResponse extends BaseResponse implements Responseable {
                parent::__construct(__CLASS__);
 
                // Set response type
-               $this->setResponseType('html');
+               $this->setResponseType('http');
        }
 
        /**
         * Creates an object of this class
         *
-        * @param       $applicationInstance    An instance of a manageable application
-        * @return      $responseInstance               A prepared instance of this class
+        * @return      $responseInstance       A prepared instance of this class
         */
-       public static final function createHtmlResponse (ManageableApplication $applicationInstance) {
+       public static final function createHtmlResponse () {
                // Get a new instance
                $responseInstance = new HtmlResponse();
 
-               // Set the application instance
-               $responseInstance->setApplicationInstance($applicationInstance);
-
-               // Initialize the template engine here
-               $responseInstance->initTemplateEngine($applicationInstance);
-
-               // Init web output instance
-               $responseInstance->initWebOutputInstance();
-
                // Return the prepared instance
                return $responseInstance;
        }
@@ -92,7 +82,7 @@ class HtmlResponse extends BaseResponse implements Responseable {
         * @todo        If the return statement is removed and setcookie() commented out,
         * @todo        this will send only one cookie out, the first one.
         */
-       public function addCookie ($cookieName, $cookieValue, $encrypted = FALSE, $expires = NULL) {
+       public function addCookie ($cookieName, $cookieValue, $encrypted = false, $expires = NULL) {
                //* DEBUG: */ echo $cookieName.'='.$cookieValue."<br />\n";
                // Are headers already sent?
                if (headers_sent()) {
@@ -102,7 +92,7 @@ class HtmlResponse extends BaseResponse implements Responseable {
                } // END - if
 
                // Shall we encrypt the cookie?
-               if ($encrypted === TRUE) {
+               if ($encrypted === true) {
                        // Unsupported at the moment
                        $this->partialStub('Encryption is unsupported at the moment.');
                } // END - if
@@ -140,6 +130,9 @@ class HtmlResponse extends BaseResponse implements Responseable {
         * @throws      ResponseHeadersAlreadySentException             If headers are already sent
         */
        public function redirectToConfiguredUrl ($configEntry) {
+               // Get application instance
+               $applicationInstance = Registry::getRegistry()->getInstance('app');
+
                // Is the header not yet sent?
                if (headers_sent()) {
                        // Throw an exception here
@@ -147,7 +140,7 @@ class HtmlResponse extends BaseResponse implements Responseable {
                } // END - if
 
                // Assign application data
-               $this->getTemplateInstance()->assignApplicationData($this->getApplicationInstance());
+               $this->getTemplateInstance()->assignApplicationData($applicationInstance());
 
                // Get the url from config
                $url = $this->getConfigInstance()->getConfigEntry($configEntry . '_url');
@@ -192,7 +185,7 @@ class HtmlResponse extends BaseResponse implements Responseable {
                // Is the cookie there?
                if (isset($_COOKIE[$cookieName])) {
                        // Then expire it with 20 minutes past
-                       $this->addCookie($cookieName, '', FALSE, (time() - 1200));
+                       $this->addCookie($cookieName, '', false, (time() - 1200));
 
                        // Remove it from array
                        unset($_COOKIE[$cookieName]);
@@ -209,7 +202,7 @@ class HtmlResponse extends BaseResponse implements Responseable {
                // Only update existing cookies
                if (isset($_COOKIE[$cookieName])) {
                        // Update the cookie
-                       $this->addCookie($cookieName, $_COOKIE[$cookieName], FALSE);
+                       $this->addCookie($cookieName, $_COOKIE[$cookieName], false);
                } // END - if
        }
 
index 58e3e41fb1e5879a27116da8d4ff6a3890407716..fac49db8af74771f065684927cc34bb1148ad9d0 100644 (file)
@@ -3,7 +3,7 @@
 namespace CoreFramework\Response;
 
 // Import framework stuff
-use CoreFramework\Manager\ManageableApplication;
+use CoreFramework\Registry\Registry;
 use CoreFramework\Response\Responseable;
 
 /**
@@ -48,22 +48,12 @@ class ImageResponse extends BaseResponse implements Responseable {
        /**
         * Creates an object of this class
         *
-        * @param       $applicationInstance    An instance of a manageable application
-        * @return      $responseInstance               A prepared instance of this class
+        * @return      $responseInstance       A prepared instance of this class
         */
-       public static final function createImageResponse (ManageableApplication $applicationInstance) {
+       public static final function createImageResponse () {
                // Get a new instance
                $responseInstance = new ImageResponse();
 
-               // Set the application instance
-               $responseInstance->setApplicationInstance($applicationInstance);
-
-               // Initialize the template engine here
-               $responseInstance->initTemplateEngine($applicationInstance);
-
-               // Init web output instance
-               $responseInstance->initWebOutputInstance();
-
                // Return the prepared instance
                return $responseInstance;
        }
@@ -104,7 +94,7 @@ class ImageResponse extends BaseResponse implements Responseable {
         * @todo        If the return statement is removed and setcookie() commented out,
         * @todo        this will send only one cookie out, the first one.
         */
-       public function addCookie ($cookieName, $cookieValue, $encrypted = FALSE, $expires = NULL) {
+       public function addCookie ($cookieName, $cookieValue, $encrypted = false, $expires = NULL) {
                // Are headers already sent?
                if (headers_sent()) {
                        // Throw an exception here
@@ -112,7 +102,7 @@ class ImageResponse extends BaseResponse implements Responseable {
                } // END - if
 
                // Shall we encrypt the cookie?
-               if ($encrypted === TRUE) {
+               if ($encrypted === true) {
                        // Unsupported at the moment
                        $this->partialStub('Encryption is unsupported at the moment.');
                } // END - if
@@ -150,6 +140,9 @@ class ImageResponse extends BaseResponse implements Responseable {
         * @throws      ResponseHeadersAlreadySentException             If headers are already sent
         */
        public function redirectToConfiguredUrl ($configEntry) {
+               // Get application instance
+               $applicationInstance = Registry::getRegistry()->getInstance('app');
+
                // Is the header not yet sent?
                if (headers_sent()) {
                        // Throw an exception here
@@ -157,7 +150,7 @@ class ImageResponse extends BaseResponse implements Responseable {
                } // END - if
 
                // Assign application data
-               $this->getTemplateInstance()->assignApplicationData($this->getApplicationInstance());
+               $this->getTemplateInstance()->assignApplicationData($applicationInstance());
 
                // Get the url from config
                $url = $this->getConfigInstance()->getConfigEntry($configEntry . '_url');
@@ -197,7 +190,7 @@ class ImageResponse extends BaseResponse implements Responseable {
         *                                      already sent with an exception
         * @return      void
         */
-       public function flushBuffer ($force = FALSE) {
+       public function flushBuffer ($force = false) {
                // Finish the image
                $this->getImageInstance()->finishImage();
 
@@ -224,7 +217,7 @@ class ImageResponse extends BaseResponse implements Responseable {
                // Is the cookie there?
                if (isset($_COOKIE[$cookieName])) {
                        // Then expire it with 20 minutes past
-                       $this->addCookie($cookieName, '', FALSE, (time() - 1200));
+                       $this->addCookie($cookieName, '', false, (time() - 1200));
 
                        // Remove it from array
                        unset($_COOKIE[$cookieName]);
@@ -241,7 +234,7 @@ class ImageResponse extends BaseResponse implements Responseable {
                // Only update existing cookies
                if (isset($_COOKIE[$cookieName])) {
                        // Update the cookie
-                       $this->addCookie($cookieName, $_COOKIE[$cookieName], FALSE);
+                       $this->addCookie($cookieName, $_COOKIE[$cookieName], false);
                } // END - if
        }
 
index 515d78810d6ca85f29f1e57bcea61ed4fd6beaf3..d2229285e9e2f9c4d61c32c2bf0142bd8a844432 100644 (file)
@@ -112,7 +112,7 @@ class RandomNumberGenerator extends BaseFrameworkSystem {
                $this->extraNumber = ($this->prime * $this->prime / pow(pi(), 2));
 
                // Seed mt_rand()
-               mt_srand((double) sqrt(microtime(TRUE) * 100000000 * $this->extraNumber));
+               mt_srand((double) sqrt(microtime(true) * 100000000 * $this->extraNumber));
 
                // Set the server IP to cluster
                $serverIp = 'cluster';
index ba563a77ce03170245cea61d64cacfddf73c27c1..5b00c898c381ccab73644035f657edc29c74a0ac 100644 (file)
@@ -3,6 +3,7 @@
 namespace Scrypt;
 
 // Import framework stuff
+use CoreFramework\Bootstrap\FrameworkBootstrap;
 use CoreFramework\Object\BaseFrameworkSystem;
 
 /**
@@ -95,7 +96,7 @@ abstract class Scrypt extends BaseFrameworkSystem
                 $buffer_valid = true;
             }
         }
-        if (!$buffer_valid && BaseFrameworkSystem::isReadableFile('/dev/urandom')) {
+        if (!$buffer_valid && FrameworkBootstrap::isReadableFile('/dev/urandom')) {
             $f = fopen('/dev/urandom', 'r');
             $read = static::strlen($buffer);
             while ($read < $length) {
index a054afcaf338f966013f7bcb0138e0005aa04ade..be0a4c3adaea49ab5b01d991017575b6c5a8c76e 100644 (file)
@@ -53,9 +53,9 @@ class BaseStacker extends BaseFrameworkSystem {
         * @return      void
         * @throws      AlreadyInitializedStackerException      If the stack is already initialized
         */
-       public function initStack ($stackerName, $forceReInit = FALSE) {
+       public function initStack ($stackerName, $forceReInit = false) {
                // Is the stack already initialized?
-               if (($forceReInit === FALSE) && ($this->isStackInitialized($stackerName))) {
+               if (($forceReInit === false) && ($this->isStackInitialized($stackerName))) {
                        // Then throw the exception
                        throw new AlreadyInitializedStackerException(array($this, $stackerName, $forceReInit), self::EXCEPTION_STACKER_ALREADY_INITIALIZED);
                } // END - if
@@ -69,7 +69,7 @@ class BaseStacker extends BaseFrameworkSystem {
         *
         * @return      void
         */
-       public function initStacks (array $stacks, $forceReInit = FALSE) {
+       public function initStacks (array $stacks, $forceReInit = false) {
                // "Walk" through all (more will be added as needed
                foreach ($stacks as $stackerName) {
                        // Init this stack
index b81d140d11e908b492883995b2e478e5e7cabf37..cf6614ee8b5798f8ac8512507f61f0595dbaa975 100644 (file)
@@ -105,7 +105,7 @@ class BaseFileStack extends BaseStacker {
                $this->getIteratorInstance()->setHeader($header);
 
                // Check if the array has only 3 elements
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] header(%d)=%s', __METHOD__, __LINE__, count($header), print_r($header, TRUE)));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] header(%d)=%s', __METHOD__, __LINE__, count($header), print_r($header, true)));
                assert(count($header) == 3);
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] Passed assert().', __METHOD__, __LINE__));
 
@@ -156,7 +156,7 @@ class BaseFileStack extends BaseStacker {
                );
 
                // Write it to disk (header is always at seek position 0)
-               $this->getIteratorInstance()->writeData(0, $header, FALSE);
+               $this->getIteratorInstance()->writeData(0, $header, false);
 
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] EXIT!', __METHOD__, __LINE__));
        }
@@ -236,7 +236,7 @@ class BaseFileStack extends BaseStacker {
                } // END - if
 
                // Debug message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . '] stackerName=' . $stackerName . ',value[' . gettype($value) . ']=' . print_r($value, TRUE));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . '] stackerName=' . $stackerName . ',value[' . gettype($value) . ']=' . print_r($value, true));
 
                // No objects/resources are allowed as their serialization takes to long
                assert(!is_object($value));
@@ -342,8 +342,8 @@ class BaseFileStack extends BaseStacker {
         */
        protected function isStackFull ($stackerName) {
                // File-based stacks will only run full if the disk space is low.
-               // @TODO Please implement this, returning FALSE
-               $isFull = FALSE;
+               // @TODO Please implement this, returning false
+               $isFull = false;
 
                // Return result
                return $isFull;
@@ -372,7 +372,7 @@ class BaseFileStack extends BaseStacker {
         * @return      void
         * @throws      UnsupportedOperationException   This method is not (and maybe never will be) supported
         */
-       public function initStack ($stackerName, $forceReInit = FALSE) {
+       public function initStack ($stackerName, $forceReInit = false) {
                throw new UnsupportedOperationException(array($this, __FUNCTION__, $this->getIteratorInstance()->getPointerInstance()), self::EXCEPTION_UNSPPORTED_OPERATION);
        }
 
@@ -382,7 +382,7 @@ class BaseFileStack extends BaseStacker {
         * @return      void
         * @throws      UnsupportedOperationException   This method is not (and maybe never will be) supported
         */
-       public function initStacks (array $stacks, $forceReInit = FALSE) {
+       public function initStacks (array $stacks, $forceReInit = false) {
                throw new UnsupportedOperationException(array($this, __FUNCTION__, $this->getIteratorInstance()->getPointerInstance()), self::EXCEPTION_UNSPPORTED_OPERATION);
        }
 
@@ -531,7 +531,7 @@ class BaseFileStack extends BaseStacker {
         * @return      void
         * @throws      UnsupportedOperationException   This method is not (and maybe never will be) supported
         */
-       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[]=%s,flushHeader=%d', __METHOD__, __LINE__, $seekPosition, gettype($data), intval($flushHeader)));
                throw new UnsupportedOperationException(array($this, __FUNCTION__, $this->getIteratorInstance()->getPointerInstance()), self::EXCEPTION_UNSPPORTED_OPERATION);
        }
@@ -545,7 +545,7 @@ class BaseFileStack extends BaseStacker {
         * @throws      UnsupportedOperationException   This method is not (and maybe never will be) supported
         */
        public function writeValueToFile ($groupId, $value) {
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] groupId=%s,value[%s]=%s', __METHOD__, __LINE__, $groupId, gettype($value), print_r($value, TRUE)));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('[%s:%d:] groupId=%s,value[%s]=%s', __METHOD__, __LINE__, $groupId, gettype($value), print_r($value, true)));
                throw new UnsupportedOperationException(array($this, __FUNCTION__, $this->getIteratorInstance()->getPointerInstance()), self::EXCEPTION_UNSPPORTED_OPERATION);
        }
 
index cb0712578ad38c5e73e86b80dbf27cd034d45340..cebf170d3056a6e1279c54d971381853fb98922e 100644 (file)
@@ -3,6 +3,7 @@
 namespace CoreFramework\Template\Engine;
 
 // Import framework stuff
+use CoreFramework\Bootstrap\FrameworkBootstrap;
 use CoreFramework\Factory\ObjectFactory;
 use CoreFramework\Generic\EmptyVariableException;
 use CoreFramework\Manager\ManageableApplication;
@@ -149,12 +150,12 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
        /**
         * Language support is enabled by default
         */
-       private $languageSupport = TRUE;
+       private $languageSupport = true;
 
        /**
         * XML compacting is disabled by default
         */
-       private $xmlCompacting = FALSE;
+       private $xmlCompacting = false;
 
        // Exception codes for the template engine
        const EXCEPTION_TEMPLATE_TYPE_IS_UNEXPECTED   = 0x110;
@@ -184,14 +185,14 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
         *
         * @param       $variableName   The variable we are looking for
         * @param       $variableGroup  Optional variable group to look in
-        * @return      $index                  FALSE means not found, >=0 means found on a specific index
+        * @return      $index                  false means not found, >=0 means found on a specific index
         */
        private function getVariableIndex ($variableName, $variableGroup = NULL) {
                // Replace all dashes to underscores to match variables with configuration entries
                $variableName = trim(self::convertDashesToUnderscores($variableName));
 
                // First everything is not found
-               $found = FALSE;
+               $found = false;
 
                // If the stack is NULL, use the current group
                if (is_null($variableGroup)) {
@@ -279,7 +280,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
                $found = $this->getVariableIndex($variableName, $variableGroup);
 
                // Is the variable found?
-               if ($found !== FALSE) {
+               if ($found !== false) {
                        // Read it
                        $content = $this->getVariableValue($variableGroup, $found);
                } // END - if
@@ -330,13 +331,13 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
         * @param       $add            Whether add this group
         * @return      void
         */
-       public function setVariableGroup ($groupName, $add = TRUE) {
+       public function setVariableGroup ($groupName, $add = true) {
                // Set group name
                //* DEBIG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(__METHOD__.': currGroup=' . $groupName);
                $this->currGroup = $groupName;
 
                // Skip group 'general'
-               if (($groupName != 'general') && ($add === TRUE)) {
+               if (($groupName != 'general') && ($add === true)) {
                        $this->variableGroups[$groupName] = 'OK';
                } // END - if
        }
@@ -394,7 +395,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
                $index = $this->getVariableIndex($variableName);
 
                // Is the variable set?
-               if ($index === FALSE) {
+               if ($index === false) {
                        // Unset variables cannot be modified
                        throw new NoVariableException(array($this, $variableName, $value), self::EXCEPTION_VARIABLE_IS_MISSING);
                } // END - if
@@ -433,7 +434,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
                $index = $this->getVariableIndex($variableName);
 
                // Is the variable set?
-               if ($index === FALSE) {
+               if ($index === false) {
                        // Is the stack there?
                        if (!isset($this->varStack[$variableGroup])) {
                                // Then initialize it here
@@ -778,7 +779,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
                preg_match_all('/\$(\w+)(\[(\w+)\])?/', $rawData, $variableMatches);
 
                // Debug message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-TEMPLATE[' . __METHOD__ . ':' . __LINE__ . ']:rawData(' . strlen($rawData) . ')=' . $rawData . ',variableMatches=' . print_r($variableMatches, TRUE));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-TEMPLATE[' . __METHOD__ . ':' . __LINE__ . ']:rawData(' . strlen($rawData) . ')=' . $rawData . ',variableMatches=' . print_r($variableMatches, true));
 
                // Did we find some variables?
                if ((is_array($variableMatches)) && (count($variableMatches) == 4) && (count($variableMatches[0]) > 0)) {
@@ -830,7 +831,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
                                //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-TEMPLATE[' . __METHOD__ . ':' . __LINE__ . ']:template=' . $template);
 
                                // Template not found, but maybe variable assigned?
-                               if ($this->getVariableIndex($template) !== FALSE) {
+                               if ($this->getVariableIndex($template) !== false) {
                                        // Use that content here
                                        $this->loadedRawData[$template] = $this->readVariable($template);
 
@@ -908,7 +909,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
                        $foundIndex = array_search($template, $templateMatches[1]);
 
                        // Lookup the matching template replacement
-                       if (($foundIndex !== FALSE) && (isset($templateMatches[0][$foundIndex]))) {
+                       if (($foundIndex !== false) && (isset($templateMatches[0][$foundIndex]))) {
 
                                // Get the current raw template
                                $rawData = $this->getRawTemplateData();
@@ -1017,10 +1018,10 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
                                $foundIndex = array_search($template, $templateMatches[1]);
 
                                // Lookup the matching variable data
-                               if (($foundIndex !== FALSE) && (isset($templateMatches[3][$foundIndex]))) {
+                               if (($foundIndex !== false) && (isset($templateMatches[3][$foundIndex]))) {
                                        // Split it up with another reg. exp. into variable=value pairs
                                        preg_match_all($this->regExpVarValue, $templateMatches[3][$foundIndex], $varMatches);
-                                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-TEMPLATE[' . __METHOD__ . ':' . __LINE__ . ']:varMatches=' . print_r($varMatches, TRUE));
+                                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-TEMPLATE[' . __METHOD__ . ':' . __LINE__ . ']:varMatches=' . print_r($varMatches, true));
 
                                        // Assign all variables
                                        $this->assignAllVariables($varMatches);
@@ -1122,7 +1123,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
                $index = $this->getVariableIndex($variableName);
 
                // Was it found?
-               if ($index === FALSE) {
+               if ($index === false) {
                        // Add it to the stack
                        //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-TEMPLATE[' . __METHOD__ . ':' . __LINE__ . ']:ADD: ' . $variableName . '[' . gettype($value) . ']=' . $value);
                        $this->addVariable($variableName, $value);
@@ -1145,7 +1146,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
                $index = $this->getVariableIndex($variableName, $variableGroup);
 
                // Was it found?
-               if ($index !== FALSE) {
+               if ($index !== false) {
                        // Remove this variable
                        //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-TEMPLATE[' . __METHOD__ . ':' . __LINE__ . ']:UNSET: variableGroup=' . $variableGroup . ',variableName=' . $variableName . ',index=' . $index);
                        $this->unsetVariableStackOffset($index, $variableGroup);
@@ -1232,7 +1233,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
         */
        public function loadCodeTemplate ($template) {
                // Set template type
-               $this->setTemplateType($this->getConfigInstance()->getConfigEntry('code_' . self::getResponseTypeFromSystem() . '_template_type'));
+               $this->setTemplateType($this->getConfigInstance()->getConfigEntry('code_' . FrameworkBootstrap::getRequestTypeFromSystem() . '_template_type'));
 
                // Load the special template
                $this->loadTemplate($template);
@@ -1271,7 +1272,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
                // Iterate through all general variables
                foreach ($this->getVarStack('general') as $index => $currVariable) {
                        // Compile the value
-                       $value = $this->compileRawCode($this->readVariable($currVariable['name']), TRUE);
+                       $value = $this->compileRawCode($this->readVariable($currVariable['name']), true);
 
                        // Debug message
                        //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-TEMPLATE[' . __METHOD__ . ':' . __LINE__ . ']: name=' . $currVariable['name'] . ',value=' . $value);
@@ -1328,7 +1329,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
                        );
 
                        // This loop does remove the backslashes (\) in PHP parameters
-                       while (strpos($eval, $this->codeBegin) !== FALSE) {
+                       while (strpos($eval, $this->codeBegin) !== false) {
                                // Get left part before "<?"
                                $evalLeft = substr($eval, 0, strpos($eval, $this->codeBegin));
 
@@ -1362,7 +1363,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
                        // Goes something wrong?
                        if ((!isset($result)) || (empty($result))) {
                                // Output eval command
-                               self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('Failed eval() code: <pre>%s</pre>', $this->markupCode($eval, TRUE)), TRUE);
+                               self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('Failed eval() code: <pre>%s</pre>', $this->markupCode($eval, true)), true);
 
                                // Output backtrace here
                                $this->debugBackTrace();
@@ -1391,12 +1392,12 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
         */
        public function compileTemplate () {
                // Get code type to make things shorter
-               $codeType = $this->getConfigInstance()->getConfigEntry('code_' . self::getResponseTypeFromSystem() . '_template_type');
+               $codeType = $this->getConfigInstance()->getConfigEntry('code_' . FrameworkBootstrap::getRequestTypeFromSystem() . '_template_type');
 
                // We will only work with template type "code" from configuration
                if (substr($this->getTemplateType(), 0, strlen($codeType)) != $codeType) {
                        // Abort here
-                       throw new UnexpectedTemplateTypeException(array($this, $this->getTemplateType(), $this->getConfigInstance()->getConfigEntry('code_' . self::getResponseTypeFromSystem() . '_template_type')), self::EXCEPTION_TEMPLATE_TYPE_IS_UNEXPECTED);
+                       throw new UnexpectedTemplateTypeException(array($this, $this->getTemplateType(), $this->getConfigInstance()->getConfigEntry('code_' . FrameworkBootstrap::getRequestTypeFromSystem() . '_template_type')), self::EXCEPTION_TEMPLATE_TYPE_IS_UNEXPECTED);
                } // END - if
 
                // Get the raw data.
@@ -1412,7 +1413,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
                preg_match_all($this->regExpCodeTags, $rawData, $templateMatches);
 
                // Debug message
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-TEMPLATE[' . __METHOD__ . ':' . __LINE__ . ']:templateMatches=' . print_r($templateMatches , TRUE));
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-TEMPLATE[' . __METHOD__ . ':' . __LINE__ . ']:templateMatches=' . print_r($templateMatches , true));
 
                // Analyze the matches array
                if ((is_array($templateMatches)) && (count($templateMatches) == 4) && (count($templateMatches[0]) > 0)) {
@@ -1476,13 +1477,13 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
         * @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) {
                // Find the variables
                //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-TEMPLATE[' . __METHOD__ . ':' . __LINE__ . ']:rawCode=<pre>' . htmlentities($rawCode) . '</pre>');
                preg_match_all($this->regExpVarValue, $rawCode, $varMatches);
 
                // Compile all variables
-               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-TEMPLATE[' . __METHOD__ . ':' . __LINE__ . ']:<pre>' . print_r($varMatches, TRUE) . '</pre>');
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-TEMPLATE[' . __METHOD__ . ':' . __LINE__ . ']:<pre>' . print_r($varMatches, true) . '</pre>');
                foreach ($varMatches[0] as $match) {
                        // Add variable tags around it
                        $varCode = '{?' . $match . '?}';
@@ -1491,12 +1492,12 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
                        //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-TEMPLATE[' . __METHOD__ . ':' . __LINE__ . ']:varCode=' . $varCode);
 
                        // Is the variable found in code? (safes some calls)
-                       if (strpos($rawCode, $varCode) !== FALSE) {
+                       if (strpos($rawCode, $varCode) !== false) {
                                // Debug message
                                //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('BASE-TEMPLATE[' . __METHOD__ . ':' . __LINE__ . ']: match=' . $match . ',rawCode[' . gettype($rawCode) . ']=' . $rawCode);
 
                                // Use $match as new value or $value from read variable?
-                               if ($setMatchAsCode === TRUE) {
+                               if ($setMatchAsCode === true) {
                                        // Insert match
                                        $rawCode = str_replace($varCode, $match, $rawCode);
                                } else {
@@ -1575,7 +1576,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
         * @param       $languageSupport        New language support setting
         * @return      void
         */
-       public final function enableLanguageSupport ($languageSupport = TRUE) {
+       public final function enableLanguageSupport ($languageSupport = true) {
                $this->languageSupport = (bool) $languageSupport;
        }
 
@@ -1594,7 +1595,7 @@ class BaseTemplateEngine extends BaseFrameworkSystem {
         * @param       $xmlCompacting  New XML compacting setting
         * @return      void
         */
-       public final function enableXmlCompacting ($xmlCompacting = TRUE) {
+       public final function enableXmlCompacting ($xmlCompacting = true) {
                $this->xmlCompacting = (bool) $xmlCompacting;
        }
 
index 316f1518b8b4f41f011ff397950581d1ce4613b7..cded4f951f98b64b3d10fdf3065143ca63bc18b4 100644 (file)
@@ -366,7 +366,7 @@ class MenuTemplateEngine extends BaseTemplateEngine implements CompileableTempla
         */
        private function initMenu ($templateDependency = '') {
                // Get web template engine
-               $this->setTemplateInstance(ObjectFactory::createObjectByConfiguredName('html_template_class', array($this->getApplicationInstance())));
+               $this->setTemplateInstance(ObjectFactory::createObjectByConfiguredName('html_template_class', array(Registry::getRegistry()->getInstance('app'))));
 
                // Handle the dependency template
                $this->handleTemplateDependency('menu', $templateDependency);
index f8b945f9e704e01ea02ddc17ad9bcec4a0f39eaa..34761fefd06821934e3b89df9984886336af6959 100644 (file)
@@ -130,7 +130,7 @@ class BaseUser extends BaseFrameworkSystem implements Updateable {
         */
        public function ifUsernameExists () {
                // By default the username does not exist
-               $exists = FALSE;
+               $exists = false;
 
                // Is a previous result there?
                if (!$this->getResultInstance() instanceof SearchableResult) {
@@ -160,7 +160,7 @@ class BaseUser extends BaseFrameworkSystem implements Updateable {
                // Search for it
                if ($this->getResultInstance()->next()) {
                        // Entry found
-                       $exists = TRUE;
+                       $exists = true;
                } // END - if
 
                // Return the status
@@ -174,7 +174,7 @@ class BaseUser extends BaseFrameworkSystem implements Updateable {
         */
        public function ifEmailAddressExists () {
                // By default the email does not exist
-               $exists = FALSE;
+               $exists = false;
 
                // Is a previous result there?
                if (!$this->getResultInstance() instanceof SearchableResult) {
@@ -204,7 +204,7 @@ class BaseUser extends BaseFrameworkSystem implements Updateable {
                // Search for it
                if ($this->getResultInstance()->next()) {
                        // Entry found
-                       $exists = TRUE;
+                       $exists = true;
 
                        // Is the username set?
                        if ($this->getUserName() == '') {
@@ -229,7 +229,7 @@ class BaseUser extends BaseFrameworkSystem implements Updateable {
         */
        public function ifPasswordHashMatches (Requestable $requestInstance) {
                // By default nothing matches... ;)
-               $matches = FALSE;
+               $matches = false;
 
                // Is a previous result there?
                if ((!$this->getResultInstance() instanceof SearchableResult) || ($this->getResultInstance()->count() == 0)) {
index ac73f177c52d21fd5c51911e40d1c04801ed072d..704767298c8b02179544f1985d71562beff82f73 100644 (file)
@@ -91,10 +91,10 @@ class Guest extends BaseUser implements ManageableGuest, Registerable {
                $userInstance->setUserName($userName);
 
                // Check if username exists
-               if ($userInstance->ifUsernameExists() === FALSE) {
+               if ($userInstance->ifUsernameExists() === false) {
                        // Throw an exception here
                        throw new UsernameMissingException(array($userInstance, $userName), self::EXCEPTION_USERNAME_NOT_FOUND);
-               } elseif ($userInstance->isGuest() === FALSE) {
+               } elseif ($userInstance->isGuest() === false) {
                        // Sanity check on 'guest' status failed
                        throw new UserNoGuestException(array($userInstance, $userName), self::EXCEPTION_USER_NOT_GUEST_STATUS);
                }
index 088a965a844cb99a4cf7701eddb7247b6cdde48a..94a37639eb0c85b5c331771ebd759dac289026fb 100644 (file)
@@ -60,10 +60,10 @@ class Member extends BaseUser implements ManageableMember, Registerable {
                $userInstance->setUserName($userName);
 
                // Check if username exists
-               if ($userInstance->ifUsernameExists() === FALSE) {
+               if ($userInstance->ifUsernameExists() === false) {
                        // Throw an exception here
                        throw new UsernameMissingException(array($userInstance, $userName), self::EXCEPTION_USERNAME_NOT_FOUND);
-               } elseif ($userInstance->isGuest() === TRUE) {
+               } elseif ($userInstance->isGuest() === true) {
                        // User should not be a guest here
                        throw new UnexpectedGuestAccountException(array($userInstance, $userName), self::EXCEPTION_USER_IS_GUEST);
                }
index 866e59f7d0b2f028ed5c7b84cebd34be6ab1dfbe..174e8763a7286c10565841d5824ff5cb8f193cd2 100644 (file)
@@ -126,7 +126,7 @@ abstract class FrameworkException extends ReflectionException {
 
                        // Are there arguments?
                        if ((isset($dbgInfo['args'])) && (is_array($dbgInfo['args'])) && (isset($dbgInfo['args'][0]))) {
-                               //* DEBUG: */ echo $dbgIndex.": <pre>".htmlentities(print_r($dbgInfo['args'], TRUE))."</pre>";
+                               //* DEBUG: */ echo $dbgIndex.": <pre>".htmlentities(print_r($dbgInfo['args'], true))."</pre>";
                                $info = '';
                                foreach ($dbgInfo['args'] as $debug) {
                                        // Add only non-array elements
diff --git a/framework/main/exceptions/dns/.htaccess b/framework/main/exceptions/dns/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/framework/main/exceptions/dns/class_UnknownHostnameException.php b/framework/main/exceptions/dns/class_UnknownHostnameException.php
new file mode 100644 (file)
index 0000000..10fa21b
--- /dev/null
@@ -0,0 +1,50 @@
+<?php
+// Own namespace
+namespace CoreFramework\Dns;
+
+// Import framework stuff
+use CoreFramework\Generic\FrameworkException;
+
+/**
+ * This exception is thrown when a host name cannot be resolved to an IP address
+ *
+ * @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/>.
+ */
+class UnknownHostnameException extends FrameworkException {
+       /**
+        * The constructor
+        *
+        * @param       $msgArray       Message array holding all needed data
+        * @param       $code           Code number for the exception
+        * @return      void
+        */
+       public function __construct (array $msgArray, $code) {
+               // Add a message around the host name
+               $message = sprintf('[%s:%d] Host name "%s" cannot be resolved (NXDOMAIN).',
+                       $msgArray[0]->__toString(),
+                       $this->getLine(),
+                       $msgArray[1]
+               );
+
+               // Call parent constructor
+               parent::__construct($message, $code);
+       }
+
+}
index 851f2ce8b065c54eb8776803cc233d8944daf4fe..0ddf02784bf62bc0ff69e5ebb360a22bcdcde284 100644 (file)
@@ -6,7 +6,7 @@ namespace CoreFramework\Deprecated;
 use CoreFramework\Generic\FrameworkException;
 
 /**
- * An exception thrown when the form name is invalid (set to FALSE)
+ * An exception thrown when the form name is invalid (set to false)
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
index f4d171b19d8c2ac6f0a85f2034a340497f06a5f7..7d6dceec926b2c790d8a6cc64b29a822d57f79e9 100644 (file)
@@ -1,48 +1,2 @@
 <?php
-// Own namespace
-namespace CoreFramework\Deprecated;
-
-/**
- * This exception is thrown when a command instance is invalid
- *
- * @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 Don't use this anymore
- *
- * 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/>.
- */
-class InvalidCommandInstanceException extends FrameworkException {
-       /**
-        * The constructor
-        *
-        * @param       $message        Message from the exception
-        * @param       $code           Code number for the exception
-        * @return      void
-        */
-       public function __construct (array $msgArray, $code) {
-               // Add a message around the missing class
-               $message = sprintf('[%s:%d] Invalid command %s detected.',
-                       $msgArray[0]->__toString(),
-                       $this->getLine(),
-                       $msgArray[1]
-               );
-
-               // Call parent constructor
-               parent::__construct($message, $code);
-       }
-
-}
+// @DEPRECATED
index 5a7a530511c1ebb3da1f4c653bd340c2eab033d6..d7cb389fc3418f8c272b59ad4662f97e561392ef 100644 (file)
@@ -35,11 +35,25 @@ use CoreFramework\Template\CompileableTemplate;
  */
 interface ManageableApplication extends FrameworkInterface {
        /**
-        * Launches the application
+        * 1) Setups application data
         *
         * @return      void
         */
-       function entryPoint ();
+       function setupApplicationData ();
+
+       /**
+        * 2) Does initial stuff before starting the application
+        *
+        * @return      void
+        */
+       function initApplication ();
+
+       /**
+        * 3) Launches the application
+        *
+        * @return      void
+        */
+       function launchApplication ();
 
        /**
         * Handle the indexed array of fatal messages and puts them out in an
index 3677e62b58dc442ae4a30f5a37cca74010ce59cb..882714b9cfe155bf786667ee3fc9427334c461b4 100644 (file)
@@ -144,7 +144,7 @@ interface Block extends FrameworkInterface {
         * @param       $flushHeader    Whether to flush the header (default: flush)
         * @return      void
         */
-       function writeData ($seekPosition, $data, $flushHeader = TRUE);
+       function writeData ($seekPosition, $data, $flushHeader = true);
 
        /**
         * Searches for next suitable gap the given length of data can fit in
index 0506238f892d39dc5e1738695d12df6d6c7a04f3..d76e0f6fbe5bd9c6a7d06c9d9fe30abd46723d30 100644 (file)
@@ -151,27 +151,27 @@ interface Criteria extends FrameworkInterface {
        function addConfiguredCriteria ($criteriaKey, $configEntry, $criteriaType = 'default');
 
        /**
-        * 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
         */
        function getCriteriaElemnent ($criteriaKey, $criteriaType = 'default');
 
        /**
-        * 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
         */
        function getCriteriaChoiceElemnent ($criteriaKey);
 
        /**
-        * 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
         */
        function getCriteriaExcludeElemnent ($criteriaKey);
 
index 441663f6335258425b764acdf4adcc237eab27fd..76a546e6fd4fb4ce359606bef4b613d83aa056b2 100644 (file)
@@ -39,7 +39,7 @@ interface Cryptable extends FrameworkInterface {
         * @param       $withFixed      Whether to include a fixed salt (not recommended in p2p applications)
         * @return      $hashed         The hashed and salted string
         */
-       function hashString ($str, $oldHash = '', $withFixed = TRUE);
+       function hashString ($str, $oldHash = '', $withFixed = true);
 
        /**
         * Encrypt the string with fixed salt
index 7ee86072ac59ad00edea7046f047525f0c37d31a..d1fbc901b5787639dd33d992340b036a7c0f5339 100644 (file)
@@ -35,6 +35,6 @@ interface Debugger extends FrameworkInterface {
         * @param       $stripTags      Whether HTML tags shall be stripped out
         * @return      void
         */
-       function outputStream ($output, $stripTags = FALSE);
+       function outputStream ($output, $stripTags = false);
 
 }
index 0ef649d9066be852a2340dd5fa4a164d5a131d26..c534338df663d52c97ad94a4e57a949eee7b9090 100644 (file)
@@ -35,6 +35,6 @@ interface OutputStreamer extends StreamableOutput {
         * @param       $stripTags      Whether HTML tags shall be stripped out
         * @return      void
         */
-       function output ($outStream = FALSE, $stripTags = FALSE);
+       function output ($outStream = false, $stripTags = false);
 
 }
index 9b934d19190985a5f0b7b58c330354c363953076..3e83cd54056d84347c8635f2629e9e5971b02c02 100644 (file)
@@ -33,7 +33,7 @@ interface OutputPointer extends StreamableOutput, FilePointer {
         * Write data to a file pointer
         *
         * @param       $dataStream             The data stream we shall write to the file
-        * @return      mixed                   Number of writes bytes or FALSE on error
+        * @return      mixed                   Number of writes bytes or false on error
         * @throws      NullPointerException    If the file pointer instance
         *                                                                      is not set by setPointer()
         * @throws      InvalidResourceException        If there is being set
@@ -46,7 +46,7 @@ interface OutputPointer extends StreamableOutput, FilePointer {
         *
         * @param       $seekPosition   Seek position in file
         * @param       $data                   Data to be written
-        * @return      mixed                   Number of writes bytes or FALSE on error
+        * @return      mixed                   Number of writes bytes or false on error
         */
        function writeAtPosition ($seedPosition, $data);
 
index f97063322401d195dc6a7de20e88e4b0fceafd1a..0b45bf6a4f6f85866630e0b0a44d5003df60a2b8 100644 (file)
@@ -45,7 +45,7 @@ interface InputOutputPointer extends InputPointer, OutputPointer {
 
        /**
         * Checks wether the current entry is valid (not at the end of the file).
-        * This method will return TRUE if an emptied (nulled) entry has been found.
+        * This method will return true if an emptied (nulled) entry has been found.
         *
         * @return      $isValid        Whether the next entry is valid
         */
index 17a93cb173ceaa57ff37e84d9eb09f47706a6454..45f49c6ea9c3f6a3f214fd56c20c3aa7c014803c 100644 (file)
@@ -152,7 +152,7 @@ interface SeekableWritableFileIterator extends SeekableIterator {
         * @param       $flushHeader    Whether to flush the header (default: flush)
         * @return      void
         */
-       function writeData ($seekPosition, $data, $flushHeader = TRUE);
+       function writeData ($seekPosition, $data, $flushHeader = true);
 
        /**
         * Getter for seek position
index a542f312667805424d01aba303c3a6ae5d6e8a74..badabef87d80c16fb9d64b3759ed230a65bfd227 100644 (file)
@@ -31,7 +31,7 @@ use CoreFramework\Registry\Registerable;
 interface RegisterableSocket extends Registerable {
        /**
         * Checks whether given socket resource is registered. If $socketResource is
-        * FALSE only the instance will be checked.
+        * false only the instance will be checked.
         *
         * @param       $infoInstance           An instance of a ShareableInfo class
         * @param       $socketResource         A valid socket resource
index 24b295a941fee9280cd60b70e8224bb44e644dd8..7639954913b985929410b99b9ae476ae6b9dd553 100644 (file)
@@ -28,19 +28,11 @@ use CoreFramework\Generic\FrameworkInterface;
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
 interface Requestable extends FrameworkInterface {
-       /**
-        * Prepares the request data for usage
-        *
-        * @return      void
-        */
-       function prepareRequestData ();
-
        /**
         * Checks whether a request element is set
         *
         * @param       $element        Name of the request element we want to check
         * @return      $isSet          Whether the request element is set
-        * @throws      MissingArrayElementsException   Thrown if a request element is not set
         */
        function isRequestElementSet ($element);
 
@@ -54,55 +46,42 @@ interface Requestable extends FrameworkInterface {
        function getRequestElement ($element);
 
        /**
-        * Wrapper method for array_key() function for the request data array
-        *
-        * @return      $array  An array containing all array keys to return
-        */
-       function getParameterNames ();
-
-       /**
-        * Getter for a header element or 'null' if header was not found
+        * Setter for request elements
         *
-        * @param       $headerName             Name of the header
-        * @return      $headerValue    Value of the header or 'null' if not found
-        */
-       function getHeaderElement ($headerName);
-
-       /**
-        * Sets whether the request was valid (default: TRUE)
-        *
-        * @param       $isValid        Whether the request is valid
+        * @param       $element        Request element to se
+        * @param       $value          Value to set
         * @return      void
         */
-       function requestIsValid ($isValid = TRUE);
+       function setRequestElement ($element, $value);
 
        /**
-        * Reads a cookie and returns it's value or null if not found
+        * Setter for request data array
         *
-        * @param       $cookieName             Name of cookie we shall read
-        * @return      $cookieValue    Value of cookie or null if not found
+        * @param       $requestData    Request element to se
+        * @return      void
         */
-       function readCookie ($cookieName);
+       function setRequestData (array $requestData);
 
        /**
-        * Checks if the request method is GET.
+        * Wrapper method for array_key() function for the request data array
         *
-        * @return      $isGet  Whether the request method is GET
+        * @return      $array  An array containing all array keys to return
         */
-       function isGetRequestMethod ();
+       function getParameterNames ();
 
        /**
-        * Checks if the request method is HEAD.
+        * Sets whether the request was valid (default: true)
         *
-        * @return      $isHead         Whether the request method is HEAD
+        * @param       $isValid        Whether the request is valid
+        * @return      void
         */
-       function isHeadRequestMethod ();
+       function requestIsValid ($isValid = true);
 
        /**
-        * Checks if the request method is POST.
+        * Returns whether this request is valid
         *
-        * @return      $isPost         Whether the request method is POST
+        * @return      $requestIsValid         Whether this request is valid
         */
-       function isPostRequestMethod ();
+       function isRequestValid ();
 
 }
index dbd09ef8d7c4a80e89842d40e1bacc283d3ef39b..d4753e9cf2e9587d34d5af50f10737d056b1f9da 100644 (file)
@@ -66,7 +66,7 @@ interface Responseable extends FrameworkInterface {
         * @throws      ResponseHeadersAlreadySentException             Thrown if headers are
         *                                                                                                      already sent
         */
-       function flushBuffer ($force = FALSE);
+       function flushBuffer ($force = false);
 
        /**
         * Adds a fatal message id to the response. The added messages can then be
@@ -86,7 +86,7 @@ interface Responseable extends FrameworkInterface {
         * @return      void
         * @throws      ResponseHeadersAlreadySentException             If headers are already sent
         */
-       function addCookie ($cookieName, $cookieValue, $encrypted = FALSE);
+       function addCookie ($cookieName, $cookieValue, $encrypted = false);
 
        /**
         * Redirect to a configured URL. The URL can be absolute or relative. In
index 2a96e9c1b5eaf4036cd4480be10d7924503e6dc4..a4a12c72c58a17627096b316195d4fbf4bd17db9 100644 (file)
@@ -147,10 +147,10 @@ interface CompileableTemplate extends FrameworkInterface {
         * "Compiles" a variable by replacing {?var?} with it's content
         *
         * @param       $rawCode                        Raw code to compile
-        * @param       $setMatchAsCode         Sets $match if readVariable() returns empty result (default: FALSE)
+        * @param       $setMatchAsCode         Sets $match if readVariable() returns empty result (default: false)
         * @return      $rawCode                        Compile code with inserted variable value
         */
-       function compileRawCode ($rawCode, $setMatchAsCode = FALSE);
+       function compileRawCode ($rawCode, $setMatchAsCode = false);
 
        /**
         * Renames a variable in code and in stack
@@ -176,7 +176,7 @@ interface CompileableTemplate extends FrameworkInterface {
         * @param       $languageSupport        New language support setting
         * @return      void
         */
-       function enableLanguageSupport ($languageSupport = TRUE);
+       function enableLanguageSupport ($languageSupport = true);
 
        /**
         * Checks whether language support is enabled
@@ -191,7 +191,7 @@ interface CompileableTemplate extends FrameworkInterface {
         * @param       $xmlCompacting  New XML compacting setting
         * @return      void
         */
-       function enableXmlCompacting ($xmlCompacting = TRUE);
+       function enableXmlCompacting ($xmlCompacting = true);
 
        /**
         * Checks whether XML compacting is enabled
@@ -223,7 +223,7 @@ interface CompileableTemplate extends FrameworkInterface {
         * @param       $add            Whether add this group
         * @return      void
         */
-       function setVariableGroup ($groupName, $add = TRUE);
+       function setVariableGroup ($groupName, $add = true);
 
        /**
         * Getter for template type
index 5416df5d6f99bb2614a241748b4096164fd98746..abca7c3091ac69836f91a64b8e0b1db5fd69cec4 100644 (file)
@@ -74,7 +74,7 @@ class DebugMiddleware extends BaseMiddleware implements Registerable {
                $debugInstance = new DebugMiddleware();
 
                // Default is that $outputClass may be invalid
-               $isInitialized = FALSE;
+               $isInitialized = false;
 
                // Is there a valid output instance provided?
                if ((!is_null($outputClass)) && (is_object($outputClass)) && ($outputClass instanceof OutputStreamer)) {
@@ -82,7 +82,7 @@ class DebugMiddleware extends BaseMiddleware implements Registerable {
                        $debugInstance->setOutputInstance($outputClass);
 
                        // All fine
-                       $isInitialized = TRUE;
+                       $isInitialized = true;
                } elseif ((!is_null($outputClass)) && (is_string($outputClass)) && (class_exists($outputClass))) {
                        // A name for a debug output class has been provided so we try to get it
                        $outputInstance = ObjectFactory::createObjectByName($outputClass);
@@ -91,11 +91,11 @@ class DebugMiddleware extends BaseMiddleware implements Registerable {
                        $debugInstance->setOutputInstance($outputInstance);
 
                        // All fine
-                       $isInitialized = TRUE;
+                       $isInitialized = true;
                }
 
                // Is the output class initialized?
-               if ($isInitialized === TRUE) {
+               if ($isInitialized === true) {
                        // Then set class name
                        $debugInstance->getOutputInstance()->setLoggerClassName($className);
                } // END - if
@@ -122,7 +122,7 @@ class DebugMiddleware extends BaseMiddleware implements Registerable {
         * @param       $stripTags      Whether HTML tags shall be stripped out
         * @return      void
         */
-       public final function output ($outStream, $stripTags = FALSE) {
+       public final function output ($outStream, $stripTags = false) {
                // Is the output stream set
                if (empty($outStream)) {
                        // @TODO Initialization phase
index d7dfd9f67de86146dcefffd947d108233b06692c..56a2940e1e270241eca6eb6e85c670b9c4cf260e 100644 (file)
@@ -62,7 +62,7 @@ class TestsConsoleCommandResolver extends BaseCommandResolver implements Command
                if (empty($commandName)) {
                        // Then thrown an exception here
                        throw new EmptyVariableException(array($resolverInstance, 'commandName'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
-               } elseif ($resolverInstance->isCommandValid('CoreFramework\Tests\Command', $commandName) === FALSE) {
+               } elseif ($resolverInstance->isCommandValid('CoreFramework\Tests\Command', $commandName) === false) {
                        // Invalid command found
                        throw new InvalidCommandException(array($resolverInstance, $commandName), self::EXCEPTION_INVALID_COMMAND);
                }
index 18124fa43fa790c7d1aba983102da636ce52aff3..07521787d17dfc2c7f5b5743f0fa9d2f8216d127 100644 (file)
@@ -63,7 +63,7 @@ class TestsConsoleControllerResolver extends BaseControllerResolver implements C
                if (empty($controllerName)) {
                        // Then thrown an exception here
                        throw new EmptyVariableException(array($resolverInstance, 'commandName'), self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
-               } elseif ($resolverInstance->isControllerValid('CoreFramework\Tests\Controller', $controllerName) === FALSE) {
+               } elseif ($resolverInstance->isControllerValid('CoreFramework\Tests\Controller', $controllerName) === false) {
                        // Invalid command found
                        throw new InvalidControllerException(array($resolverInstance, $controllerName), self::EXCEPTION_INVALID_CONTROLLER);
                }
diff --git a/framework/main/third_party/api/primusportal/.htaccess b/framework/main/third_party/api/primusportal/.htaccess
deleted file mode 100644 (file)
index 3a42882..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Deny from all
diff --git a/framework/main/third_party/api/primusportal/class_PrimeraApi.php b/framework/main/third_party/api/primusportal/class_PrimeraApi.php
deleted file mode 100644 (file)
index 20288de..0000000
+++ /dev/null
@@ -1,269 +0,0 @@
-<?php
-// Own namespace
-namespace PrimeraPortal\Api;
-
-// Import framework stuff
-use CoreFramework\Object\BaseFrameworkSystem;
-
-/**
- * PrimeraApi
- * -------------------------------------------
- * Mit dieser Klasse ist ein einfacher Primeratransfer von Ihrem Account
- * zu dem Account eines bei Primusportal.de registrierten Mitglieds m�glich.
- *
- * ----------------- Aenderungen durch Roland Haeder 09.08.2008 ---------------
- * Klasse umbenannt nach PrimeraApi, damit sie in das Framework besser passt.
- * Zudem sind alle oeffentlichen Attribute nun privat, der Konstruktor hat den
- * neuen "magischen" Namen __construct() und "normale" Konstanten sind nach
- * Klassenkonstanten umbenannt. Unsinnige else-Bloecke sind noch umgewandelt.
- * Methodennamen fangen nun immer mit einem kleinen Buchstaben an. Zudem sind
- * die Methoden Pay,Query und Parse umbenannt.
- * ----------------- Aenderungen durch Roland Haeder 09.08.2008 ---------------
- *
- * ----------------- Aenderungen durch Roland Haeder 19.04.2011 ---------------
- * Es ist nun bei allen Methoden- und Feldnamen der erste Buchstabe
- * kleingeschrieben, damit es besser in meine Namenskonvention passt. Noch mehr
- * doppelte Anfuehrungszeichen in einfache umgewandelt, damit die Klasse
- * performanter (wegen sonst doppeltes Parsen) wird.
- * ----------------- Aenderungen durch Roland Haeder 19.04.2011 ---------------
- *
- * ------------ Achtung! Bitte zuerst lesen, bevor Sie weiterlesen: -----------
- * Das meiste aus der unteren Anleitung sollte auf die hier verwendeten Namen
- * portiert sein. Falls Sie Fragen haben, bitte melden Sie sich bei Roland
- * Haeder. Funktionell wurde hier aber nichts geaendert.
- * ------------ Achtung! Bitte zuerst lesen, bevor Sie weiterlesen: -----------
- *
- * Die Einbindung des Interfaces geschieht folgenderma�en:
- *  1. Einbindung der Klasse in Ihr PHP-Auszahlungsskript:
- *     CODE:
- *       $primusUsername = 'username'; // Ihr Username bei Primusportal
- *       $primusPassword = 'passwort'; // Ihr Passwort bei Primusportal
- *
- *       $apiInstance = ObjectFactory::createObjectByName('PrimeraApi', array($primusUsername, $primusPassword));
- *  2. Durchf�hren einer Auszahlung:
- *     CODE:
- *       $Status = $apiInstance->payPrimera($PayReceiver, $PayAmount, $PayDescription);
- *
- *     Wobei $PayReicer der Username des Empf�ngers bei
- *     Primusportal.de ist. $PayAmount ist der gerundete( !! ) Betrag an Primera,
- *     die der Empf�nger erhalten soll. $PayDescription ist eine von Ihnen 
- *     festgelegte kurze Beschreibung. Die L�nge dieses Textes darf 100 Zeichen
- *     nicht �berschreiten. Beispiel:
- *       $status = $apiInstance->payPrimera('garbage', 10000, 'Auszahlung IhreSeite.de - ID: 12345');
- *  3. �berpr�fung des Status (R�ckgabecode):
- *     CODE:
- *       if ($status === FALSE) {
- *         // Ein Fehler ist aufgetreten
- *     // Fehlerbehandlung hier einf�gen...
- *       } else {
- *         // Auszahlung erfolgreich durchgef�hrt
- *         // F�hren Sie hier Ihre Datenbankabfragen durch, um die Auszahlung zu
- *         // best�tigen...
- *       }
- *
- *     Die komplette R�ckgabe des Interfaces wird als assoziatives Array in der Klassen-
- *     variable $data gespeichert:
- *     $data = array(
- *           'status' => R�ckgabecode (PI_DONE, PI_SENDER_ERROR, ...),
- *           'statustext' => Status in Worten (z.B.: 'Transaktion erfolgreich durchgef�hrt'),
- *     );
- *
- *
- * @author             Andreas Schmidt <xxgarbagexx@web.de>
- * @author             Roland Haeder <webmaster.shipsimu.org>
- * @version            1.0 - beta
- * @copyright  (c) 2007 by Primusportal.de
- * @copyright  (c) 2008, 2011 by Roland Haeder
- */
-class PrimeraApi extends BaseFrameworkSystem {
-       /**
-        * Fehler - Interfacebenutzer
-        */
-       const PI_ERROR = -1;
-
-       /**
-        * Statuscode f�r erfolgreich ausgef�hrte Transaktion
-        */
-       const PI_DONE = 200;
-
-       /**
-        * Fehler - User existiert nicht oder ist gesperrt
-        */
-       const PI_RECEIVER_ERROR = 301;
-
-       /**
-        * Sender-Account Fehler (User nicht existent, gesperrt, ...)
-        */
-       const PI_SENDER_ERROR = 401;
-
-       /**
-        * Betrag fehler
-        */
-       const PI_AMOUNT_ERROR = 501;
-
-       /**
-        * Zu wenig Primera
-        */
-       const PI_TOO_LESS_PRIMERA = 502;
-
-       /**
-        * User nicht aktiv oder existiert nicht
-        */
-       const PI_USER_CHECK_ERROR = 601;
-
-       /**
-        * User aktiv
-        */
-       const PI_USER_CHECK_OK = 602;
-
-       /**
-        * Primerastand erfolgreich geholt
-        */
-       const PI_GET_PRIMERA_DONE = 701;
-
-       /**
-        * HTTP-EOL
-        */
-       const HTTP_EOL = "\r\n";
-
-       /**
-        * URL f�r das Interface auf dem Primusserver:
-        */
-       private $host = 'www.primusportal.de';
-       private $path = '/transfer.interface.2.0.php';
-
-       private $errno = 0;
-       private $err = '';
-
-       private $separator = ':';
-
-       private $username = '';
-       private $password = '';
-
-       private $data = array();
-
-       /**
-        * Konstruktor
-        */
-       public function __construct ($primusUsername, $primusPassword) {
-               // Call parent constructor
-               parent::__construct();
-
-               // Set data
-               $this->username = $primusUsername;
-               $this->password = $primusPassword;
-       }
-
-       /**
-        * Anfrage senden und Rueckgabecode in Variable speichern
-        */
-       private function queryApi ( $data = array() ) {
-               $fp = fsockopen($this->host, 80, $this->errno, $this->_err);
-               if (!$fp) return false;
-
-               $data['PrimusInterface_Username'] = base64_encode($this->username);
-               $data['PrimusInterface_Password'] = base64_encode(md5($this->password));
-
-               // POST-Daten uebermitteln:
-               $queryData = http_build_query($data, '', '&');
-
-               $request .= 'POST ' . $this->path . 'HTTP/1.1' . self::HTTP_EOL;
-               $request .= 'Host: ' . $this->host . self::HTTP_EOL;
-               $request .= 'Content-type: application/x-www-form-urlencoded' . self::HTTP_EOL;
-               $request .= 'Content-length: '. strlen($queryData) . self::HTTP_EOL;
-               $request .= 'Connection: close' . self::HTTP_EOL;
-               $request .= self::HTTP_EOL;
-               $request .= $queryData;
-
-               fputs($fp, $request);
-
-               $return = '';
-               while (!feof($fp)) {
-                       $return .= fgets($fp, 128);
-               } // END - while
-
-               $content = explode('<!-- return-start -->', $return);
-               return $content[1];
-       }
-
-       /**
-        * Funktion parst die R�ckgabe vom Transferskript:
-        */
-       private function parseContent ( $content ) {
-               $x = explode("\n", $content);
-               $return = array();
-               foreach($x as $currentLine) {
-                       $line_exploded = explode($this->separator, $currentLine,2);
-                       if (count($line_exploded) > 1) {
-                               $return[$line_exploded[0]] = $line_exploded[1];
-                       } // END - if
-               } // END - foreach
-               return $return;
-       }
-
-       /**
-        * @param int/string $Receiver UserID / Username des Empf�ngers
-        * @param int$Amount Betrag in ganzzahligen Primera
-        * @param string $Description Beschreibung (Sichtbar in Einzelauflistung)
-        */
-       public function payPrimera ($Receiver, $Amount, $Description = '') {
-               $valid = FALSE;
-               $postData = array(
-                       'PrimusInterface_Action'      => 'Pay',
-                       'PrimusInterface_Receiver'    => base64_encode($Receiver),
-                       'PrimusInterface_Amount'      => base64_encode($Amount),
-                       'PrimusInterface_Description' => base64_encode($Description)
-               );
-
-               $postReturn = $this->parseContent( $this->queryApi($postData) );
-
-               $this->data = $postReturn;
-               if ($postReturn['status'] == '200') {
-                       $valid = TRUE;
-               } // END - if
-               return $valid;
-       }
-
-       /**
-        * �berpr�ft den Status eines Primus-Users
-        * - existiert der User
-        * - ist er aktiv
-        * @param string/int $User Userid / Username
-        */
-       public function checkPrimusUser ($userName) {
-               $valid = FALSE;
-               $postData = array(
-                       'PrimusInterface_Action'          => 'CheckPrimusUser',
-                       'PrimusInterface_CheckPrimusUser' => $userName
-               );
-
-               $postReturn = $this->parseContent( $this->queryApi($postData) );
-
-               $this->data = $postReturn;
-
-               if ($postReturn['status'] == self::PI_USER_CHECK_OK) {
-                       $valid = TRUE;
-               } // END - if
-               return $valid;
-       }
-
-       /**
-        * Die Funktion liefer den aktuellen Primerastand
-        */
-       public function getPrimera() {
-               $primera = FALSE;
-               $postData = array(
-                       'PrimusInterface_Action' => 'GetPrimera'
-               );
-               $postReturn = $this->parseContent( $this->queryApi($postData) );
-
-               $this->data = $postReturn;
-
-               if ($postReturn['status'] == self::PI_GET_PRIMERA_DONE) {
-                       $primera = $postReturn['primera'];
-               } // END - if
-
-               return $primera;
-       }
-
-}
index c64fba3e7b7260a405c5c5d99187a2cc144f61aa..cc81fe7394ba059a64f78b5c6d7f74e20b6c0d7b 100644 (file)
@@ -32,7 +32,7 @@ class WernisApi extends BaseFrameworkSystem {
        /**
         * Static base API URL
         */
-       private static $apiUrl = 'http://www.wds66.com/api/';
+       private static $apiUrl = 'https://www.wds66.com/api/';
 
        /**
         * API Wernis amount
@@ -216,7 +216,7 @@ class WernisApi extends BaseFrameworkSystem {
                $response = $this->sendRawRequest($requestString);
 
                // Check the response header if all is fine
-               if (strpos($response[0], '200') === FALSE) {
+               if (strpos($response[0], '200') === false) {
                        // Something bad happend... :(
                        return array(
                                'status'  => 'request_error',
@@ -309,7 +309,7 @@ class WernisApi extends BaseFrameworkSystem {
        // Widthdraw this amount
        private function executeWithdraw ($amount) {
                // First all fails...
-               $result = FALSE;
+               $result = false;
 
                // Prepare the purpose
                $purpose = "\"Bube oder Dame\"-Einsatz gesetzt.";
@@ -329,7 +329,7 @@ class WernisApi extends BaseFrameworkSystem {
 
                if ($return['status'] == $this->statusOkay) {
                        // All fine!
-                       $result = TRUE;
+                       $result = true;
                } else {
                        // Status failture text
                        $this->setStatusMessage($return['message'], $return['status']);
@@ -342,7 +342,7 @@ class WernisApi extends BaseFrameworkSystem {
        // Payout this amount
        private function executePayout ($amount) {
                // First all fails...
-               $result = FALSE;
+               $result = false;
 
                // Prepare the purpose
                $purpose = "\"Bube oder Dame\"-Gewinn erhalten.";
@@ -362,7 +362,7 @@ class WernisApi extends BaseFrameworkSystem {
 
                if ($return['status'] == $this->statusOkay) {
                        // All fine!
-                       $result = TRUE;
+                       $result = true;
                } else {
                        // Status failture text
                        $this->setStatusMessage($return['message'], $return['status']);
index 7f88c168d1cb7bba483ede648b236d2a4f0fd461..7d6dceec926b2c790d8a6cc64b29a822d57f79e9 100644 (file)
@@ -1,83 +1,2 @@
 <?php
-// Import framework stuff
-use CoreFramework\Configuration\FrameworkConfiguration;
-use CoreFramework\Object\BaseFrameworkSystem;
-
-/**
- * The application selector main include file
- *
- * @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/>.
- */
-
-// Try to load these includes in the given order
-$configAppIncludes = array(
-       'class_ApplicationHelper', // The ApplicationHelper class
-       'debug',                // Some debugging stuff
-       'exceptions',   // The application's own exception handler
-       'config',               // The application's own configuration
-       'config-local', // Local configuration file (optional)
-       'data',                 // Application data
-       'init',                 // The application initializer
-       'starter',              // The application starter (calls entryPoint(), etc.)
-);
-
-// Cache base path/file here
-$basePathFile = FrameworkConfiguration::getSelfInstance()->getConfigEntry('application_base_path') . FrameworkConfiguration::getSelfInstance()->getConfigEntry('app_name');
-
-// Is the directory there?
-if (!is_dir($basePathFile)) {
-       // Not found.
-       trigger_error('Application ' . FrameworkConfiguration::getSelfInstance()->getConfigEntry('app_name') . ' not found.');
-       exit;
-} // END - if
-
-// Load them all (try only)
-foreach ($configAppIncludes as $appInc) {
-       // Skip starter in test mode
-       if (($appInc == 'starter') && (defined('TEST'))) {
-               // Skip it here
-               continue;
-       } // END - if
-
-       // Generate a FQFN for the helper class
-       $appFqFn = $basePathFile . '/' . $appInc . '.php';
-
-       // Does the include file exists?
-       if (BaseFrameworkSystem::isReadableFile($appFqFn)) {
-               // Load it
-               //* DEBUG: */ print basename(__FILE__)."[".__LINE__."]: Loading ".basename($appFqFn)." - START\n";
-               require $appFqFn;
-               //* DEBUG: */ print basename(__FILE__)."[".__LINE__."]: Loading ".basename($appFqFn)." - END\n";
-       } elseif (FrameworkConfiguration::getSelfInstance()->getConfigEntry('verbose_level') > 0) {
-               // File is missing
-               trigger_error(sprintf('Cannot load application script %s.php! File is missing or read-protected.',
-                       $appInc
-               ));
-               exit;
-       }
-}
-
-// Remove variables from namespace, which we don't need
-unset($appInc);
-unset($configAppIncludes);
-unset($appFqFn);
-unset($basePathFile);
+// @DEPRECATED
index 3cca6d52f2f0ac6a4f0dac63d963a25bf24d2e23..f0f02f6df124b1ce00ac8d4c18ab96d35d9b7310 100644 (file)
--- a/index.php
+++ b/index.php
@@ -57,7 +57,7 @@ final class ApplicationEntryPoint {
         * @return      void
         * @todo        This method is old code and needs heavy rewrite and should be moved to ApplicationHelper
         */
-       public static final function app_exit ($message = '', $code = FALSE, $extraData = '', $silentMode = FALSE) {
+       public static final function app_exit ($message = '', $code = false, $extraData = '', $silentMode = false) {
                // Is this method already called?
                if (isset($GLOBALS['app_die_called'])) {
                        // Then output the text directly
@@ -65,7 +65,7 @@ final class ApplicationEntryPoint {
                } // END - if
 
                // This method shall not be called twice
-               $GLOBALS['app_die_called'] = TRUE;
+               $GLOBALS['app_die_called'] = true;
 
                // Is a message set?
                if (empty($message)) {
@@ -77,7 +77,7 @@ final class ApplicationEntryPoint {
                $configInstance = FrameworkConfiguration::getSelfInstance();
 
                // Do we have debug installation?
-               if (($configInstance->getConfigEntry('product_install_mode') == 'productive') || ($silentMode === TRUE)) {
+               if (($configInstance->getConfigEntry('product_install_mode') == 'productive') || ($silentMode === true)) {
                        // Abort here
                        exit();
                } // END - if
@@ -199,15 +199,15 @@ final class ApplicationEntryPoint {
                                // Debug message
                                //* NOISY-DEBUG: */ printf('[%s:%d]: realPath[%s]=%s' . PHP_EOL, __METHOD__, __LINE__, gettype($realPath), $realPath);
 
-                               // Is it FALSE?
-                               if ($realPath === FALSE) {
+                               // Is it false?
+                               if ($realPath === false) {
                                        // Then, not found.
                                        continue;
                                } // END - if
 
-                               // First create full-qualified file name (FQFN) to framework/config.inc.php
+                               // First create full-qualified file name (FQFN) to framework/config-global.php
                                $fqfn = sprintf(
-                                       '%s%sframework%sconfig.inc.php',
+                                       '%s%sframework%sconfig-global.php',
                                        $realPath,
                                        DIRECTORY_SEPARATOR,
                                        DIRECTORY_SEPARATOR,
@@ -258,21 +258,30 @@ final class ApplicationEntryPoint {
         */
        public static final function main () {
                // Load bootstrap file
-               require self::detectFrameworkPath() . 'bootstrap/bootstrap.inc.php';
+               require sprintf('%sbootstrap%sbootstrap.inc.php', self::detectFrameworkPath(), DIRECTORY_SEPARATOR);
 
                /*
-                * Initial bootstrap is done, continue with parsing parameters and
-                * look for 'app'.
+                * Initial bootstrap is done, continue with initialization of
+                * framework.
                 */
-               FrameworkBootstrap::parseParameters();
+               FrameworkBootstrap::initFramework();
+
+               // Next initialize the detected application
+               FrameworkBootstrap::prepareApplication();
+
+               /*
+                * Last step is to start the application, this will also initialize and
+                * register the application instance in registry.
+                */
+               FrameworkBootstrap::startApplication();
        }
 }
 
 // Developer mode active? Comment out if no dev!
-define('DEVELOPER', TRUE);
+define('DEVELOPER', true);
 
 // Log all exceptions (only debug! This option can create large error logs)
-//define('LOG_EXCEPTIONS', TRUE);
+//define('LOG_EXCEPTIONS', true);
 
 //xdebug_start_trace();