X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fclasses%2Fmain%2Fclass_BaseFrameworkSystem.php;h=b3ad65ff8cc163cea7d0c01f00b6e36a4d1ec059;hb=8388b0ef4894097cbd2f44d0efb29e1d8e64a728;hp=370e2ff0f4baa6de2ebb75aa63686c53bf449234;hpb=8e5bb526ab03b1de868e80e9bf0ef662ba2421a3;p=core.git diff --git a/inc/classes/main/class_BaseFrameworkSystem.php b/inc/classes/main/class_BaseFrameworkSystem.php index 370e2ff0..b3ad65ff 100644 --- a/inc/classes/main/class_BaseFrameworkSystem.php +++ b/inc/classes/main/class_BaseFrameworkSystem.php @@ -5,7 +5,7 @@ * * @author Roland Haeder * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2011 Core Developer Team + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2012 Core Developer Team * @license GNU GPL 3.0 or any newer version * @link http://www.ship-simu.org * @@ -1346,7 +1346,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { } // END - if // Construct the full message - $stubMessage = sprintf("[%s:] Partial stub!", + $stubMessage = sprintf('[%s:] Partial stub!', $methodName ); @@ -1377,7 +1377,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface { // Sorry, there is no other way getting this nice backtrace if (!empty($message)) { // Output message - printf("Message: %s
" . chr(10), $message); + printf('Message: %s
' . chr(10), $message); } // END - if print('
');
@@ -1398,8 +1398,16 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
 	 * @return	void
 	 */
 	public function debugOutput ($message, $doPrint = true) {
-		// Get debug instance
-		$debugInstance = $this->getDebugInstance();
+		// Set debug instance to NULL
+		$debugInstance = NULL;
+
+		// Try it:
+		try {
+			// Get debug instance
+			$debugInstance = $this->getDebugInstance();
+		} catch (NullPointerException $e) {
+			// The debug instance is not set (yet)
+		}
 
 		// Is the debug instance there?
 		if (is_object($debugInstance)) {
@@ -1422,7 +1430,10 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
 				// Print message
 				print($message . chr(10));
 			} else {
-				// DO NOT REWRITE THIS TO app_die() !!!
+				/*
+				 * BIG FAT NOTE: Do NEVER rewrite this to app_die(), this will
+				 * cause an endless loop.
+				 */
 				die($message);
 			}
 		}
@@ -1625,11 +1636,17 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
 		$fieldArray = $resultInstance->current();
 		//* DEBUG: */ $this->debugOutput($fieldName.':
'.print_r($fieldArray, true).'
'); + // Convert dashes to underscore + $fieldName = $this->convertDashesToUnderscores($fieldName); + // Does the field exist? if (isset($fieldArray[$fieldName])) { // Get it $fieldValue = $fieldArray[$fieldName]; - } // END - if + } else { + // Missing field entry, may require debugging + $this->debugOutput($this->__toString() . ':fieldname=' . $fieldName . ' not found!'); + } // Return it return $fieldValue;