Make etherpad::API optional

master
Daniel Berteaud 9 years ago
parent e67ad9abf8
commit 7487895a4a
  1. 8
      vroom.pl

@ -16,7 +16,6 @@ use Digest::HMAC_SHA1 qw(hmac_sha1);
use MIME::Base64;
use File::stat;
use File::Basename;
use Etherpad::API;
use Session::Token;
use Email::Valid;
use Protocol::SocketIO::Handshake;
@ -42,7 +41,10 @@ foreach my $dir (qw/assets/){
# Create etherpad api client if enabled
our $ec = undef;
my $etherpad = eval { require Etherpad::API };
if ($config->{'etherpad.uri'} =~ m/https?:\/\/.*/ && $config->{'etherpad.api_key'} ne ''){
if ($etherpad){
import Etherpad::API;
$ec = Etherpad::API->new({
url => $config->{'etherpad.uri'},
apikey => $config->{'etherpad.api_key'}
@ -52,6 +54,10 @@ if ($config->{'etherpad.uri'} =~ m/https?:\/\/.*/ && $config->{'etherpad.api_key
$ec = undef;
}
}
else{
app->log->info("Etherpad::API not found, disabling Etherpad-Lite support");
}
}
# Global error check
our $error = undef;

Loading…
Cancel
Save