Added pluggable URL and content handlers.
This commit is contained in:
parent
fb33859cc6
commit
1fc11fbda8
19 changed files with 1101 additions and 411 deletions
|
|
@ -8,6 +8,7 @@
|
|||
- rfe: Added message to user search operation when user count exceeds 250.
|
||||
(Diona Kidd, Knowmad Technologies)
|
||||
- rfe: Add menuTitle to folder template (perlDreamer Consulting, LLC)
|
||||
- Added pluggable URL and content handlers.
|
||||
|
||||
7.4.19
|
||||
- fix: Import Package does nothing when re-importing trashed package
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ my $quiet; # this line required
|
|||
|
||||
my $session = start(); # this line required
|
||||
|
||||
addUrlAndContentHandlers($session);
|
||||
addFriendsNetwork($session);
|
||||
addSearchWithContainers($session);
|
||||
addGroupToEditPost($session);
|
||||
|
|
@ -28,6 +29,38 @@ addGroupToEditPost($session);
|
|||
finish($session); # this line required
|
||||
|
||||
|
||||
#-------------------------------------------------
|
||||
sub addUrlAndContentHandlers {
|
||||
my $session = shift;
|
||||
print "\tAdding pluggable URL and content handlers." unless $quiet;
|
||||
my $config = $session->config;
|
||||
my @urlHandlers = (
|
||||
{ "^/extras" => "WebGUI::URL::PassThru" },
|
||||
{ "^/uploads/dictionaries" => "WebGUI::URL::Unauthorized" },
|
||||
{ "^/uploads" => "WebGUI::URL::Uploads" },
|
||||
{ '^/\*give-credit-where-credit-is-due\*$' => "WebGUI::URL::Credits" },
|
||||
{ '^/abcdefghijklmnopqrstuvwxyz$' => "WebGUI::URL::Snoop" },
|
||||
{ ".*" => "WebGUI::URL::Content" }
|
||||
);
|
||||
my $passthrus = $config->get("passthruUrls");
|
||||
if (defined $passthrus) {
|
||||
foreach my $url (@{$passthrus}) {
|
||||
unshift @urlHandlers, { "^".$url => "WebGUI::URL::PassThru" };
|
||||
}
|
||||
}
|
||||
$config->set("urlHandlers", \@urlHandlers);
|
||||
$config->set("contentHandlers" , [
|
||||
"WebGUI::Content::Prefetch",
|
||||
"WebGUI::Content::Maintenance",
|
||||
"WebGUI::Content::Operation",
|
||||
"WebGUI::Content::Setup",
|
||||
"WebGUI::Content::Asset",
|
||||
"WebGUI::Content::NotFound"
|
||||
]);
|
||||
$config->delete("passthruUrls");
|
||||
print "DONE!\n" unless $quiet;
|
||||
}
|
||||
|
||||
#-------------------------------------------------
|
||||
sub addSearchWithContainers {
|
||||
my $session = shift;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue