]> git.mxchange.org Git - core.git/commitdiff
Static method getInstance() conflicts with getInstance() in class BaseRegistry,
authorRoland Häder <roland@mxchange.org>
Tue, 8 Nov 2011 06:35:06 +0000 (06:35 +0000)
committerRoland Häder <roland@mxchange.org>
Tue, 8 Nov 2011 06:35:06 +0000 (06:35 +0000)
better it gets renamed to something else.

19 files changed:
inc/classes.php
inc/classes/main/class_BaseFrameworkSystem.php
inc/classes/main/console/class_ConsoleTools.php
inc/classes/main/crypto/class_CryptoHelper.php
inc/classes/main/factories/objects/class_ObjectFactory.php
inc/classes/main/language/class_LanguageSystem.php
inc/classes/main/output/class_ConsoleOutput.php
inc/classes/main/registry/class_BaseRegistry.php
inc/classes/middleware/database/class_DatabaseConnection.php
inc/classes/middleware/debug/class_DebugMiddleware.php
inc/classes/middleware/io/class_FileIoHandler.php
inc/config.php
inc/config/class_FrameworkConfiguration.php
inc/config/config-hubmaster.php
inc/database.php
inc/includes.php
inc/loader/class_ClassLoader.php
inc/output.php
inc/selector.php

index ac3940a4e7cbcce9793b2583ef237895d4d8c2b6..6084add1e799e8ab0ba2b4b8e857a35f6bd2f74e 100644 (file)
@@ -32,7 +32,7 @@ $lowerClasses = array(
 );
 
 // Cache loader instance
-$loaderInstance = ClassLoader::getInstance();
+$loaderInstance = ClassLoader::getSelfInstance();
 
 // Load all classes
 foreach ($lowerClasses as $className) {
index 34c10efe4aae4054f3fc3a71a176eabcd141d902..fcd7dab773ce99d083c2f8a8309fdd7689a6cbb0 100644 (file)
@@ -313,7 +313,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                // Set configuration instance if no registry ...
                if (!$this instanceof Register) {
                        // ... because registries doesn't need to be configured
-                       $this->setConfigInstance(FrameworkConfiguration::getInstance());
+                       $this->setConfigInstance(FrameworkConfiguration::getSelfInstance());
                } // END - if
 
                // Is the startup time set? (0 cannot be true anymore)
@@ -893,7 +893,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                ApplicationEntryPoint::app_die(sprintf("<div class=\"debug_header\">%s debug output:</div><div class=\"debug_content\">%s</div>\nLoaded includes: <div class=\"debug_include_list\">%s</div>",
                        $this->__toString(),
                        $content,
-                       ClassLoader::getInstance()->getPrintableIncludeList()
+                       ClassLoader::getSelfInstance()->getPrintableIncludeList()
                ));
        }
 
index 825f5fa9cfd440331236268808ae1447b6df5c90..e43c96946aeb640280d95e675e96fd727c66ce24 100644 (file)
@@ -127,7 +127,7 @@ class ConsoleTools extends BaseFrameworkSystem {
                }
 
                // Set it in configuration
-               FrameworkConfiguration::getInstance()->setServerAddress($ip);
+               FrameworkConfiguration::getSelfInstance()->setServerAddress($ip);
        }
 
        /**
index 0c626bba48025d4427bee36666cb393be3af1845..61df314948539b8df5a9d01658b16b14b409ab46 100644 (file)
@@ -75,7 +75,7 @@ class CryptoHelper extends BaseFrameworkSystem implements Cryptable {
         *
         * @return      $selfInstance   An instance of this crypto helper class
         */
