[Rt-commit] rt branch, 3.8/perlcritic, created. rt-3.8.9-24-gf7352fd

Kevin Falcone falcone at bestpractical.com
Thu Mar 3 14:40:12 EST 2011


The branch, 3.8/perlcritic has been created
        at  f7352fdfb256e048289c2a33662de5cd09cbfb42 (commit)

- Log -----------------------------------------------------------------
commit 9d066f9ef77ac7f8dde57b7751e5e288cdebe261
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Wed Aug 18 12:14:24 2010 -0400

    A new version of the overlay loading code that doesn't use string eval
    and is a method on RT::Base
    (cherry picked from commit a75a973c5de760e1a086a4a9d834752f7e0b3f22)

diff --git a/lib/RT/Base.pm b/lib/RT/Base.pm
index 72c3adf..1ceee3a 100755
--- a/lib/RT/Base.pm
+++ b/lib/RT/Base.pm
@@ -163,10 +163,17 @@ sub loc_fuzzy {
     }
 }
 
-eval "require RT::Base_Vendor";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Base_Vendor.pm});
-eval "require RT::Base_Local";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Base_Local.pm});
+sub _ImportOverlays {
+    my $class = shift;
+    my ($package,undef,undef) = caller();
+    $package =~ s|::|/|g;
+    for (qw(Overlay Vendor Local)) {
+        my $filename = $package."_".$_.".pm";
+        eval { require $filename };
+        die $@ if ($@ && $@ !~ qr{^Can't locate $filename});
+    }
+}
 
+__PACKAGE__->_ImportOverlays();
 
 1;

commit 5ebd2a8214bf02278512b4d2880f512a22750c10
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Wed Mar 2 17:01:16 2011 -0500

    Remove yet-still-more string eval overlay loads
    (cherry picked from commit 28b671deed51459673209701e1e12b2d5c0ca84b)
    
    Conflicts:
    
    	lib/RT/Config.pm
    	lib/RT/SavedSearch.pm
    	lib/RT/SavedSearches.pm
    	lib/RT/SharedSetting.pm

diff --git a/lib/RT/Action.pm b/lib/RT/Action.pm
index 0993d58..cd1f4c8 100755
--- a/lib/RT/Action.pm
+++ b/lib/RT/Action.pm
@@ -219,9 +219,6 @@ sub DESTROY {
 
 # }}}
 
-eval "require RT::Action_Vendor";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Action_Vendor.pm});
-eval "require RT::Action_Local";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Action_Local.pm});
+RT::Base->_ImportOverlays();
 
 1;
diff --git a/lib/RT/Action/AutoOpen.pm b/lib/RT/Action/AutoOpen.pm
index f81fce8..b99b214 100755
--- a/lib/RT/Action/AutoOpen.pm
+++ b/lib/RT/Action/AutoOpen.pm
@@ -97,9 +97,6 @@ sub Commit {
     return 1;
 }
 
-eval "require RT::Action::AutoOpen_Vendor";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Action/AutoOpen_Vendor.pm});
-eval "require RT::Action::AutoOpen_Local";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Action/AutoOpen_Local.pm});
+RT::Base->_ImportOverlays();
 
 1;
diff --git a/lib/RT/Action/Autoreply.pm b/lib/RT/Action/Autoreply.pm
index a412118..e3e792e 100755
--- a/lib/RT/Action/Autoreply.pm
+++ b/lib/RT/Action/Autoreply.pm
@@ -127,9 +127,6 @@ sub SetRTSpecialHeaders {
 
 # }}}
 
-eval "require RT::Action::Autoreply_Vendor";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Action/Autoreply_Vendor.pm});
-eval "require RT::Action::Autoreply_Local";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Action/Autoreply_Local.pm});
+RT::Base->_ImportOverlays();
 
 1;
diff --git a/lib/RT/Action/CreateTickets.pm b/lib/RT/Action/CreateTickets.pm
index bfe14a6..7b8a136 100755
--- a/lib/RT/Action/CreateTickets.pm
+++ b/lib/RT/Action/CreateTickets.pm
@@ -1239,10 +1239,7 @@ sub PostProcess {
 
 }
 
-eval "require RT::Action::CreateTickets_Vendor";
-die $@ if ( $@ && $@ !~ qr{^Can't locate RT/Action/CreateTickets_Vendor.pm} );
-eval "require RT::Action::CreateTickets_Local";
-die $@ if ( $@ && $@ !~ qr{^Can't locate RT/Action/CreateTickets_Local.pm} );
+RT::Base->_ImportOverlays();
 
 1;
 
diff --git a/lib/RT/Action/EscalatePriority.pm b/lib/RT/Action/EscalatePriority.pm
index 86e3e64..5f8f879 100755
--- a/lib/RT/Action/EscalatePriority.pm
+++ b/lib/RT/Action/EscalatePriority.pm
@@ -158,9 +158,6 @@ sub Commit {
    }
 }
 
-eval "require RT::Action::EscalatePriority_Vendor";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Action/EscalatePriority_Vendor.pm});
-eval "require RT::Action::EscalatePriority_Local";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Action/EscalatePriority_Local.pm});
+RT::Base->_ImportOverlays();
 
 1;
diff --git a/lib/RT/Action/ExtractSubjectTag.pm b/lib/RT/Action/ExtractSubjectTag.pm
index e891e58..7121c13 100644
--- a/lib/RT/Action/ExtractSubjectTag.pm
+++ b/lib/RT/Action/ExtractSubjectTag.pm
@@ -90,14 +90,6 @@ sub Commit {
     return (1);
 }
 
-eval "require RT::Action::ExtractSubjectTag_Vendor";
-if ($@ && $@ !~ qr{^Can't locate RT/Action/ExtractSubjectTag_Vendor.pm}) {
-    die $@;
-};
-
-eval "require RT::Action::ExtractSubjectTag_Local";
-if ($@ && $@ !~ qr{^Can't locate RT/Action/ExtractSubjectTag_Local.pm}) {
-    die $@;
-};
+RT::Base->_ImportOverlays();
 
 1;
diff --git a/lib/RT/Action/LinearEscalate.pm b/lib/RT/Action/LinearEscalate.pm
index 04affde..3e54320 100755
--- a/lib/RT/Action/LinearEscalate.pm
+++ b/lib/RT/Action/LinearEscalate.pm
@@ -263,10 +263,7 @@ sub Commit {
     return 1;
 }
 
-eval "require RT::Action::LinearEscalate_Vendor";
-die $@ if ( $@ && $@ !~ qr{^Can't locate RT/Action/LinearEscalate_Vendor.pm} );
-eval "require RT::Action::LinearEscalate_Local";
-die $@ if ( $@ && $@ !~ qr{^Can't locate RT/Action/LinearEscalate_Local.pm} );
+RT::Base->_ImportOverlays();
 
 1;
 
diff --git a/lib/RT/Action/Notify.pm b/lib/RT/Action/Notify.pm
index 30afeef..3f58bf5 100755
--- a/lib/RT/Action/Notify.pm
+++ b/lib/RT/Action/Notify.pm
@@ -162,9 +162,6 @@ sub SetRecipients {
 
 }
 
-eval "require RT::Action::Notify_Vendor";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Action/Notify_Vendor.pm});
-eval "require RT::Action::Notify_Local";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Action/Notify_Local.pm});
+RT::Base->_ImportOverlays();
 
 1;
diff --git a/lib/RT/Action/NotifyAsComment.pm b/lib/RT/Action/NotifyAsComment.pm
index 567aac6..504d139 100755
--- a/lib/RT/Action/NotifyAsComment.pm
+++ b/lib/RT/Action/NotifyAsComment.pm
@@ -70,9 +70,6 @@ sub SetReturnAddress {
     return $self->SUPER::SetReturnAddress( @_, is_comment => 1 );
 }
 
-eval "require RT::Action::NotifyAsComment_Vendor";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Action/NotifyAsComment_Vendor.pm});
-eval "require RT::Action::NotifyAsComment_Local";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Action/NotifyAsComment_Local.pm});
+RT::Base->_ImportOverlays();
 
 1;
diff --git a/lib/RT/Action/NotifyGroup.pm b/lib/RT/Action/NotifyGroup.pm
index b943e2d..a0efd5b 100644
--- a/lib/RT/Action/NotifyGroup.pm
+++ b/lib/RT/Action/NotifyGroup.pm
@@ -201,14 +201,6 @@ L<RT::Action::NotifyGroupAsComment>, F<rt-email-group-admin>
 
 =cut
 
-eval "require RT::Action::NotifyGroup_Vendor";
-if ($@ && $@ !~ qr{^Can't locate RT/Action/NotifyGroup_Vendor.pm}) {
-    die $@;
-};
-
-eval "require RT::Action::NotifyGroup_Local";
-if ($@ && $@ !~ qr{^Can't locate RT/Action/NotifyGroup_Local.pm}) {
-    die $@;
-};
+RT::Base->_ImportOverlays();
 
 1;
diff --git a/lib/RT/Action/NotifyGroupAsComment.pm b/lib/RT/Action/NotifyGroupAsComment.pm
index 7574a8c..a5bc49c 100644
--- a/lib/RT/Action/NotifyGroupAsComment.pm
+++ b/lib/RT/Action/NotifyGroupAsComment.pm
@@ -78,14 +78,6 @@ Ruslan U. Zakirov E<lt>ruz at bestpractical.comE<gt>
 
 =cut
 
-eval "require RT::Action::NotifyGroupAsComment_Vendor";
-if ($@ && $@ !~ qr{^Can't locate RT/Action/NotifyGroupAsComment_Vendor.pm}) {
-    die $@;
-};
-
-eval "require RT::Action::NotifyGroupAsComment_Local";
-if ($@ && $@ !~ qr{^Can't locate RT/Action/NotifyGroupAsComment_Local.pm}) {
-    die $@;
-};
+RT::Base->_ImportOverlays();
 
 1;
diff --git a/lib/RT/Action/RecordComment.pm b/lib/RT/Action/RecordComment.pm
index ccec8fa..5d3664d 100644
--- a/lib/RT/Action/RecordComment.pm
+++ b/lib/RT/Action/RecordComment.pm
@@ -111,9 +111,6 @@ sub CreateTransaction {
 }
     
 
-eval "require RT::Action::RecordComment_Vendor";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Action/RecordComment_Vendor.pm});
-eval "require RT::Action::RecordComment_Local";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Action/RecordComment_Local.pm});
+RT::Base->_ImportOverlays();
 
 1;
diff --git a/lib/RT/Action/RecordCorrespondence.pm b/lib/RT/Action/RecordCorrespondence.pm
index abbcfc7..109c0df 100644
--- a/lib/RT/Action/RecordCorrespondence.pm
+++ b/lib/RT/Action/RecordCorrespondence.pm
@@ -112,9 +112,6 @@ sub CreateTransaction {
 }
     
 
-eval "require RT::Action::RecordCorrespondence_Vendor";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Action/RecordCorrespondence_Vendor.pm});
-eval "require RT::Action::RecordCorrespondence_Local";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Action/RecordCorrespondence_Local.pm});
+RT::Base->_ImportOverlays();
 
 1;
diff --git a/lib/RT/Action/ResolveMembers.pm b/lib/RT/Action/ResolveMembers.pm
index 8302973..aff6365 100755
--- a/lib/RT/Action/ResolveMembers.pm
+++ b/lib/RT/Action/ResolveMembers.pm
@@ -102,10 +102,7 @@ sub IsApplicable  {
 }
 # }}}
 
-eval "require RT::Action::ResolveMembers_Vendor";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Action/ResolveMembers_Vendor.pm});
-eval "require RT::Action::ResolveMembers_Local";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Action/ResolveMembers_Local.pm});
+RT::Base->_ImportOverlays();
 
 1;
 
diff --git a/lib/RT/Action/SendEmail.pm b/lib/RT/Action/SendEmail.pm
index 3492822..49762b7 100755
--- a/lib/RT/Action/SendEmail.pm
+++ b/lib/RT/Action/SendEmail.pm
@@ -1091,10 +1091,7 @@ sub MIMEEncodeString {
     return RT::Interface::Email::EncodeToMIME( String => $_[0], Charset => $_[1] );
 }
 
-eval "require RT::Action::SendEmail_Vendor";
-die $@ if ( $@ && $@ !~ qr{^Can't locate RT/Action/SendEmail_Vendor.pm} );
-eval "require RT::Action::SendEmail_Local";
-die $@ if ( $@ && $@ !~ qr{^Can't locate RT/Action/SendEmail_Local.pm} );
+RT::Base->_ImportOverlays();
 
 1;
 
diff --git a/lib/RT/Action/SetPriority.pm b/lib/RT/Action/SetPriority.pm
index bdd50a3..420f9bd 100755
--- a/lib/RT/Action/SetPriority.pm
+++ b/lib/RT/Action/SetPriority.pm
@@ -76,9 +76,6 @@ sub Commit {
 
 }
 
-eval "require RT::Action::SetPriority_Vendor";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Action/SetPriority_Vendor.pm});
-eval "require RT::Action::SetPriority_Local";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Action/SetPriority_Local.pm});
+RT::Base->_ImportOverlays();
 
 1;
diff --git a/lib/RT/Action/UserDefined.pm b/lib/RT/Action/UserDefined.pm
index 9c36504..3d8e73c 100755
--- a/lib/RT/Action/UserDefined.pm
+++ b/lib/RT/Action/UserDefined.pm
@@ -83,10 +83,7 @@ sub Commit {
     return ($retval);
 }
 
-eval "require RT::Action::UserDefined_Vendor";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Action/UserDefined_Vendor.pm});
-eval "require RT::Action::UserDefined_Local";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Action/UserDefined_Local.pm});
+RT::Base->_ImportOverlays();
 
 1;
 
diff --git a/lib/RT/Approval.pm b/lib/RT/Approval.pm
index 50bd1fe..44b7a15 100644
--- a/lib/RT/Approval.pm
+++ b/lib/RT/Approval.pm
@@ -61,14 +61,6 @@ RT::Ruleset->Add(
         'RT::Approval::Rule::Created',
     ]);
 
