application/hub/interfaces/helper/.htaccess -text svneol=unset#text/plain
application/hub/interfaces/helper/hub/.htaccess -text svneol=unset#text/plain
application/hub/interfaces/helper/hub/class_HelpableHub.php svneol=native#text/plain
+application/hub/interfaces/helper/messages/.htaccess svneol=native#text/plain
+application/hub/interfaces/helper/messages/class_MessageHelper.php svneol=native#text/plain
application/hub/interfaces/listener/.htaccess -text svneol=unset#text/plain
application/hub/interfaces/listener/class_Listenable.php -text svneol=unset#text/plain
application/hub/interfaces/lists/.htaccess -text svneol=unset#text/plain
application/hub/main/helper/messages/class_BaseMessageHelper.php svneol=native#text/plain
application/hub/main/helper/messages/crypto/.htaccess svneol=native#text/plain
application/hub/main/helper/messages/crypto/class_CryptoRandomMessageHelper.php svneol=native#text/plain
+application/hub/main/helper/messages/crypto/class_CryptoRandomUnitMessageHelper.php svneol=native#text/plain
application/hub/main/helper/work_units/.htaccess svneol=native#text/plain
application/hub/main/helper/work_units/class_ -text
application/hub/main/helper/work_units/class_BaseWorkUnitHelper.php svneol=native#text/plain
$cfg->setConfigEntry('test_unit_source_class', 'TestUnitSource');
// CFG: CRYPTO-RANDOM-MESSAGE-HELPER-CLASS
-$cfg->setConfigEntry('crypto_random_message_helper_class', 'CryptoRandomMessageHelper');
+$cfg->setConfigEntry('crypto_random_message_helper_class', 'CryptoRandomUnitMessageHelper');
// [EOF]
?>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-interface HelpableHub extends FrameworkInterface {
+interface HelpableHub extends Helper {
/**
* Loads the descriptor XML file
*
--- /dev/null
+Deny from all
--- /dev/null
+<?php
+/**
+ * An interface for message helper
+ *
+ * @author Roland Haeder <webmaster@ship-simu.org>
+ * @version 0.0.0
+ * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 Hub Developer Team
+ * @license GNU GPL 3.0 or any newer version
+ * @link http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+interface MessageHelper extends Helper {
+}
+
+// [EOF]
+?>
<?php
-/**
- * An interface for message helper
- *
- * @author Roland Haeder <webmaster@ship-simu.org>
- * @version 0.0.0
- * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 Hub Developer Team
- * @license GNU GPL 3.0 or any newer version
- * @link http://www.ship-simu.org
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-interface MessageHelper extends FrameworkInterface {
-}
-
-// [EOF]
+// @DEPRECATED
?>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-class TcpConnectionHelper extends BaseConnectionHelper {
+class TcpConnectionHelper extends BaseConnectionHelper implements Helper {
/**
* Protected constructor
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-class UdpConnectionHelper extends BaseConnectionHelper {
+class UdpConnectionHelper extends BaseConnectionHelper implements Helper {
/**
* Protected constructor
*
<?php
-/**
- * A CryptoRandom message helper
- *
- * @author Roland Haeder <webmaster@ship-simu.org>
- * @version 0.0.0
- * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 Hub Developer Team
- * @license GNU GPL 3.0 or any newer version
- * @link http://www.ship-simu.org
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-class CryptoRandomMessageHelper extends BaseMessageHelper implements MessageHelper {
- /**
- * Protected constructor
- *
- * @return void
- */
- protected function __construct () {
- // Call parent constructor
- parent::__construct(__CLASS__);
- }
-
- /**
- * Creates an instance of this class
- *
- * @return $messageInstance An instance of a UnitHelper class
- */
- public final static function createCryptoRandomMessageHelper () {
- // Get new instance
- $messageInstance = new CryptoRandomMessageHelper();
-
- // Create a RNG instance and set it in this class
- $rngInstance = ObjectFactory::createObjectByConfiguredName('rng_class');
- $messageInstance->setRngInstance($rngInstance);
-
- // And also a crypto instance (for our encrypted messages)
- $cryptoInstance = ObjectFactory::createObjectByConfiguredName('crypto_class');
- $messageInstance->setCryptoInstance($cryptoInstance);
-
- // Return the prepared instance
- return $messageInstance;
- }
-
- /**
- * Generates an encrypted random message
- *
- * @return $encryptedMessage The encrypted random message
- */
- public function generateRandomMessage () {
- // Get a very secret message by encoding and random string with BASE64
- $secretMessage = base64_encode($this->getRngInstance()->randomString($this->getConfigInstance()->getConfigEntry('random_secret_message_length')));
-
- // Get a random, secret key
- $secretKey = $this->getRngInstance()->randomString($this->getConfigInstance()->getConfigEntry('random_secret_key_length'));
-
- // Now encrypt the message with our key and a good (strong) cipher
- $encryptedMessage = base64_encode($this->getCryptoInstance()->encryptString($secretMessage, $secretKey));
-
- // Return it
- return $encryptedMessage;
- }
-}
-
-// [EOF]
+// @DEPRECATED
?>
--- /dev/null
+<?php
+/**
+ * A CryptoRandom message helper
+ *
+ * @author Roland Haeder <webmaster@ship-simu.org>
+ * @version 0.0.0
+ * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 Hub Developer Team
+ * @license GNU GPL 3.0 or any newer version
+ * @link http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class CryptoRandomUnitMessageHelper extends BaseMessageHelper implements MessageHelper {
+ /**
+ * Protected constructor
+ *
+ * @return void
+ */
+ protected function __construct () {
+ // Call parent constructor
+ parent::__construct(__CLASS__);
+ }
+
+ /**
+ * Creates an instance of this class
+ *
+ * @param $sourceType Type of the source
+ * @return $messageInstance An instance of a UnitHelper class
+ */
+ public final static function createCryptoRandomUnitMessageHelper ($sourceType) {
+ // Get new instance
+ $messageInstance = new CryptoRandomUnitMessageHelper();
+
+ // Generate a source instance
+ $sourceInstance = UnitSourceFactory::createUnitSourceInstance($sourceType);
+
+ // Set the source instance
+ $messageInstance->setSourceInstance($sourceInstance);
+
+ // Return the prepared instance
+ return $messageInstance;
+ }
+
+ /**
+ * Generates an encrypted random message
+ *
+ * @return $encryptedMessage The encrypted random message
+ */
+ public function generateRandomMessage () {
+ // Get the message from our source
+ $encryptedMessage = $this->getSourceInstance()->generateMessageFromSource();
+
+ // Return it
+ return $encryptedMessage;
+ }
+}
+
+// [EOF]
+?>
*/
private $outgoingQueueInstance = null;
- /**
- * Every procuded item/unit/etc. usually have a source
- */
- private $sourceInstance = null;
-
/**
* Protected constructor
*
* @param $outgoingQueueInstance The out-going work queue instance
* @return void
*/
- private function setOutgoingQueueInstance (Stackable $outgoingQueueInstance) {
+ private final function setOutgoingQueueInstance (Stackable $outgoingQueueInstance) {
$this->outgoingQueueInstance = $outgoingQueueInstance;
}
*
* @param $outgoingQueueInstance The out-going work queue instance
*/
- protected function getOutgoingQueueInstance () {
+ protected final function getOutgoingQueueInstance () {
return $this->outgoingQueueInstance;
}
- /**
- * Setter for a Sourceable instance
- *
- * @param $sourceInstance The Sourceable instance
- * @return void
- */
- protected function setSourceInstance (Sourceable $sourceInstance) {
- $this->sourceInstance = $sourceInstance;
- }
-
- /**
- * Getter for a Sourceable instance
- *
- * @param $sourceInstance The Sourceable instance
- */
- protected function getSourceInstance () {
- return $this->sourceInstance;
- }
-
/**
* Initializes this producer, this method must be overwritten.
*
// Get new instance
$producerInstance = new CruncherTestUnitProducer();
- // Test units have a 'test' source
- $sourceInstance = UnitSourceFactory::createUnitSourceInstance('test');
+ // Test units have a helper class that wraps the source
+ $helperInstance = ObjectFactory::createObjectByConfiguredName('crypto_random_message_helper_class', array('test'));
// So set it in the producer
- $producerInstance->setSourceInstance($sourceInstance);
+ $producerInstance->setHelperInstance($helperInstance);
// Return the prepared instance
return $producerInstance;
$this->debugInstance();
} else {
// Get an encrypted, random message from our source
- $encryptedMessage = $this->getSourceInstance()->generateMessageFromSource();
+ $encryptedMessage = $this->getHelperInstance()->generateRandomMessage();
die($encryptedMessage."\n");
}
}
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
class TestUnitSource extends BaseSource implements Sourceable {
- /**
- * Message helper instance
- */
- private $messageInstance = null;
-
/**
* Protected constructor
*
// Get new instance
$sourceInstance = new TestUnitSource();
+ // Create a RNG instance and set it in this class
+ $rngInstance = ObjectFactory::createObjectByConfiguredName('rng_class');
+ $sourceInstance->setRngInstance($rngInstance);
+
+ // And also a crypto instance (for our encrypted messages)
+ $cryptoInstance = ObjectFactory::createObjectByConfiguredName('crypto_class');
+ $sourceInstance->setCryptoInstance($cryptoInstance);
+
// Return the prepared instance
return $sourceInstance;
}
* @return $encryptedMessage The encrypted random message
*/
public function generateMessageFromSource () {
- // Is the instance set?
- if (is_null($this->messageInstance)) {
- // No, then create a new instance
- $this->messageInstance = ObjectFactory::createObjectByConfiguredName('crypto_random_message_helper_class');
- } // END - if
+ // Get a very secret message by encoding and random string with BASE64
+ $secretMessage = base64_encode($this->getRngInstance()->randomString($this->getConfigInstance()->getConfigEntry('random_secret_message_length')));
+
+ // Get a random, secret key
+ $secretKey = $this->getRngInstance()->randomString($this->getConfigInstance()->getConfigEntry('random_secret_key_length'));
- // Get the message from the message helper
- $encryptedMessage = $this->messageInstance->generateRandomMessage();
+ // Now encrypt the message with our key and a good (strong) cipher
+ $encryptedMessage = base64_encode($this->getCryptoInstance()->encryptString($secretMessage, $secretKey));
// Return it
return $encryptedMessage;
./inc/classes/exceptions/main/class_MissingMethodException.php:13: * @todo Try to rewrite user/guest login classes and mark this exception as deprecated
./inc/classes/exceptions/main/class_NoConfigEntryException.php:10: * @todo Rename this class to NoFoundEntryException
./inc/classes/interfaces/class_FrameworkInterface.php:11: * @todo Find a better name for this interface
-./inc/classes/main/class_BaseFrameworkSystem.php:1168: * @todo Write a logging mechanism for productive mode
-./inc/classes/main/class_BaseFrameworkSystem.php:1182: // @TODO Finish this part!
-./inc/classes/main/class_BaseFrameworkSystem.php:159: // @todo Try to clean these constants up
-./inc/classes/main/class_BaseFrameworkSystem.php:345: * @todo SearchableResult and UpdateableResult shall have a super interface to use here
+./inc/classes/main/class_BaseFrameworkSystem.php:1178: * @todo Write a logging mechanism for productive mode
+./inc/classes/main/class_BaseFrameworkSystem.php:1192: // @TODO Finish this part!
+./inc/classes/main/class_BaseFrameworkSystem.php:169: // @todo Try to clean these constants up
+./inc/classes/main/class_BaseFrameworkSystem.php:355: * @todo SearchableResult and UpdateableResult shall have a super interface to use here
./inc/classes/main/commands/web/class_WebLoginAreaCommand.php:64: * @todo Add some stuff here: Some personal data, app/game related data
./inc/classes/main/commands/web/class_WebProblemCommand.php:58: * @todo 0% done
./inc/classes/main/commands/web/class_WebStatusCommand.php:58: * @todo 0% done
./inc/selector.php:11: * @todo We should minimize these includes
./index.php:59: * @todo This method is old code and needs heavy rewrite
### ### DEPRECATION FOLLOWS: ### ###
+./application/hub/interfaces/messages/class_MessageHelper.php:2:// @DEPRECATED
./application/hub/main/database/wrapper/class_NodeInformationDatabaseWrapper.php:2:// @DEPRECATED
./application/hub/main/database/wrapper/class_NodeListDatabaseWrapper.php:2:// @DEPRECATED
./application/hub/main/database/wrapper/class_PeerStateLookupDatabaseWrapper.php:2:// @DEPRECATED
./application/hub/main/filter/task/class_CruncherTaskHandlerInitializerFilter.php:2:// @DEPRECATED
./application/hub/main/filter/task/class_HubTaskHandlerInitializerFilter.php:2:// @DEPRECATED
./application/hub/main/filter/task/class_TaskHandlerInitializerFilter.php:2:// @DEPRECATED
+./application/hub/main/helper/messages/crypto/class_CryptoRandomMessageHelper.php:2:// @DEPRECATED
./application/hub/main/nodes/class_BaseHubNode.php:50: * @deprecated
./application/hub/main/template/announcement/class_AnnouncementTemplateEngine.php:2:// @DEPRECATED
./application/hub/main/template/connect/class_SelfConnectTemplateEngine.php:2:// @DEPRECATED
./inc/classes/exceptions/language/class_MissingLanguageHandlerException.php:2:// @DEPRECATED
./inc/classes/exceptions/main/class_ClassNotFoundException.php:2:// @DEPRECATED
./inc/classes/exceptions/main/class_ConfigEntryNotFoundException.php:2:// @DEPRECATED
+./inc/classes/interfaces/helper/class_HelpableLogin.php:2:// @DEPRECATED
+./inc/classes/interfaces/helper/class_HelpableTemplate.php:2:// @DEPRECATED
./inc/classes.php:9: * @deprecated
./inc/database.php:10: * @deprecated
./inc/file_io.php:2:// @DEPRECATED