[Rt-commit] rt branch, 4.0/sanity-check-url-config, updated. rt-3.9.7-1139-gb3aff1d

Shawn Moore sartak at bestpractical.com
Wed Mar 2 21:49:23 EST 2011


The branch, 4.0/sanity-check-url-config has been updated
       via  b3aff1dee707578d50c3a6e0295805d6be85aff5 (commit)
      from  d8369fb109108b6cd528be10b4e7fc815d21ce1d (commit)

Summary of changes:
 lib/RT/Interface/Web.pm |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

- Log -----------------------------------------------------------------
commit b3aff1dee707578d50c3a6e0295805d6be85aff5
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Wed Mar 2 21:49:00 2011 -0500

    Add a hook for validating Web* config against %ENV once per server process

diff --git a/lib/RT/Interface/Web.pm b/lib/RT/Interface/Web.pm
index bd5b1fb..39bbdc1 100644
--- a/lib/RT/Interface/Web.pm
+++ b/lib/RT/Interface/Web.pm
@@ -208,6 +208,8 @@ sub HandleRequest {
     $HTML::Mason::Commands::m->autoflush( $HTML::Mason::Commands::m->request_comp->attr('AutoFlush') )
         if ( $HTML::Mason::Commands::m->request_comp->attr_exists('AutoFlush') );
 
+    ValidateWebConfig();
+
     DecodeARGS($ARGS);
     PreprocessTimeUpdates($ARGS);
 
@@ -1003,6 +1005,16 @@ sub LogRecordedSQLStatements {
 
 }
 
+my $_has_validated_web_config = 0;
+sub ValidateWebConfig {
+    my $self = shift;
+
+    # do this once per server instance, not once per request
+    return if $_has_validated_web_config;
+    $_has_validated_web_config = 1;
+
+}
+
 package HTML::Mason::Commands;
 
 use vars qw/$r $m %session/;

-----------------------------------------------------------------------


More information about the Rt-commit mailing list