*
* @author Roland Haeder <webmaster@ship-simu.org>
* @version 0.0.0
- * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Core Developer Team
+ * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009, 2010 Core Developer Team
* @license GNU GPL 3.0 or any newer version
* @link http://www.ship-simu.org
*
*/
private $menuInstance = null;
+ /**
+ * Instance of the image
+ */
+ private $imageInstance = null;
+
+ /**
+ * Instance of the stacker
+ */
+ private $stackerInstance = null;
+
+ /**
+ * A Compressor instance
+ */
+ private $compressorInstance = null;
+
+ /**
+ * A Parseable instance
+ */
+ private $parserInstance = null;
+
+ /**
+ * A ProtocolHandler instance
+ */
+ private $protocolInstance = null;
+
+ /**
+ * A database wrapper instance
+ */
+ private $databaseInstance = null;
+
/**
* The real class name
*/
- private $realClass = 'BaseFrameworkSystem';
+ private $realClass = 'BaseFrameworkSystem';
/**
* Thousands seperator
*/
private $decimals = ','; // German
+ /**
+ * Socket resource
+ */
+ private $socketResource = false;
+
+ /**
+ * Package data
+ */
+ private $packageData = array();
+
/***********************
* Exception codes.... *
***********************/
// Some arguments are there
foreach ($args as $arg) {
// Add the type
- $argsString .= $arg . ' (' . gettype($arg);
+ $argsString .= $this->replaceControlCharacters($arg) . ' (' . gettype($arg);
// Add length if type is string
if (gettype($arg) == 'string') $argsString .= ', '.strlen($arg);
/**
* Setter for resolver instance
*
- * @param $resolverInstance Instance of a command resolver class
+ * @param $resolverInstance Instance of a command resolver class
* @return void
*/
public final function setResolverInstance (Resolver $resolverInstance) {
/**
* Getter for resolver instance
*
- * @return $resolverInstance Instance of a command resolver class
+ * @return $resolverInstance Instance of a command resolver class
*/
public final function getResolverInstance () {
return $this->resolverInstance;
/**
* Setter for database instance
*
- * @param $dbInstance The instance for the database connection
- * (forced DatabaseConnection)
+ * @param $dbInstance The instance for the database connection (forced DatabaseConnection)
* @return void
*/
public final function setDatabaseInstance (DatabaseConnection $dbInstance) {
*
* @return $realClass The name of the real class (not BaseFrameworkSystem)
*/
- public final function __toString () {
+ public function __toString () {
return $this->realClass;
}
));
// Return the result
- return $result;
+ return $equals;
+ }
+
+ /**
+ * Generates a generic hash code of this class. You should really overwrite
+ * this method with your own hash code generator code. But keep KISS in mind.
+ *
+ * @return $hashCode A generic hash code respresenting this whole class
+ */
+ public function hashCode () {
+ // Simple hash code
+ return crc32($this->__toString());
}
/**
}
// Initialize the template engine
- $templateInstance = ObjectFactory::createObjectByConfiguredName('template_class', array($appInstance));
+ $templateInstance = ObjectFactory::createObjectByConfiguredName('web_template_class', array($appInstance));
// Return the prepared instance
return $templateInstance;
));
}
+ /**
+ * Replaces control characters with printable output
+ *
+ * @param $str String with control characters
+ * @return $str Replaced string
+ */
+ protected function replaceControlCharacters ($str) {
+ // Replace them
+ $str = str_replace(
+ "\r", '[r]', str_replace(
+ "\n", '[n]', str_replace(
+ "\t", '[t]',
+ $str
+ )));
+
+ // Return it
+ return $str;
+ }
+
/**
* Output a partial stub message for the caller method
*
* @return $localized Localized value
*/
public function doFilterFormatNumber ($value) {
- // Generate it from config and localize depencies
+ // Generate it from config and localize dependencies
switch ($this->getLanguageInstance()->getLanguageCode()) {
case 'de': // German format is a bit different to default
$localized = number_format($value, $this->getConfigInstance()->getConfigEntry('decimals'), ',', '.');
}
}
- /**
- * Generates a generic hash code of this class. You should really overwrite
- * this method with your own hash code generator code. But keep KISS in mind.
- *
- * @return $hashCode A generic hash code respresenting this whole class
- */
- public function hashCode () {
- // Simple hash code
- return crc32($this->__toString());
- }
-
/**
* Checks wether the given PHP extension is loaded
*
protected final function getMenuInstance () {
return $this->menuInstance;
}
+
+ /**
+ * Setter for image instance
+ *
+ * @param $imageInstance An instance of an image
+ * @return void
+ */
+ public final function setImageInstance (BaseImage $imageInstance) {
+ $this->imageInstance = $imageInstance;
+ }
+
+ /**
+ * Getter for image instance
+ *
+ * @return $imageInstance An instance of an image
+ */
+ public final function getImageInstance () {
+ return $this->imageInstance;
+ }
+
+ /**
+ * Setter for stacker instance
+ *
+ * @param $stackerInstance An instance of an stacker
+ * @return void
+ */
+ public final function setStackerInstance (Stackable $stackerInstance) {
+ $this->stackerInstance = $stackerInstance;
+ }
+
+ /**
+ * Getter for stacker instance
+ *
+ * @return $stackerInstance An instance of an stacker
+ */
+ public final function getStackerInstance () {
+ return $this->stackerInstance;
+ }
+
+ /**
+ * Setter for compressor instance
+ *
+ * @param $compressorInstance An instance of an compressor
+ * @return void
+ */
+ public final function setCompressorInstance (Compressor $compressorInstance) {
+ $this->compressorInstance = $compressorInstance;
+ }
+
+ /**
+ * Getter for compressor instance
+ *
+ * @return $compressorInstance An instance of an compressor
+ */
+ public final function getCompressorInstance () {
+ return $this->compressorInstance;
+ }
+
+ /**
+ * Setter for Parseable instance
+ *
+ * @param $parserInstance An instance of an Parseable
+ * @return void
+ */
+ public final function setParserInstance (Parseable $parserInstance) {
+ $this->parserInstance = $parserInstance;
+ }
+
+ /**
+ * Getter for Parseable instance
+ *
+ * @return $parserInstance An instance of an Parseable
+ */
+ public final function getParserInstance () {
+ return $this->parserInstance;
+ }
+
+ /**
+ * Setter for ProtocolHandler instance
+ *
+ * @param $protocolInstance An instance of an ProtocolHandler
+ * @return void
+ */
+ public final function setProtocolInstance (ProtocolHandler $protocolInstance) {
+ $this->protocolInstance = $protocolInstance;
+ }
+
+ /**
+ * Getter for ProtocolHandler instance
+ *
+ * @return $protocolInstance An instance of an ProtocolHandler
+ */
+ public final function getProtocolInstance () {
+ return $this->protocolInstance;
+ }
+
+ /**
+ * Setter for BaseDatabaseWrapper instance
+ *
+ * @param $wrapperInstance An instance of an BaseDatabaseWrapper
+ * @return void
+ */
+ public final function setWrapperInstance (BaseDatabaseWrapper $wrapperInstance) {
+ $this->wrapperInstance = $wrapperInstance;
+ }
+
+ /**
+ * Getter for BaseDatabaseWrapper instance
+ *
+ * @return $wrapperInstance An instance of an BaseDatabaseWrapper
+ */
+ public final function getWrapperInstance () {
+ return $this->wrapperInstance;
+ }
+
+ /**
+ * Setter for socket resource
+ *
+ * @param $socketResource A valid socket resource
+ * @return void
+ */
+ public final function setSocketResource ($socketResource) {
+ $this->socketResource = $socketResource;
+ }
+
+ /**
+ * Getter for socket resource
+ *
+ * @return $socketResource A valid socket resource
+ */
+ public function getSocketResource () {
+ return $this->socketResource;
+ }
+
+ /**
+ * Setter for raw package Data
+ *
+ * @param $packageData Raw package Data
+ * @return void
+ */
+ public final function setPackageData (array $packageData) {
+ $this->packageData = $packageData;
+ }
+
+ /**
+ * Getter for raw package Data
+ *
+ * @return $packageData Raw package Data
+ */
+ public function getPackageData () {
+ return $this->packageData;
+ }
}
// [EOF]