]> git.mxchange.org Git - hub.git/commitdiff
Rewritten to shortcut method debugOutput()
authorRoland Häder <roland@mxchange.org>
Wed, 8 Jul 2009 21:21:55 +0000 (21:21 +0000)
committerRoland Häder <roland@mxchange.org>
Wed, 8 Jul 2009 21:21:55 +0000 (21:21 +0000)
application/hub/class_ApplicationHelper.php
application/hub/main/listener/tcp/class_TcpListener.php
application/hub/main/listener/udp/class_UdpListener.php
application/hub/main/nodes/boot/class_HubBootNode.php
application/hub/main/nodes/class_BaseHubNode.php
application/hub/main/pools/listener/class_DefaultListenerPool.php

index 921f04d7991e0daa99be45ac51b8516c178b3f9c..b15862e2dad0848b03c2e60a001c0c21d1938600 100644 (file)
@@ -195,9 +195,9 @@ class ApplicationHelper extends BaseFrameworkSystem implements ManageableApplica
                // Try to bootstrap the node and pass the request instance to it for
                // extra arguments which mostly override config entries or enable special
                // features within the hub (none is ready at this development stage)
-               $this->getDebugInstance()->output('BOOTSTRAP: Beginning with bootstrap...');
+               $this->debugOutput('BOOTSTRAP: Beginning with bootstrap...');
                $nodeInstance->doBootstrapping();
-               $this->getDebugInstance()->output('BOOTSTRAP: Bootstrap finished.');
+               $this->debugOutput('BOOTSTRAP: Bootstrap finished.');
 
                // ----------------------- Init all query queues ----------------------
                // After the bootstrap is done we need to initialize the queues which
index f9fc6214242b7dd6db1b872f9388c490c0102089..c48f4d4f5faefdd380eb58e30541fd83049f3763 100644 (file)
@@ -137,7 +137,7 @@ class TcpListener extends BaseListener implements Listenable {
                $this->setPoolInstance($poolInstance);
 
                // Output message
-               $this->getDebugInstance()->output('LISTENER: TCP listener now ready on IP ' . $this->getListenAddress() . ', port ' . $this->getListenPort() . ' for service.');
+               $this->debugOutput('LISTENER: TCP listener now ready on IP ' . $this->getListenAddress() . ', port ' . $this->getListenPort() . ' for service.');
        }
 }
 
index 9edd449e13586e6b573f27546841b284a602f22b..f0d006655844fb01c298962a352c283ed9b8f1c3 100644 (file)
@@ -75,7 +75,7 @@ class UdpListener extends BaseListener implements Listenable {
                $this->setSocketResource($socket);
 
                // Output message
-               $this->getDebugInstance()->output('LISTENER: UDP listener now ready on IP ' . $this->getListenAddress() . ', port ' . $this->getListenPort() . ' for service.');
+               $this->debugOutput('LISTENER: UDP listener now ready on IP ' . $this->getListenAddress() . ', port ' . $this->getListenPort() . ' for service.');
        }
 }
 
index d27eb90f4bd20154674326dec2bcfd5b9b0f6baa..8ffe3088612e5897b18f5e30c3d506c87ce53e87 100644 (file)
@@ -72,23 +72,23 @@ class HubBootNode extends BaseHubNode implements NodeHelper {
                        // Is the port the same?
                        if ($bootPort == $ourPort) {
                                // It is the same!
-                               $this->getDebugInstance()->output('BOOTSTRAP: IP/port matches bootstrapping node ' . $this->getBootIpPort() . '.');
+                               $this->debugOutput('BOOTSTRAP: IP/port matches bootstrapping node ' . $this->getBootIpPort() . '.');
 
                                // Now, does the mode match (should be 'boot'!)
                                if ($this->getRequestInstance()->getRequestElement('mode') == 'boot') {
                                        // Output debug message
-                                       $this->getDebugInstance()->output('BOOTSTRAP: Our node is a valid bootstrapping node.');
+                                       $this->debugOutput('BOOTSTRAP: Our node is a valid bootstrapping node.');
                                } else {
                                        // Output warning
-                                       $this->getDebugInstance()->output('BOOTSTRAP: WARNING: Mismatching mode ' . $this->getRequestInstance()->getRequestElement('mode') . '!=boot detected.');
+                                       $this->debugOutput('BOOTSTRAP: WARNING: Mismatching mode ' . $this->getRequestInstance()->getRequestElement('mode') . '!=boot detected.');
                                }
                        } else {
                                // IP does match, but no port
-                               $this->getDebugInstance()->output('BOOTSTRAP: WARNING: Our IP ' . $_SERVER['SERVER_ADDR'] . ' does match a known bootstrap-node but not the port ' . $ourPort . '/' . $bootPort . '.');
+                               $this->debugOutput('BOOTSTRAP: WARNING: Our IP ' . $_SERVER['SERVER_ADDR'] . ' does match a known bootstrap-node but not the port ' . $ourPort . '/' . $bootPort . '.');
                        }
                } else {
                        // Node does not match any know bootstrap-node
-                       $this->getDebugInstance()->output('BOOTSTRAP: WARNING: Our IP ' . $_SERVER['SERVER_ADDR'] . ' does not match any known bootstrap-nodes.');
+                       $this->debugOutput('BOOTSTRAP: WARNING: Our IP ' . $_SERVER['SERVER_ADDR'] . ' does not match any known bootstrap-nodes.');
                }
 
                // This might not be all...
