X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=C4%2FSMS.pm;h=457a662e643f1eacb04e4a66958fff038b5586ba;hb=f4a344eb4a26c6a22669d14c2c726ce157593c14;hp=959e407c8d9d68d16ee79ad83020c98ad2f0436f;hpb=2cae4efa0a0f3d3f960b173b3e3d2eef4ecf555e;p=koha.git diff --git a/C4/SMS.pm b/C4/SMS.pm index 959e407c8d..457a662e64 100644 --- a/C4/SMS.pm +++ b/C4/SMS.pm @@ -34,7 +34,6 @@ use strict; use warnings; use C4::Context; -use SMS::Send; use vars qw( $VERSION ); @@ -52,10 +51,6 @@ BEGIN { =head2 send_sms -=over4 - -=back - =cut sub send_sms { @@ -67,6 +62,12 @@ sub send_sms { return unless defined $params->{ $required_parameter }; } + eval { require SMS::Send; }; + if ( $@ ) { + # we apparently don't have SMS::Send. Return a failure. + return; + } + # This allows the user to override the driver. See SMS::Send::Test my $driver = exists $params->{'driver'} ? $params->{'driver'} : $self->driver(); return unless $driver;