-eval "require RT::Approval_Vendor";
-if ($@ && $@ !~ qr{^Can't locate RT/Approval_Vendor.pm}) {
-    die $@;
-};
-
-eval "require RT::Approval_Local";
-if ($@ && $@ !~ qr{^Can't locate RT/Approval_Local.pm}) {
-    die $@;
-};
+RT::Base->_ImportOverlays();
 
 1;
diff --git a/lib/RT/Approval/Rule.pm b/lib/RT/Approval/Rule.pm
index 9b1998e..4201240 100644
--- a/lib/RT/Approval/Rule.pm
+++ b/lib/RT/Approval/Rule.pm
@@ -71,15 +71,7 @@ sub GetTemplate {
     return $template;
 }
 
-eval "require RT::Approval::Rule_Vendor";
-if ($@ && $@ !~ qr{^Can't locate RT/Approval/Rule_Vendor.pm}) {
-    die $@;
-};
-
-eval "require RT::Approval::Rule_Local";
-if ($@ && $@ !~ qr{^Can't locate RT/Approval/Rule_Local.pm}) {
-    die $@;
-};
+RT::Base->_ImportOverlays();
 
 1;
 
diff --git a/lib/RT/Condition.pm b/lib/RT/Condition.pm
index e04fd64..458bf80 100755
--- a/lib/RT/Condition.pm
+++ b/lib/RT/Condition.pm
@@ -225,9 +225,6 @@ sub DESTROY {
 
 # }}}
 
-eval "require RT::Condition_Vendor";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Condition_Vendor.pm});
-eval "require RT::Condition_Local";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Condition_Local.pm});
+RT::Base->_ImportOverlays();
 
 1;
diff --git a/lib/RT/Condition/AnyTransaction.pm b/lib/RT/Condition/AnyTransaction.pm
index 3308622..7558794 100755
--- a/lib/RT/Condition/AnyTransaction.pm
+++ b/lib/RT/Condition/AnyTransaction.pm
@@ -63,10 +63,7 @@ sub IsApplicable {
     return(1);
 }
 
-eval "require RT::Condition::AnyTransaction_Vendor";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Condition/AnyTransaction_Vendor.pm});
-eval "require RT::Condition::AnyTransaction_Local";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Condition/AnyTransaction_Local.pm});
+RT::Base->_ImportOverlays();
 
 1;
 
diff --git a/lib/RT/Condition/BeforeDue.pm b/lib/RT/Condition/BeforeDue.pm
index cb19ccb..d119ff0 100755
--- a/lib/RT/Condition/BeforeDue.pm
+++ b/lib/RT/Condition/BeforeDue.pm
@@ -78,9 +78,6 @@ sub IsApplicable {
     }
 }
 
-eval "require RT::Condition::BeforeDue_Vendor";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Condition/BeforeDue_Vendor.pm});
-eval "require RT::Condition::BeforeDue_Local";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Condition/BeforeDue_Local.pm});
+RT::Base->_ImportOverlays();
 
 1;
diff --git a/lib/RT/Condition/CloseTicket.pm b/lib/RT/Condition/CloseTicket.pm
index ad0793d..ec3c24f 100644
--- a/lib/RT/Condition/CloseTicket.pm
+++ b/lib/RT/Condition/CloseTicket.pm
@@ -76,9 +76,6 @@ sub IsApplicable {
     return 1;
 }
 
-eval "require RT::Condition::CloseTicket_Vendor";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Condition/CloseTicket_Vendor.pm});
-eval "require RT::Condition::CloseTicket_Local";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Condition/CloseTicket_Local.pm});
+RT::Base->_ImportOverlays();
 
 1;
diff --git a/lib/RT/Condition/Overdue.pm b/lib/RT/Condition/Overdue.pm
index 164c6e2..17f71f5 100755
--- a/lib/RT/Condition/Overdue.pm
+++ b/lib/RT/Condition/Overdue.pm
@@ -78,10 +78,7 @@ sub IsApplicable {
     }
 }
 
-eval "require RT::Condition::Overdue_Vendor";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Condition/Overdue_Vendor.pm});
-eval "require RT::Condition::Overdue_Local";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Condition/Overdue_Local.pm});
+RT::Base->_ImportOverlays();
 
 1;
 
diff --git a/lib/RT/Condition/OwnerChange.pm b/lib/RT/Condition/OwnerChange.pm
index d981530..42048cd 100755
--- a/lib/RT/Condition/OwnerChange.pm
+++ b/lib/RT/Condition/OwnerChange.pm
@@ -69,10 +69,7 @@ sub IsApplicable {
     }
 }
 
-eval "require RT::Condition::OwnerChange_Vendor";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Condition/OwnerChange_Vendor.pm});
-eval "require RT::Condition::OwnerChange_Local";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Condition/OwnerChange_Local.pm});
+RT::Base->_ImportOverlays();
 
 1;
 
diff --git a/lib/RT/Condition/PriorityChange.pm b/lib/RT/Condition/PriorityChange.pm
index a896940..b13b48d 100644
--- a/lib/RT/Condition/PriorityChange.pm
+++ b/lib/RT/Condition/PriorityChange.pm
@@ -68,10 +68,7 @@ sub IsApplicable {
     }
 }
 
-eval "require RT::Condition::PriorityChange_Vendor";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Condition/PriorityChange_Vendor.pm});
-eval "require RT::Condition::PriorityChange_Local";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Condition/PriorityChange_Local.pm});
+RT::Base->_ImportOverlays();
 
 1;
 
diff --git a/lib/RT/Condition/PriorityExceeds.pm b/lib/RT/Condition/PriorityExceeds.pm
index ba8b7b6..916b71d 100755
--- a/lib/RT/Condition/PriorityExceeds.pm
+++ b/lib/RT/Condition/PriorityExceeds.pm
@@ -66,10 +66,7 @@ sub IsApplicable {
     }
 }
 
-eval "require RT::Condition::PriorityExceeds_Vendor";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Condition/PriorityExceeds_Vendor.pm});
-eval "require RT::Condition::PriorityExceeds_Local";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Condition/PriorityExceeds_Local.pm});
+RT::Base->_ImportOverlays();
 
 1;
 
diff --git a/lib/RT/Condition/QueueChange.pm b/lib/RT/Condition/QueueChange.pm
index 4764893..dab4299 100755
--- a/lib/RT/Condition/QueueChange.pm
+++ b/lib/RT/Condition/QueueChange.pm
@@ -66,10 +66,7 @@ sub IsApplicable {
     }
 }
 
-eval "require RT::Condition::QueueChange_Vendor";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Condition/QueueChange_Vendor.pm});
-eval "require RT::Condition::QueueChange_Local";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Condition/QueueChange_Local.pm});
+RT::Base->_ImportOverlays();
 
 1;
 
diff --git a/lib/RT/Condition/ReopenTicket.pm b/lib/RT/Condition/ReopenTicket.pm
index 52a325e..cf1b91f 100644
--- a/lib/RT/Condition/ReopenTicket.pm
+++ b/lib/RT/Condition/ReopenTicket.pm
@@ -81,9 +81,6 @@ sub IsApplicable {
     return 1;
 }
 
-eval "require RT::Condition::ReopenTicket_Vendor";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Condition/ReopenTicket_Vendor.pm});
-eval "require RT::Condition::ReopenTicket_Local";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Condition/ReopenTicket_Local.pm});
+RT::Base->_ImportOverlays();
 
 1;
diff --git a/lib/RT/Condition/StatusChange.pm b/lib/RT/Condition/StatusChange.pm
index dba3b7a..b20a5ac 100755
--- a/lib/RT/Condition/StatusChange.pm
+++ b/lib/RT/Condition/StatusChange.pm
@@ -69,10 +69,7 @@ sub IsApplicable {
     }
 }
 
-eval "require RT::Condition::StatusChange_Vendor";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Condition/StatusChange_Vendor.pm});
-eval "require RT::Condition::StatusChange_Local";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Condition/StatusChange_Local.pm});
+RT::Base->_ImportOverlays();
 
 1;
 
diff --git a/lib/RT/Condition/UserDefined.pm b/lib/RT/Condition/UserDefined.pm
index 2d5b41d..fac3394 100755
--- a/lib/RT/Condition/UserDefined.pm
+++ b/lib/RT/Condition/UserDefined.pm
@@ -68,10 +68,7 @@ sub IsApplicable {
     return ($retval);
 }
 
-eval "require RT::Condition::UserDefined_Vendor";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Condition/UserDefined_Vendor.pm});
-eval "require RT::Condition::UserDefined_Local";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Condition/UserDefined_Local.pm});
+RT::Base->_ImportOverlays();
 
 1;
 
diff --git a/lib/RT/Config.pm b/lib/RT/Config.pm
index d69ccac..ff93c84 100644
--- a/lib/RT/Config.pm
+++ b/lib/RT/Config.pm
@@ -931,14 +931,6 @@ sub Options {
     return @res;
 }
 
-eval "require RT::Config_Vendor";
-if ($@ && $@ !~ qr{^Can't locate RT/Config_Vendor.pm}) {
-    die $@;
-};
-
-eval "require RT::Config_Local";
-if ($@ && $@ !~ qr{^Can't locate RT/Config_Local.pm}) {
-    die $@;
-};
+RT::Base->_ImportOverlays();
 
 1;
diff --git a/lib/RT/Crypt/GnuPG.pm b/lib/RT/Crypt/GnuPG.pm
index 29dd2a9..314e6cc 100644
--- a/lib/RT/Crypt/GnuPG.pm
+++ b/lib/RT/Crypt/GnuPG.pm
@@ -2463,15 +2463,7 @@ sub _make_gpg_handles {
     return ($handles, \%handle_map);
 }
 
-eval "require RT::Crypt::GnuPG_Vendor";
-if ($@ && $@ !~ qr{^Can't locate RT/Crypt/GnuPG_Vendor.pm}) {
-    die $@;
-};
-
-eval "require RT::Crypt::GnuPG_Local";
-if ($@ && $@ !~ qr{^Can't locate RT/Crypt/GnuPG_Local.pm}) {
-    die $@;
-};
+RT::Base->_ImportOverlays();
 
 # helper package to avoid using temp file
 package IO::Handle::CRLF;
diff --git a/lib/RT/CurrentUser.pm b/lib/RT/CurrentUser.pm
index 127116b..85b95f8 100755
--- a/lib/RT/CurrentUser.pm
+++ b/lib/RT/CurrentUser.pm
@@ -311,9 +311,6 @@ sub Authenticate {
     return ($password eq $auth_digest);
 }
 
-eval "require RT::CurrentUser_Vendor";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/CurrentUser_Vendor.pm});
-eval "require RT::CurrentUser_Local";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/CurrentUser_Local.pm});
+RT::Base->_ImportOverlays();
 
 1;
diff --git a/lib/RT/CustomFieldValues/External.pm b/lib/RT/CustomFieldValues/External.pm
index bd60674..997108d 100644
--- a/lib/RT/CustomFieldValues/External.pm
+++ b/lib/RT/CustomFieldValues/External.pm
@@ -222,14 +222,6 @@ sub LimitToCustomField {
     return $self->SUPER::LimitToCustomField( @_ );
 }
 
-eval "require RT::CustomFieldValues::External_Vendor";
-if ($@ && $@ !~ qr{^Can't locate RT/CustomFieldValues/External_Vendor.pm}) {
-    die $@;
-};
-
-eval "require RT::CustomFieldValues::External_Local";
-if ($@ && $@ !~ qr{^Can't locate RT/CustomFieldValues/External_Local.pm}) {
-    die $@;
-};
+RT::Base->_ImportOverlays();
 
 1;
diff --git a/lib/RT/CustomFieldValues/Groups.pm b/lib/RT/CustomFieldValues/Groups.pm
index f14fd6b..59e3104 100644
--- a/lib/RT/CustomFieldValues/Groups.pm
+++ b/lib/RT/CustomFieldValues/Groups.pm
@@ -75,14 +75,6 @@ sub ExternalValues {
     return \@res;
 }
 
-eval "require RT::CustomFieldValues::Groups_Vendor";
-if ($@ && $@ !~ qr{^Can't locate RT/CustomFieldValues/Groups_Vendor.pm}) {
-    die $@;
-};
-
-eval "require RT::CustomFieldValues::Groups_Local";
-if ($@ && $@ !~ qr{^Can't locate RT/CustomFieldValues/Groups_Local.pm}) {
-    die $@;
-};
+RT::Base->_ImportOverlays();
 
 1;
diff --git a/lib/RT/Dashboard.pm b/lib/RT/Dashboard.pm
index 4c991e8..9fb2e60 100644
--- a/lib/RT/Dashboard.pm
+++ b/lib/RT/Dashboard.pm
@@ -350,9 +350,6 @@ sub CurrentUserCanSubscribe {
     $self->_CurrentUserCan($privacy, FullRight => 'SubscribeDashboard');
 }
 
-eval "require RT::Dashboard_Vendor";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Dashboard_Vendor.pm});
-eval "require RT::Dashboard_Local";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Dashboard_Local.pm});
+RT::Base->_ImportOverlays();
 
 1;
diff --git a/lib/RT/Date.pm b/lib/RT/Date.pm
index e51a775..2b6a3e3 100755
--- a/lib/RT/Date.pm
+++ b/lib/RT/Date.pm
@@ -1040,9 +1040,6 @@ sub Timezone {
 }
 
 
-eval "require RT::Date_Vendor";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Date_Vendor.pm});
-eval "require RT::Date_Local";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Date_Local.pm});
+RT::Base->_ImportOverlays();
 
 1;
diff --git a/lib/RT/EmailParser.pm b/lib/RT/EmailParser.pm
index 3c77f46..a0affd9 100755
--- a/lib/RT/EmailParser.pm
+++ b/lib/RT/EmailParser.pm
@@ -629,9 +629,6 @@ sub DESTROY {
 
 
 
-eval "require RT::EmailParser_Vendor";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/EmailParser_Vendor.pm});
-eval "require RT::EmailParser_Local";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/EmailParser_Local.pm});
+RT::Base->_ImportOverlays();
 
 1;
diff --git a/lib/RT/Handle.pm b/lib/RT/Handle.pm
index b9a017c..f99974d 100755
--- a/lib/RT/Handle.pm
+++ b/lib/RT/Handle.pm
@@ -1065,9 +1065,6 @@ sub ACLEquivGroupId {
 
 __PACKAGE__->FinalizeDatabaseType;
 
-eval "require RT::Handle_Vendor";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Handle_Vendor.pm});
-eval "require RT::Handle_Local";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Handle_Local.pm});
+RT::Base->_ImportOverlays();
 
 1;
diff --git a/lib/RT/I18N.pm b/lib/RT/I18N.pm
index 9e89ecd..2056b3e 100755
--- a/lib/RT/I18N.pm
+++ b/lib/RT/I18N.pm
@@ -550,10 +550,7 @@ sub SetMIMEHeadToEncoding {
 }
 # }}}
 