-       public static final function getInstance () {
+       public static final function getSelfInstance () {
                // Is no instance there?
                if (is_null(self::$selfInstance)) {
                        // Then get a new one
index b84f55a221bf493e63a2357f96801863e6571db2..c089ba32beb46c3697f10db1bdfebb2d6d20198e 100644 (file)
@@ -81,7 +81,7 @@ class ObjectFactory extends BaseFactory {
         */
        public static final function createObjectByConfiguredName ($configEntry, array $args=array()) {
                // Read the configuration entry
-               $className = FrameworkConfiguration::getInstance()->getConfigEntry($configEntry);
+               $className = FrameworkConfiguration::getSelfInstance()->getConfigEntry($configEntry);
 
                // Send this to the other factory...
                $objectInstance = self::createObjectByName($className, $args);
index df1fe429001379ecba87afbac262aa317ae18bac..3cde53082b6dd0c129efdb0debd6c4d2797658a5 100644 (file)
@@ -91,7 +91,7 @@ class LanguageSystem extends BaseFrameworkSystem implements ManageableLanguage,
                $langInstance->initLanguageStrings();
 
                // Set language code from default config
-               $langInstance->setLanguageCode(FrameworkConfiguration::getInstance()->getConfigEntry('default_lang'));
+               $langInstance->setLanguageCode(FrameworkConfiguration::getSelfInstance()->getConfigEntry('default_lang'));
 
                // Remember this instance
                self::$thisInstance = $langInstance;
@@ -105,7 +105,7 @@ class LanguageSystem extends BaseFrameworkSystem implements ManageableLanguage,
         *
         * @return      $thisInstance   An instance of this class
         */
-       public static final function getInstance () {
+       public static final function getSelfInstance () {
                return self::$thisInstance;
        }
 
index af45aaad14fe423ed83990ee7cd624d2a051fe85..3fc2bcc01f9a73e309ae7afd4dc8ba4bb1917623 100644 (file)
@@ -72,7 +72,7 @@ class ConsoleOutput extends BaseFrameworkSystem implements OutputStreamer {
        public static final function getInstance() {
                // Is the self-instance already set?
                if (is_null(self::$consoleInstance)) {
-                       $contentType = FrameworkConfiguration::getInstance()->getConfigEntry('web_content_type');
+                       $contentType = FrameworkConfiguration::getSelfInstance()->getConfigEntry('web_content_type');
                        self::$consoleInstance = ConsoleOutput::createConsoleOutput($contentType);
                } // END - if
 
index 390d2c67bfcc9025bc80ea3656d754d9e6eda41f..718f0a4f24b17176e13676eaf7562f0c44d8122e 100644 (file)
@@ -74,7 +74,7 @@ class BaseRegistry extends BaseFrameworkSystem implements Registerable {
        }
 
        /**
-        * Getter for whole instanceregistry
+        * Getter for whole instance registry
         *
         * @return      $instanceRegistry       The whole instance registry array
         */
index 84b8cc24b82e88edd7b9660a239825d753338539..0a688c39638799f2a2d0cf01628ac2d21d350abf 100644 (file)
@@ -67,7 +67,7 @@ class DatabaseConnection extends BaseMiddleware implements DatabaseConnector, Re
        }
 
        // Get an instance of this class
-       public static final function getInstance () {
+       public static final function getSelfInstance () {
                return self::$thisInstance;
        }
 
index 4d70703b842a2eafdc88e2a65f5886d1e07c4f7b..14901161715315e47ea5bd1ff98310913e915505 100644 (file)
@@ -84,7 +84,7 @@ class DebugMiddleware extends BaseMiddleware implements Registerable {
         *
         * @return      $thisInstance           An instance of this class
         */
-       public static final function getInstance() {
+       public static final function getSelfInstance() {
                return self::$thisInstance;
        }
 
index 22dff80329e9e95fa96c8cee61eea8403d64e8a7..70afeefe664bb7dc5590b4a5becee5bc32350528 100644 (file)
@@ -74,7 +74,7 @@ class FileIoHandler extends BaseMiddleware {
         *
         * @return      $thisInstance   An instance of this class
         */
-       public static final function getInstance () {
+       public static final function getSelfInstance () {
                return self::$thisInstance;
        }
 
index 441e0caf3043e3538fe73fa3030afd26791e4543..8e9c3d4f4acb323a9338cb6d3e3517a593a437d2 100644 (file)
@@ -30,7 +30,7 @@ require(ApplicationEntryPoint::detectCorePath() . '/inc/classes/interfaces/regis
 require(ApplicationEntryPoint::detectCorePath() . '/inc/config/class_FrameworkConfiguration.php');
 
 // Get a new configuration instance
-$cfg = FrameworkConfiguration::getInstance();
+$cfg = FrameworkConfiguration::getSelfInstance();
 
 // CFG: SERVER-PATH
 $cfg->setConfigEntry('base_path', ApplicationEntryPoint::detectCorePath() . '/');
index 938b67ba99c954a1265b1e44dedf1be577554eee..5006ea46680ef43d5be943444fcf8ad34a7b905f 100644 (file)
@@ -65,7 +65,7 @@ class FrameworkConfiguration implements Registerable {
         *
         * @return      $configInstance An instance of this class
         */
-       public static final function getInstance () {
+       public static final function getSelfInstance () {
                // is the instance there?
                if (is_null(self::$configInstance))  {
                        // Create a config instance
index 9e06c503dc11e9c2ad5e9678b77ef9db2fa9755a..be3267b34756d8e1675a9009c9a78066b547e08c 100644 (file)
@@ -22,7 +22,7 @@
  */
 
 // Get the configuration instance
-$cfg = FrameworkConfiguration::getInstance();
+$cfg = FrameworkConfiguration::getSelfInstance();
 
 // CFG: HUB-BOOTSTRAP-NODES
 $cfg->setConfigEntry('hub_bootstrap_nodes', '188.138.90.169:9060');
index 54329fdeff19c33bff97b7407934e1c23ca1b72f..badcd35549396a2f12458a9b31cb2210fe2d30b0 100644 (file)
@@ -28,7 +28,7 @@
 $databaseInstance = NULL;
 
 // Generate FQFN for the database layer
-$fqfn = FrameworkConfiguration::getInstance()->getConfigEntry('base_path') . 'inc/database/lib-' . FrameworkConfiguration::getInstance()->getConfigEntry('db_type') . '.php';
+$fqfn = FrameworkConfiguration::getSelfInstance()->getConfigEntry('base_path') . 'inc/database/lib-' . FrameworkConfiguration::getSelfInstance()->getConfigEntry('db_type') . '.php';
 
 // Load the database layer include
 if ((file_exists($fqfn)) && (is_file($fqfn)) && (is_readable($fqfn))) {
@@ -37,7 +37,7 @@ if ((file_exists($fqfn)) && (is_file($fqfn)) && (is_readable($fqfn))) {
 } else {
        // Layer is missing!
        ApplicationEntryPoint::app_die(sprintf("[Main:] Database layer is missing! (%s) -&gt; R.I.P.",
-               FrameworkConfiguration::getInstance()->getConfigEntry('db_type')
+               FrameworkConfiguration::getSelfInstance()->getConfigEntry('db_type')
        ));
 }
 
@@ -45,7 +45,7 @@ if ((file_exists($fqfn)) && (is_file($fqfn)) && (is_readable($fqfn))) {
 unset($fqfn);
 
 // Prepare database instance
-$connectionInstance = DatabaseConnection::createDatabaseConnection(DebugMiddleware::getInstance(), $databaseInstance);
+$connectionInstance = DatabaseConnection::createDatabaseConnection(DebugMiddleware::getSelfInstance(), $databaseInstance);
 
 // Is the app variable there and valid?
 // @TODO Rewrite this
index 38ec9eec70a4a9bb91a817799f5869123a156bd8..95d8086fbf84d876e4f1397137683ed33c89fbca 100644 (file)
  */
 
 // Include the class loader function
-require(FrameworkConfiguration::getInstance()->getConfigEntry('base_path') . 'inc/loader/class_ClassLoader.php');
+require(FrameworkConfiguration::getSelfInstance()->getConfigEntry('base_path') . 'inc/loader/class_ClassLoader.php');
 
 // Shall we include additional configs where you can configure some things? Then
 // Load matching config
-ClassLoader::getInstance()->loadExtraConfigs();
+ClassLoader::getSelfInstance()->loadExtraConfigs();
 
 // Register hooks here
-require(FrameworkConfiguration::getInstance()->getConfigEntry('base_path') . 'inc/hooks.php');
+require(FrameworkConfiguration::getSelfInstance()->getConfigEntry('base_path') . 'inc/hooks.php');
 
 // Does the user has an application specified?
 // @TODO Find a nicer OOP-ed way for this
@@ -48,11 +48,11 @@ if (!empty($_GET['app'])) {
                $application = trim($app[1]);
        } else {
                // Invalid entry found, first must be "app"!
-               $application = FrameworkConfiguration::getInstance()->getConfigEntry('default_application');
+               $application = FrameworkConfiguration::getSelfInstance()->getConfigEntry('default_application');
        }
 } else {
        // Set the "application selector" application
-       $application = FrameworkConfiguration::getInstance()->getConfigEntry('default_application');
+       $application = FrameworkConfiguration::getSelfInstance()->getConfigEntry('default_application');
 }
 
 // Secure it, by keeping out tags
@@ -62,7 +62,7 @@ $application = htmlentities(strip_tags($application), ENT_QUOTES);
 $application = preg_replace('/([^a-z0-9_-])+/i', '', $application);
 
 // Set the application name for later usage
-FrameworkConfiguration::getInstance()->setConfigEntry('app_name', $application);
+FrameworkConfiguration::getSelfInstance()->setConfigEntry('app_name', $application);
 
 // [EOF]
 ?>
index 18b9244c65111d93ee66cff96003bcc7f8b0fc26..ae5eb6fe08c8acf4f896ee09eead5550a74f3a06 100644 (file)
@@ -25,7 +25,7 @@
  * 1.3
  *  - Constructor is now empty and factory method 'createClassLoader' is created
  *  - renamed loadClasses to scanClassPath
- *  - Added initLoader(), $configInstance renamed to $configInstance
+ *  - Added initLoader()
  * 1.2
  *  - ClassLoader rewritten to PHP SPL's own RecursiveIteratorIterator class
  * 1.1
@@ -98,12 +98,12 @@ class ClassLoader {
 
        /**
         * The protected constructor. Please use the factory method below, or use
-        * getInstance() for singleton
+        * getSelfInstance() for singleton
         *
         * @return      void
         */
        protected function __construct () {
-               // Is Currently empty
+               // Is currently empty
        }
 
        /**
@@ -179,7 +179,9 @@ class ClassLoader {
                self::$selfInstance = $this;
 
                // Skip here if no dev-mode
-               if (defined('DEVELOPER')) return;
+               if (defined('DEVELOPER')) {
+                       return;
+               } // END - if
 
                // IS the cache there?
                if (file_exists($this->listCacheFQFN)) {
@@ -211,19 +213,19 @@ class ClassLoader {
         */
        public static function autoLoad ($className) {
                // Try to include this class
-               self::getInstance()->includeClass($className);
+               self::getSelfInstance()->includeClass($className);
        }
 
        /**
-        * Getter for an instance of this class
+        * Singleton getter for an instance of this class
         *
-        * @return      $selfInstance           An instance of this class
+        * @return      $selfInstance           A singleton instance of this class
         */
-       public static final function getInstance () {
+       public static final function getSelfInstance () {
                // Is the instance there?
                if (is_null(self::$selfInstance)) {
                        // Get a new one
-                       self::$selfInstance = ClassLoader::createClassLoader(FrameworkConfiguration::getInstance());
+                       self::$selfInstance = ClassLoader::createClassLoader(FrameworkConfiguration::getSelfInstance());
                } // END - if
 
                // Return the instance
index 1e6705656c638f14282ed3b5715e1ef7bc343bf0..6dbafafa8659bffd58e2058c7684d6018fc383b6 100644 (file)
  */
 
 // Get a debugger instance
-$debug = DebugMiddleware::createDebugMiddleware(FrameworkConfiguration::getInstance()->getConfigEntry('debug_class'));
+$debug = DebugMiddleware::createDebugMiddleware(FrameworkConfiguration::getSelfInstance()->getConfigEntry('debug_class'));
 
 // Empty string should be ignored and used for testing the middleware
-DebugMiddleware::getInstance()->output('');
+DebugMiddleware::getSelfInstance()->output('');
 
 // [EOF]
 ?>
index 00b1dffbb1303eec8d6c9947743ce2fa49c8017f..38f765617988cd03eb7e344fbd093363531effa7 100644 (file)
@@ -26,7 +26,7 @@
 
 // Try to load these includes in the given order
 $configAppIncludes = array(
-       'class_' . FrameworkConfiguration::getInstance()->getConfigEntry('app_helper_class'), // The ApplicationHelper class
+       'class_' . FrameworkConfiguration::getSelfInstance()->getConfigEntry('app_helper_class'), // The ApplicationHelper class
        'debug',                // Some debugging stuff
        'exceptions',   // The application's own exception handler
        'loader',               // The application's class loader
@@ -38,12 +38,12 @@ $configAppIncludes = array(
 );
 
 // Cache base path/file here
-$basePathFile = FrameworkConfiguration::getInstance()->getConfigEntry('application_path') . FrameworkConfiguration::getInstance()->getConfigEntry('app_name');
+$basePathFile = FrameworkConfiguration::getSelfInstance()->getConfigEntry('application_path') . FrameworkConfiguration::getSelfInstance()->getConfigEntry('app_name');
 
 // Is the directory there?
 if (!is_dir($basePathFile)) {
        // Not found.
-       trigger_error('Application ' . FrameworkConfiguration::getInstance()->getConfigEntry('app_name') . ' not found.');
+       trigger_error('Application ' . FrameworkConfiguration::getSelfInstance()->getConfigEntry('app_name') . ' not found.');
 } // END - if
 
 // Load them all (try only)
@@ -63,7 +63,7 @@ foreach ($configAppIncludes as $appInc) {
                //* DEBUG: */ print basename(__FILE__)."[".__LINE__."]: Loading ".basename($appFqFn)." - START\n";
                require($appFqFn);
                //* DEBUG: */ print basename(__FILE__)."[".__LINE__."]: Loading ".basename($appFqFn)." - END\n";
-       } elseif (FrameworkConfiguration::getInstance()->getConfigEntry('verbose_level') > 0) {
+       } 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