| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package SMS::Send::Driver; |
|
2
|
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
=pod |
|
4
|
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
=head1 NAME |
|
6
|
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
SMS::Send::Driver - Base class for SMS::Send drivers |
|
8
|
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
10
|
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
The C class provides an abstract base class for all |
|
12
|
|
|
|
|
|
|
L driver classes. |
|
13
|
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
At this time it does not provide any implementation code for drivers |
|
15
|
|
|
|
|
|
|
(although this may change in the future) with the exception of some |
|
16
|
|
|
|
|
|
|
methods provided to trigger "does not implement method" errors. |
|
17
|
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
However, it does serve as something you should sub-class your driver from |
|
19
|
|
|
|
|
|
|
to identify it as a L driver. |
|
20
|
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
Please note that if your driver class not B return true for |
|
22
|
|
|
|
|
|
|
C<$driver->isa('SMS::Send::Driver')> then the L constructor |
|
23
|
|
|
|
|
|
|
will refuse to use your class as a driver. |
|
24
|
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=head1 METHODS |
|
26
|
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=cut |
|
28
|
|
|
|
|
|
|
|
|
29
|
4
|
|
|
4
|
|
159
|
use 5.006; |
|
|
4
|
|
|
|
|
14
|
|
|
|
4
|
|
|
|
|
198
|
|
|
30
|
4
|
|
|
4
|
|
21
|
use strict; |
|
|
4
|
|
|
|
|
14
|
|
|
|
4
|
|
|
|
|
132
|
|
|
31
|
4
|
|
|
4
|
|
20
|
use Carp (); |
|
|
4
|
|
|
|
|
6
|
|
|
|
4
|
|
|
|
|
83
|
|
|
32
|
|
|
|
|
|
|
|
|
33
|
4
|
|
|
4
|
|
21
|
use vars qw{$VERSION}; |
|
|
4
|
|
|
|
|
7
|
|
|
|
4
|
|
|
|
|
269
|
|
|
34
|
|
|
|
|
|
|
BEGIN { |
|
35
|
4
|
|
|
4
|
|
734
|
$VERSION = '0.06'; |
|
36
|
|
|
|
|
|
|
} |
|
37
|
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=pod |
|
39
|
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=head2 new |
|
41
|
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
The C constructor is required to be implemented by your driver subclass. |
|
43
|
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
It recieves a set of arbitrary paired params. The values of these params are |
|
45
|
|
|
|
|
|
|
assumed to be driver-specific (this is expected to change). |
|
46
|
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
If your driver will need to login to some system, locate hardware, or |
|
48
|
|
|
|
|
|
|
do some other form of initialisation to validate the SMS delivery mechanism |
|
49
|
|
|
|
|
|
|
exists, it should do so in C. |
|
50
|
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
Should return a new L-subclass object, or die on error. |
|
52
|
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=cut |
|
54
|
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
sub new { |
|
56
|
2
|
|
|
2
|
1
|
4
|
my $class = shift; |
|
57
|
2
|
|
|
|
|
257
|
Carp::croak("Driver Error: $class does not implement the 'new' constructor"); |
|
58
|
|
|
|
|
|
|
} |
|
59
|
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=pod |
|
61
|
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=head2 send_sms |
|
63
|
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
The C method is required to be implemented by your driver subclass. |
|
65
|
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
It recieves a set of param pairs as documented in L. |
|
67
|
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
Should return true for either success or fire-and-forget with unknown result, |
|
69
|
|
|
|
|
|
|
defined-but-false ('' or 0) for a failed message send, or die on a fatal error. |
|
70
|
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=cut |
|
72
|
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
sub send_sms { |
|
74
|
0
|
|
0
|
0
|
1
|
|
my $class = ref($_[0]) || $_[0]; |
|
75
|
0
|
|
|
|
|
|
Carp::croak("Driver Error: $class does not implement the 'send_sms' method"); |
|
76
|
|
|
|
|
|
|
} |
|
77
|
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
1; |
|
79
|
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
=pod |
|
81
|
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=head1 SUPPORT |
|
83
|
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
Bugs should be reported via the CPAN bug tracker at |
|
85
|
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
L |
|
87
|
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
For other issues, contact the author. |
|
89
|
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=head1 AUTHOR |
|
91
|
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
Adam Kennedy Eadamk@cpan.orgE |
|
93
|
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=head1 COPYRIGHT |
|
95
|
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
Copyright 2005 - 2011 Adam Kennedy. |
|
97
|
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
This program is free software; you can redistribute |
|
99
|
|
|
|
|
|
|
it and/or modify it under the same terms as Perl itself. |
|
100
|
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
The full text of the license can be found in the |
|
102
|
|
|
|
|
|
|
LICENSE file included with this module. |
|
103
|
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
=cut |