-eval "require RT::I18N_Vendor";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/I18N_Vendor.pm});
-eval "require RT::I18N_Local";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/I18N_Local.pm});
+RT::Base->_ImportOverlays();
 
 1;  # End of module.
 
diff --git a/lib/RT/I18N/i_default.pm b/lib/RT/I18N/i_default.pm
index 277ffbf..cba6547 100755
--- a/lib/RT/I18N/i_default.pm
+++ b/lib/RT/I18N/i_default.pm
@@ -50,10 +50,7 @@ package RT::I18N::i_default;
 use base 'RT::I18N';
 use strict;
 
-eval "require RT::I18N::i_default_Vendor";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/I18N/i_default_Vendor.pm});
-eval "require RT::I18N::i_default_Local";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/I18N/i_default_Local.pm});
+RT::Base->_ImportOverlays();
 
 1;
 
diff --git a/lib/RT/Installer.pm b/lib/RT/Installer.pm
index 780faa8..0cf4d01 100644
--- a/lib/RT/Installer.pm
+++ b/lib/RT/Installer.pm
@@ -326,15 +326,7 @@ C<RT::Installer> class provides access to RT Installer Meta
 
 =cut
 
-eval "require RT::Installer_Vendor";
-if ($@ && $@ !~ qr{^Can't locate RT/Installer_Vendor.pm}) {
-    die $@;
-};
-
-eval "require RT::Installer_Local";
-if ($@ && $@ !~ qr{^Can't locate RT/Installer_Local.pm}) {
-    die $@;
-};
+RT::Base->_ImportOverlays();
 
 1;
 
diff --git a/lib/RT/Interface/CLI.pm b/lib/RT/Interface/CLI.pm
index 343edbf..e56cae5 100755
--- a/lib/RT/Interface/CLI.pm
+++ b/lib/RT/Interface/CLI.pm
@@ -256,9 +256,6 @@ sub debug {
 # }}}
 
 
-eval "require RT::Interface::CLI_Vendor";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Interface/CLI_Vendor.pm});
-eval "require RT::Interface::CLI_Local";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Interface/CLI_Local.pm});
+RT::Base->_ImportOverlays();
 
 1;
diff --git a/lib/RT/Interface/Email.pm b/lib/RT/Interface/Email.pm
index 9e535f6..401e970 100755
--- a/lib/RT/Interface/Email.pm
+++ b/lib/RT/Interface/Email.pm
@@ -1809,9 +1809,6 @@ sub _RecordSendEmailFailure {
     }
 }
 
-eval "require RT::Interface::Email_Vendor";
-die $@ if ( $@ && $@ !~ qr{^Can't locate RT/Interface/Email_Vendor.pm} );
-eval "require RT::Interface::Email_Local";
-die $@ if ( $@ && $@ !~ qr{^Can't locate RT/Interface/Email_Local.pm} );
+RT::Base->_ImportOverlays();
 
 1;
diff --git a/lib/RT/Interface/Email/Auth/GnuPG.pm b/lib/RT/Interface/Email/Auth/GnuPG.pm
index cc15abb..6d43b96 100644
--- a/lib/RT/Interface/Email/Auth/GnuPG.pm
+++ b/lib/RT/Interface/Email/Auth/GnuPG.pm
@@ -250,14 +250,7 @@ sub VerifyDecrypt {
     return $status, @res, @nested;
 }
 
-eval "require RT::Interface::Email::Auth::GnuPG_Vendor";
-die $@
-  if ( $@
-    && $@ !~ qr{^Can't locate RT/Interface/Email/Auth/GnuPG_Vendor.pm} );
-eval "require RT::Interface::Email::Auth::GnuPG_Local";
-die $@
-  if ( $@
-    && $@ !~ qr{^Can't locate RT/Interface/Email/Auth/GnuPG_Local.pm} );
+RT::Base->_ImportOverlays();
 
 1;
 
diff --git a/lib/RT/Interface/Email/Auth/MailFrom.pm b/lib/RT/Interface/Email/Auth/MailFrom.pm
index a90306b..093e267 100755
--- a/lib/RT/Interface/Email/Auth/MailFrom.pm
+++ b/lib/RT/Interface/Email/Auth/MailFrom.pm
@@ -174,9 +174,6 @@ sub GetCurrentUser {
     return ( $CurrentUser, 1 );
 }
 
-eval "require RT::Interface::Email::Auth::MailFrom_Vendor";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Interface/Email/Auth/MailFrom_Vendor.pm});
-eval "require RT::Interface::Email::Auth::MailFrom_Local";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Interface/Email/Auth/MailFrom_Local.pm});
+RT::Base->_ImportOverlays();
 
 1;
diff --git a/lib/RT/Interface/Email/Filter/SpamAssassin.pm b/lib/RT/Interface/Email/Filter/SpamAssassin.pm
index 6e99fec..4f9c1d0 100755
--- a/lib/RT/Interface/Email/Filter/SpamAssassin.pm
+++ b/lib/RT/Interface/Email/Filter/SpamAssassin.pm
@@ -90,9 +90,6 @@ the floor; otherwise, it is passed on as normal.
 
 =cut
 
-eval "require RT::Interface::Email::Filter::SpamAssassin_Vendor";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Interface/Email/Filter/SpamAssassin_Vendor.pm});
-eval "require RT::Interface::Email::Filter::SpamAssassin_Local";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Interface/Email/Filter/SpamAssassin_Local.pm});
+RT::Base->_ImportOverlays();
 
 1;
diff --git a/lib/RT/Interface/REST.pm b/lib/RT/Interface/REST.pm
index a029e43..267f454 100755
--- a/lib/RT/Interface/REST.pm
+++ b/lib/RT/Interface/REST.pm
@@ -306,15 +306,7 @@ sub vsplit {
     return \@words;
 }
 
-eval "require RT::Interface::REST_Vendor";
-if ($@ && $@ !~ qr{^Can't locate RT/Interface/REST_Vendor.pm}) {
-    die $@;
-};
-
-eval "require RT::Interface::REST_Local";
-if ($@ && $@ !~ qr{^Can't locate RT/Interface/REST_Local.pm}) {
-    die $@;
-};
+RT::Base->_ImportOverlays();
 
 1;
 
diff --git a/lib/RT/Interface/Web.pm b/lib/RT/Interface/Web.pm
index 8c3884f..976fa56 100755
--- a/lib/RT/Interface/Web.pm
+++ b/lib/RT/Interface/Web.pm
@@ -2254,9 +2254,6 @@ sub _parse_saved_search {
     return ( _load_container_object( $obj_type, $obj_id ), $search_id );
 }
 
-eval "require RT::Interface::Web_Vendor";
-die $@ if ( $@ && $@ !~ qr{^Can't locate RT/Interface/Web_Vendor.pm} );
-eval "require RT::Interface::Web_Local";
-die $@ if ( $@ && $@ !~ qr{^Can't locate RT/Interface/Web_Local.pm} );
+RT::Base->_ImportOverlays();
 
 1;
diff --git a/lib/RT/Interface/Web/QueryBuilder.pm b/lib/RT/Interface/Web/QueryBuilder.pm
index 6e462ec..09b9539 100755
--- a/lib/RT/Interface/Web/QueryBuilder.pm
+++ b/lib/RT/Interface/Web/QueryBuilder.pm
@@ -51,9 +51,6 @@ package RT::Interface::Web::QueryBuilder;
 use strict;
 use warnings;
 
-eval "require RT::Interface::Web::QueryBuilder_Vendor";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Interface/Web/QueryBuilder_Vendor.pm});
-eval "require RT::Interface::Web::QueryBuilder_Local";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Interface/Web/QueryBuilder_Local.pm});
+RT::Base->_ImportOverlays();
 
 1;
diff --git a/lib/RT/Interface/Web/QueryBuilder/Tree.pm b/lib/RT/Interface/Web/QueryBuilder/Tree.pm
index f804e09..493ab44 100755
--- a/lib/RT/Interface/Web/QueryBuilder/Tree.pm
+++ b/lib/RT/Interface/Web/QueryBuilder/Tree.pm
@@ -285,9 +285,6 @@ sub ParseSQL {
     return @results;
 }
 
-eval "require RT::Interface::Web::QueryBuilder::Tree_Vendor";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Interface/Web/QueryBuilder/Tree_Vendor.pm});
-eval "require RT::Interface::Web::QueryBuilder::Tree_Local";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Interface/Web/QueryBuilder/Tree_Local.pm});
+RT::Base->_ImportOverlays();
 
 1;
diff --git a/lib/RT/Plugin.pm b/lib/RT/Plugin.pm
index e78775e..846b021 100644
--- a/lib/RT/Plugin.pm
+++ b/lib/RT/Plugin.pm
@@ -128,14 +128,6 @@ Returns the directory this plugin has installed its message catalogs into.
 
 sub PoDir { return $_[0]->Path('po') }
 
-eval "require RT::Plugin_Vendor";
-if ($@ && $@ !~ qr{^Can't locate RT/Plugin_Vendor.pm}) {
-    die $@;
-};
-
-eval "require RT::Plugin_Local";
-if ($@ && $@ !~ qr{^Can't locate RT/Plugin_Local.pm}) {
-    die $@;
-};
+RT::Base->_ImportOverlays();
 
 1;
diff --git a/lib/RT/Record.pm b/lib/RT/Record.pm
index 804adb8..3c85753 100755
--- a/lib/RT/Record.pm
+++ b/lib/RT/Record.pm
@@ -1926,9 +1926,6 @@ sub WikiBase {
     return RT->Config->Get('WebPath'). "/index.html?q=";
 }
 
-eval "require RT::Record_Vendor";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Record_Vendor.pm});
-eval "require RT::Record_Local";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Record_Local.pm});
+RT::Base->_ImportOverlays();
 
 1;
diff --git a/lib/RT/Reminders.pm b/lib/RT/Reminders.pm
index 21f0537..8d2bdcb 100644
--- a/lib/RT/Reminders.pm
+++ b/lib/RT/Reminders.pm
@@ -155,15 +155,7 @@ sub Resolve {
                                    NewValue => $reminder->id);
 }
 
-    eval "require RT::Reminders_Vendor";
-        if ($@ && $@ !~ qr{^Can't locate RT/Reminders_Vendor.pm}) {
-            die $@;
-        };
-
-        eval "require RT::Reminders_Local";
-        if ($@ && $@ !~ qr{^Can't locate RT/Reminders_Local.pm}) {
-            die $@;
-        };
+    RT::Base->_ImportOverlays();
 
 
 1;
diff --git a/lib/RT/Report/Tickets.pm b/lib/RT/Report/Tickets.pm
index 97a6d46..c601485 100644
--- a/lib/RT/Report/Tickets.pm
+++ b/lib/RT/Report/Tickets.pm
@@ -324,14 +324,6 @@ sub AddEmptyRows {
     }
 }
 
-eval "require RT::Report::Tickets_Vendor";
-if ($@ && $@ !~ qr{^Can't locate RT/Report/Tickets_Vendor.pm}) {
-    die $@;
-};
-
-eval "require RT::Report::Tickets_Local";
-if ($@ && $@ !~ qr{^Can't locate RT/Report/Tickets_Local.pm}) {
-    die $@;
-};
+RT::Base->_ImportOverlays();
 
 1;
diff --git a/lib/RT/Report/Tickets/Entry.pm b/lib/RT/Report/Tickets/Entry.pm
index 15405d7..158e553 100644
--- a/lib/RT/Report/Tickets/Entry.pm
+++ b/lib/RT/Report/Tickets/Entry.pm
@@ -79,14 +79,6 @@ sub LabelValue {
     return $value;
 }
 
-eval "require RT::Report::Tickets::Entry_Vendor";
-if ($@ && $@ !~ qr{^Can't locate RT/Report/Tickets/Entry_Vendor.pm}) {
-    die $@;
-};
-
-eval "require RT::Report::Tickets::Entry_Local";
-if ($@ && $@ !~ qr{^Can't locate RT/Report/Tickets/Entry_Local.pm}) {
-    die $@;
-};
+RT::Base->_ImportOverlays();
 
 1;
diff --git a/lib/RT/Rule.pm b/lib/RT/Rule.pm
index 071f539..86ff63d 100644
--- a/lib/RT/Rule.pm
+++ b/lib/RT/Rule.pm
@@ -105,14 +105,6 @@ sub RunScripAction {
 
 }
 
-eval "require RT::Rule_Vendor";
-if ($@ && $@ !~ qr{^Can't locate RT/Rule_Vendor.pm}) {
-    die $@;
-};
-
-eval "require RT::Rule_Local";
-if ($@ && $@ !~ qr{^Can't locate RT/Rule_Local.pm}) {
-    die $@;
-};
+RT::Base->_ImportOverlays();
 
 1;
diff --git a/lib/RT/Ruleset.pm b/lib/RT/Ruleset.pm
index f4c986f..d914f0a 100644
--- a/lib/RT/Ruleset.pm
+++ b/lib/RT/Ruleset.pm
@@ -81,14 +81,6 @@ sub Add {
     push @RULE_SETS, $class->new(\%args);
 }
 
-eval "require RT::Ruleset_Vendor";
-if ($@ && $@ !~ qr{^Can't locate RT/Ruleset_Vendor.pm}) {
-    die $@;
-};
-
-eval "require RT::Ruleset_Local";
-if ($@ && $@ !~ qr{^Can't locate RT/Ruleset_Local.pm}) {
-    die $@;
-};
+RT::Base->_ImportOverlays();
 
 1;
diff --git a/lib/RT/SQL.pm b/lib/RT/SQL.pm
index e696dd2..b5782b1 100644
--- a/lib/RT/SQL.pm
+++ b/lib/RT/SQL.pm
@@ -289,14 +289,6 @@ sub PossibleCustomFields {
 }
 
 
-eval "require RT::SQL_Vendor";
-if ($@ && $@ !~ qr{^Can't locate RT/SQL_Vendor.pm}) {
-    die $@;
-};
-
-eval "require RT::SQL_Local";
-if ($@ && $@ !~ qr{^Can't locate RT/SQL_Local.pm}) {
-    die $@;
-};
+RT::Base->_ImportOverlays();
 
 1;
diff --git a/lib/RT/SavedSearch.pm b/lib/RT/SavedSearch.pm
index 4ad3202..1867e21 100644
--- a/lib/RT/SavedSearch.pm
+++ b/lib/RT/SavedSearch.pm
@@ -126,9 +126,6 @@ sub Type {
     return $self->{'Type'};
 }
 
-eval "require RT::SavedSearch_Vendor";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/SavedSearch_Vendor.pm});
-eval "require RT::SavedSearch_Local";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/SavedSearch_Local.pm});
+RT::Base->_ImportOverlays();
 
 1;
diff --git a/lib/RT/SavedSearches.pm b/lib/RT/SavedSearches.pm
index 2a33649..3e32ed1 100644
--- a/lib/RT/SavedSearches.pm
+++ b/lib/RT/SavedSearches.pm
@@ -174,9 +174,6 @@ sub _PrivacyObjects {
     return ( $CurrentUser->UserObj, @{ $groups->ItemsArrayRef() } );
 }
 
-eval "require RT::SavedSearches_Vendor";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/SavedSearches_Vendor.pm});
-eval "require RT::SavedSearches_Local";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/SavedSearches_Local.pm});
+RT::Base->_ImportOverlays();
 
 1;
diff --git a/lib/RT/Search.pm b/lib/RT/Search.pm
index 99b3901..2335540 100755
--- a/lib/RT/Search.pm
+++ b/lib/RT/Search.pm
@@ -140,9 +140,6 @@ sub Prepare  {
 }
 # }}}
 
-eval "require RT::Search_Vendor";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Search_Vendor.pm});
-eval "require RT::Search_Local";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Search_Local.pm});
+RT::Base->_ImportOverlays();
 
 1;
