Avoid object conflict

This commit is contained in:
Xavier Guimard 2016-01-29 11:09:51 +00:00
parent 6c6b582cb5
commit a61ef89228
2 changed files with 17 additions and 20 deletions

View File

@ -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/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)
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; \
elif test "$(TESTWEBSERVER)" = "nginx"; then \
echo "Launching nginx"; \
@ -331,7 +331,8 @@ start_web_server: all prepare_test_server
--pidfile e2e-tests/conf/plackup.pid \
-d `pwd` -b -m \
--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; \
else \
echo "!!!!! Unknown test server: $(TESTWEBSERVER) !!!!!" >&2; \

View File

@ -32,8 +32,6 @@ BEGIN {
}
our $mode;
sub AUTOLOAD {
my $func = $AUTOLOAD;
$func =~ s/^.*:://;
@ -42,24 +40,22 @@ sub AUTOLOAD {
# - Apache (modperl 2),
# - Apache (modperl1),
# - Nginx
unless ($mode) {
$mode =
( caller(6)
and ( caller(6) )[0] eq 'Lemonldap::NG::Handler::PSGI::Server' )
? 'PSGI/Server'
: ( caller(6) and ( caller(6) )[0] =~ /Lemonldap::NG::Handler::PSGI/ )
? 'PSGI'
: $ENV{GATEWAY_INTERFACE} ? 'CGI'
: ( MP == 2 ) ? 'ApacheMP2'
: ( MP == 1 ) ? 'ApacheMP1'
: $main::{'nginx::'} ? 'Nginx'
: 'CGI';
unless ( $INC{"Lemonldap/NG/Handler/API/$mode.pm"} ) {
$mode =~ s#/#::#g;
eval
my $mode =
( caller(6)
and ( caller(6) )[0] eq 'Lemonldap::NG::Handler::PSGI::Server' )
? 'PSGI/Server'
: ( caller(6) and ( caller(6) )[0] =~ /Lemonldap::NG::Handler::PSGI/ )
? 'PSGI'
: $ENV{GATEWAY_INTERFACE} ? 'CGI'
: ( MP == 2 ) ? 'ApacheMP2'
: ( MP == 1 ) ? 'ApacheMP1'
: $main::{'nginx::'} ? 'Nginx'
: 'CGI';
unless ( $INC{"Lemonldap/NG/Handler/API/$mode.pm"} ) {
$mode =~ s#/#::#g;
eval
"use Lemonldap::NG::Handler::API::$mode (':httpCodes', ':functions');";
die $@ if ($@);
}
}
shift;
return "Lemonldap::NG::Handler::API::${mode}"->${func}(@_);