Revision: 2027
Author: olavmrk
Date: Fri Dec  4 00:06:56 2009
Log: Error_Assertion: Only log assertion failures.

Instead of throwing an exception for all assertion failures, simply log
an error with a stack trace. PHP will still abort execution if
assert.bail is enabled.
http://code.google.com/p/simplesamlphp/source/detail?r=2027

Modified:
  /trunk/lib/SimpleSAML/Error/Assertion.php

=======================================
--- /trunk/lib/SimpleSAML/Error/Assertion.php   Thu Jul 16 02:43:14 2009
+++ /trunk/lib/SimpleSAML/Error/Assertion.php   Fri Dec  4 00:06:56 2009
@@ -52,8 +52,8 @@
         * disabled.
         */
        public static function installHandler() {
+
                assert_options(ASSERT_WARNING,    0);
-               assert_options(ASSERT_BAIL,       0);
                assert_options(ASSERT_QUIET_EVAL, 0);
                assert_options(ASSERT_CALLBACK,    
array('SimpleSAML_Error_Assertion', 'onAssertion'));
        }
@@ -71,10 +71,12 @@
        public static function onAssertion($file, $line, $message) {

                if(!empty($message)) {
-                       throw new self($message);
+                       $exception = new self($message);
                } else {
-                       throw new self();
-               }
+                       $exception = new self();
+               }
+
+               $exception->logError();
        }

  }

--

You received this message because you are subscribed to the Google Groups 
"simpleSAMLphp commits" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/simplesamlphp-commits?hl=en.


Reply via email to