]> git.mxchange.org Git - hub.git/commitdiff
The encrypted message is now assigned to its template variable, big comment added...
authorRoland Häder <roland@mxchange.org>
Tue, 29 Mar 2011 22:08:12 +0000 (22:08 +0000)
committerRoland Häder <roland@mxchange.org>
Tue, 29 Mar 2011 22:08:12 +0000 (22:08 +0000)
application/hub/main/producer/cruncher/work_units/class_CruncherTestUnitProducer.php

index 0f2b55b732969ae872defde13b0c5abee8f1cd0b..545babfeeb36006329f95b851439b1527e6b584b 100644 (file)
@@ -87,7 +87,7 @@ class CruncherTestUnitProducer extends BaseUnitProducer implements UnitProducer,
                // Add criteria for looking up already created and available test units
                $searchInstance->addCriteria(CruncherUnitDatabaseWrapper::DB_COLUMN_UNIT_TYPE  , BaseUnitProducer::UNIT_TYPE_TEST_UNIT);
                $searchInstance->addCriteria(CruncherUnitDatabaseWrapper::DB_COLUMN_UNIT_STATUS, BaseUnitProducer::UNIT_STATUS_AVAILABLE);
-               $searchInstance->setLimit($this->getConfigInstance()->getConfigEntry('cruncher_test_unit_max_count'));
+               $searchInstance->setConfiguredLimit('cruncher_test_unit_max_count');
 
                // Search for our units
                $resultInstance = $wrapperInstance->doSelectByCriteria($searchInstance);
@@ -100,7 +100,21 @@ class CruncherTestUnitProducer extends BaseUnitProducer implements UnitProducer,
                } else {
                        // Get an encrypted, random message from our source
                        $encryptedMessage = $this->getHelperInstance()->generateRandomMessage();
-                       die($encryptedMessage."\n");
+
+                       // Debug message
+                       $this->debugOutput('PRODUCER: An encrypted, random message has been generated. Generating keys ...');
+
+                       // Set the encrypted message in the template instance
+                       $this->getTemplateInstance()->assignVariable('encrypted_message', $encryptedMessage);
+
+                       /*
+                        * Now we need to create an iterator, just as for the work units,
+                        * to create new keys from the encrypted message. The iterator will
+                        * not iterate over an object or collection. It will instead
+                        * encapsulate "key production" into a class and not in a simple
+                        * for() loop. These keys then needs to be bundled into test units
+                        * and stored to database for later re-usage.
+                        */
                }
        }
 }