- rfe: snippets should have titles too!

- Added a mechanism for using external folders for custom code. See 
   sbin/preload.custom.example for details.
This commit is contained in:
JT Smith 2007-06-21 17:58:58 +00:00
parent d32d4112f4
commit ec67b2e8fe
5 changed files with 34 additions and 7 deletions

View file

@ -1,4 +1,7 @@
7.4.0 7.4.0
- rfe: snippets should have titles too!
- Added a mechanism for using external folders for custom code. See
sbin/preload.custom.example for details.
- Added a realtime workflow option for content publishing. - Added a realtime workflow option for content publishing.
- Added switches to auto request commit operations and skip adding comments. - Added switches to auto request commit operations and skip adding comments.
- fix: old recurring events were not deleted when changing recurrence pattern - fix: old recurring events were not deleted when changing recurrence pattern

View file

@ -164,7 +164,7 @@ sub view {
WebGUI::Macro::process($self->session,\$output); WebGUI::Macro::process($self->session,\$output);
$output = $self->getToolbar.$output if ($self->session->var->get("adminOn") && !$calledAsWebMethod); $output = $self->getToolbar.$output if ($self->session->var->get("adminOn") && !$calledAsWebMethod);
if ($self->getValue("processAsTemplate")) { if ($self->getValue("processAsTemplate")) {
$output = WebGUI::Asset::Template->processRaw($self->session, $output); $output = WebGUI::Asset::Template->processRaw($self->session, $output, $self->get);
} }
if (!$self->session->var->isAdminOn && $self->get("cacheTimeout") > 10) { if (!$self->session->var->isAdminOn && $self->get("cacheTimeout") > 10) {
WebGUI::Cache->new($self->session,"view_".$calledAsWebMethod."_".$self->getId)->set($output,$self->get("cacheTimeout")); WebGUI::Cache->new($self->session,"view_".$calledAsWebMethod."_".$self->getId)->set($output,$self->get("cacheTimeout"));

View file

@ -0,0 +1,4 @@
# Add paths to lib folders where you have custom plugins for WebGUI.
# Note that the folder must contain the same directory structure of
# of WebGUI itself. This file should reside at WebGUI/sbin/preload.custom
/data/Custom/lib

View file

@ -1,3 +1,7 @@
# Create preload.exclude in your WebGUI/sbin directory and add modules to it
# that you don't want to be loaded by modperl. This will decrease the overall
# size of your modperl instances, which will increase performance, and reduce
# memory use.
WebGUI::Cache::Database WebGUI::Cache::Database
WebGUI::Auth::LDAP WebGUI::Auth::LDAP
WebGUI::Asset::Wobject::WSClient WebGUI::Asset::Wobject::WSClient

View file

@ -1,8 +1,20 @@
my $webguiRoot; my $webguiRoot;
my $customLibs;
BEGIN { BEGIN {
$webguiRoot = "/data/WebGUI"; $webguiRoot = "/data/WebGUI";
unshift (@INC, $webguiRoot."/lib"); unshift (@INC, $webguiRoot."/lib");
@{$customLibs} = ();
open(FILE,"<".$webguiRoot."/sbin/preload.custom");
while (my $line = <FILE>) {
next if $line =~ m/^#/;
chomp $line;
push(@{$customLibs}, $line);
}
close(FILE);
foreach my $lib (@customLibs) {
unshift (@INC, $lib);
}
} }
$|=1; $|=1;
@ -10,7 +22,6 @@ $|=1;
use strict; use strict;
print "\nStarting WebGUI ".$WebGUI::VERSION."\n"; print "\nStarting WebGUI ".$WebGUI::VERSION."\n";
#---------------------------------------- #----------------------------------------
# Logger # Logger
#---------------------------------------- #----------------------------------------
@ -39,12 +50,17 @@ my @modules = ();
# these modules should always be skipped # these modules should always be skipped
my @excludes = qw(WebGUI::i18n::English::Automated_Information WebGUI::PerformanceProfiler); my @excludes = qw(WebGUI::i18n::English::Automated_Information WebGUI::PerformanceProfiler);
open(FILE,"<".$webguiRoot."/sbin/preload.exclude"); open(FILE,"<".$webguiRoot."/sbin/preload.exclude");
while (<FILE>) { while (my $line = <FILE>) {
chomp; next if $line =~ m/^#/;
push(@excludes,$_); chomp $line;
push(@excludes, $line);
} }
close(FILE); close(FILE);
File::Find::find(\&getWebGUIModules, $webguiRoot."/lib/WebGUI"); my @folders = ($webguiRoot."/lib/WebGUI");
foreach my $lib (@{$customLibs}) {
push(@folders, $lib."/WebGUI");
}
File::Find::find(\&getWebGUIModules, @folders);
foreach my $package (@modules) { foreach my $package (@modules) {
next if (WebGUI::Utility::isIn($package,@excludes)); next if (WebGUI::Utility::isIn($package,@excludes));
my $use = "use ".$package." ()"; my $use = "use ".$package." ()";
@ -79,7 +95,7 @@ sub getWebGUIModules {
my $filename = $File::Find::dir."/".$_; my $filename = $File::Find::dir."/".$_;
return unless $filename =~ m/\.pm$/; return unless $filename =~ m/\.pm$/;
my $package = $filename; my $package = $filename;
$package =~ s/^$webguiRoot\/lib\/(.*)\.pm$/$1/; $package =~ s/.*\/lib\/(.*)\.pm$/$1/;
$package =~ s/\//::/g; $package =~ s/\//::/g;
push(@modules,$package); push(@modules,$package);
} }