]> git.mxchange.org Git - hub.git/blobdiff - application/hub/main/cruncher/mcrypt/class_HubMcryptCruncher.php
Introduced experimental apt-proxy sub project (a connector for apt-proxy usage into...
[hub.git] / application / hub / main / cruncher / mcrypt / class_HubMcryptCruncher.php
index 442268e7c93cf4f560abc2de6eede8a982aa3ed4..51d6224442f671581f004e7a5df9bd8f09e59c6d 100644 (file)
@@ -4,7 +4,7 @@
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 Hub Developer Team
+ * @copyright  Copyright (c) 2011 - 2012 Cruncher Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -64,7 +64,10 @@ class HubMcryptCruncher extends BaseHubCruncher implements CruncherHelper, Regis
                if ($this->getConfigInstance()->getConfigEntry('cruncher_test_units_enabled') == 'N') {
                        // They are disabled, so skip any further steps
                        return;
-               } // END - if
+               } elseif ($this->getStateInstance()->isCruncherStateVirgin()) {
+                       // No virgin crunchers please, because they usually have no test units ready for crunching
+                       return;
+               }
 
                // Get a test-unit generator instance
                $generatorInstance = ObjectFactory::createObjectByConfiguredName('cruncher_test_unit_generator_class');
@@ -72,7 +75,7 @@ class HubMcryptCruncher extends BaseHubCruncher implements CruncherHelper, Regis
                // We don't need an iterator here because we just need to generate some test units
                for ($idx = 0; $idx < $this->getConfigInstance()->getConfigEntry('cruncher_max_text_unit_amount'); $idx++) {
                        // Get a test unit from it
-                       $unitInstance = $generatorInstance->generateUnit();
+                       $unitInstance = $generatorInstance->generateNextUnitInstance();
 
                        // ... and finally queue it to the in-buffer queue
                        $this->queueUnitInstanceToInBuffer($unitInstance);
@@ -86,6 +89,13 @@ class HubMcryptCruncher extends BaseHubCruncher implements CruncherHelper, Regis
         * @return      void
         */
        protected function fillInBufferQueueWithWorkUnits () {
+               // This cruncher's state must not be one of these: 'virgin'
+               if ($this->getStateInstance()->isCruncherStateVirgin()) {
+                       // We can silently skip here, until the generation is finished
+                       return;
+               } // END - if
+
+               // @TODO Implement this method
                $this->partialStub('Please implement this method.');
        }
 
@@ -109,14 +119,14 @@ class HubMcryptCruncher extends BaseHubCruncher implements CruncherHelper, Regis
         */
        public function outputConsoleTeaser () {
                // Output all lines
-               $this->debugOutput(' ');
-               $this->debugOutput('MCrypt Cruncher v' . $this->getVersion() . ' is starting ...');
-               $this->debugOutput('Copyright (c) 2011 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(' ');
+               self::createDebugInstance(__CLASS__)->debugOutput(' ');
+               self::createDebugInstance(__CLASS__)->debugOutput('MCrypt Cruncher v' . $this->getVersion() . ' is starting ...');
+               self::createDebugInstance(__CLASS__)->debugOutput('Copyright (c) 2011 Cruncher Developer Team');
+               self::createDebugInstance(__CLASS__)->debugOutput(' ');
+               self::createDebugInstance(__CLASS__)->debugOutput('This program comes with ABSOLUTELY NO WARRANTY; for details see docs/COPYING.');
+               self::createDebugInstance(__CLASS__)->debugOutput('This is free software, and you are welcome to redistribute it under certain');
+               self::createDebugInstance(__CLASS__)->debugOutput('conditions; see docs/COPYING for details.');
+               self::createDebugInstance(__CLASS__)->debugOutput(' ');
        }
 
        /**