index 2830144acd2283df866c56ba689b7bf217936232..08e6fbdd2adbeeec59fa092fca723e3b5b5f81a9 100644 (file)
@@ -101,7 +101,7 @@ class BaseHubNode extends BaseHubSystem implements Updateable {
                                $this->bootIpPort = $ipPort;
 
                                // Output message
-                               $this->getDebugInstance()->output('BOOTSTRAP: ' . __FUNCTION__ . '[' . __LINE__ . ']: IP matches remote address ' . $ipPort . '.');
+                               $this->debugOutput('BOOTSTRAP: ' . __FUNCTION__ . '[' . __LINE__ . ']: IP matches remote address ' . $ipPort . '.');
 
                                // Stop further searching
                                break;
@@ -114,7 +114,7 @@ class BaseHubNode extends BaseHubSystem implements Updateable {
                                $this->bootIpPort = $ipPort;
 
                                // Output message
-                               $this->getDebugInstance()->output('BOOTSTRAP: ' . __FUNCTION__ . '[' . __LINE__ . ']: IP matches listen address ' . $ipPort . '.');
+                               $this->debugOutput('BOOTSTRAP: ' . __FUNCTION__ . '[' . __LINE__ . ']: IP matches listen address ' . $ipPort . '.');
 
                                // Stop further searching
                                break;
@@ -136,14 +136,14 @@ class BaseHubNode extends BaseHubSystem implements Updateable {
                $app = $this->getApplicationInstance();
 
                // Output all lines
-               $this->getDebugInstance()->output(' ');
-               $this->getDebugInstance()->output($app->getAppName() . ' v' . $app->getAppVersion() . ' - ' . $this->getRequestInstance()->getRequestElement('mode') . ' mode active');
-               $this->getDebugInstance()->output('Copyright (c) 2007 - 2008 Roland Haeder, 2009 Hub Developer Team');
-               $this->getDebugInstance()->output(' ');
-               $this->getDebugInstance()->output('This program comes with ABSOLUTELY NO WARRANTY; for details see docs/COPYING.');
-               $this->getDebugInstance()->output('This is free software, and you are welcome to redistribute it under certain');
-               $this->getDebugInstance()->output('conditions; see docs/COPYING for details.');
-               $this->getDebugInstance()->output(' ');
+               $this->debugOutput(' ');
+               $this->debugOutput($app->getAppName() . ' v' . $app->getAppVersion() . ' - ' . $this->getRequestInstance()->getRequestElement('mode') . ' mode active');
+               $this->debugOutput('Copyright (c) 2007 - 2008 Roland Haeder, 2009 Hub Developer Team');
+               $this->debugOutput(' ');
+               $this->debugOutput('This program comes with ABSOLUTELY NO WARRANTY; for details see docs/COPYING.');
+               $this->debugOutput('This is free software, and you are welcome to redistribute it under certain');
+               $this->debugOutput('conditions; see docs/COPYING for details.');
+               $this->debugOutput(' ');
        }
 
        /**
@@ -204,7 +204,7 @@ class BaseHubNode extends BaseHubSystem implements Updateable {
                        $this->setNodeId($this->getField(NodeInformationDatabaseWrapper::DB_COLUMN_NODE_ID));
 
                        // Output message
-                       $this->getDebugInstance()->output('BOOTSTRAP: Re-using found node-id: ' . $this->getNodeId() . '');
+                       $this->debugOutput('BOOTSTRAP: Re-using found node-id: ' . $this->getNodeId() . '');
                } else {
                        // Get an RNG instance (Random Number Generator)
                        $rngInstance = ObjectFactory::createObjectByConfiguredName('rng_class');
@@ -222,7 +222,7 @@ class BaseHubNode extends BaseHubSystem implements Updateable {
                        $wrapperInstance->registerNodeId($this, $this->getRequestInstance());
 
                        // Output message
-                       $this->getDebugInstance()->output('BOOTSTRAP: Created new node-id: ' . $this->getNodeId() . '');
+                       $this->debugOutput('BOOTSTRAP: Created new node-id: ' . $this->getNodeId() . '');
                }
        }
 
index 1340c89544d95815b74a15160956e6ff2f21089b..c3d28b7f47ca2136c1acc39b5438a1a573ba2f1f 100644 (file)
@@ -46,7 +46,7 @@ class DefaultListenerPool extends BasePool implements PoolableListener {
                $listenerInstance->setNodeInstance($nodeInstance);
 
                // This is the last line before the return statement to output some debug output
-               $listenerInstance->getDebugInstance()->output('POOL: ' . __CLASS__ . ': Initialization finished.');
+               $listenerInstance->debugOutput('POOL: ' . __CLASS__ . ': Initialization finished.');
 
                // Return the prepared instance
                return $listenerInstance;
@@ -63,7 +63,7 @@ class DefaultListenerPool extends BasePool implements PoolableListener {
                parent::addInstance($listenerInstance->getProtocol(), 'listener', $listenerInstance);
 
                // Debug message
-               $this->getDebugInstance()->output(
+               $this->debugOutput(
                        'POOL: Listener ' . $listenerInstance->__toString() .
                        ' listening to ' . $listenerInstance->getListenAddress() . ':' .
                        $listenerInstance->getListenPort() . ' added to listener pool.'