View | Details | Raw Unified | Return to bug 7844
Collapse All | Expand All

(-)a/misc/plack/cpanm-install.sh (+8 lines)
Line 0 Link Here
1
#!/bin/sh -xe
2
3
sudo cpan App::cpanminus
4
cpanm --sudo Task::Plack \
5
	Plack::Middleware::Static::Minifier \
6
	Plack::Middleware::Debug::Profiler::NYTProf \
7
	Plack::Middleware::Debug::DBIProfile
8
(-)a/misc/plack/intranet-plack.sh (+18 lines)
Line 0 Link Here
1
#!/bin/sh -xe
2
3
site=ffzg
4
test ! -z "$1" && site=$1
5
dir=`dirname $0`
6
opt=""
7
8
export KOHA_CONF=/etc/koha/sites/$site/koha-conf.xml 
9
export INTRANETDIR="$( xmlstarlet sel -t -v 'yazgfs/config/intranetdir' $KOHA_CONF )"
10
11
if [ ! -e "$INTRANETDIR/C4" ] ; then
12
	echo "intranetdir in $KOHA_CONF doesn't point to Koha git checkout"
13
	exit 1
14
fi
15
16
# we are not wathcing all CGI scripts since that tends to use a lot of CPU time for plackup
17
opt="--reload -R $INTRANETDIR/C4"
18
sudo -E -u $site-koha plackup -I $INTRANETDIR $opt --port 5001 $dir/intranet.psgi
(-)a/misc/plack/intranet.psgi (-1 / +44 lines)
Line 0 Link Here
0
- 
1
#!/usr/bin/perl
2
use Plack::Builder;
3
use Plack::App::CGIBin;
4
use Plack::Middleware::Debug;
5
use Plack::App::Directory;
6
7
# cpanm Plack::Middleware::Debug::DBIProfile
8
9
use C4::Context;
10
use C4::Languages;
11
use C4::Members;
12
use C4::Dates;
13
use C4::Boolean;
14
use C4::Letters;
15
use C4::Koha;
16
use C4::XSLT;
17
use C4::Branch;
18
use C4::Category;
19
20
my $app=Plack::App::CGIBin->new(root => $ENV{INTRANETDIR});
21
22
builder {
23
24
	enable_if { $ENV{PLACK_DEBUG} } 'Debug',  panels => [
25
		qw(Environment Response Timer Memory),
26
#		[ 'Profiler::NYTProf', exclude => [qw(.*\.css .*\.png .*\.ico .*\.js .*\.gif)] ],
27
#		[ 'DBITrace', level => 1 ], # a LOT of fine-graded SQL trace
28
		[ 'DBIProfile', profile => 2 ],
29
	];
30
31
	enable_if { $ENV{PLACK_DEBUG} } 'StackTrace';
32
33
	enable "Plack::Middleware::Static",
34
		path => qr{^/intranet-tmpl/}, root => '/srv/koha/koha-tmpl/';
35
36
	enable_if { $ENV{PLACK_MINIFIER} } "Plack::Middleware::Static::Minifier",
37
		path => qr{^/intranet-tmpl/},
38
		root => './koha-tmpl/';
39
40
41
	mount "/cgi-bin/koha" => $app;
42
43
};
44

Return to bug 7844