[Rt-commit] rt branch, 3.9-trunk, updated. rt-3.9.7-935-g3b69095

Alex Vandiver alexmv at bestpractical.com
Fri Dec 17 17:08:50 EST 2010


The branch, 3.9-trunk has been updated
       via  3b69095467e19b257de1ad35b19450a61a4cfe78 (commit)
      from  fdbe6f9d481b5b18140d0f794c3f1f43e054847d (commit)

Summary of changes:
 lib/RT.pm                                  |  128 +++++++------------------
 lib/RT/Plugin.pm                           |  109 +++------------------
 lib/RT/Test.pm                             |   22 ++--
 sbin/rt-server.in                          |    2 +-
 sbin/rt-test-dependencies.in               |    1 -
 share/html/Admin/Elements/CheckRestart     |    6 -
 share/html/Admin/Global/Plugins.html       |  143 ----------------------------
 share/html/Elements/Tabs                   |    2 -
 share/html/NoAuth/css/base/admin.css       |   34 -------
 t/plugins/_plugins/Hello/html/NoAuth/hello |    1 -
 t/plugins/_plugins/Hello/lib/Hello.pm      |    3 -
 t/plugins/_plugins/Hello/po/zh_tw.po       |   13 ---
 t/plugins/_plugins/World/html/NoAuth/hello |    1 -
 t/plugins/_plugins/World/lib/World.pm      |    3 -
 t/plugins/api.t                            |   73 --------------
 t/plugins/probe.t                          |   14 ---
 16 files changed, 62 insertions(+), 493 deletions(-)
 delete mode 100644 share/html/Admin/Elements/CheckRestart
 delete mode 100644 share/html/Admin/Global/Plugins.html
 delete mode 100644 t/plugins/_plugins/Hello/html/NoAuth/hello
 delete mode 100644 t/plugins/_plugins/Hello/lib/Hello.pm
 delete mode 100644 t/plugins/_plugins/Hello/po/zh_tw.po
 delete mode 100644 t/plugins/_plugins/World/html/NoAuth/hello
 delete mode 100644 t/plugins/_plugins/World/lib/World.pm
 delete mode 100644 t/plugins/api.t
 delete mode 100644 t/plugins/probe.t

- Log -----------------------------------------------------------------
commit 3b69095467e19b257de1ad35b19450a61a4cfe78
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Fri Dec 17 15:58:20 2010 -0500

    Revert the runtime-plugins branch
    
    This reverts the following commits:
     249bf51d05d51f07c540b94c80d3111959a5ce42 (from 1aa8e01)
     3d682a92a227a8483f314b7ad0e976af7fd1f8a7
     f54031c07ce86be01c7d401abfd88e258b468c56
     cfb7fd942163c05d78e95250dbebd4cfe49cb5d6
     044ec159007eec106a7a611a775f5b32c99b668d
     a7dee13e7e4a083b1a989cb2e61da88f385882eb
     60a7ba2782d3d0779c4c4137c19678ae89233b55