diff --git a/lib/RT/Search/ActiveTicketsInQueue.pm b/lib/RT/Search/ActiveTicketsInQueue.pm
index cc7103c..3291456 100755
--- a/lib/RT/Search/ActiveTicketsInQueue.pm
+++ b/lib/RT/Search/ActiveTicketsInQueue.pm
@@ -90,9 +90,6 @@ sub Prepare  {
 }
 # }}}
 
-eval "require RT::Search::ActiveTicketsInQueue_Vendor";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Search/ActiveTicketsInQueue_Vendor.pm});
-eval "require RT::Search::ActiveTicketsInQueue_Local";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Search/ActiveTicketsInQueue_Local.pm});
+RT::Base->_ImportOverlays();
 
 1;
diff --git a/lib/RT/Search/FromSQL.pm b/lib/RT/Search/FromSQL.pm
index 364d7cf..6f2a874 100644
--- a/lib/RT/Search/FromSQL.pm
+++ b/lib/RT/Search/FromSQL.pm
@@ -98,9 +98,6 @@ sub Prepare  {
 }
 # }}}
 
-eval "require RT::Search::FromSQL_Vendor";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Search/FromSQL_Vendor.pm});
-eval "require RT::Search::FromSQL_Local";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Search/FromSQL_Local.pm});
+RT::Base->_ImportOverlays();
 
 1;
diff --git a/lib/RT/Search/Googleish.pm b/lib/RT/Search/Googleish.pm
index 4b73dd7..3174800 100644
--- a/lib/RT/Search/Googleish.pm
+++ b/lib/RT/Search/Googleish.pm
@@ -202,9 +202,6 @@ sub Prepare  {
 }
 # }}}
 
-eval "require RT::Search::Googleish_Vendor";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Search/Googleish_Vendor.pm});
-eval "require RT::Search::Googleish_Local";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Search/Googleish_Local.pm});
+RT::Base->_ImportOverlays();
 
 1;
diff --git a/lib/RT/SearchBuilder.pm b/lib/RT/SearchBuilder.pm
index a078a31..be64a2c 100755
--- a/lib/RT/SearchBuilder.pm
+++ b/lib/RT/SearchBuilder.pm
@@ -345,9 +345,6 @@ sub _DoCount {
     return $self->SUPER::_DoCount(@_);
 }
 
-eval "require RT::SearchBuilder_Vendor";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/SearchBuilder_Vendor.pm});
-eval "require RT::SearchBuilder_Local";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/SearchBuilder_Local.pm});
+RT::Base->_ImportOverlays();
 
 1;
diff --git a/lib/RT/SharedSetting.pm b/lib/RT/SharedSetting.pm
index 74fe9d5..6d1dbfe 100644
--- a/lib/RT/SharedSetting.pm
+++ b/lib/RT/SharedSetting.pm
@@ -450,9 +450,6 @@ sub _build_privacy {
          : undef;
 }
 
-eval "require RT::SharedSetting_Vendor";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/SharedSetting_Vendor.pm});
-eval "require RT::SharedSetting_Local";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/SharedSetting_Local.pm});
+RT::Base->_ImportOverlays();
 
 1;
diff --git a/lib/RT/System.pm b/lib/RT/System.pm
index 6ba5d1a..7a5bff0 100755
--- a/lib/RT/System.pm
+++ b/lib/RT/System.pm
@@ -189,9 +189,6 @@ sub SubjectTag {
     return grep !$seen{lc $_}++, values %$map;
 }
 
-eval "require RT::System_Vendor";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/System_Vendor.pm});
-eval "require RT::System_Local";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/System_Local.pm});
+RT::Base->_ImportOverlays();
 
 1;
diff --git a/lib/RT/URI.pm b/lib/RT/URI.pm
index 1e0c036..facce04 100755
--- a/lib/RT/URI.pm
+++ b/lib/RT/URI.pm
@@ -278,9 +278,6 @@ sub Resolver {
     return ($self->{'resolver'});
 }
 
-eval "require RT::URI_Vendor";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/URI_Vendor.pm});
-eval "require RT::URI_Local";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/URI_Local.pm});
+RT::Base->_ImportOverlays();
 
 1;
diff --git a/lib/RT/URI/base.pm b/lib/RT/URI/base.pm
index 14f58dd..1534149 100755
--- a/lib/RT/URI/base.pm
+++ b/lib/RT/URI/base.pm
@@ -142,9 +142,6 @@ sub AsString {
     return $self->URI;
 }
 
-eval "require RT::URI::base_Vendor";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/URI/base_Vendor.pm});
-eval "require RT::URI::base_Local";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/URI/base_Local.pm});
+RT::Base->_ImportOverlays();
 
 1;
diff --git a/lib/RT/URI/fsck_com_rt.pm b/lib/RT/URI/fsck_com_rt.pm
index a55bff0..aa0b4e0 100755
--- a/lib/RT/URI/fsck_com_rt.pm
+++ b/lib/RT/URI/fsck_com_rt.pm
@@ -223,9 +223,6 @@ sub AsString {
     }
 }
 
-eval "require RT::URI::fsck_com_rt_Vendor";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/URI/fsck_com_rt_Vendor.pm});
-eval "require RT::URI::fsck_com_rt_Local";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/URI/fsck_com_rt_Local.pm});
+RT::Base->_ImportOverlays();
 
 1;
diff --git a/lib/RT/Util.pm b/lib/RT/Util.pm
index fec3168..cfff219 100644
--- a/lib/RT/Util.pm
+++ b/lib/RT/Util.pm
@@ -116,14 +116,6 @@ sub _safe_run_child {
     return shift->();
 }
 
-eval "require RT::Util_Vendor";
-if ($@ && $@ !~ qr{^Can't locate RT/Util_Vendor.pm}) {
-    die $@;
-};
-
-eval "require RT::Util_Local";
-if ($@ && $@ !~ qr{^Can't locate RT/Util_Local.pm}) {
-    die $@;
-};
+RT::Base->_ImportOverlays();
 
 1;

commit a62c33a12a664c582f94ce8218fdde878eab9bfa
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Mon Aug 23 14:59:54 2010 -0400

    Remove string eval to set the RT::Handle's superclass
    (cherry picked from commit fc931e9d40d3a6f9180be3b8c7ca28252cd4dbe5)

diff --git a/lib/RT/Handle.pm b/lib/RT/Handle.pm
index f99974d..c5dc81c 100755
--- a/lib/RT/Handle.pm
+++ b/lib/RT/Handle.pm
@@ -82,8 +82,9 @@ L<DBIx::SearchBuilder::Handle>, using the C<DatabaseType> configuration.
 =cut
 
 sub FinalizeDatabaseType {
-    eval "use DBIx::SearchBuilder::Handle::". RT->Config->Get('DatabaseType') .";
-    \@ISA= qw(DBIx::SearchBuilder::Handle::". RT->Config->Get('DatabaseType') .");";
+    eval {
+        use base "DBIx::SearchBuilder::Handle::". RT->Config->Get('DatabaseType');
+    };
 
     if ($@) {
         die "Unable to load DBIx::SearchBuilder database handle for '". RT->Config->Get('DatabaseType') ."'.\n".

commit ce2c1d712ed4c52f2c8e10a91bf67e6ed9d91b60
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Mon Feb 28 16:24:00 2011 -0500

    Switch to using RT::Base->_ImportOverlays

diff --git a/lib/RT.pm.in b/lib/RT.pm.in
index ee9d6c2..623de66 100755
--- a/lib/RT.pm.in
+++ b/lib/RT.pm.in
@@ -703,9 +703,7 @@ L<DBIx::SearchBuilder>
 
 =cut
 
-eval "require RT_Vendor";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT_Vendor.pm});
-eval "require RT_Local";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT_Local.pm});
+require RT::Base;
+RT::Base->_ImportOverlays();
 
 1;
diff --git a/lib/RT/ACE.pm b/lib/RT/ACE.pm
index 8c2551c..dca50c3 100755
--- a/lib/RT/ACE.pm
+++ b/lib/RT/ACE.pm
@@ -284,24 +284,7 @@ sub _CoreAccessible {
  }
 };
 
