Commit a61ef892 authored by Xavier Guimard's avatar Xavier Guimard

Avoid object conflict

parent 6c6b582c
...@@ -318,7 +318,7 @@ start_web_server: all prepare_test_server ...@@ -318,7 +318,7 @@ start_web_server: all prepare_test_server
-@[ -e e2e-tests/conf/nginx.pid ] && kill `cat e2e-tests/conf/nginx.pid` || true -@[ -e e2e-tests/conf/nginx.pid ] && kill `cat e2e-tests/conf/nginx.pid` || true
-@[ -e e2e-tests/conf/plackup.pid ] && kill `cat e2e-tests/conf/plackup.pid` && rm -f e2e-tests/conf/plackup.pid || true -@[ -e e2e-tests/conf/plackup.pid ] && kill `cat e2e-tests/conf/plackup.pid` && rm -f e2e-tests/conf/plackup.pid || true
# Start web server (designed for Debian, path may be broken else) # Start web server (designed for Debian, path may be broken else)
if test "$(TESTWEBSERVER)" = "apache"; then \ @if test "$(TESTWEBSERVER)" = "apache"; then \
LLNG_DEFAULTCONFFILE=`pwd`/e2e-tests/conf/lemonldap-ng.ini /usr/sbin/apache2 -d `pwd`/e2e-tests -f apache2.conf -k start; \ LLNG_DEFAULTCONFFILE=`pwd`/e2e-tests/conf/lemonldap-ng.ini /usr/sbin/apache2 -d `pwd`/e2e-tests -f apache2.conf -k start; \
elif test "$(TESTWEBSERVER)" = "nginx"; then \ elif test "$(TESTWEBSERVER)" = "nginx"; then \
echo "Launching nginx"; \ echo "Launching nginx"; \
...@@ -331,7 +331,8 @@ start_web_server: all prepare_test_server ...@@ -331,7 +331,8 @@ start_web_server: all prepare_test_server
--pidfile e2e-tests/conf/plackup.pid \ --pidfile e2e-tests/conf/plackup.pid \
-d `pwd` -b -m \ -d `pwd` -b -m \
--exec /usr/bin/plackup -- \ --exec /usr/bin/plackup -- \
-s FCGI --listen e2e-tests/conf/llng.sock \ -s FCGI \
--listen e2e-tests/conf/llng.sock \
e2e-tests/handler-server.psgi; \ e2e-tests/handler-server.psgi; \
else \ else \
echo "!!!!! Unknown test server: $(TESTWEBSERVER) !!!!!" >&2; \ echo "!!!!! Unknown test server: $(TESTWEBSERVER) !!!!!" >&2; \
......
...@@ -32,8 +32,6 @@ BEGIN { ...@@ -32,8 +32,6 @@ BEGIN {
} }
our $mode;
sub AUTOLOAD { sub AUTOLOAD {
my $func = $AUTOLOAD; my $func = $AUTOLOAD;
$func =~ s/^.*:://; $func =~ s/^.*:://;
...@@ -42,24 +40,22 @@ sub AUTOLOAD { ...@@ -42,24 +40,22 @@ sub AUTOLOAD {
# - Apache (modperl 2), # - Apache (modperl 2),
# - Apache (modperl1), # - Apache (modperl1),
# - Nginx # - Nginx
unless ($mode) { my $mode =
$mode = ( caller(6)
( caller(6) and ( caller(6) )[0] eq 'Lemonldap::NG::Handler::PSGI::Server' )
and ( caller(6) )[0] eq 'Lemonldap::NG::Handler::PSGI::Server' ) ? 'PSGI/Server'
? 'PSGI/Server' : ( caller(6) and ( caller(6) )[0] =~ /Lemonldap::NG::Handler::PSGI/ )
: ( caller(6) and ( caller(6) )[0] =~ /Lemonldap::NG::Handler::PSGI/ ) ? 'PSGI'
? 'PSGI' : $ENV{GATEWAY_INTERFACE} ? 'CGI'
: $ENV{GATEWAY_INTERFACE} ? 'CGI' : ( MP == 2 ) ? 'ApacheMP2'
: ( MP == 2 ) ? 'ApacheMP2' : ( MP == 1 ) ? 'ApacheMP1'
: ( MP == 1 ) ? 'ApacheMP1' : $main::{'nginx::'} ? 'Nginx'
: $main::{'nginx::'} ? 'Nginx' : 'CGI';
: 'CGI'; unless ( $INC{"Lemonldap/NG/Handler/API/$mode.pm"} ) {
unless ( $INC{"Lemonldap/NG/Handler/API/$mode.pm"} ) { $mode =~ s#/#::#g;
$mode =~ s#/#::#g; eval
eval
"use Lemonldap::NG::Handler::API::$mode (':httpCodes', ':functions');"; "use Lemonldap::NG::Handler::API::$mode (':httpCodes', ':functions');";
die $@ if ($@); die $@ if ($@);
}
} }
shift; shift;
return "Lemonldap::NG::Handler::API::${mode}"->${func}(@_); return "Lemonldap::NG::Handler::API::${mode}"->${func}(@_);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment