]> git.mxchange.org Git - hub.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Mon, 26 Oct 2020 08:49:10 +0000 (09:49 +0100)
committerRoland Häder <roland@mxchange.org>
Mon, 26 Oct 2020 08:49:10 +0000 (09:49 +0100)
- fixed some more old $packageData to $packageInstance

Signed-off-by: Roland Häder <roland@mxchange.org>
application/hub/classes/tags/package/class_PackageTags.php
application/hub/classes/template/objects/class_XmlObjectRegistryTemplateEngine.php

index d25d7ad8baedaa66870925a90bbaa5b48019e617..bcf0c093a71c9f0c80970881181f60e38e6b55b4 100644 (file)
@@ -133,7 +133,7 @@ class PackageTags extends BaseTag implements Tagable {
         * shared over the whole hub-network. So if the "tag" (let's better say
         * object type) isn't found in that XML the package won't be distributed.
         *
-        * @param       $packageData                    An instance of a DeliverablePackage class
+        * @param       $packageInstance                An instance of a DeliverablePackage class
         * @return      void
         * @throws      InvalidTagException             If a provided tag from the package data is invalid
         */
@@ -144,7 +144,7 @@ class PackageTags extends BaseTag implements Tagable {
                // "Walk" over all tags
                foreach ($this->getTags() as $tag) {
                        // Debug output
-                       self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TAGS: Validating tag ' . $tag . ' ...');
+                       self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('TAGS: Validating tag %s ...', $tag));
 
                        // Get an array from this tag
                        $entry = $objectRegistryInstance->getArrayFromKey(XmlObjectRegistryTemplateEngine::OBJECT_TYPE_DATA_NAME, $tag);
@@ -159,7 +159,7 @@ class PackageTags extends BaseTag implements Tagable {
                        } // END - if
 
                        // Now save the last discovered protocol/recipient type
-                       $this->lastProtocol      = ProtocolHandlerFactory::createProtocolHandlerFromPackageInstance($packageData);
+                       $this->lastProtocol      = ProtocolHandlerFactory::createProtocolHandlerFromPackageInstance($packageInstance);
                        $this->lastRecipientType = $entry[XmlObjectRegistryTemplateEngine::OBJECT_TYPE_DATA_RECIPIENT_TYPE];
                } // END - foreach
        }
@@ -167,15 +167,15 @@ class PackageTags extends BaseTag implements Tagable {
        /**
         * Chooses the right protocol from given package data
         *
-        * @param       $packageData    An instance of a DeliverablePackage class
+        * @param       $packageInstance        An instance of a DeliverablePackage class
         * @return      $lastProtocol   An instance of the last used HandleableProtocol class
         */
        public function chooseProtocolFromPackageInstance (DeliverablePackage $packageInstance) {
                // Extract the tags
-               $this->extractTagsFromPackageInstance($packageData);
+               $this->extractTagsFromPackageInstance($packageInstance);
 
                // Now we need to verify every single tag
-               $this->verifyAllTags($packageData);
+               $this->verifyAllTags($packageInstance);
 
                // Return the last (and only) found protocol (e.g. 'tcp' is very usual)
                return $this->lastProtocol;
@@ -184,16 +184,16 @@ class PackageTags extends BaseTag implements Tagable {
        /**
         * Checks whether the given package data is accepted by the listener
         *
-        * @param       $packageData            An instance of a DeliverablePackage class
+        * @param       $packageInstance                An instance of a DeliverablePackage class
         * @param       $listenerInstance       A Listenable instance
         * @return      $accepts                        Whether it is accepted
         */
        public function ifPackageDataIsAcceptedByListener (DeliverablePackage $packageInstance, Listenable $listenerInstance) {
                // Extract the tags
-               $this->extractTagsFromPackageInstance($packageData);
+               $this->extractTagsFromPackageInstance($packageInstance);
 
                // Now every single tag needs to be validated
-               $this->verifyAllTags($packageData);
+               $this->verifyAllTags($packageInstance);
 
                // Now simply check it out
                $accepts = (($this->lastRecipientType == $listenerInstance->getListenerType()) && ($listenerInstance->getListenerType() != 'invalid'));
index 84032e1bc409651df6cb85e826199d5dff13bf36..b389c1166d886d42c4becac9ec6f2a08a8ce15e7 100644 (file)
@@ -99,10 +99,10 @@ class XmlObjectRegistryTemplateEngine extends BaseXmlTemplateEngine implements C
         * @param       $resource               XML parser resource (currently ignored)
         * @param       $characters             Characters to handle
         * @return      void
-        * @todo        Find something useful with this!
         */
        public function characterHandler ($resource, $characters) {
                // Trim all spaces away
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('TAGS: resource[%s]=%s,characters[%s]=%s - CALLED!', gettype($resource), $resource, gettype($characters), $characters));
                $characters = trim($characters);
 
                // Is this string empty?
@@ -115,13 +115,15 @@ class XmlObjectRegistryTemplateEngine extends BaseXmlTemplateEngine implements C
                $nodeName = $this->getStackInstance()->getNamed('node_object_registry');
 
                // Is the node name self::OBJECT_TYPE_DATA_NAME?
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('TAGS: Checking nodeName=%s ...', $nodeName));
                if ($nodeName == self::OBJECT_TYPE_DATA_NAME) {
                        // Output debug message
-                       self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TAGS: Adding object type ' . $characters . ' to registry.');
+                       //* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TAGS: Adding object type ' . $characters . ' to registry.');
+                       $this->objectRegistryInstance->addEntry($nodeName, $characters);
                } // END - if
 
                // Add it to the registry
-               $this->objectRegistryInstance->addEntry($nodeName, $characters);
+               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TAGS: EXIT!');
        }
 
        /**
@@ -294,7 +296,5 @@ class XmlObjectRegistryTemplateEngine extends BaseXmlTemplateEngine implements C
                // Pop the last entry
                $this->getStackInstance()->popNamed('node_object_registry');
        }
-}
 
-// [EOF]
-?>
+}