[Rt-commit] rt branch, 3.8/perlcritic, updated. rt-3.8.10-167-g46b383d

Thomas Sibley trs at bestpractical.com
Mon Jul 25 12:34:53 EDT 2011


The branch, 3.8/perlcritic has been updated
       via  46b383d04ba594050ff82feca198416998e96a6b (commit)
      from  29593d87e49af061548b1e283a354e4c8fc6e400 (commit)

Summary of changes:
 lib/RT.pm.in                            |    2 +-
 lib/RT/Base.pm                          |    2 +-
 lib/RT/Graph/Tickets.pm                 |    4 ++--
 lib/RT/Interface/Email.pm               |    2 +-
 lib/RT/Interface/Web.pm                 |    5 +++--
 lib/RT/Principal_Overlay.pm             |    2 +-
 lib/RT/Record.pm                        |    2 +-
 lib/RT/Shredder.pm                      |    4 ++--
 lib/RT/Shredder/Dependencies.pm         |    2 +-
 lib/RT/Shredder/Exceptions.pm           |    2 +-
 share/html/Install/DatabaseDetails.html |    6 +++---
 11 files changed, 17 insertions(+), 16 deletions(-)

- Log -----------------------------------------------------------------
commit 46b383d04ba594050ff82feca198416998e96a6b
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Mon Jul 25 12:28:52 2011 -0400

    Access config variables through RT->Config->Get rather than reaching into RT::

