]> git.evergreen-ils.org Git - OpenSRF.git/blob - src/perl/lib/OpenSRF.pm
40a70972438792543b6a464b3ecb9ceee693681a
[OpenSRF.git] / src / perl / lib / OpenSRF.pm
1 package OpenSRF;
2 use warnings;
3 use strict;
4 use Error;
5 require UNIVERSAL::require;
6
7 # $Revision$
8
9 =head1 NAME
10
11 OpenSRF - Top level class for OpenSRF perl modules.
12
13 =head1 VERSION
14
15 Version 3.0.1
16
17 =cut
18
19 our $VERSION = "3.000001";
20
21 =head1 METHODS
22
23 =head2 alert_abstract
24
25 This method is called by abstract methods to ensure that the process
26 dies when an undefined abstract method is called.
27
28 =cut
29
30 sub alert_abstract() {
31         my $c = shift;
32         my $class = ref( $c ) || $c;
33         my ($file, $line, $method) = (caller(1))[1..3];
34         die " * Call to abstract method $method at $file, line $line";
35 }
36
37 =head2 class
38
39 Returns the scalar value of its caller.
40
41 =cut
42
43 sub class { return scalar(caller); }
44
45 =head2 OSRF_APACHE_REQUEST_OBJ
46
47 Gets and sets the Apache request object when running inside mod_perl.
48 This allows other parts of OpenSRF to investigate the state of the
49 remote connection, such as whether the client has disconnected, and
50 react accordingly.
51
52 =cut
53
54 our $_OARO;
55 sub OSRF_APACHE_REQUEST_OBJ {
56         my $self = shift;
57         my $a = shift;
58         $_OARO = $a if $a;
59         return $_OARO;
60 }
61
62 1;