diff --git a/lib/RT.pm b/lib/RT.pm
index 8706e05..0d5c823 100755
--- a/lib/RT.pm
+++ b/lib/RT.pm
@@ -139,12 +139,14 @@ sub Init {
 
     CheckPerlRequirements();
 
+    InitPluginPaths();
+
     #Get a database connection
     ConnectToDatabase();
     InitSystemObjects();
     InitClasses();
     InitLogging();
-    RT->InitPlugins();
+    InitPlugins();
     RT::I18N->Init;
     RT->Config->PostLoadCheck;
 
@@ -548,40 +550,6 @@ also L</InitSystemObjects>.
 
 sub Nobody { return $Nobody }
 
-my $PLUGINS;
-my $ENABLED_PLUGINS;
-my $LOADED_PLUGINS;
-
-=head2 ProbePlugins($reprobe)
-
-Probe for available plugins.  By default RT caches the plugins found, use C<$reprobe> to override the behaviour.
-
-=cut
-
-sub ProbePlugins {
-    my $self = shift;
-    my $reprobe = shift;
-    undef $PLUGINS if $reprobe;
-    $PLUGINS ||= RT::Plugin->AvailablePlugins;
-
-    @$ENABLED_PLUGINS = ();
-    for (grep $_, RT->Config->Get('Plugins')) {
-        s/::/-/g;
-        my $plugin = $PLUGINS->{$_};
-        $plugin->ConfigEnabled(1);
-        $plugin->Enabled(1);
-        push @$ENABLED_PLUGINS, $plugin;
-    }
-
-    for (keys %$PLUGINS) {
-        my $plugin = $PLUGINS->{$_};
-        next unless -e $plugin->Path(".enabled");
-
-        $plugin->Enabled(1);
-        push @$ENABLED_PLUGINS, $plugin;
-    }
-}
-
 =head2 Plugins
 
 Returns a listref of all Plugins currently configured for this RT instance.
@@ -589,11 +557,14 @@ You can define plugins by adding them to the @Plugins list in your RT_SiteConfig
 
 =cut
 
+our @PLUGINS = ();
 sub Plugins {
     my $self = shift;
-    $self->ProbePlugins;
-
-    return $ENABLED_PLUGINS;
+    unless (@PLUGINS) {
+        $self->InitPluginPaths;
+        @PLUGINS = $self->InitPlugins;
+    }
+    return \@PLUGINS;
 }
 
 =head2 PluginDirs
@@ -605,7 +576,6 @@ is loaded to load plugins' configs.
 
 =cut
 
-
 sub PluginDirs {
     my $self = shift;
     my $subdir = shift;
@@ -613,8 +583,8 @@ sub PluginDirs {
     require RT::Plugin;
 
     my @res;
-    foreach my $plugin (@{ RT->Plugins }) {
-        my $path = $plugin->Path($subdir);
+    foreach my $plugin (grep $_, RT->Config->Get('Plugins')) {
+        my $path = RT::Plugin->new( name => $plugin )->Path( $subdir );
         next unless -d $path;
         push @res, $path;
     }
@@ -629,11 +599,26 @@ In case F<local/lib> isn't in @INC, append them to @INC
 =cut
 
 sub InitPluginPaths {
-    Carp::carp "DEPRECATED";
     my $self = shift || __PACKAGE__;
 
-    $self->ProbePlugins(1);
-    $self->UnloadPlugins();
+    my @lib_dirs = $self->PluginDirs('lib');
+
+    my @tmp_inc;
+    my $added;
+    for (@INC) {
+        if ( Cwd::realpath($_) eq $RT::LocalLibPath) {
+            push @tmp_inc, $_, @lib_dirs;
+            $added = 1;
+        } else {
+            push @tmp_inc, $_;
+        }
+    }
+
+    # append @lib_dirs in case $RT::LocalLibPath isn't in @INC
+    push @tmp_inc, @lib_dirs unless $added;
+
+    my %seen;
+    @INC = grep !$seen{$_}++, @tmp_inc;
 }
 
 =head2 InitPlugins
@@ -642,62 +627,19 @@ Initialze all Plugins found in the RT configuration file, setting up their lib a
 
 =cut
 
-sub _try_load_plugin {
-    my ($self, $plugin) = @_;
-
-    eval { $plugin->Load; 1 }
-        or do {
-            # XXX: the rt bootstrapping sequence loads RT_Config
-            # first, which requires scanning plugin directories,
-            # so the very first initplugins calls is actually
-            # before initlogging.
-            warn "Unable to load plugin: @{[ $plugin->Name ]}: $@";
-            return;
-        };
-    push @$LOADED_PLUGINS, $plugin;
-}
-
 sub InitPlugins {
     my $self    = shift;
+    my @plugins;
     require RT::Plugin;
-
-    for (@$ENABLED_PLUGINS) {
-        $self->_try_load_plugin($_)
-            unless $_->Loaded;
+    foreach my $plugin (grep $_, RT->Config->Get('Plugins')) {
+        $plugin->require;
+        die $UNIVERSAL::require::ERROR if ($UNIVERSAL::require::ERROR);
+        push @plugins, RT::Plugin->new(name =>$plugin);
     }
-
-    return @$LOADED_PLUGINS;
-}
-
-sub UnloadPlugins {
-    my $self = shift;
-    $LOADED_PLUGINS = undef;
+    return @plugins;
 }
 
 
-=head2 RestartRequired
-
-=cut
-
-sub RestartRequired {
-    my ($class, $arg) = @_;
-    my $restart_file = File::Spec->catdir( $VarPath, 'restart' );
-
-    if ($arg) {
-        my $atime = my $mtime = time;
-        if (-e $restart_file) {
-            utime $atime, $mtime, $restart_file;
-        }
-        else {
-            open my $fh, '>', $restart_file or die $!;
-            close $fh;
-        }
-        return 1;
-    }
-
-    return -e $restart_file && -M $restart_file < 0;
-}
-
 sub InstallMode {
     my $self = shift;
     if (@_) {
diff --git a/lib/RT/Plugin.pm b/lib/RT/Plugin.pm
index 7638c8b..1705c47 100644
--- a/lib/RT/Plugin.pm
+++ b/lib/RT/Plugin.pm
@@ -51,9 +51,6 @@ use strict;
 
 package RT::Plugin;
 use File::ShareDir;
-use Class::Accessor "antlers";
-use Parse::CPAN::Meta;
-use UNIVERSAL::require;
 
 =head1 NAME
 
@@ -68,57 +65,23 @@ it cares about is 'name', the name of this plugin.
 
 =cut
 
-use List::MoreUtils qw(first_index);
-
-has _added_inc_path => (is => "rw", isa => "Str");
-has Name => (is => "rw", isa => "Str");
-has Loaded => (is => "rw", isa => "Bool");
-has Enabled => (is => "rw", isa => "Bool");
-has ConfigEnabled => (is => "rw", isa => "Bool");
-has Description => (is => "rw", isa => "Str");
-has BasePath => (is => "rw", isa => "Str");
-
 sub new {
     my $class = shift;
     my $args ={@_};
     my $self = bless $args, $class;
-
     return $self;
 }
 
-# the @INC entry that plugins lib dirs should be pushed splice into.
-# it should be the one after local lib
-my $inc_anchor;
-sub Load {
-    my ($self) = @_;
-    my $add = $self->Path("lib");
-    unless (defined $inc_anchor) {
-        my $anchor = first_index { Cwd::realpath($_) eq Cwd::realpath($RT::LocalLibPath) } @INC;
-        $inc_anchor = ($anchor == -1 || $anchor == $#INC) # not found or last
-            ? '' : Cwd::realpath($INC[$anchor+1]);
-    }
-    my $anchor_idx = first_index { Cwd::realpath($_) eq $inc_anchor } @INC;
-    if ($anchor_idx >= 0 ) {
-        splice(@INC, $anchor_idx, 0, $add);
-    }
-    else {
-        push @INC, $add;
-    }
-    my $module = $self->Name;
-    $module =~ s/-/::/g;
-    $module->require;
-    die $UNIVERSAL::require::ERROR if ($UNIVERSAL::require::ERROR);
-    $self->Loaded(1);
-    $self->_added_inc_path( $add );
-}
 
-sub DESTROY {
+=head2 Name
+
+Returns a human-readable name for this plugin.
+
+=cut
+
+sub Name { 
     my $self = shift;
-    my $added = $self->_added_inc_path or return;
-    my $inc_path = first_index { Cwd::realpath($_) eq $added } @INC;
-    if ($inc_path >= 0 ) {
-        splice(@INC, $inc_path, 1);
-    }
+    return $self->{name};
 }
 
 =head2 Path
@@ -134,63 +97,21 @@ See also L</ComponentRoot>, L</PoDir> and other shortcut methods.
 sub Path {
     my $self   = shift;
     my $subdir = shift;
-    my $res = $self->BasePath || $self->BasePathFor($self->Name);
+    my $res = $self->_BasePath;
     $res .= "/$subdir" if defined $subdir && length $subdir;
     return $res;
 }
 
-=head2 $class->BasePathFor($name)
-
-Takes a name of a given plugin and return its base path.
-
-=cut
-
-sub BasePathFor {
-    my ($class, $name) = @_;
-
-    $name =~ s/::/-/g;
-    my $local_base = $RT::LocalPluginPath."/".$name;
-    my $base_base = $RT::PluginPath."/".$name;
+sub _BasePath {
+    my $self = shift;
+    my $base = $self->{'name'};
+    $base =~ s/::/-/g;
+    my $local_base = $RT::LocalPluginPath."/".$base;
+    my $base_base = $RT::PluginPath."/".$base;
 
     return -d $local_base ? $local_base : $base_base;
 }
 
-=head2 AvailablePlugins($plugin_path)
-
-=cut
-
-sub AvailablePlugins {
-    my ($class, $plugin_path) = @_;
-    my @res;
-    my @paths = $plugin_path ? ($plugin_path) : ($RT::LocalPluginPath, $RT::PluginPath);
-    for my $abs_path (map { <$_/*> } @paths) {
-        my ($dir, $name) = $abs_path =~ m|(.*)/([^/]+)$|;
-        # ensure no cascading
-        next if $class->BasePathFor($name) ne $abs_path;
-        push @res, $class->ProbePlugin($name);
-    }
-
-    # XXX: look for collision and warn
-    my %seen;
-    return { map { $seen{$_->Name}++ ? () : ($_->Name => $_) } @res };
-}
-
-sub ProbePlugin {
-    my ($class, $name) = @_;
-    my $base_path = $class->BasePathFor($name);
-    my $meta;
-    if (-e "$base_path/META.yml") {
-        ($meta) = Parse::CPAN::Meta::LoadFile( "$base_path/META.yml" ) or return;
-    }
-    else {
-        $meta = { name => $name };
-    }
-
-    return $class->new(Name => $meta->{name},
-                       Description => $meta->{abstract},
-                       BasePath => $base_path);
-}
-
 =head2 ComponentRoot
 
 Returns the directory this plugin has installed its L<HTML::Mason> templates into
diff --git a/lib/RT/Test.pm b/lib/RT/Test.pm
index cb6c023..e7e6352 100644
--- a/lib/RT/Test.pm
+++ b/lib/RT/Test.pm
@@ -140,6 +140,8 @@ sub import {
 
     $class->bootstrap_db( %args );
 
+    RT::InitPluginPaths();
+
     RT::ConnectToDatabase()
         unless $args{nodb};
 
@@ -148,6 +150,8 @@ sub import {
 
     $class->bootstrap_plugins( %args );
 
+    RT->Plugins;
+    
     RT::I18N->Init();
     RT->Config->PostLoadCheck;
 
@@ -412,9 +416,7 @@ sub bootstrap_plugins {
     my $self = shift;
     my %args = @_;
 
-    unless ($args{'requires'}) {
-        return RT->Plugins;
-    }
+    return unless $args{'requires'};
 
     my @plugins = @{ $args{'requires'} };
     push @plugins, $args{'testing'}
@@ -427,10 +429,10 @@ sub bootstrap_plugins {
         $cwd = Cwd::getcwd();
     }
 
-    my $old_func = \&RT::Plugin::BasePathFor;
+    my $old_func = \&RT::Plugin::_BasePath;
     no warnings 'redefine';
-    *RT::Plugin::BasePathFor = sub {
-        my $name = $_[1];
+    *RT::Plugin::_BasePath = sub {
+        my $name = $_[0]->{'name'};
 
         return $cwd if $args{'testing'} && $name eq $args{'testing'};
 
@@ -443,8 +445,7 @@ sub bootstrap_plugins {
     };
 
     RT->Config->Set( Plugins => @plugins );
-    RT->ProbePlugins(1);
-    RT->UnloadPlugins();
+    RT->InitPluginPaths();
 
     my $dba_dbh;
     $dba_dbh = _get_dbh(
@@ -453,8 +454,8 @@ sub bootstrap_plugins {
     ) if @plugins;
 
     require File::Spec;
-    foreach my $plugin ( @{ RT->Plugins } ) {
-        my $name = $plugin->Name;
+    foreach my $name ( @plugins ) {
+        my $plugin = RT::Plugin->new( name => $name );
         Test::More::diag( "Initializing DB for the $name plugin" )
             if $ENV{'TEST_VERBOSE'};
 
@@ -487,7 +488,6 @@ sub bootstrap_plugins {
         $RT::Handle->Connect; # XXX: strange but mysql can loose connection
     }
     $dba_dbh->disconnect if $dba_dbh;
-    return RT->InitPlugins;
 }
 
 sub _get_dbh {
diff --git a/sbin/rt-server.in b/sbin/rt-server.in
index 6ca2b1c..97ad46a 100755
--- a/sbin/rt-server.in
+++ b/sbin/rt-server.in
@@ -84,7 +84,6 @@ if (grep { m/help/ } @ARGV) {
 }
 
 require RT;
-require RT::Interface::Web::Handler;
 RT->LoadConfig();
 
 require RT::Handle;
@@ -135,6 +134,7 @@ if ($RT::Handle) {
     undef $RT::Handle;
 }
 
+require RT::Interface::Web::Handler;
 my $app = RT::Interface::Web::Handler->PSGIApp;
 
 if ($ENV{RT_TESTING}) {
diff --git a/sbin/rt-test-dependencies.in b/sbin/rt-test-dependencies.in
index 5ecf010..506ecd3 100755
--- a/sbin/rt-test-dependencies.in
+++ b/sbin/rt-test-dependencies.in
@@ -215,7 +215,6 @@ List::MoreUtils
 Net::CIDR
 Regexp::Common::net::CIDR
 Regexp::IPv6
-Parse::CPAN::Meta
 .
 
 $deps{'MASON'} = [ text_to_hash( << '.') ];
diff --git a/share/html/Admin/Elements/CheckRestart b/share/html/Admin/Elements/CheckRestart
deleted file mode 100644
index 700d980..0000000
--- a/share/html/Admin/Elements/CheckRestart
+++ /dev/null
@@ -1,6 +0,0 @@
-% if (RT->RestartRequired) {
-<&| /Widgets/TitleBox, title => loc('Server restart required') &>
-<% loc('Some configuration that you changed requires the web server to be restarted to be fully functional.') %>
-</&>
-% }
-
diff --git a/share/html/Admin/Global/Plugins.html b/share/html/Admin/Global/Plugins.html
deleted file mode 100644
index ef55177..0000000
--- a/share/html/Admin/Global/Plugins.html
+++ /dev/null
@@ -1,143 +0,0 @@
-%# BEGIN BPS TAGGED BLOCK {{{
-%#
-%# COPYRIGHT:
-%#
-%# This software is Copyright (c) 1996-2010 Best Practical Solutions, LLC
-%#                                          <jesse at bestpractical.com>
-%#
-%# (Except where explicitly superseded by other copyright notices)
-%#
-%#
-%# LICENSE:
-%#
-%# This work is made available to you under the terms of Version 2 of
-%# the GNU General Public License. A copy of that license should have
-%# been provided with this software, but in any event can be snarfed
-%# from www.gnu.org.
-%#
-%# This work is distributed in the hope that it will be useful, but
-%# WITHOUT ANY WARRANTY; without even the implied warranty of
-%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-%# General Public License for more details.
-%#
-%# You should have received a copy of the GNU General Public License
-%# along with this program; if not, write to the Free Software
-%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-%# 02110-1301 or visit their web page on the internet at
-%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
-%#
-%#
-%# CONTRIBUTION SUBMISSION POLICY:
-%#
-%# (The following paragraph is not intended to limit the rights granted
-%# to you to modify and distribute this software under the terms of
-%# the GNU General Public License and is only of importance to you if
-%# you choose to contribute your changes and enhancements to the
-%# community by submitting them to Best Practical Solutions, LLC.)
-%#
-%# By intentionally submitting any modifications, corrections or
-%# derivatives to this work, or any other work intended for use with
-%# Request Tracker, to Best Practical Solutions, LLC, you confirm that
-%# you are the copyright holder for those contributions and you grant
-%# Best Practical Solutions,  LLC a nonexclusive, worldwide, irrevocable,
-%# royalty-free, perpetual, license to use, copy, create derivative
-%# works based on those contributions, and sublicense and distribute
-%# those contributions and any derivatives thereof.
-%#
-%# END BPS TAGGED BLOCK }}}
-<& /Admin/Elements/Header, Title => $title &>
-<& /Elements/Tabs &>
-<& /Admin/Elements/CheckRestart &>
-
-<& /Elements/ListActions, actions => \@results &>
-
-% if (not keys %$plugins) {
-<p><&|/l&>No installed plugins were found.</&></p>
-% } else {
-<p><&|/l&>The following plugins were found.  You may enable or disable plugins not listed in your SiteConfig's <code>@Plugins</code> setting by using the buttons below.</&></p>
-% }
-
-<ul class="plugin-list">
-% for my $plugin_name (sort keys %$plugins) {
-% my $plugin = $plugins->{$plugin_name};
-% my $enabled = $plugin->Enabled;
-<li class="plugin-<% $enabled ? 'enabled' : 'disabled'%>">
-<span class="name"><% $plugin->Name %></span>
-<span class="description"><% $plugin->Description || loc("No description") %></span>
-% if ($plugin->ConfigEnabled) {
-<span class="config-enabled"><&|/l&>Enabled in your SiteConfig.</&></span>
-% } else {
-<form method="POST">
-  <input name="PluginName" value="<% $plugin->Name %>" type="hidden" />
-  <input name="<% $enabled ? 'Disable' : 'Enable' %>"
-         value="<% $enabled ? loc('Disable') : loc('Enable') %>"
-         type="submit" class="submit" />
-</form>
-% }
-</li>
-% }
-</ul>
-
-<%init>
-my $title = loc("Plugins");
-my (@results);
-
-my $plugins = RT->ProbePlugins;
-
-if ($PluginName) {
-    my $plugin = $plugins->{$PluginName};
-    unless ($plugin) {
-        push @results, loc("Plugin [_1] not found", $PluginName);
-        return;
-    }
-
-    my $plugin_enable = $plugin->Path(".enabled");
-    if ($Enable) {
-        if ( eval { die loc("You need to make the directory [_1] writable first.\n", $plugin->Path)
-                        unless -w $plugin->Path;
-                    $plugin->Load;
-                    open my $fh, '>', $plugin_enable
-                        or die $!;
-                    close $fh;
-                    RT->RestartRequired(1);
-                    1 } ) {
-            push @results, loc("Plugin [_1] enabled.", $PluginName);
-            push @results, loc("Server restart required");
-        }
-        else {
-            push @results, loc("Failed to enable plugin [_1]: [_2].", $PluginName, $@);
-        }
-    }
-    elsif ($Disable) {
-        if ($plugin->ConfigEnabled) {
-            push @results, loc("Plugin [_1] is enabled through RT_SiteConfig.pm, please disable it there.",
-                               $PluginName);
-        }
-        elsif (-e $plugin_enable) {
-            if ( eval { unlink($plugin_enable)
-                            or die loc("You need to make the directory [_1] writable first.", $plugin->Path);
-                        RT->RestartRequired(1);
-                        RT->UnloadPlugins;
-                        $plugins = RT->ProbePlugins(1);
-                        RT->InitPlugins;
-                        1 } ) {
-                push @results, loc("Plugin [_1] disabled.", $PluginName);
-                push @results, loc("Server restart required");
-            }
-            else {
-                push @results, loc("Failed to disable plugin [_1]: [_2].", $PluginName, $@);
-            }
-        }
-        else {
-            push @results, loc("Failed to disable plugin [_1]. Perhaps it's already disabled?",
-                               $PluginName);
-        }
-    }
-}
-
-</%init>
-<%args>
-$Enable => ''
-$Disable => ''
-$PluginName => ''
-</%args>
diff --git a/share/html/Elements/Tabs b/share/html/Elements/Tabs
index 06015c4..05a91cc 100755
--- a/share/html/Elements/Tabs
+++ b/share/html/Elements/Tabs
@@ -203,8 +203,6 @@ if ( $request_path !~ m{^/SelfService/} ) {
                               description => loc('Modify the default "RT at a glance" view') );
         $admin_global->child( theme => title => loc('Theme'), path => '/Admin/Global/Theme.html',
                               description => loc('Customize the look of your RT') );
-        $admin_global->child( 'rt-features' => title => loc('Plugins'), path => '/Admin/Global/Plugins.html',
-                              description => loc('Enable and Disable Plugins') );
 
         my $admin_tools = $admin->child( tools => title => loc('Tools'), path => '/Admin/Tools/', description => loc('Use other RT administrative tools') );
         $admin_tools->child( configuration => title => loc('System Configuration'), path => '/Admin/Tools/Configuration.html',
diff --git a/share/html/NoAuth/css/base/admin.css b/share/html/NoAuth/css/base/admin.css
index 483a489..2d03ace 100644
--- a/share/html/NoAuth/css/base/admin.css
+++ b/share/html/NoAuth/css/base/admin.css
@@ -90,37 +90,3 @@ ul.list-menu ul li {
     padding-bottom: 0;
 }
 
-.plugin-list {
-    margin-left: 0;
-    padding-left: 0;
-    list-style: none;
-    width: 55%;
-}
-
-.plugin-list li {
-    border-bottom: 1px solid #ccc;
-    padding: 0.5em 1em;
-    clear: both;
-    position: relative;
-}
-
-.plugin-list .name {
-    font-weight: bold;
-}
-
-.plugin-list .description {
-    display: block;
-    font-style: italic;
-    margin-right: 6em;
-}
-
-.plugin-list .plugin-disabled {
-    color: #a0a0a0;
-}
-
-.plugin-list li form .submit,
-.plugin-list li .config-enabled {
-    position: absolute;
-    top: 0.5em;
-    right: 1em;
-}
diff --git a/t/plugins/_plugins/Hello/html/NoAuth/hello b/t/plugins/_plugins/Hello/html/NoAuth/hello
deleted file mode 100644
index e892a58..0000000
--- a/t/plugins/_plugins/Hello/html/NoAuth/hello
+++ /dev/null
@@ -1 +0,0 @@
-<% _("Hello") %>
\ No newline at end of file
diff --git a/t/plugins/_plugins/Hello/lib/Hello.pm b/t/plugins/_plugins/Hello/lib/Hello.pm
deleted file mode 100644
index 6bff916..0000000
--- a/t/plugins/_plugins/Hello/lib/Hello.pm
+++ /dev/null
@@ -1,3 +0,0 @@
-package Hello;
-
-1;
diff --git a/t/plugins/_plugins/Hello/po/zh_tw.po b/t/plugins/_plugins/Hello/po/zh_tw.po
deleted file mode 100644
index 4f78110..0000000
--- a/t/plugins/_plugins/Hello/po/zh_tw.po
+++ /dev/null
@@ -1,13 +0,0 @@
-msgid ""
-msgstr ""
-"PO-Revision-Date: 2008-10-20 17:11-0400\n"
-"Project-Id-Version: Hello\n"
-"Last-Translator: Chia-liang Kao <clkao at clkao.org>\n"
-"Language-Team: rt-devel <rt-devel at lists.bestpractical.com>\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=utf-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-
-#: NOT FOUND IN SOURCE
-msgid "Hello"
-msgstr "你好"
diff --git a/t/plugins/_plugins/World/html/NoAuth/hello b/t/plugins/_plugins/World/html/NoAuth/hello
deleted file mode 100644
index 216e97c..0000000
--- a/t/plugins/_plugins/World/html/NoAuth/hello
+++ /dev/null
@@ -1 +0,0 @@
-World
diff --git a/t/plugins/_plugins/World/lib/World.pm b/t/plugins/_plugins/World/lib/World.pm
deleted file mode 100644
index 1dfec57..0000000
--- a/t/plugins/_plugins/World/lib/World.pm
+++ /dev/null
@@ -1,3 +0,0 @@
-package World;
-
-1;
diff --git a/t/plugins/api.t b/t/plugins/api.t
deleted file mode 100644
index a7a44d4..0000000
--- a/t/plugins/api.t
+++ /dev/null
@@ -1,73 +0,0 @@
-#!perl
-use Cwd qw(abs_path);
-use File::Basename qw(basename dirname);
-use File::Path qw(mkpath);
-
-BEGIN {
-    require RT;
-    require RT::Generated;
-    require File::Temp;
-
-    # bootstrap a fake LocalLibPath
-    my $dir_name = File::Spec->rel2abs('t/tmp');
-    mkpath( $dir_name );
-    $RT::LocalLibPath =  File::Temp::tempdir( CLEANUP => 1);
-
-    unshift @INC, abs_path($RT::LocalLibPath);
-    $RT::LocalPluginPath = abs_path(dirname($0)).'/_plugins';
-}
-
-use RT::Test nodb => 1, tests => 9;
-
-ok(!grep { $_ eq "$RT::LocalPluginPath/Hello/lib" } @INC);;
-RT->Config->Set('Plugins',qw(Hello));
-
-RT->ProbePlugins(1);
-RT->UnloadPlugins;
-RT->Plugins;
-
-ok(!grep { $_ eq "$RT::LocalPluginPath/Hello/lib" } @INC);;
-
-RT->InitPlugins;
-ok(grep { $_ eq "$RT::LocalPluginPath/Hello/lib" } @INC);;
-
-is_deeply([RT->PluginDirs('lib')], ["$RT::LocalPluginPath/Hello/lib"], 'plugin lib dir found');
-
-require RT::Interface::Web::Handler;
-
-is_deeply({RT::Interface::Web::Handler->DefaultHandlerArgs}->{comp_root}[1],
-          ['plugin-Hello', $RT::LocalPluginPath.'/Hello/html']);
-
-# reset
-RT->Config->Set('Plugins',qw());
-RT->ProbePlugins(1);
-RT->UnloadPlugins;
-
-ok(!grep { $_ eq "$RT::LocalPluginPath/Hello/lib" } @INC);
-is_deeply(
-    [map { $_->[0] }
-         @{ {RT::Interface::Web::Handler->DefaultHandlerArgs}->{comp_root} }],
-    [qw(local standard)]
-);
-
-
-my %inc_seem = map { $_ => 1 } @INC;
-# reset
-RT->Config->Set('Plugins',qw(Hello World));
-RT->ProbePlugins(1);
-RT->UnloadPlugins;
-RT->Plugins;
-RT->InitPlugins;
-
-is_deeply([@INC[0..2]],
-          [map { abs_path($_) }
-               $RT::LocalLibPath,
-               "$RT::LocalPluginPath/Hello/lib",
-               "$RT::LocalPluginPath/World/lib"]);
-
-is_deeply(
-    [map { $_->[0] }
-         @{ {RT::Interface::Web::Handler->DefaultHandlerArgs}->{comp_root} }],
-    [qw(local plugin-Hello plugin-World standard)]
-);
-
diff --git a/t/plugins/probe.t b/t/plugins/probe.t
deleted file mode 100644
index 7fed5c4..0000000
--- a/t/plugins/probe.t
+++ /dev/null
@@ -1,14 +0,0 @@
-#!perl
-use Cwd qw(abs_path);
-use File::Basename qw(basename dirname);
-
-require RT;
-$RT::PluginPath = abs_path(dirname($0)).'/_plugins';
-$RT::LocalPluginPath = abs_path(dirname($0)).'/_plugins_null';
-
-use RT::Test nodb => 1, tests => 2;
-
-my $plugins = RT::Plugin->AvailablePlugins;
-is_deeply( [ sort keys %$plugins ], [qw(Hello World)]);
-my $hello = $plugins->{Hello};
-is($hello->BasePath, "$RT::PluginPath/Hello");

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


More information about the Rt-commit mailing list