diff --git a/lib/RT.pm.in b/lib/RT.pm.in
index c5e6575..3e6082b 100755
--- a/lib/RT.pm.in
+++ b/lib/RT.pm.in
@@ -156,7 +156,7 @@ sub LoadConfig {
 
     # RT::Essentials mistakenly recommends that WebPath be set to '/'.
     # If the user does that, do what they mean.
-    $RT::WebPath = '' if ($RT::WebPath eq '/');
+    $Config->Set( WebPath => '' ) if $Config->Get('WebPath') eq '/';
 
     # fix relative LogDir and GnuPG homedir
     unless ( File::Spec->file_name_is_absolute( $Config->Get('LogDir') ) ) {
diff --git a/lib/RT/Base.pm b/lib/RT/Base.pm
index 115981d..99c04e3 100755
--- a/lib/RT/Base.pm
+++ b/lib/RT/Base.pm
@@ -106,7 +106,7 @@ sub CurrentUser {
             ." with a RT::CurrentUser or a RT::User object as the first argument.";
         $msg .= "\n". Carp::longmess() if @_;
 
-        $RT::Logger->error( $msg );
+        RT->Logger->error( $msg );
         return $self->{'user'} = undef;
     }
 
diff --git a/lib/RT/Graph/Tickets.pm b/lib/RT/Graph/Tickets.pm
index 3cea972..1bdfeb7 100644
--- a/lib/RT/Graph/Tickets.pm
+++ b/lib/RT/Graph/Tickets.pm
@@ -57,7 +57,7 @@ RT::Graph::Tickets - view relations between tickets as graphs
 
 =cut
 
-unless ($RT::DisableGraphViz) {
+unless (RT->Config->Get('DisableGraphViz')) {
     require IPC::Run;
     IPC::Run->import;
     require IPC::Run::SafeHandles;
@@ -226,7 +226,7 @@ sub AddTicket {
     my %node_style = (
         style => 'filled,rounded',
         %{ $ticket_status_style{ $args{'Ticket'}->Status } || {} },
-        URL   => $RT::WebPath .'/Ticket/Display.html?id='. $args{'Ticket'}->id,
+        URL   => RT->Config->Get('WebPath') .'/Ticket/Display.html?id='. $args{'Ticket'}->id,
         tooltip => gv_escape( $args{'Ticket'}->Subject || '#'. $args{'Ticket'}->id ),
     );
 
diff --git a/lib/RT/Interface/Email.pm b/lib/RT/Interface/Email.pm
index f136df2..88ac1da 100755
--- a/lib/RT/Interface/Email.pm
+++ b/lib/RT/Interface/Email.pm
@@ -1367,7 +1367,7 @@ sub Gateway {
     );
 
     # Do not pass loop messages to MailPlugins, to make sure the loop
-    # is broken, unless $RT::StoreLoops is set.
+    # is broken, unless $StoreLoops is set.
     if ($IsALoop && !$should_store_machine_generated_message) {
         return ( 0, $result, undef );
     }
diff --git a/lib/RT/Interface/Web.pm b/lib/RT/Interface/Web.pm
index 1193a09..0a23052 100755
--- a/lib/RT/Interface/Web.pm
+++ b/lib/RT/Interface/Web.pm
@@ -141,8 +141,9 @@ sub WebExternalAutoInfo {
 
     # default to making Privileged users, even if they specify
     # some other default Attributes
-    if ( not $RT::AutoCreate
-        or ( ref($RT::AutoCreate) and not exists $RT::AutoCreate->{Privileged} ) )
+    my $autocreate = RT->Config->Get('AutoCreate');
+    if ( not $autocreate
+        or ( ref($autocreate) and not exists $autocreate->{Privileged} ) )
     {
         $user_info{'Privileged'} = 1;
     }
diff --git a/lib/RT/Principal_Overlay.pm b/lib/RT/Principal_Overlay.pm
index 10e2af0..0754f5e 100755
--- a/lib/RT/Principal_Overlay.pm
+++ b/lib/RT/Principal_Overlay.pm
@@ -583,7 +583,7 @@ Cleans out and reinitializes the user rights cache
 sub InvalidateACLCache {
     $_ACL_CACHE = Cache::Simple::TimedExpiry->new();
     my $lifetime;
-    $lifetime = $RT::Config->Get('ACLCacheLifetime') if $RT::Config;
+    $lifetime = RT->Config->Get('ACLCacheLifetime') if RT->Config;
     $_ACL_CACHE->expire_after( $lifetime || 60 );
     return;
 }
diff --git a/lib/RT/Record.pm b/lib/RT/Record.pm
index 51ff750..27fe7e9 100755
--- a/lib/RT/Record.pm
+++ b/lib/RT/Record.pm
@@ -77,7 +77,7 @@ use RT::Base;
 
 BEGIN {
     my $base = 'DBIx::SearchBuilder::Record::Cachable';
-    if ( $RT::Config && $RT::Config->Get('DontCacheSearchBuilderRecords') ) {
+    if ( RT->Config && RT->Config->Get('DontCacheSearchBuilderRecords') ) {
         $base = 'DBIx::SearchBuilder::Record';
     }
 
diff --git a/lib/RT/Shredder.pm b/lib/RT/Shredder.pm
index cd3ccd5..4ee6da7 100644
--- a/lib/RT/Shredder.pm
+++ b/lib/RT/Shredder.pm
@@ -138,10 +138,10 @@ shredding session when the file had been created.
 
 =head1 CONFIGURATION
 
-=head2 $RT::DependenciesLimit
+=head2 $DependenciesLimit
 
 Shredder stops with an error if the object has more than
-C<$RT::DependenciesLimit> dependencies. For example: a ticket has 1000
+C<$DependenciesLimit> dependencies. For example: a ticket has 1000
 transactions or a transaction has 1000 attachments. This is protection
 from bugs in shredder from wiping out your whole database, but
 sometimes when you have big mail loops you may hit it.
diff --git a/lib/RT/Shredder/Dependencies.pm b/lib/RT/Shredder/Dependencies.pm
index 753364f..40cab8e 100644
--- a/lib/RT/Shredder/Dependencies.pm
+++ b/lib/RT/Shredder/Dependencies.pm
@@ -115,7 +115,7 @@ sub _PushDependency
             TargetObject => $rec->{'Object'},
         );
 
-    if( scalar @{ $self->{'list'} } > ( $RT::DependenciesLimit || 1000 ) ) {
+    if( scalar @{ $self->{'list'} } > ( RT->Config->Get('DependenciesLimit') || 1000 ) ) {
         RT::Shredder::Exception::Info->throw( 'DependenciesLimit' );
     }
     return;
diff --git a/lib/RT/Shredder/Exceptions.pm b/lib/RT/Shredder/Exceptions.pm
index 4dd63f8..ca04f8e 100644
--- a/lib/RT/Shredder/Exceptions.pm
+++ b/lib/RT/Shredder/Exceptions.pm
@@ -68,7 +68,7 @@ use base qw(RT::Shredder::Exception);
 my %DESCRIPTION = (
     DependenciesLimit => <<END,
 Dependecies list have reached its limit.
-See \$RT::DependenciesLimit in RT::Shredder docs.
+See \$DependenciesLimit in RT::Shredder docs.
 END
 
     SystemObject => <<END,
diff --git a/share/html/Install/DatabaseDetails.html b/share/html/Install/DatabaseDetails.html
index 23e13e1..46b1ac1 100644
--- a/share/html/Install/DatabaseDetails.html
+++ b/share/html/Install/DatabaseDetails.html
@@ -162,16 +162,16 @@ if ( $Run ) {
                     $sth->execute('RT_System'); 
                     if ( $sth->fetchrow_array ) {
                         $RT::Installer->{DatabaseAction} = 'none';
-                        push @results, loc("[_1] appears to be fully initialized.  We won't need to create any tables or insert metadata, but you can continue to customize RT by clicking 'Customize Basics' below", $RT::DatabaseName);
+                        push @results, loc("[_1] appears to be fully initialized.  We won't need to create any tables or insert metadata, but you can continue to customize RT by clicking 'Customize Basics' below", RT->Config->Get('DatabaseName'));
                     }
                     else {
                         $RT::Installer->{DatabaseAction} = 'acl,coredata,insert';
-                        push @results, loc("[_1] already exists and has RT's tables in place, but does not contain RT's metadata. The 'Initialize Database' step later on can insert metadata into this existing database. If this is acceptable, click 'Customize Basics' below to continue customizing RT.", $RT::DatabaseName);
+                        push @results, loc("[_1] already exists and has RT's tables in place, but does not contain RT's metadata. The 'Initialize Database' step later on can insert metadata into this existing database. If this is acceptable, click 'Customize Basics' below to continue customizing RT.", RT->Config->Get('DatabaseName'));
                     }
                 }
                 else {
                     $RT::Installer->{DatabaseAction} = 'schema,acl,coredata,insert';
-                    push @results, loc("[_1] already exists, but does not contain RT's tables or metadata. The 'Initialize Database' step later on can insert tables and metadata into this existing database. if this is acceptable, click 'Customize Basic' below to continue customizing RT.", $RT::DatabaseName );
+                    push @results, loc("[_1] already exists, but does not contain RT's tables or metadata. The 'Initialize Database' step later on can insert tables and metadata into this existing database. if this is acceptable, click 'Customize Basic' below to continue customizing RT.", RT->Config->Get('DatabaseName') );
                 }
 
             }

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


More information about the Rt-commit mailing list