Now adding E_NOTICE to error reporting for controller then restoring - When Front...
authorChuck Scott <cscott@gaslightmedia.com>
Thu, 12 Apr 2018 13:26:36 +0000 (09:26 -0400)
committerChuck Scott <cscott@gaslightmedia.com>
Thu, 12 Apr 2018 13:26:36 +0000 (09:26 -0400)
controllers/front.php

index f066eaf..92a37a3 100644 (file)
@@ -285,7 +285,15 @@ class glmMembersFront extends GlmPluginSupport
     {
 
         if (GLM_MEMBERS_PLUGIN_FRONT_DEBUG) {
+
+            // Save current error reporting level and add E_NOTICE
+            $oldErrorLogSetting = error_reporting();
+            error_reporting($oldErrorLogSetting | E_NOTICE);
+
+            // Report current memory
             trigger_error(glmAssociateMemoryUsage(),E_USER_NOTICE);
+
+            // Setup for reports at end of controller
             $controllerShortcode = $shortcode;
             $controllerStartTime = microtime(true);
         }
@@ -675,6 +683,9 @@ class glmMembersFront extends GlmPluginSupport
             trigger_error(glmAssociateMemoryUsage(),E_USER_NOTICE);
             $controllerTime = round(microtime(true) - $controllerStartTime, 6);
             trigger_error($controllerTime." seconds - Shortcode: $controllerShortcode, Model class: $className ---", E_USER_NOTICE);
+
+            // restore error reporting levels
+            error_reporting($oldErrorLogSetting);
         }
 
         return $out;