*
* @author Roland Haeder <webmaster@ship-simu.org>
* @version 0.0.0
- * @copyright Copyright (c) 2007 - 2009 Roland Haeder, this is free software
+ * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 Core Developer Team
* @license GNU GPL 3.0 or any newer version
* @link http://www.ship-simu.org
*
$this->setConfigInstance(FrameworkConfiguration::getInstance());
// Add application helper to our class
- $this->systemclasses[] = $this->getConfigInstance()->readConfig('app_helper_class');
+ $this->systemclasses[] = $this->getConfigInstance()->getConfigEntry('app_helper_class');
// Set debug instance
- $this->setDebugInstance(DebugMiddleware::createDebugMiddleware($this->getConfigInstance()->readConfig('debug_class')));
+ $this->setDebugInstance(DebugMiddleware::createDebugMiddleware($this->getConfigInstance()->getConfigEntry('debug_class')));
// Get output instance and set it
- $outputInstance = ObjectFactory::createObjectByConfiguredName('web_engine', array($this->getConfigInstance()->readConfig('web_content_type')));
+ $outputInstance = ObjectFactory::createObjectByConfiguredName('output_class', array($this->getConfigInstance()->getConfigEntry('web_content_type')));
$this->setWebOutputInstance($outputInstance);
// Set the compressor channel
$this->setCompressorChannel(CompressorChannel::createCompressorChannel(
- $this->getConfigInstance()->readConfig('base_path').
- $this->getConfigInstance()->readConfig('compressor_base_path')
+ $this->getConfigInstance()->getConfigEntry('base_path').
+ $this->getConfigInstance()->getConfigEntry('compressor_base_path')
));
// Initialization done! :D
return ($this->__toString() == $className);
}
- /**
- * Stub method (only real cabins shall override it)
- *
- * @return boolean false = is no cabin, true = is a cabin
- * @deprecated
- */
- public function isCabin () {
- return false;
- }
-
- /**
- * Stub method for tradeable objects
- *
- * @return boolean false = is not tradeable by the Merchant class,
- * true = is a tradeable object
- * @deprecated
- */
- public function isTradeable () {
- return false;
- }
-
/**
* Formats computer generated price values into human-understandable formats
* with thousand and decimal seperators.
} // END - if
} // END - if
- // Generate FQFN for all application templates
- $fqfn = sprintf("%s%s/%s",
- $this->getConfigInstance()->readConfig('application_path'),
- strtolower($appInstance->getAppShortName()),
- $this->getConfigInstance()->readConfig('tpl_base_path')
- );
-
// Are both instances set?
if ($appInstance->getLanguageInstance() === null) {
// Invalid language instance
}
// Initialize the template engine
- $templateInstance = ObjectFactory::createObjectByConfiguredName('template_class', array($fqfn, $appInstance->getLanguageInstance(), $appInstance->getFileIoInstance()));
+ $templateInstance = ObjectFactory::createObjectByConfiguredName('template_class', array($appInstance));
// Return the prepared instance
return $templateInstance;
if ($doPrint === false) die(); // Die here if not printed
} else {
// Put directly out
- if ($doPrint) {
+ if ($doPrint === true) {
print($message);
} else {
// DO NOT REWRITE THIS TO app_die() !!!
$className = '';
// Convert all dashes in underscores
- $str = $this->convertDashesToUnderscore($str);
+ $str = $this->convertDashesToUnderscores($str);
// Now use that underscores to get classname parts for hungarian style
foreach (explode('_', $str) as $strPart) {
$timeArray = explode(':', $dateTime[1]);
// Construct the timestamp
- $readable = sprintf($this->getConfigInstance()->readConfig('german_date_time'),
+ $readable = sprintf($this->getConfigInstance()->getConfigEntry('german_date_time'),
$dateArray[0],
$dateArray[1],
$dateArray[2],
$wrapperInstance->doUpdateByResult($this->getResultInstance());
} // END - if
}
+
+ /**
+ * Outputs a deprecation warning to the developer.
+ *
+ * @param $message The message we shall output to the developer
+ * @return void
+ * @todo Write a logging mechanism for productive mode
+ */
+ public function deprecationWarning ($message) {
+ // Is developer mode active?
+ if (defined('DEVELOPER')) {
+ // Debug instance is there?
+ if (!is_null($this->getDebugInstance())) {
+ // Output stub message
+ $this->debugOutput($message);
+ } else {
+ // Trigger an error
+ trigger_error($message."<br />\n");
+ }
+ } else {
+ // @TODO Finish this part!
+ $this->partialStub('Developer mode inactive. Message:' . $message);
+ }
+ }
}
// [EOF]