]> git.mxchange.org Git - core.git/commitdiff
New method replaceControlCharacters() introduced (very basic implementation), typo...
authorRoland Häder <roland@mxchange.org>
Tue, 22 Dec 2009 15:43:40 +0000 (15:43 +0000)
committerRoland Häder <roland@mxchange.org>
Tue, 22 Dec 2009 15:43:40 +0000 (15:43 +0000)
inc/classes/exceptions/stacker/class_NoStackerException.php
inc/classes/main/class_BaseFrameworkSystem.php

index f610d27140717ffff5b3ebe444b046f31952c4aa..a8639bc4c0282513621fd001827919a440d5f878 100644 (file)
@@ -31,7 +31,7 @@ class NoStackerException extends FrameworkException {
         */
        public function __construct(array $messageArray, $code) {
                // Construct message
-               $message = sprintf("[%s:%d] Stacker %s is not intialized.",
+               $message = sprintf("[%s:%d] Stacker %s is not initialized.",
                        $messageArray[0]->__toString(),
                        $this->getLine(),
                        $messageArray[1]
index 10b67239db4697fbe098c0e904462f7f92241f7f..ecca05012742e2f3eff381b42a470bfd0854bea6 100644 (file)
@@ -236,7 +236,7 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                        // 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);
@@ -731,6 +731,25 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                ));
        }
 
+       /**
+        * 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
         *