[Rt-commit] rt branch, overlay_cleanup, created. rt-3.8.8-447-ga548539

Jesse Vincent jesse at bestpractical.com
Wed Aug 18 12:13:25 EDT 2010


The branch, overlay_cleanup has been created
        at  a548539d14044dab397480c745e5ad249c6ae0c4 (commit)

- Log -----------------------------------------------------------------
commit a548539d14044dab397480c745e5ad249c6ae0c4
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

diff --git a/lib/RT/Base.pm b/lib/RT/Base.pm
index 6e481b0..461bb38 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;

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


More information about the Rt-commit mailing list