Log.php
function _extractMessage($message)
    {
        /*
         * If we've been given an object, attempt to extract the message using
         * a known method.  If we can't find such a method, default to the
         * "human-readable" version of the object.
         *
         * We also use the human-readable format for arrays.
         */
        if (is_object($message)) {
            if (method_exists($message, 'getmessage')) {
                $message = $message->getMessage();
            } else if (method_exists($message, 'tostring')) {
                $message = $message->toString();
            } else if (method_exists($message, '__tostring')) {
                $message = (string)$message;
            } else {
                $message = var_export($message, true);
            }
        } else if (is_array($message)) {
            if (isset($message['message'])) {
                if (is_scalar($message['message'])) {
                    $message = $message['message'];
                } else {
                    $message = var_export($message['message'], true);
                }
            } else {
                $message = var_export($message, true);
            }
        } else if (is_bool($message) || $message === NULL) {
            $message = var_export($message, true);
        }

        /* Otherwise, we assume the message is a string. */
        return $message;
    }
function _extractMessage($message)
    {
        /*
         * If we've been given an object, attempt to extract the message using
         * a known method.  If we can't find such a method, default to the
         * "human-readable" version of the object.
         *
         * We also use the human-readable format for arrays.
         */
        if (is_object($message)) {
            if (method_exists($message, 'getmessage')) {
                $message = $message->getMessage();
            } else if (method_exists($message, 'tostring')) {
                $message = $message->toString();
            } else if (method_exists($message, '__tostring')) {
                $message = (string)$message;
            } else {
                $message = var_export($message, true);
            }
        } else if (is_array($message)) {
            if (isset($message['message'])) {
                if (is_scalar($message['message'])) {
                    $message = $message['message'];
                } else {
                    $message = var_export($message['message'], true);
                }
            } else {
                $message = var_export($message, true);
            }
        } else if (is_bool($message) || $message === NULL) {
            $message = var_export($message, true);
        }

        /* Otherwise, we assume the message is a string. */
        return $message;
    }
function _extractMessage ( $ message ) { /*
         * If we've been given an object, attempt to extract the message using
         * a known method.  If we can't find such a method, default to the
         * "human-readable" version of the object.
         *
         * We also use the human-readable format for arrays.
         */ if ( is_object ( $ message ) ) { if ( method_exists ( $ message , 'getmessage' ) ) { $ message = $ message -> getMessage ( ) ; } else if ( method_exists ( $ message , 'tostring' ) ) { $ message = $ message -> toString ( ) ; } else if ( method_exists ( $ message , '__tostring' ) ) { $ message = ( string ) $ message ; } else { $ message = var_export ( $ message , true ) ; } } else if ( is_array ( $ message ) ) { if ( isset ( $ message [ 'message' ] ) ) { if ( is_scalar ( $ message [ 'message' ] ) ) { $ message = $ message [ 'message' ] ; } else { $ message = var_export ( $ message [ 'message' ] , true ) ; } } else { $ message = var_export ( $ message , true ) ; } } else if ( is_bool ( $ message ) || $ message === NULL ) { $ message = var_export ( $ message , true ) ; } /* Otherwise, we assume the message is a string. */ return $ message ; }
Returns the string representation of the message data.

If $message is an object, _extractMessage() will attempt to extract
the message text using a known method (such as a PEAR_Error object's
getMessage() method).  If a known method, cannot be found, the
serialized representation of the object will be returned.

If the message data is already a string, it will be returned unchanged.

@param  mixed $message   The original message data.  This may be a
string or any object.

@return string           The string representation of the message.

@access protected
Returns the string representation of the message data .