Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Item13897: Reverted erroneous merge from Item14152.
Thanks to George who cleanly separated wrongful merges allowing me to
generate a patch for this branch.
  • Loading branch information
vrurg committed Sep 7, 2016
1 parent f1d0b90 commit 493732d
Show file tree
Hide file tree
Showing 11 changed files with 9 additions and 708 deletions.
5 changes: 1 addition & 4 deletions UnitTestContrib/lib/Unit/FoswikiTestRole.pm
Expand Up @@ -484,6 +484,7 @@ sub setupDirs {

=begin TML
#setupAdminUser
---++ ObjectMethod setupAdminUser(%userData)
Sets this test administrator user data. The =%userData= hash may have the
Expand All @@ -507,7 +508,6 @@ sub setupAdminUser {
}

=begin TML
---++ ObjectMethod setupUserRegistration
Configures components needed to register new users so as to avoid polluting the
Expand Down Expand Up @@ -577,8 +577,6 @@ sub _fixupAppObjects {
|| ( $this->$attr->app != $app ) )
)
{
# NOTE app object attribute must be 'rwp' for this code to work
# properly.
$this->$attr->_set_app($app);
}
}
Expand Down Expand Up @@ -608,7 +606,6 @@ sub createNewFoswikiApp {
}

=begin TML
---++ ObjectMethod testWebName($baseName) -> $webName
Returns a standard test web name formed with test suite name and =$baseName=.
Expand Down
1 change: 0 additions & 1 deletion UnitTestContrib/test/bin/TestRunner.pl
Expand Up @@ -4,7 +4,6 @@
use warnings;
use v5.14;

use Assert;
use Try::Tiny;
use FindBin;
use Cwd ();
Expand Down
12 changes: 0 additions & 12 deletions core/lib/Foswiki/App.pm
Expand Up @@ -94,11 +94,6 @@ has env => (
is => 'rw',
required => 1,
);
has extensions => (
is => 'ro',
lazy => 1,
builder => '_prepareExtensions',
);
has forms => (
is => 'ro',
lazy => 1,
Expand Down Expand Up @@ -325,8 +320,6 @@ sub BUILD {

$Foswiki::app = $this;

ASSERT( defined $this->extensions, "Extensions failed to initialize" );

unless ( $this->cfg->data->{isVALID} ) {
$this->cfg->bootstrapSystemSettings;
}
Expand Down Expand Up @@ -1540,11 +1533,6 @@ sub _prepareUser {
return undef;
}

sub _prepareExtensions {
my $this = shift;
return $this->create('Foswiki::Extensions');
}

# If the X-Foswiki-Tickle header is present, this request is an attempt to
# verify that the requested function is available on this Foswiki. Respond with
# the serialised dispatcher, and finish the request. Need to stringify since
Expand Down
43 changes: 1 addition & 42 deletions core/lib/Foswiki/Class.pm
Expand Up @@ -102,15 +102,7 @@ sub import {
# Keywords exported with this option.
keywords => [qw(callback_names)],
},
app => { use => 0, },
extension => {
use => 0,
keywords => [qw(extClass extAfter extBefore plugBefore)],
},
extensible => {
use => 0,
keywords => [qw(pluggable)],
},
app => { use => 0, },
);

my @p;
Expand Down Expand Up @@ -199,39 +191,6 @@ sub _install_app {
_assign_role( $target, 'Foswiki::AppObject' );
}

sub _handler_plugBefore ($&) {
my ( $plug, $code ) = @_;
say STDERR "Replacing plug $plug with $code";
}

sub _handler_extClass ($$) {
my ( $class, $subClass ) = @_;
my $target = caller;

Foswiki::Extensions::registerSubClass( $target, $class, $subClass );
}

sub _handler_extAfter (@) {
my $target = caller;

Foswiki::Extensions::registerDeps( $target, @_ );
}

sub _handler_extBefore (@) {
my $target = caller;

Foswiki::Extensions::registerDeps( $_, $target ) foreach @_;
}

sub _install_extension {
my ( $class, $target ) = @_;

_inject_code( $target, 'plugBefore', \&_handler_plugBefore );
_inject_code( $target, 'extClass', \&_handler_extClass );
_inject_code( $target, 'extAfter', \&_handler_extAfter );
_inject_code( $target, 'extBefore', \&_handler_extBefore );
}

1;
__END__
Foswiki - The Free and Open Source Wiki, http://foswiki.org/
Expand Down
63 changes: 0 additions & 63 deletions core/lib/Foswiki/Exception.pm
Expand Up @@ -612,69 +612,6 @@ around BUILDARGS => sub {
return $orig->( $class, %params );
};

package Foswiki::Exception::Ext;
use Foswiki::Class;
extends qw(Foswiki::Exception);

=begin TML
---++ package Foswiki::Exception::Ext
Base class for Foswiki::Extensions-related exceptions.
Generic. Must not be used directly.
=cut

=begin TML
---++ ObjectAttribute extension => string
Extension name.
=cut

has extension => (
is => 'ro',
required => 1,
);

around prepareText => sub {
my $orig = shift;
my $this = shift;

return "Failed extension: " . $this->extension;
};

package Foswiki::Exception::Ext::BadName;
use Foswiki::Class;
extends qw(Foswiki::Exception::Ext);

around prepareText => sub {
my $orig = shift;
my $this = shift;

return "Bad extension name: '" . $this->extension . "'";
};

package Foswiki::Exception::Ext::Load;
use Foswiki::Class;
extends qw(Foswiki::Exception::Ext);

has reason => (
is => 'rw',
required => 1,
);

around prepareText => sub {
my $orig = shift;
my $this = shift;

return
"Failed to load extension '"
. $this->extension . "': "
. $this->reason;
};

1;
__END__
Foswiki - The Free and Open Source Wiki, http://foswiki.org/
Expand Down
26 changes: 0 additions & 26 deletions core/lib/Foswiki/Extension.pm

This file was deleted.

13 changes: 0 additions & 13 deletions core/lib/Foswiki/Extension/Empty.pm

This file was deleted.

18 changes: 0 additions & 18 deletions core/lib/Foswiki/Extension/Sample.pm

This file was deleted.

0 comments on commit 493732d

Please sign in to comment.