From 66475fd767c61dcaf8d50bfa9ef3226c10419d7b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Tue, 29 Mar 2011 22:08:12 +0000 Subject: [PATCH] The encrypted message is now assigned to its template variable, big comment added for upcoming (tomorrow more) commits --- .../class_CruncherTestUnitProducer.php | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/application/hub/main/producer/cruncher/work_units/class_CruncherTestUnitProducer.php b/application/hub/main/producer/cruncher/work_units/class_CruncherTestUnitProducer.php index 0f2b55b73..545babfee 100644 --- a/application/hub/main/producer/cruncher/work_units/class_CruncherTestUnitProducer.php +++ b/application/hub/main/producer/cruncher/work_units/class_CruncherTestUnitProducer.php @@ -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. + */ } } } -- 2.39.5