Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handlers are keywrods describing basic extension functionality. So far the following are added: extClass, extAfter, extBefore, plugBefore. All are part of Foswiki::Class 'extension' option. Another Foswiki::Class option added is 'extensible' to be used by classes allowing their functionality to be overriden. This option exports 'pluggable' handler to declare overridable methods. - TBM (to be merged into Item13897) – Foswiki::Class imports 5.14 feature set into a module. No need to always `use v5.14;' or a kind of. - TBM Foswiki::Exception::transmute doesn't enforce an exception into destination class if the exception's class is a subclass of destination. - Added Foswiki::Extension – base class for extensions. - Foswiki::Extensions performs registration of some of extension parameters upon loading stage. - Fixed erroneous use of fetchVar name instead of fetchGlobal. Thanks to George Clark for pointing me out. - TBM? Finding name space glob code has been extracted from Foswiki::fetchGlobal() into Foswiki::getNS() function. May even replace use of Devel::Symbols in some cases.
- Loading branch information
Showing
7 changed files
with
209 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# See bottom of file for license and copyright information | ||
|
||
package Foswiki::Extension; | ||
|
||
use Foswiki::Class qw(app); | ||
extends qw(Foswiki::Object); | ||
|
||
1; | ||
__END__ | ||
Foswiki - The Free and Open Source Wiki, http://foswiki.org/ | ||
Copyright (C) 2016 Foswiki Contributors. Foswiki Contributors | ||
are listed in the AUTHORS file in the root of this distribution. | ||
NOTE: Please extend that file, not this notice. | ||
This program is free software; you can redistribute it and/or | ||
modify it under the terms of the GNU General Public License | ||
as published by the Free Software Foundation; either version 2 | ||
of the License, or (at your option) any later version. For | ||
more details read LICENSE in the root of this distribution. | ||
This program 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. | ||
As per the GPL, removal of this notice is prohibited. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,13 @@ | ||
package Foswiki::Extension::Empty; | ||
use v5.14; | ||
|
||
use Foswiki::Class; | ||
extends qw(Foswiki::Object); | ||
use Foswiki::Class qw(extension); | ||
extends qw(Foswiki::Extension); | ||
|
||
use version 0.77; our $VERSION = version->declare(0.0.1); | ||
our $API_VERSION = version->declare("2.98.0"); | ||
our $API_VERSION = version->declare("2.99.0"); | ||
|
||
extAfter qw(Sample); | ||
|
||
extBefore qw(Test1 Foswiki::Extension::Test2); | ||
|
||
1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,18 @@ | ||
|
||
package Foswiki::Extension::Sample; | ||
use v5.14; | ||
|
||
use Foswiki::Class; | ||
extends qw(Foswiki::Object); | ||
use Foswiki::Class qw(extension); | ||
extends qw(Foswiki::Extension); | ||
|
||
use version 0.77; our $VERSION = version->declare(0.0.1); | ||
our $API_VERSION = version->declare("2.99.0"); | ||
|
||
#our $API_VERSION = version->declare("2.98.0"); | ||
plugBefore 'Foswiki::Exception::transmute' => sub { | ||
|
||
}; | ||
|
||
extClass 'Foswiki::Logger', 'Foswiki::Extension::Sample::Logger'; | ||
|
||
extBefore qw(Empty); | ||
|
||
1; |
Oops, something went wrong.