]> git.mxchange.org Git - hub.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Wed, 28 Oct 2020 07:35:41 +0000 (08:35 +0100)
committerRoland Häder <roland@mxchange.org>
Wed, 28 Oct 2020 07:35:41 +0000 (08:35 +0100)
- activated own exception handler
- ASSERT_WARNING enabled

Signed-off-by: Roland Häder <roland@mxchange.org>
application/hub/classes/dht/node/class_NodeDhtFacade.php
application/hub/exceptions.php

index 66f7ba1d676955e0af9e764666c3eaec530cab79..fd25b163b806b57d162923fcd85275f81ec5e59d 100644 (file)
@@ -229,23 +229,18 @@ class NodeDhtFacade extends BaseDht implements DistributableNode, Registerable {
         */
        public function registerNodeByMessageData (array $messageData, HandleableDataSet $handlerInstance, $forceUpdate = FALSE) {
                // Get a search criteria class
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NODE-DHT-FACADE: state=%s,messageData()=%d,handlerInstance=%s,forceUpdate=%d - CALLED', $this->getPrintableState(), count($messageData), $handlerInstance->__toString(), intval($forceUpdate)));
                $searchInstance = ObjectFactory::createObjectByConfiguredName('search_criteria_class');
 
-               // Debug message
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NODE-DHT-FACADE: state=' . $this->getPrintableState() . ',messageData=' . print_r($messageData, TRUE) . ',handlerInstance=' . $handlerInstance->__toString() . ',forceUpdate=' . intval($forceUpdate) . ',count(getSearchData())=' . count($handlerInstance->getSearchData()));
-
                // Search for the node's session id and external address/hostname + TCP/UDP listen port
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NODE-DHT-FACADE: handlerInstance->searchData()=%d', count($handlerInstance->getSearchData())));
                foreach ($handlerInstance->getSearchData() as $key) {
-                       // Debug message
-                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NODE-DHT-FACADE: state=' . $this->getPrintableState() . ',key=' . $key);
-
                        // Is it there?
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NODE-DHT-FACADE: state=%s,key=%s', $this->getPrintableState(), $key));
                        assert(isset($messageData[$key]));
 
-                       // Debug message
-                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('NODE-DHT-FACADE: state=' . $this->getPrintableState() . ',messageData[' . $key . ']=' . $messageData[$key]);
-
                        // Add criteria
+                       /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('NODE-DHT-FACADE: state=%s,messageData[%s]=%s', $this->getPrintableState(), $key, $messageData[$key]));
                        $searchInstance->addCriteria(str_replace('my-', '', $key), $messageData[$key]);
                } // END - foreach
 
index 5fcd0be2b0dfad6916f6d24b31a8ee3203dc0026..1b74a7286585166af56c643457ed355485c50976 100644 (file)
@@ -137,14 +137,14 @@ function hub_assert_handler ($file, $line, $code) {
 } // END - function
 
 // Set error handler
-//set_error_handler('hub_error_handler');
+set_error_handler('hub_error_handler');
 
 // Set the new handler
 set_exception_handler('hub_exception_handler');
 
 // Init assert handling
 assert_options(ASSERT_ACTIVE    , true);
-assert_options(ASSERT_WARNING   , false);
+assert_options(ASSERT_WARNING   , true);
 assert_options(ASSERT_BAIL      , true);
 assert_options(ASSERT_QUIET_EVAL, false);
 assert_options(ASSERT_CALLBACK  , 'hub_assert_handler');