-
-        eval "require RT::ACE_Overlay";
-        if ($@ && $@ !~ qr{^Can't locate RT/ACE_Overlay.pm}) {
-            die $@;
-        };
-
-        eval "require RT::ACE_Vendor";
-        if ($@ && $@ !~ qr{^Can't locate RT/ACE_Vendor.pm}) {
-            die $@;
-        };
-
-        eval "require RT::ACE_Local";
-        if ($@ && $@ !~ qr{^Can't locate RT/ACE_Local.pm}) {
-            die $@;
-        };
-
-
-
+RT::Base->_ImportOverlays();
 
 =head1 SEE ALSO
 
diff --git a/lib/RT/ACL.pm b/lib/RT/ACL.pm
index 26acbd9..94a0c91 100755
--- a/lib/RT/ACL.pm
+++ b/lib/RT/ACL.pm
@@ -96,24 +96,7 @@ sub NewItem {
     my $self = shift;
     return(RT::ACE->new($self->CurrentUser));
 }
-
-        eval "require RT::ACL_Overlay";
-        if ($@ && $@ !~ qr{^Can't locate RT/ACL_Overlay.pm}) {
-            die $@;
-        };
-
-        eval "require RT::ACL_Vendor";
-        if ($@ && $@ !~ qr{^Can't locate RT/ACL_Vendor.pm}) {
-            die $@;
-        };
-
-        eval "require RT::ACL_Local";
-        if ($@ && $@ !~ qr{^Can't locate RT/ACL_Local.pm}) {
-            die $@;
-        };
-
-
-
+RT::Base->_ImportOverlays();
 
 =head1 SEE ALSO
 
diff --git a/lib/RT/Action/Generic.pm b/lib/RT/Action/Generic.pm
index 7793622..d747813 100644
--- a/lib/RT/Action/Generic.pm
+++ b/lib/RT/Action/Generic.pm
@@ -68,13 +68,6 @@ use warnings;
 package RT::Action::Generic;
 use base 'RT::Action';
 
-eval "require RT::Action::Generic_Vendor";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Action/Generic_Vendor.pm});
-warn "RT::Action::Generic has become RT::Action. Please adjust your deprecated RT::Action::Generic_Vendor file at " . $INC{"RT/Action/Generic_Vendor.pm"} if !$@;
-
-eval "require RT::Action::Generic_Local";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Action/Generic_Local.pm});
-warn "RT::Action::Generic has become RT::Action. Please adjust your deprecated RT::Action::Generic_Local file at " . $INC{"RT/Action/Generic_Local.pm"} if !$@;
-
+RT::Base->_ImportOverlays();
 1;
 
diff --git a/lib/RT/Attachment.pm b/lib/RT/Attachment.pm
index 6f6bb26..e9a3dc6 100755
--- a/lib/RT/Attachment.pm
+++ b/lib/RT/Attachment.pm
@@ -356,24 +356,7 @@ sub _CoreAccessible {
  }
 };
 
-
-        eval "require RT::Attachment_Overlay";
-        if ($@ && $@ !~ qr{^Can't locate RT/Attachment_Overlay.pm}) {
-            die $@;
-        };
-
-        eval "require RT::Attachment_Vendor";
-        if ($@ && $@ !~ qr{^Can't locate RT/Attachment_Vendor.pm}) {
-            die $@;
-        };
-
-        eval "require RT::Attachment_Local";
-        if ($@ && $@ !~ qr{^Can't locate RT/Attachment_Local.pm}) {
-            die $@;
-        };
-
-
-
+RT::Base->_ImportOverlays();
 
 =head1 SEE ALSO
 
diff --git a/lib/RT/Attachments.pm b/lib/RT/Attachments.pm
index 93c9445..40f25e4 100755
--- a/lib/RT/Attachments.pm
+++ b/lib/RT/Attachments.pm
@@ -99,24 +99,7 @@ sub NewItem {
     my $self = shift;
     return(RT::Attachment->new($self->CurrentUser));
 }
-
-        eval "require RT::Attachments_Overlay";
-        if ($@ && $@ !~ qr{^Can't locate RT/Attachments_Overlay.pm}) {
-            die $@;
-        };
-
-        eval "require RT::Attachments_Vendor";
-        if ($@ && $@ !~ qr{^Can't locate RT/Attachments_Vendor.pm}) {
-            die $@;
-        };
-
-        eval "require RT::Attachments_Local";
-        if ($@ && $@ !~ qr{^Can't locate RT/Attachments_Local.pm}) {
-            die $@;
-        };
-
-
-
+RT::Base->_ImportOverlays();
 
 =head1 SEE ALSO
 
diff --git a/lib/RT/Attribute.pm b/lib/RT/Attribute.pm
index 5f5a08c..01d8318 100644
--- a/lib/RT/Attribute.pm
+++ b/lib/RT/Attribute.pm
@@ -309,24 +309,7 @@ sub _CoreAccessible {
  }
 };
 
-
-        eval "require RT::Attribute_Overlay";
-        if ($@ && $@ !~ qr{^Can't locate RT/Attribute_Overlay.pm}) {
-            die $@;
-        };
-
-        eval "require RT::Attribute_Vendor";
-        if ($@ && $@ !~ qr{^Can't locate RT/Attribute_Vendor.pm}) {
-            die $@;
-        };
-
-        eval "require RT::Attribute_Local";
-        if ($@ && $@ !~ qr{^Can't locate RT/Attribute_Local.pm}) {
-            die $@;
-        };
-
-
-
+RT::Base->_ImportOverlays();
 
 =head1 SEE ALSO
 
diff --git a/lib/RT/Attributes.pm b/lib/RT/Attributes.pm
index 320cb8d..2be0130 100644
--- a/lib/RT/Attributes.pm
+++ b/lib/RT/Attributes.pm
@@ -99,24 +99,7 @@ sub NewItem {
     my $self = shift;
     return(RT::Attribute->new($self->CurrentUser));
 }
-
-        eval "require RT::Attributes_Overlay";
-        if ($@ && $@ !~ qr{^Can't locate RT/Attributes_Overlay.pm}) {
-            die $@;
-        };
-
-        eval "require RT::Attributes_Vendor";
-        if ($@ && $@ !~ qr{^Can't locate RT/Attributes_Vendor.pm}) {
-            die $@;
-        };
-
-        eval "require RT::Attributes_Local";
-        if ($@ && $@ !~ qr{^Can't locate RT/Attributes_Local.pm}) {
-            die $@;
-        };
-
-
-
+RT::Base->_ImportOverlays();
 
 =head1 SEE ALSO
 
diff --git a/lib/RT/CachedGroupMember.pm b/lib/RT/CachedGroupMember.pm
index 3a0bdde..e8329ae 100755
--- a/lib/RT/CachedGroupMember.pm
+++ b/lib/RT/CachedGroupMember.pm
@@ -242,24 +242,7 @@ sub _CoreAccessible {
  }
 };
 
-
-        eval "require RT::CachedGroupMember_Overlay";
-        if ($@ && $@ !~ qr{^Can't locate RT/CachedGroupMember_Overlay.pm}) {
-            die $@;
-        };
-
-        eval "require RT::CachedGroupMember_Vendor";
-        if ($@ && $@ !~ qr{^Can't locate RT/CachedGroupMember_Vendor.pm}) {
-            die $@;
-        };
-
-        eval "require RT::CachedGroupMember_Local";
-        if ($@ && $@ !~ qr{^Can't locate RT/CachedGroupMember_Local.pm}) {
-            die $@;
-        };
-
-
-
+RT::Base->_ImportOverlays();
 
 =head1 SEE ALSO
 
diff --git a/lib/RT/CachedGroupMembers.pm b/lib/RT/CachedGroupMembers.pm
index 804dcb2..c75a654 100755
--- a/lib/RT/CachedGroupMembers.pm
+++ b/lib/RT/CachedGroupMembers.pm
@@ -99,24 +99,7 @@ sub NewItem {
     my $self = shift;
     return(RT::CachedGroupMember->new($self->CurrentUser));
 }
-
-        eval "require RT::CachedGroupMembers_Overlay";
-        if ($@ && $@ !~ qr{^Can't locate RT/CachedGroupMembers_Overlay.pm}) {
-            die $@;
-        };
-
-        eval "require RT::CachedGroupMembers_Vendor";
-        if ($@ && $@ !~ qr{^Can't locate RT/CachedGroupMembers_Vendor.pm}) {
-            die $@;
-        };
-
-        eval "require RT::CachedGroupMembers_Local";
-        if ($@ && $@ !~ qr{^Can't locate RT/CachedGroupMembers_Local.pm}) {
-            die $@;
-        };
-
-
-
+RT::Base->_ImportOverlays();
 
 =head1 SEE ALSO
 
diff --git a/lib/RT/Condition/Generic.pm b/lib/RT/Condition/Generic.pm
index 6032427..a3bfa75 100644
--- a/lib/RT/Condition/Generic.pm
+++ b/lib/RT/Condition/Generic.pm
@@ -68,13 +68,7 @@ use warnings;
 package RT::Condition::Generic;
 use base 'RT::Condition';
 
-eval "require RT::Condition::Generic_Vendor";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Condition/Generic_Vendor.pm});
-warn "RT::Condition::Generic has become RT::Condition. Please adjust your RT::Condition::Generic_Vendor file at " . $INC{"RT/Condition/Generic_Vendor.pm"} if !$@;
-
-eval "require RT::Condition::Generic_Local";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Condition/Generic_Local.pm});
-warn "RT::Condition::Generic has become RT::Condition. Please adjust your RT::Condition::Generic_Local file at " . $INC{"RT/Condition/Generic_Local.pm"} if !$@;
+RT::Base->_ImportOverlays();
 
 1;
 
diff --git a/lib/RT/CustomField.pm b/lib/RT/CustomField.pm
index 260e9bd..408bd10 100755
--- a/lib/RT/CustomField.pm
+++ b/lib/RT/CustomField.pm
@@ -385,24 +385,7 @@ sub _CoreAccessible {
  }
 };
 
-
-        eval "require RT::CustomField_Overlay";
-        if ($@ && $@ !~ qr{^Can't locate RT/CustomField_Overlay.pm}) {
-            die $@;
-        };
-
-        eval "require RT::CustomField_Vendor";
-        if ($@ && $@ !~ qr{^Can't locate RT/CustomField_Vendor.pm}) {
-            die $@;
-        };
-
-        eval "require RT::CustomField_Local";
-        if ($@ && $@ !~ qr{^Can't locate RT/CustomField_Local.pm}) {
-            die $@;
-        };
-
-
-
+RT::Base->_ImportOverlays();
 
 =head1 SEE ALSO
 
diff --git a/lib/RT/CustomFieldValue.pm b/lib/RT/CustomFieldValue.pm
index 0e09353..bfff16c 100755
--- a/lib/RT/CustomFieldValue.pm
+++ b/lib/RT/CustomFieldValue.pm
@@ -278,24 +278,7 @@ sub _CoreAccessible {
  }
 };
 
-
-        eval "require RT::CustomFieldValue_Overlay";
-        if ($@ && $@ !~ qr{^Can't locate RT/CustomFieldValue_Overlay.pm}) {
-            die $@;
-        };
-
-        eval "require RT::CustomFieldValue_Vendor";
-        if ($@ && $@ !~ qr{^Can't locate RT/CustomFieldValue_Vendor.pm}) {
-            die $@;
-        };
-
-        eval "require RT::CustomFieldValue_Local";
-        if ($@ && $@ !~ qr{^Can't locate RT/CustomFieldValue_Local.pm}) {
-            die $@;
-        };
-
-
-
+RT::Base->_ImportOverlays();
 
 =head1 SEE ALSO
 
diff --git a/lib/RT/CustomFieldValues.pm b/lib/RT/CustomFieldValues.pm
index 9cf7161..4fa062e 100755
--- a/lib/RT/CustomFieldValues.pm
+++ b/lib/RT/CustomFieldValues.pm
@@ -111,24 +111,7 @@ sub NewItem {
     my $self = shift;
     return(RT::CustomFieldValue->new($self->CurrentUser));
 }
-
-        eval "require RT::CustomFieldValues_Overlay";
-        if ($@ && $@ !~ qr{^Can't locate RT/CustomFieldValues_Overlay.pm}) {
-            die $@;
-        };
-
-        eval "require RT::CustomFieldValues_Vendor";
-        if ($@ && $@ !~ qr{^Can't locate RT/CustomFieldValues_Vendor.pm}) {
-            die $@;
-        };
-
-        eval "require RT::CustomFieldValues_Local";
-        if ($@ && $@ !~ qr{^Can't locate RT/CustomFieldValues_Local.pm}) {
-            die $@;
-        };
-
-
-
+RT::Base->_ImportOverlays();
 
 =head1 SEE ALSO
 
diff --git a/lib/RT/CustomFields.pm b/lib/RT/CustomFields.pm
index 7c81c0a..c1c4021 100755
--- a/lib/RT/CustomFields.pm
+++ b/lib/RT/CustomFields.pm
@@ -110,24 +110,7 @@ sub NewItem {
     my $self = shift;
     return(RT::CustomField->new($self->CurrentUser));
 }
-
-        eval "require RT::CustomFields_Overlay";
-        if ($@ && $@ !~ qr{^Can't locate RT/CustomFields_Overlay.pm}) {
-            die $@;
-        };
-
-        eval "require RT::CustomFields_Vendor";
-        if ($@ && $@ !~ qr{^Can't locate RT/CustomFields_Vendor.pm}) {
-            die $@;
-        };
-
-        eval "require RT::CustomFields_Local";
-        if ($@ && $@ !~ qr{^Can't locate RT/CustomFields_Local.pm}) {
-            die $@;
-        };
-
-
-
+RT::Base->_ImportOverlays();
 
 =head1 SEE ALSO
 
diff --git a/lib/RT/Graph/Tickets.pm b/lib/RT/Graph/Tickets.pm
index 46345fb..cab4299 100644
--- a/lib/RT/Graph/Tickets.pm
+++ b/lib/RT/Graph/Tickets.pm
@@ -345,14 +345,6 @@ sub TicketLinks {
     return $args{'Graph'};
 }
 
-eval "require RT::Graph::Tickets_Vendor";
-if ($@ && $@ !~ qr{^Can't locate RT/Graph/Tickets_Vendor.pm}) {
-    die $@;
-};
-
-eval "require RT::Graph::Tickets_Local";
-if ($@ && $@ !~ qr{^Can't locate RT/Graph/Tickets_Local.pm}) {
-    die $@;
-};
+RT::Base->_ImportOverlays();
 
 1;
diff --git a/lib/RT/Group.pm b/lib/RT/Group.pm
index 1f2c7c6..7af79ce 100755
--- a/lib/RT/Group.pm
+++ b/lib/RT/Group.pm
@@ -242,24 +242,7 @@ sub _CoreAccessible {
  }
 };
 
-
-        eval "require RT::Group_Overlay";
-        if ($@ && $@ !~ qr{^Can't locate RT/Group_Overlay.pm}) {
-            die $@;
-        };
-
-        eval "require RT::Group_Vendor";
-        if ($@ && $@ !~ qr{^Can't locate RT/Group_Vendor.pm}) {
-            die $@;
-        };
-
-        eval "require RT::Group_Local";
-        if ($@ && $@ !~ qr{^Can't locate RT/Group_Local.pm}) {
-            die $@;
-        };
-
-
-
+RT::Base->_ImportOverlays();
 
 =head1 SEE ALSO
 
diff --git a/lib/RT/GroupMember.pm b/lib/RT/GroupMember.pm
index 00381f4..ae0160c 100755
--- a/lib/RT/GroupMember.pm
+++ b/lib/RT/GroupMember.pm
@@ -173,24 +173,7 @@ sub _CoreAccessible {
  }
 };
 
-
-        eval "require RT::GroupMember_Overlay";
-        if ($@ && $@ !~ qr{^Can't locate RT/GroupMember_Overlay.pm}) {
-            die $@;
-        };
-
-        eval "require RT::GroupMember_Vendor";
-        if ($@ && $@ !~ qr{^Can't locate RT/GroupMember_Vendor.pm}) {
-            die $@;
-        };
-
-        eval "require RT::GroupMember_Local";
-        if ($@ && $@ !~ qr{^Can't locate RT/GroupMember_Local.pm}) {
-            die $@;
-        };
-
-
-
+RT::Base->_ImportOverlays();
 
 =head1 SEE ALSO
 
diff --git a/lib/RT/GroupMembers.pm b/lib/RT/GroupMembers.pm
index 49415e2..5d821ad 100755
--- a/lib/RT/GroupMembers.pm
+++ b/lib/RT/GroupMembers.pm
@@ -99,24 +99,7 @@ sub NewItem {
     my $self = shift;
     return(RT::GroupMember->new($self->CurrentUser));
 }
-
-        eval "require RT::GroupMembers_Overlay";
-        if ($@ && $@ !~ qr{^Can't locate RT/GroupMembers_Overlay.pm}) {
-            die $@;
-        };
-
-        eval "require RT::GroupMembers_Vendor";
-        if ($@ && $@ !~ qr{^Can't locate RT/GroupMembers_Vendor.pm}) {
-            die $@;
-        };
-
-        eval "require RT::GroupMembers_Local";
-        if ($@ && $@ !~ qr{^Can't locate RT/GroupMembers_Local.pm}) {
-            die $@;
-        };
-
-
-
+RT::Base->_ImportOverlays();
 
 =head1 SEE ALSO
 
diff --git a/lib/RT/Groups.pm b/lib/RT/Groups.pm
index 4f33a4a..2ec2f79 100755
--- a/lib/RT/Groups.pm
+++ b/lib/RT/Groups.pm
@@ -99,22 +99,7 @@ sub NewItem {
     my $self = shift;
     return(RT::Group->new($self->CurrentUser));
 }
-
-        eval "require RT::Groups_Overlay";
-        if ($@ && $@ !~ qr{^Can't locate RT/Groups_Overlay.pm}) {
-            die $@;
-        };
-
-        eval "require RT::Groups_Vendor";
-        if ($@ && $@ !~ qr{^Can't locate RT/Groups_Vendor.pm}) {
-            die $@;
-        };
-
-        eval "require RT::Groups_Local";
-        if ($@ && $@ !~ qr{^Can't locate RT/Groups_Local.pm}) {
-            die $@;
-        };
-
+RT::Base->_ImportOverlays();
 
 =head1 SEE ALSO
 
diff --git a/lib/RT/Link.pm b/lib/RT/Link.pm
index 027962e..1aff5ef 100755
--- a/lib/RT/Link.pm
+++ b/lib/RT/Link.pm
@@ -286,24 +286,7 @@ sub _CoreAccessible {
  }
 };
 
-
-        eval "require RT::Link_Overlay";
-        if ($@ && $@ !~ qr{^Can't locate RT/Link_Overlay.pm}) {
-            die $@;
-        };
-
-        eval "require RT::Link_Vendor";
-        if ($@ && $@ !~ qr{^Can't locate RT/Link_Vendor.pm}) {
-            die $@;
-        };
-
-        eval "require RT::Link_Local";
-        if ($@ && $@ !~ qr{^Can't locate RT/Link_Local.pm}) {
-            die $@;
-        };
-
-
-
+RT::Base->_ImportOverlays();
 
 =head1 SEE ALSO
 
diff --git a/lib/RT/Links.pm b/lib/RT/Links.pm
index bd0b297..d8b6025 100755
--- a/lib/RT/Links.pm
+++ b/lib/RT/Links.pm
@@ -99,24 +99,7 @@ sub NewItem {
     my $self = shift;
     return(RT::Link->new($self->CurrentUser));
 }
-
-        eval "require RT::Links_Overlay";
-        if ($@ && $@ !~ qr{^Can't locate RT/Links_Overlay.pm}) {
-            die $@;
-        };
-
-        eval "require RT::Links_Vendor";
-        if ($@ && $@ !~ qr{^Can't locate RT/Links_Vendor.pm}) {
-            die $@;
-        };
-
-        eval "require RT::Links_Local";
-        if ($@ && $@ !~ qr{^Can't locate RT/Links_Local.pm}) {
-            die $@;
-        };
-
-
-
+RT::Base->_ImportOverlays();
 
 =head1 SEE ALSO
 
diff --git a/lib/RT/ObjectCustomField.pm b/lib/RT/ObjectCustomField.pm
index 04387d2..14bb61b 100644
--- a/lib/RT/ObjectCustomField.pm
+++ b/lib/RT/ObjectCustomField.pm
@@ -255,24 +255,7 @@ sub _CoreAccessible {
  }
 };
 
-
-        eval "require RT::ObjectCustomField_Overlay";
-        if ($@ && $@ !~ qr{^Can't locate RT/ObjectCustomField_Overlay.pm}) {
-            die $@;
-        };
-
-        eval "require RT::ObjectCustomField_Vendor";
-        if ($@ && $@ !~ qr{^Can't locate RT/ObjectCustomField_Vendor.pm}) {
-            die $@;
-        };
-
-        eval "require RT::ObjectCustomField_Local";
-        if ($@ && $@ !~ qr{^Can't locate RT/ObjectCustomField_Local.pm}) {
-            die $@;
-        };
-
-
-
+RT::Base->_ImportOverlays();
 
 =head1 SEE ALSO
 
diff --git a/lib/RT/ObjectCustomFieldValue.pm b/lib/RT/ObjectCustomFieldValue.pm
index 9000ee6..5f51ee6 100644
--- a/lib/RT/ObjectCustomFieldValue.pm
+++ b/lib/RT/ObjectCustomFieldValue.pm
@@ -379,24 +379,7 @@ sub _CoreAccessible {
  }
 };
 
-
-        eval "require RT::ObjectCustomFieldValue_Overlay";
-        if ($@ && $@ !~ qr{^Can't locate RT/ObjectCustomFieldValue_Overlay.pm}) {
-            die $@;
-        };
-
-        eval "require RT::ObjectCustomFieldValue_Vendor";
-        if ($@ && $@ !~ qr{^Can't locate RT/ObjectCustomFieldValue_Vendor.pm}) {
-            die $@;
-        };
-
-        eval "require RT::ObjectCustomFieldValue_Local";
-        if ($@ && $@ !~ qr{^Can't locate RT/ObjectCustomFieldValue_Local.pm}) {
-            die $@;
-        };
-
-
-
+RT::Base->_ImportOverlays();
 
 =head1 SEE ALSO
 
diff --git a/lib/RT/ObjectCustomFieldValues.pm b/lib/RT/ObjectCustomFieldValues.pm
index 25d5a48..ca1ed08 100644
--- a/lib/RT/ObjectCustomFieldValues.pm
+++ b/lib/RT/ObjectCustomFieldValues.pm
@@ -110,24 +110,7 @@ sub NewItem {
     my $self = shift;
     return(RT::ObjectCustomFieldValue->new($self->CurrentUser));
 }
-
-        eval "require RT::ObjectCustomFieldValues_Overlay";
-        if ($@ && $@ !~ qr{^Can't locate RT/ObjectCustomFieldValues_Overlay.pm}) {
-            die $@;
-        };
-
-        eval "require RT::ObjectCustomFieldValues_Vendor";
-        if ($@ && $@ !~ qr{^Can't locate RT/ObjectCustomFieldValues_Vendor.pm}) {
-            die $@;
-        };
-
-        eval "require RT::ObjectCustomFieldValues_Local";
-        if ($@ && $@ !~ qr{^Can't locate RT/ObjectCustomFieldValues_Local.pm}) {
-            die $@;
-        };
-
-
-
+RT::Base->_ImportOverlays();
 
 =head1 SEE ALSO
 
diff --git a/lib/RT/ObjectCustomFields.pm b/lib/RT/ObjectCustomFields.pm
index d38eb97..053b1d1 100644
--- a/lib/RT/ObjectCustomFields.pm
+++ b/lib/RT/ObjectCustomFields.pm
@@ -110,24 +110,7 @@ sub NewItem {
     my $self = shift;
     return(RT::ObjectCustomField->new($self->CurrentUser));
 }
-
-        eval "require RT::ObjectCustomFields_Overlay";
-        if ($@ && $@ !~ qr{^Can't locate RT/ObjectCustomFields_Overlay.pm}) {
-            die $@;
-        };
-
-        eval "require RT::ObjectCustomFields_Vendor";
-        if ($@ && $@ !~ qr{^Can't locate RT/ObjectCustomFields_Vendor.pm}) {
-            die $@;
-        };
-
-        eval "require RT::ObjectCustomFields_Local";
-        if ($@ && $@ !~ qr{^Can't locate RT/ObjectCustomFields_Local.pm}) {
-            die $@;
-        };
-
-
-
+RT::Base->_ImportOverlays();
 
 =head1 SEE ALSO
 
diff --git a/lib/RT/Principal.pm b/lib/RT/Principal.pm
index 92bf371..17a7346 100755
--- a/lib/RT/Principal.pm
+++ b/lib/RT/Principal.pm
@@ -196,24 +196,7 @@ sub _CoreAccessible {
  }
 };
 
-
-        eval "require RT::Principal_Overlay";
-        if ($@ && $@ !~ qr{^Can't locate RT/Principal_Overlay.pm}) {
-            die $@;
-        };
-
-        eval "require RT::Principal_Vendor";
-        if ($@ && $@ !~ qr{^Can't locate RT/Principal_Vendor.pm}) {
-            die $@;
-        };
-
-        eval "require RT::Principal_Local";
-        if ($@ && $@ !~ qr{^Can't locate RT/Principal_Local.pm}) {
-            die $@;
-        };
-
-
-
+RT::Base->_ImportOverlays();
 
 =head1 SEE ALSO
 
diff --git a/lib/RT/Principals.pm b/lib/RT/Principals.pm
index 147a1fa..ef2c4d7 100755
--- a/lib/RT/Principals.pm
+++ b/lib/RT/Principals.pm
@@ -99,24 +99,7 @@ sub NewItem {
     my $self = shift;
     return(RT::Principal->new($self->CurrentUser));
 }
-
-        eval "require RT::Principals_Overlay";
-        if ($@ && $@ !~ qr{^Can't locate RT/Principals_Overlay.pm}) {
-            die $@;
-        };
-
-        eval "require RT::Principals_Vendor";
-        if ($@ && $@ !~ qr{^Can't locate RT/Principals_Vendor.pm}) {
-            die $@;
-        };
-
-        eval "require RT::Principals_Local";
-        if ($@ && $@ !~ qr{^Can't locate RT/Principals_Local.pm}) {
-            die $@;
-        };
-
-
-
+RT::Base->_ImportOverlays();
 
 =head1 SEE ALSO
 
diff --git a/lib/RT/Queue.pm b/lib/RT/Queue.pm
index 7a86046..c0a0229 100755
--- a/lib/RT/Queue.pm
+++ b/lib/RT/Queue.pm
@@ -355,24 +355,7 @@ sub _CoreAccessible {
  }
 };
 
-
-        eval "require RT::Queue_Overlay";
-        if ($@ && $@ !~ qr{^Can't locate RT/Queue_Overlay.pm}) {
-            die $@;
-        };
-
-        eval "require RT::Queue_Vendor";
-        if ($@ && $@ !~ qr{^Can't locate RT/Queue_Vendor.pm}) {
-            die $@;
-        };
-
-        eval "require RT::Queue_Local";
-        if ($@ && $@ !~ qr{^Can't locate RT/Queue_Local.pm}) {
-            die $@;
-        };
-
-
-
+RT::Base->_ImportOverlays();
 
 =head1 SEE ALSO
 
diff --git a/lib/RT/Queues.pm b/lib/RT/Queues.pm
index 4b4c678..e634a96 100755
--- a/lib/RT/Queues.pm
+++ b/lib/RT/Queues.pm
@@ -99,24 +99,7 @@ sub NewItem {
     my $self = shift;
     return(RT::Queue->new($self->CurrentUser));
 }
-
-        eval "require RT::Queues_Overlay";
-        if ($@ && $@ !~ qr{^Can't locate RT/Queues_Overlay.pm}) {
-            die $@;
-        };
-
-        eval "require RT::Queues_Vendor";
-        if ($@ && $@ !~ qr{^Can't locate RT/Queues_Vendor.pm}) {
-            die $@;
-        };
-
-        eval "require RT::Queues_Local";
-        if ($@ && $@ !~ qr{^Can't locate RT/Queues_Local.pm}) {
-            die $@;
-        };
-
-
-
+RT::Base->_ImportOverlays();
 
 =head1 SEE ALSO
 
diff --git a/lib/RT/Scrip.pm b/lib/RT/Scrip.pm
index 4333f23..b430a77 100755
--- a/lib/RT/Scrip.pm
+++ b/lib/RT/Scrip.pm
@@ -484,24 +484,7 @@ sub _CoreAccessible {
  }
 };
 
-
-        eval "require RT::Scrip_Overlay";
-        if ($@ && $@ !~ qr{^Can't locate RT/Scrip_Overlay.pm}) {
-            die $@;
-        };
-
-        eval "require RT::Scrip_Vendor";
-        if ($@ && $@ !~ qr{^Can't locate RT/Scrip_Vendor.pm}) {
-            die $@;
-        };
-
-        eval "require RT::Scrip_Local";
-        if ($@ && $@ !~ qr{^Can't locate RT/Scrip_Local.pm}) {
-            die $@;
-        };
-
-
-
+RT::Base->_ImportOverlays();
 
 =head1 SEE ALSO
 
diff --git a/lib/RT/ScripAction.pm b/lib/RT/ScripAction.pm
index 9afcb84..21a8a0e 100755
--- a/lib/RT/ScripAction.pm
+++ b/lib/RT/ScripAction.pm
@@ -263,24 +263,7 @@ sub _CoreAccessible {
  }
 };
 
-
-        eval "require RT::ScripAction_Overlay";
-        if ($@ && $@ !~ qr{^Can't locate RT/ScripAction_Overlay.pm}) {
-            die $@;
-        };
-
-        eval "require RT::ScripAction_Vendor";
-        if ($@ && $@ !~ qr{^Can't locate RT/ScripAction_Vendor.pm}) {
-            die $@;
-        };
-
-        eval "require RT::ScripAction_Local";
-        if ($@ && $@ !~ qr{^Can't locate RT/ScripAction_Local.pm}) {
-            die $@;
-        };
-
-
-
+RT::Base->_ImportOverlays();
 
 =head1 SEE ALSO
 
diff --git a/lib/RT/ScripActions.pm b/lib/RT/ScripActions.pm
index c1f8efd..d2f987c 100755
--- a/lib/RT/ScripActions.pm
+++ b/lib/RT/ScripActions.pm
@@ -99,24 +99,7 @@ sub NewItem {
     my $self = shift;
     return(RT::ScripAction->new($self->CurrentUser));
 }
-
-        eval "require RT::ScripActions_Overlay";
-        if ($@ && $@ !~ qr{^Can't locate RT/ScripActions_Overlay.pm}) {
-            die $@;
-        };
-
-        eval "require RT::ScripActions_Vendor";
-        if ($@ && $@ !~ qr{^Can't locate RT/ScripActions_Vendor.pm}) {
-            die $@;
-        };
-
-        eval "require RT::ScripActions_Local";
-        if ($@ && $@ !~ qr{^Can't locate RT/ScripActions_Local.pm}) {
-            die $@;
-        };
-
-
-
+RT::Base->_ImportOverlays();
 
 =head1 SEE ALSO
 
diff --git a/lib/RT/ScripCondition.pm b/lib/RT/ScripCondition.pm
index a4cb268..48ea27a 100755
--- a/lib/RT/ScripCondition.pm
+++ b/lib/RT/ScripCondition.pm
@@ -286,24 +286,7 @@ sub _CoreAccessible {
  }
 };
 
-
-        eval "require RT::ScripCondition_Overlay";
-        if ($@ && $@ !~ qr{^Can't locate RT/ScripCondition_Overlay.pm}) {
-            die $@;
-        };
-
-        eval "require RT::ScripCondition_Vendor";
-        if ($@ && $@ !~ qr{^Can't locate RT/ScripCondition_Vendor.pm}) {
-            die $@;
-        };
-
-        eval "require RT::ScripCondition_Local";
-        if ($@ && $@ !~ qr{^Can't locate RT/ScripCondition_Local.pm}) {
-            die $@;
-        };
-
-
-
+RT::Base->_ImportOverlays();
 
 =head1 SEE ALSO
 
diff --git a/lib/RT/ScripConditions.pm b/lib/RT/ScripConditions.pm
index 828e5f4..76777cb 100755
--- a/lib/RT/ScripConditions.pm
+++ b/lib/RT/ScripConditions.pm
@@ -99,24 +99,7 @@ sub NewItem {
     my $self = shift;
     return(RT::ScripCondition->new($self->CurrentUser));
 }
-
-        eval "require RT::ScripConditions_Overlay";
-        if ($@ && $@ !~ qr{^Can't locate RT/ScripConditions_Overlay.pm}) {
-            die $@;
-        };
-
-        eval "require RT::ScripConditions_Vendor";
-        if ($@ && $@ !~ qr{^Can't locate RT/ScripConditions_Vendor.pm}) {
-            die $@;
-        };
-
-        eval "require RT::ScripConditions_Local";
-        if ($@ && $@ !~ qr{^Can't locate RT/ScripConditions_Local.pm}) {
-            die $@;
-        };
-
-
-
+RT::Base->_ImportOverlays();
 
 =head1 SEE ALSO
 
diff --git a/lib/RT/Scrips.pm b/lib/RT/Scrips.pm
index 5b05e0b..7e63217 100755
--- a/lib/RT/Scrips.pm
+++ b/lib/RT/Scrips.pm
@@ -99,24 +99,7 @@ sub NewItem {
     my $self = shift;
     return(RT::Scrip->new($self->CurrentUser));
 }
-
-        eval "require RT::Scrips_Overlay";
-        if ($@ && $@ !~ qr{^Can't locate RT/Scrips_Overlay.pm}) {
-            die $@;
-        };
-
-        eval "require RT::Scrips_Vendor";
-        if ($@ && $@ !~ qr{^Can't locate RT/Scrips_Vendor.pm}) {
-            die $@;
-        };
-
-        eval "require RT::Scrips_Local";
-        if ($@ && $@ !~ qr{^Can't locate RT/Scrips_Local.pm}) {
-            die $@;
-        };
-
-
-
+RT::Base->_ImportOverlays();
 
 =head1 SEE ALSO
 
diff --git a/lib/RT/Search/Generic.pm b/lib/RT/Search/Generic.pm
index 57cbfb6..589033e 100644
--- a/lib/RT/Search/Generic.pm
+++ b/lib/RT/Search/Generic.pm
@@ -68,13 +68,7 @@ use warnings;
 package RT::Search::Generic;
 use base 'RT::Search';
 
-eval "require RT::Search::Generic_Vendor";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Search/Generic_Vendor.pm});
-warn "RT::Search::Generic has become RT::Search. Please adjust your RT::Search::Generic_Vendor file at " . $INC{"RT/Search/Generic_Vendor.pm"} if !$@;
-
-eval "require RT::Search::Generic_Local";
-die $@ if ($@ && $@ !~ qr{^Can't locate RT/Search/Generic_Local.pm});
-warn "RT::Search::Generic has become RT::Search. Please adjust your RT::Search::Generic_Local file at " . $INC{"RT/Search/Generic_Local.pm"} if !$@;
+RT::Base->_ImportOverlays;
 
 1;
 
diff --git a/lib/RT/Template.pm b/lib/RT/Template.pm
index 12d0fc9..b77820d 100755
--- a/lib/RT/Template.pm
+++ b/lib/RT/Template.pm
@@ -347,24 +347,7 @@ sub _CoreAccessible {
  }
 };
 
-
-        eval "require RT::Template_Overlay";
-        if ($@ && $@ !~ qr{^Can't locate RT/Template_Overlay.pm}) {
-            die $@;
-        };
-
-        eval "require RT::Template_Vendor";
-        if ($@ && $@ !~ qr{^Can't locate RT/Template_Vendor.pm}) {
-            die $@;
-        };
-
-        eval "require RT::Template_Local";
-        if ($@ && $@ !~ qr{^Can't locate RT/Template_Local.pm}) {
-            die $@;
-        };
-
-
-
+RT::Base->_ImportOverlays();
 
 =head1 SEE ALSO
 
diff --git a/lib/RT/Templates.pm b/lib/RT/Templates.pm
index 0432ffa..97b37c5 100755
--- a/lib/RT/Templates.pm
+++ b/lib/RT/Templates.pm
@@ -99,24 +99,7 @@ sub NewItem {
     my $self = shift;
     return(RT::Template->new($self->CurrentUser));
 }
-
-        eval "require RT::Templates_Overlay";
-        if ($@ && $@ !~ qr{^Can't locate RT/Templates_Overlay.pm}) {
-            die $@;
-        };
-
-        eval "require RT::Templates_Vendor";
-        if ($@ && $@ !~ qr{^Can't locate RT/Templates_Vendor.pm}) {
-            die $@;
-        };
-
-        eval "require RT::Templates_Local";
-        if ($@ && $@ !~ qr{^Can't locate RT/Templates_Local.pm}) {
-            die $@;
-        };
-
-
-
+RT::Base->_ImportOverlays();
 
 =head1 SEE ALSO
 
diff --git a/lib/RT/Ticket.pm b/lib/RT/Ticket.pm
index def7236..edf38f0 100755
--- a/lib/RT/Ticket.pm
+++ b/lib/RT/Ticket.pm
@@ -648,24 +648,7 @@ sub _CoreAccessible {
  }
 };
 
-
-        eval "require RT::Ticket_Overlay";
-        if ($@ && $@ !~ qr{^Can't locate RT/Ticket_Overlay.pm}) {
-            die $@;
-        };
-
-        eval "require RT::Ticket_Vendor";
-        if ($@ && $@ !~ qr{^Can't locate RT/Ticket_Vendor.pm}) {
-            die $@;
-        };
-
-        eval "require RT::Ticket_Local";
-        if ($@ && $@ !~ qr{^Can't locate RT/Ticket_Local.pm}) {
-            die $@;
-        };
-
-
-
+RT::Base->_ImportOverlays();
 
 =head1 SEE ALSO
 
diff --git a/lib/RT/Tickets.pm b/lib/RT/Tickets.pm
index 77d4456..b3a84ae 100755
--- a/lib/RT/Tickets.pm
+++ b/lib/RT/Tickets.pm
@@ -99,24 +99,7 @@ sub NewItem {
     my $self = shift;
     return(RT::Ticket->new($self->CurrentUser));
 }
-
-        eval "require RT::Tickets_Overlay";
-        if ($@ && $@ !~ qr{^Can't locate RT/Tickets_Overlay.pm}) {
-            die $@;
-        };
-
-        eval "require RT::Tickets_Vendor";
-        if ($@ && $@ !~ qr{^Can't locate RT/Tickets_Vendor.pm}) {
-            die $@;
-        };
-
-        eval "require RT::Tickets_Local";
-        if ($@ && $@ !~ qr{^Can't locate RT/Tickets_Local.pm}) {
-            die $@;
-        };
-
-
-
+RT::Base->_ImportOverlays();
 
 =head1 SEE ALSO
 
diff --git a/lib/RT/Transaction.pm b/lib/RT/Transaction.pm
index d0228ad..bc2b5cd 100755
--- a/lib/RT/Transaction.pm
+++ b/lib/RT/Transaction.pm
@@ -402,24 +402,7 @@ sub _CoreAccessible {
  }
 };
 
-
-        eval "require RT::Transaction_Overlay";
-        if ($@ && $@ !~ qr{^Can't locate RT/Transaction_Overlay.pm}) {
-            die $@;
-        };
-
-        eval "require RT::Transaction_Vendor";
-        if ($@ && $@ !~ qr{^Can't locate RT/Transaction_Vendor.pm}) {
-            die $@;
-        };
-
-        eval "require RT::Transaction_Local";
-        if ($@ && $@ !~ qr{^Can't locate RT/Transaction_Local.pm}) {
-            die $@;
-        };
-
-
-
+RT::Base->_ImportOverlays();
 
 =head1 SEE ALSO
 
diff --git a/lib/RT/Transactions.pm b/lib/RT/Transactions.pm
index 8ba1a96..0b977c6 100755
--- a/lib/RT/Transactions.pm
+++ b/lib/RT/Transactions.pm
@@ -99,24 +99,7 @@ sub NewItem {
     my $self = shift;
     return(RT::Transaction->new($self->CurrentUser));
 }
-
-        eval "require RT::Transactions_Overlay";
-        if ($@ && $@ !~ qr{^Can't locate RT/Transactions_Overlay.pm}) {
-            die $@;
-        };
-
-        eval "require RT::Transactions_Vendor";
-        if ($@ && $@ !~ qr{^Can't locate RT/Transactions_Vendor.pm}) {
-            die $@;
-        };
-
-        eval "require RT::Transactions_Local";
-        if ($@ && $@ !~ qr{^Can't locate RT/Transactions_Local.pm}) {
-            die $@;
-        };
-
-
-
+RT::Base->_ImportOverlays();
 
 =head1 SEE ALSO
 
diff --git a/lib/RT/User.pm b/lib/RT/User.pm
index af36c85..b7ebd5b 100755
--- a/lib/RT/User.pm
+++ b/lib/RT/User.pm
@@ -838,24 +838,7 @@ sub _CoreAccessible {
  }
 };
 
-
-        eval "require RT::User_Overlay";
-        if ($@ && $@ !~ qr{^Can't locate RT/User_Overlay.pm}) {
-            die $@;
-        };
-
-        eval "require RT::User_Vendor";
-        if ($@ && $@ !~ qr{^Can't locate RT/User_Vendor.pm}) {
-            die $@;
-        };
-
-        eval "require RT::User_Local";
-        if ($@ && $@ !~ qr{^Can't locate RT/User_Local.pm}) {
-            die $@;
-        };
-
-
-
+RT::Base->_ImportOverlays();
 
 =head1 SEE ALSO
 
diff --git a/lib/RT/Users.pm b/lib/RT/Users.pm
index e1c8825..f0f07fd 100755
--- a/lib/RT/Users.pm
+++ b/lib/RT/Users.pm
@@ -99,24 +99,7 @@ sub NewItem {
     my $self = shift;
     return(RT::User->new($self->CurrentUser));
 }
-
-        eval "require RT::Users_Overlay";
-        if ($@ && $@ !~ qr{^Can't locate RT/Users_Overlay.pm}) {
-            die $@;
-        };
-
-        eval "require RT::Users_Vendor";
-        if ($@ && $@ !~ qr{^Can't locate RT/Users_Vendor.pm}) {
-            die $@;
-        };
-
-        eval "require RT::Users_Local";
-        if ($@ && $@ !~ qr{^Can't locate RT/Users_Local.pm}) {
-            die $@;
-        };
-
-
-
+RT::Base->_ImportOverlays();
 
 =head1 SEE ALSO
 

commit b06085df1a742a266c11305d870129cab11f8d2e
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Thu Mar 3 10:38:07 2011 -0500

    some old loop cleanup flagged by perlcritic

diff --git a/lib/RT/Interface/REST.pm b/lib/RT/Interface/REST.pm
index 267f454..1f7295d 100755
--- a/lib/RT/Interface/REST.pm
+++ b/lib/RT/Interface/REST.pm
@@ -51,6 +51,7 @@
 
 package RT::Interface::REST;
 use strict;
+use warnings;
 use RT;
 
 BEGIN {
@@ -160,8 +161,8 @@ sub form_parse {
                 pop @v while (@v && $v[-1] eq '');
 
                 # Strip longest common leading indent from text.
-                my ($ws, $ls) = ("");
-                foreach $ls (map {/^(\s+)/} @v[1..$#v]) {
+                my $ws = ("");
+                foreach my $ls (map {/^(\s+)/} @v[1..$#v]) {
                     $ws = $ls if (!$ws || length($ls) < length($ws));
                 }
                 s/^$ws// foreach @v;
@@ -189,8 +190,7 @@ sub form_parse {
     }
     push(@forms, [ $c, $o, $k, $e ]) if ($e || $c || @$o);
 
-    my $l;
-    foreach $l (keys %$k) {
+    foreach my $l (keys %$k) {
         $k->{$l} = vsplit($k->{$l}) if (ref $k->{$l} eq 'ARRAY');
     }
 
@@ -202,7 +202,7 @@ sub form_compose {
     my ($forms) = @_;
     my (@text, $form);
 
-    foreach $form (@$forms) {
+    foreach my $form (@$forms) {
         my ($c, $o, $k, $e) = @$form;
         my $text = "";
 
@@ -216,7 +216,7 @@ sub form_compose {
         elsif ($o) {
             my (@lines, $key);
 
-            foreach $key (@$o) {
+            foreach my $key (@$o) {
                 my ($line, $sp, $v);
                 my @values = (ref $k->{$key} eq 'ARRAY') ?
                                @{ $k->{$key} } :
@@ -225,7 +225,7 @@ sub form_compose {
                 $sp = " "x(length("$key: "));
                 $sp = " "x4 if length($sp) > 16;
 
-                foreach $v (@values) {
+                foreach my $v (@values) {
                     $v = '' unless defined $v;
                     if ( $v =~ /\n/) {
                         $v =~ s/^/$sp/gm;
@@ -293,9 +293,9 @@ sub vpush {
 # "Normalise" a hash key that's known to be multi-valued.
 sub vsplit {
     my ($val) = @_;
-    my ($line, $word, @words);
+    my @words;
 
-    foreach $line (map {split /\n/} (ref $val eq 'ARRAY') ? @$val : ($val||''))
+    foreach my $line (map {split /\n/} (ref $val eq 'ARRAY') ? @$val : ($val||''))
     {
         # XXX: This should become a real parser, ? la Text::ParseWords.
         $line =~ s/^\s+//;
diff --git a/lib/RT/Ticket_Overlay.pm b/lib/RT/Ticket_Overlay.pm
index 97bcdf5..8dd88c9 100755
--- a/lib/RT/Ticket_Overlay.pm
+++ b/lib/RT/Ticket_Overlay.pm
@@ -944,15 +944,14 @@ sub Import {
 
     $self->OwnerGroup->_AddMember( PrincipalId => $Owner->PrincipalId );
 
-    my $watcher;
-    foreach $watcher ( @{ $args{'Cc'} } ) {
+    foreach my $watcher ( @{ $args{'Cc'} } ) {
         $self->_AddWatcher( Type => 'Cc', Email => $watcher, Silent => 1 );
     }
-    foreach $watcher ( @{ $args{'AdminCc'} } ) {
+    foreach my $watcher ( @{ $args{'AdminCc'} } ) {
         $self->_AddWatcher( Type => 'AdminCc', Email => $watcher,
             Silent => 1 );
     }
-    foreach $watcher ( @{ $args{'Requestor'} } ) {
+    foreach my $watcher ( @{ $args{'Requestor'} } ) {
         $self->_AddWatcher( Type => 'Requestor', Email => $watcher,
             Silent => 1 );
     }
diff --git a/lib/RT/Tickets_Overlay.pm b/lib/RT/Tickets_Overlay.pm
index 2c44019..e4020f6 100755
--- a/lib/RT/Tickets_Overlay.pm
+++ b/lib/RT/Tickets_Overlay.pm
@@ -3134,9 +3134,9 @@ is a description of the purpose of that TicketRestriction
 sub DescribeRestrictions {
     my $self = shift;
 
-    my ( $row, %listing );
+    my %listing;
 
-    foreach $row ( keys %{ $self->{'TicketRestrictions'} } ) {
+    foreach my $row ( keys %{ $self->{'TicketRestrictions'} } ) {
         $listing{$row} = $self->{'TicketRestrictions'}{$row}{'DESCRIPTION'};
     }
     return (%listing);
@@ -3211,9 +3211,8 @@ sub DeleteRestriction {
 sub _RestrictionsToClauses {
     my $self = shift;
 
-    my $row;
     my %clause;
-    foreach $row ( keys %{ $self->{'TicketRestrictions'} } ) {
+    foreach my $row ( keys %{ $self->{'TicketRestrictions'} } ) {
         my $restriction = $self->{'TicketRestrictions'}{$row};
 
         # We need to reimplement the subclause aggregation that SearchBuilder does.

commit aec41e18300346910735fc3386b08ffe7814fba5
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Mon Feb 28 16:03:22 2011 -0500

    Make this private method public
    
    The only code that uses it, uses it like a public method.
    There is a glob alias for the _ version for back compat.
    All of this code goes away in 4.0

diff --git a/lib/RT/ACE_Overlay.pm b/lib/RT/ACE_Overlay.pm
index 93607b2..c3444b3 100755
--- a/lib/RT/ACE_Overlay.pm
+++ b/lib/RT/ACE_Overlay.pm
@@ -481,7 +481,7 @@ sub _Delete {
     # revoke all rights delegated by the recipient.
     if ($val and ($self->RightName() eq 'DelegateRights' or
 		  $self->RightName() eq 'SuperUser')) {
-	$val = $self->PrincipalObj->_CleanupInvalidDelegations( InsideTransaction => 1 );
+	$val = $self->PrincipalObj->CleanupInvalidDelegations( InsideTransaction => 1 );
     }
 
     if ($val) {
diff --git a/lib/RT/GroupMember_Overlay.pm b/lib/RT/GroupMember_Overlay.pm
index efaa3c7..48d55d9 100755
--- a/lib/RT/GroupMember_Overlay.pm
+++ b/lib/RT/GroupMember_Overlay.pm
@@ -337,7 +337,7 @@ sub Delete {
     # Since this deletion may have changed the former member's
     # delegation rights, we need to ensure that no invalid delegations
     # remain.
-    $err = $self->MemberObj->_CleanupInvalidDelegations(InsideTransaction => 1);
+    $err = $self->MemberObj->CleanupInvalidDelegations(InsideTransaction => 1);
     unless ($err) {
 	$RT::Logger->warning("Unable to revoke delegated rights for principal ".$self->Id);
 	$RT::Handle->Rollback();
diff --git a/lib/RT/Group_Overlay.pm b/lib/RT/Group_Overlay.pm
index af47baf..09f3082 100755
--- a/lib/RT/Group_Overlay.pm
+++ b/lib/RT/Group_Overlay.pm
@@ -1189,9 +1189,9 @@ sub _DeleteMember {
 
 # }}}
 
-# {{{ sub _CleanupInvalidDelegations
+# {{{ sub CleanupInvalidDelegations
 
-=head2 _CleanupInvalidDelegations { InsideTransaction => undef }
+=head2 CleanupInvalidDelegations { InsideTransaction => undef }
 
 Revokes all ACE entries delegated by members of this group which are
 inconsistent with their current delegation rights.  Does not perform
@@ -1206,12 +1206,15 @@ and logs an internal error if the deletion fails (should not happen).
 
 =cut
 
-# XXX Currently there is a _CleanupInvalidDelegations method in both
+# XXX Currently there is a CleanupInvalidDelegations method in both
 # RT::User and RT::Group.  If the recursive cleanup call for groups is
 # ever unrolled and merged, this code will probably want to be
 # factored out into RT::Principal.
 
-sub _CleanupInvalidDelegations {
+# backcompat for 3.8.8 and before
+*_CleanupInvalidDelegations = \&CleanupInvalidDelegations;
+
+sub CleanupInvalidDelegations {
     my $self = shift;
     my %args = ( InsideTransaction => undef,
 		  @_ );
@@ -1228,7 +1231,7 @@ sub _CleanupInvalidDelegations {
     $members->LimitToUsers();
     $RT::Handle->BeginTransaction() unless $in_trans;
     while ( my $member = $members->Next()) {
-	my $ret = $member->MemberObj->_CleanupInvalidDelegations(InsideTransaction => 1,
+	my $ret = $member->MemberObj->CleanupInvalidDelegations(InsideTransaction => 1,
 								 Object => $args{Object});
 	unless ($ret) {
 	    $RT::Handle->Rollback() unless $in_trans;
diff --git a/lib/RT/Principal_Overlay.pm b/lib/RT/Principal_Overlay.pm
index 2ceca46..88e721e 100755
--- a/lib/RT/Principal_Overlay.pm
+++ b/lib/RT/Principal_Overlay.pm
@@ -216,9 +216,9 @@ sub RevokeRight {
 
 # }}}
 
-# {{{ sub _CleanupInvalidDelegations
+# {{{ sub CleanupInvalidDelegations
 
-=head2 sub _CleanupInvalidDelegations { InsideTransaction => undef }
+=head2 sub CleanupInvalidDelegations { InsideTransaction => undef }
 
 Revokes all ACE entries delegated by this principal which are
 inconsistent with this principal's current delegation rights.  Does
@@ -240,15 +240,19 @@ and logs an internal error if the deletion fails (should not happen).
 # This is currently just a stub for the methods of the same name in
 # RT::User and RT::Group.
 
-sub _CleanupInvalidDelegations {
+# backcompat for 3.8.8 and before
+*_CleanupInvalidDelegations = \&CleanupInvalidDelegations;
+
+sub CleanupInvalidDelegations {
     my $self = shift;
     unless ( $self->Id ) {
 	$RT::Logger->warning("Principal not loaded.");
 	return (undef);
     }
-    return ($self->Object->_CleanupInvalidDelegations(@_));
+    return ($self->Object->CleanupInvalidDelegations(@_));
 }
 
+
 # }}}
 
 # {{{ sub HasRight
diff --git a/lib/RT/User_Overlay.pm b/lib/RT/User_Overlay.pm
index 4de0d2a..b86a924 100755
--- a/lib/RT/User_Overlay.pm
+++ b/lib/RT/User_Overlay.pm
@@ -1545,7 +1545,7 @@ sub WatchedQueues {
 
 }
 
-=head2 _CleanupInvalidDelegations { InsideTransaction => undef }
+=head2 CleanupInvalidDelegations { InsideTransaction => undef }
 
 Revokes all ACE entries delegated by this user which are inconsistent
 with their current delegation rights.  Does not perform permission
@@ -1559,12 +1559,15 @@ and logs an internal error if the deletion fails (should not happen).
 
 =cut
 
-# XXX Currently there is a _CleanupInvalidDelegations method in both
+# XXX Currently there is a CleanupInvalidDelegations method in both
 # RT::User and RT::Group.  If the recursive cleanup call for groups is
 # ever unrolled and merged, this code will probably want to be
 # factored out into RT::Principal.
 
-sub _CleanupInvalidDelegations {
+# backcompat for 3.8.8 and before
+*_CleanupInvalidDelegations = \&CleanupInvalidDelegations;
+
+sub CleanupInvalidDelegations {
     my $self = shift;
     my %args = ( InsideTransaction => undef,
           @_ );

commit 4d753091ab8e3d4db0d72677388aeb2e70f6ccbd
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Wed Mar 2 17:14:38 2011 -0500

    temp - define our policy

diff --git a/.perlcriticrc b/.perlcriticrc
new file mode 100644
index 0000000..7bf9a04
--- /dev/null
+++ b/.perlcriticrc
@@ -0,0 +1,31 @@
+# space separated list of strings to regex match against rules
+exclude = Modules::RequireFilenameMatchesPackage Subroutines::ProhibitExplicitReturnUndef Subroutines::RequireArgUnpacking
+
+# [Modules::RequireFilenameMatchesPackage]
+# versions up to RT 3.8 use _Overlay files to separate generated code
+# from core code, as such there are a lot of needless warnings about
+# this.  These were removed in 4.0 so skipping this will not be required
+#
+# [Subroutines::ProhibitExplicitReturnUndef] 
+# RT is documented to return undef in a number of places, and on a
+# stable series I'm hesitant to go around changing to implicitly return
+# undef.  We can clean this up in 4.0 and ensure that if something
+# calling us in list context really needs that explicit undef, it
+# doesn't break on a minor release upgrade.
+#
+# [Subroutines::RequireArgUnpacking]
+# RT is a big user of my $self = shift; and will continue doing so
+#
+
+# Eliminate globals declared with `our' or `use vars'.
+[Variables::ProhibitPackageVars]
+# set_themes                         = core maintenance pbp
+# add_themes                         =
+# severity                           = 3
+# maximum_violations_per_document    = no_limit
+
+# The base set of packages to allow variables for.
+# packages = Data::Dumper File::Find FindBin Log::Log4perl
+
+# The set of packages to allow variables for, in addition to those given in "packages".
+# add_packages = 

commit 597e7f6eeb964f1c7b9548693abfc65da013f836
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Thu Mar 3 13:21:16 2011 -0500

    More perlcritic fixups
    
    Turn off one more warning about require in eval and
    sprinkle strict in some older unloved code.

diff --git a/.perlcriticrc b/.perlcriticrc
index 7bf9a04..4048656 100644
--- a/.perlcriticrc
+++ b/.perlcriticrc
@@ -29,3 +29,13 @@ exclude = Modules::RequireFilenameMatchesPackage Subroutines::ProhibitExplicitRe
 
 # The set of packages to allow variables for, in addition to those given in "packages".
 # add_packages = 
+
+# Write `eval { my $foo; bar($foo) }' instead of `eval "my $foo; bar($foo);"'.
+[BuiltinFunctions::ProhibitStringyEval]
+# set_themes                         = bugs core pbp
+# add_themes                         =
+# severity                           = 5
+# maximum_violations_per_document    = no_limit
+
+# Allow eval of "use" and "require" strings.
+allow_includes = 1
diff --git a/lib/RT/Interface/Email/Auth/MailFrom.pm b/lib/RT/Interface/Email/Auth/MailFrom.pm
index 093e267..be2f517 100755
--- a/lib/RT/Interface/Email/Auth/MailFrom.pm
+++ b/lib/RT/Interface/Email/Auth/MailFrom.pm
@@ -48,6 +48,8 @@
 
 package RT::Interface::Email::Auth::MailFrom;
 use RT::Interface::Email qw(ParseSenderAddressFromHead CreateUser);
+use strict;
+use warnings;
 
 # This is what the ordinary, non-enhanced gateway does at the moment.
 
diff --git a/lib/RT/Interface/Email/Filter/SpamAssassin.pm b/lib/RT/Interface/Email/Filter/SpamAssassin.pm
index 4f9c1d0..0470e63 100755
--- a/lib/RT/Interface/Email/Filter/SpamAssassin.pm
+++ b/lib/RT/Interface/Email/Filter/SpamAssassin.pm
@@ -47,6 +47,8 @@
 # END BPS TAGGED BLOCK }}}
 
 package RT::Interface::Email::Filter::SpamAssassin;
+use strict;
+use warnings;
 
 use Mail::SpamAssassin;
 my $spamtest = Mail::SpamAssassin->new();
diff --git a/lib/RT/Interface/Web/Menu/Item.pm b/lib/RT/Interface/Web/Menu/Item.pm
index 5d8e675..29fb13b 100644
--- a/lib/RT/Interface/Web/Menu/Item.pm
+++ b/lib/RT/Interface/Web/Menu/Item.pm
@@ -47,7 +47,8 @@
 # END BPS TAGGED BLOCK }}}
 
 package RT::Interface::Web::Menu::Item;
-
+use strict;
+use warnings;
 
 sub new {
     my $class = shift;

commit bea8b97f8b860f140fd4cbfb945c8e5a4e4dce4b
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Tue Mar 1 09:24:36 2011 -0500

    minor warnings cleanups

diff --git a/lib/RT/Base.pm b/lib/RT/Base.pm
index 1ceee3a..3970850 100755
--- a/lib/RT/Base.pm
+++ b/lib/RT/Base.pm
@@ -51,6 +51,7 @@ use Carp ();
 use Scalar::Util ();
 
 use strict;
+use warnings;
 use vars qw(@EXPORT);
 
 @EXPORT=qw(loc CurrentUser);
@@ -87,7 +88,7 @@ sub CurrentUser {
         $self->{'original_user'} = $self->{'user'};
         my $current_user = $_[0];
         if ( ref $current_user eq 'RT::User' ) {
-            $self->{'user'} = new RT::CurrentUser;
+            $self->{'user'} = RT::CurrentUser->new;
             $self->{'user'}->Load( $current_user->id );
         } else {
             $self->{'user'} = $current_user;

commit 057b906e64b09ad2202fe571677ab0faa722bfcb
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Thu Mar 3 13:28:16 2011 -0500

    Stop warnings from running at more severe levels that flag RT::Logger
    
    Stopping it from warning about RT::Logger and RT::Handle also seems to
    break perltidy when it goes looking for 'new RT::User;' which we'd like
    it to still catch.

diff --git a/.perlcriticrc b/.perlcriticrc
index 4048656..bcb3507 100644
--- a/.perlcriticrc
+++ b/.perlcriticrc
@@ -17,6 +17,10 @@ exclude = Modules::RequireFilenameMatchesPackage Subroutines::ProhibitExplicitRe
 # RT is a big user of my $self = shift; and will continue doing so
 #
 
+# 3.8 hasn't converted to using RT->SystemUser and the like and still reaches
+# for RT:: in a lot of places.  Quiet that down with what seems like a slightly
+# larger hammer than I would like.
+#
 # Eliminate globals declared with `our' or `use vars'.
 [Variables::ProhibitPackageVars]
 # set_themes                         = core maintenance pbp
@@ -28,7 +32,7 @@ exclude = Modules::RequireFilenameMatchesPackage Subroutines::ProhibitExplicitRe
 # packages = Data::Dumper File::Find FindBin Log::Log4perl
 
 # The set of packages to allow variables for, in addition to those given in "packages".
-# add_packages = 
+add_packages = RT
 
 # Write `eval { my $foo; bar($foo) }' instead of `eval "my $foo; bar($foo);"'.
 [BuiltinFunctions::ProhibitStringyEval]

commit f7352fdfb256e048289c2a33662de5cd09cbfb42
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Thu Mar 3 14:33:44 2011 -0500

    provide pointers to the .perlcriticrc

diff --git a/docs/perlcritic.pod b/docs/perlcritic.pod
new file mode 100644
index 0000000..9c40353
--- /dev/null
+++ b/docs/perlcritic.pod
@@ -0,0 +1,8 @@
+=head1 Perl::Critic
+
+RT ships a .perlcriticrc which can be used by running perlcritic from
+the root of the rt tarball.  It disables or turns on flags for a few
+policies.  Reasoning for those changes can be found in the .perlcriticrc
+file itself.
+
+=cut

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


More information about the Rt-commit mailing list