cross
New Foswiki release 2.1.6 is available with important security fixes.
Sourceforge foswiki email lists being discontinued. Subscribe to the new Foswiki announce and discuss lists at MailingLists
You are here: Foswiki>Tasks Web>Item12392 (05 Jul 2015, GeorgeClark)Edit Attach

Item12392: Add a "preload" plugin handler to the Foswiki plugin API.

pencil
Priority: Enhancement
Current State: Closed
Released In: 2.0.0
Target Release: major
Applies To: Engine
Component:
Branches: trunk
Reported By: CrawfordCurrie
Waiting For:
Last Change By: GeorgeClark
Sometimes a decision can be made very early whether to allow a request to proceed or not; for example, on the basis of server resources, or information from the request. At the moment the earliest a decision can be made by a plugin is in the earlyInitHandler, which isn't early at al. By the time is is called the Store, the Prefs and the logged-in user are all set up - pointless, if a simple check is going to reject or shortcut the request in some way.

By splitting up some code in the Plugins.pm I was able to divide the plugin initialisation process so that plugins can be initiated very very early. This allows the addition of a new handler - I called it preload - that can perform this sort of check.

All other functionality is identical, and code performance is not impacted measurably.

I propose to check this in for 1.2.0

See Development.AddEarlyPluginHandler for feature proposal.

If you want to try it, there's an implementation in the patch file attached.

-- CrawfordCurrie - 13 Feb 2013

Some fixing in Item12440.

-- MichaelDaum - 18 Mar 2013

Correction to cure test failures

-- CrawfordCurrie - 23 Mar 2013
 

ItemTemplate edit

Summary Add a "preload" plugin handler to the Foswiki plugin API.
ReportedBy CrawfordCurrie
Codebase
SVN Range
AppliesTo Engine
Component
Priority Enhancement
CurrentState Closed
WaitingFor
Checkins distro:87a95d329bf0 distro:88ddfd950239
TargetRelease major
ReleasedIn 2.0.0
CheckinsOnBranches trunk
trunkCheckins distro:87a95d329bf0 distro:88ddfd950239
masterCheckins
ItemBranchCheckins
Release01x01Checkins
Topic attachments
I Attachment Action Size Date Who Comment
Item12392.diffdiff Item12392.diff manage 11 K 13 Feb 2013 - 16:49 CrawfordCurrie Inplementation of preload handler
Topic revision: r11 - 05 Jul 2015, GeorgeClark - This page was cached on 21 Jul 2018 - 15:25.

The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy