Skip to content

Commit

Permalink
[#985 state:resolved] Aliased deprecated config directives PerlLocalL…
Browse files Browse the repository at this point in the history
…ibPath and LocalLib to PERL5LIB. Removed related but unneeded code from MT::init_config.
  • Loading branch information
jayallen committed Jul 11, 2011
1 parent f976062 commit 7692e1d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
15 changes: 8 additions & 7 deletions lib/MT.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1005,13 +1005,14 @@ sub init_config {
}
} ## end for my $meth (@mt_paths)

if ( my $local_lib = $cfg->PERL5LIB || $cfg->PerlLocalLibPath ) {
$local_lib = [$local_lib] if !'ARRAY' eq ref $local_lib;
eval "use local::lib qw( @{$local_lib} )";
return
$mt->trans_error( 'Can\'t load local lib from path [_1]: ',
join( ', ', @$local_lib ), $@, )
if $@;

if ( my @local_lib = $cfg->PERL5LIB ) {
eval sprintf "use local::lib qw( %s )", join(' ', @local_lib);
$@ and return $mt->errtrans(
'PERL5LIB: Error loading Perl local libraries: [_1]. '
. 'Please re-check your PERL5LIB configuration value: [_2]',
$@, join( ', ', @local_lib )
);
}

return $mt->trans_error("Bad ObjectDriver config")
Expand Down
9 changes: 6 additions & 3 deletions lib/MT/Core.pm
Original file line number Diff line number Diff line change
Expand Up @@ -311,12 +311,15 @@ BEGIN {
'ImportPath' => { default => 'import', path => 1, },
'PluginPath' =>
{ default => 'plugins', path => 1, type => 'ARRAY', },
'PerlLocalLibPath' => # This directive is deprecated.
{ default => undef, path => 1, type => 'ARRAY', },
'PERL5LIB' => { default => undef, path => 1, type => 'ARRAY', },
'EnableArchivePaths' => { default => 0, },
'SearchTemplatePath' =>
{ default => 'search_templates', path => 1, },
# The following three are aliased, with the latter two being
# deprecated in favor of the first.
# LocalLib is included for people upgrading to Melody from MT 5.1+
'PERL5LIB' => { path => 1, type => 'ARRAY' },
'PerlLocalLibPath' => { alias => 'PERL5LIB' }, # Deprecated.
'LocalLib' => { alias => 'PERL5LIB' }, # Deprecated.
'SupportDirectoryPath' => { default => '' },
'SupportDirectoryURL' => { default => '' },
'ObjectDriver' => undef,
Expand Down

0 comments on commit 7692e1d

Please sign in to comment.