3 # Copyright 2002 Katipo Communications
5 # This file is part of Koha.
7 # Koha is free software; you can redistribute it and/or modify it
8 # under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 3 of the License, or
10 # (at your option) any later version.
12 # Koha is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with Koha; if not, see <http://www.gnu.org/licenses>.
22 use vars qw($AUTOLOAD $context @context_stack);
24 if ( $ENV{'HTTP_USER_AGENT'} ) { # Only hit when plack is not enabled
26 # Redefine multi_param if cgi version is < 4.08
27 # Remove the "CGI::param called in list context" warning in this case
28 require CGI; # Can't check version without the require.
29 if ( !defined($CGI::VERSION) || $CGI::VERSION < 4.08 ) {
30 no warnings 'redefine';
31 *CGI::multi_param = \&CGI::param;
32 use warnings 'redefine';
33 $CGI::LIST_CONTEXT_WARN = 0;
39 use DateTime::TimeZone;
45 use List::MoreUtils qw(any);
48 use Koha::Config::SysPref;
49 use Koha::Config::SysPrefs;
55 C4::Context - Maintain and manipulate the context of a Koha script
61 use C4::Context("/path/to/koha-conf.xml");
63 $config_value = C4::Context->config("config_variable");
65 $koha_preference = C4::Context->preference("preference");
67 $db_handle = C4::Context->dbh;
69 $Zconn = C4::Context->Zconn;
73 When a Koha script runs, it makes use of a certain number of things:
74 configuration settings in F</etc/koha/koha-conf.xml>, a connection to the Koha
75 databases, and so forth. These things make up the I<context> in which
78 This module takes care of setting up the context for a script:
79 figuring out which configuration file to load, and loading it, opening
80 a connection to the right database, and so forth.
82 Most scripts will only use one context. They can simply have
88 Other scripts may need to use several contexts. For instance, if a
89 library has two databases, one for a certain collection, and the other
90 for everything else, it might be necessary for a script to use two
91 different contexts to search both databases. Such scripts should use
92 the C<&set_context> and C<&restore_context> functions, below.
94 By default, C4::Context reads the configuration from
95 F</etc/koha/koha-conf.xml>. This may be overridden by setting the C<$KOHA_CONF>
96 environment variable to the pathname of a configuration file to use.
103 # In addition to what is said in the POD above, a Context object is a
104 # reference-to-hash with the following fields:
107 # A reference-to-hash whose keys and values are the
108 # configuration variables and values specified in the config
109 # file (/etc/koha/koha-conf.xml).
111 # A handle to the appropriate database for this context.
113 # Used by &set_dbh and &restore_dbh to hold other database
114 # handles for this context.
116 # A connection object for the Zebra server
118 $context = undef; # Initially, no context is set
119 @context_stack = (); # Initially, no saved contexts
122 # Create the default context ($C4::Context::Context)
123 # the first time the module is called
124 # (a config file can be optionaly passed)
126 # default context already exists?
130 my ($pkg,$config_file) = @_ ;
131 my $new_ctx = __PACKAGE__->new($config_file);
132 return unless $new_ctx;
134 # if successfully loaded, use it by default
135 $new_ctx->set_context;
141 $context = C4::Context->new;
142 $context = C4::Context->new("/path/to/koha-conf.xml");
144 Allocates a new context. Initializes the context from the specified
145 file, which defaults to either the file given by the C<$KOHA_CONF>
146 environment variable, or F</etc/koha/koha-conf.xml>.
148 It saves the koha-conf.xml values in the declared memcached server(s)
149 if currently available and uses those values until them expire and
152 C<&new> does not set this context as the new default context; for
153 that, use C<&set_context>.
159 # 2004-08-10 A. Tarallo: Added check if the conf file is not empty
162 my $conf_fname = shift; # Config file to load
164 # check that the specified config file exists and is not empty
165 undef $conf_fname unless
166 (defined $conf_fname && -s $conf_fname);
167 # Figure out a good config file to load if none was specified.
168 unless ( defined $conf_fname ) {
169 $conf_fname = Koha::Config->guess_koha_conf;
170 unless ( $conf_fname ) {
171 warn "unable to locate Koha configuration file koha-conf.xml";
177 $self->{config} = Koha::Config->get_instance($conf_fname);
178 unless ( defined $self->{config} ) {
179 warn "The config file ($conf_fname) has not been parsed correctly";
183 $self->{"Zconn"} = undef; # Zebra Connections
184 $self->{"userenv"} = undef; # User env
185 $self->{"activeuser"} = undef; # current active user
186 $self->{"shelves"} = undef;
187 $self->{tz} = undef; # local timezone object
195 $context = new C4::Context;
196 $context->set_context();
198 set_context C4::Context $context;
201 restore_context C4::Context;
203 In some cases, it might be necessary for a script to use multiple
204 contexts. C<&set_context> saves the current context on a stack, then
205 sets the context to C<$context>, which will be used in future
206 operations. To restore the previous context, use C<&restore_context>.
214 my $new_context; # The context to set
216 # Figure out whether this is a class or instance method call.
218 # We're going to make the assumption that control got here
219 # through valid means, i.e., that the caller used an instance
220 # or class method call, and that control got here through the
221 # usual inheritance mechanisms. The caller can, of course,
222 # break this assumption by playing silly buggers, but that's
223 # harder to do than doing it properly, and harder to check
225 if (ref($self) eq "")
227 # Class method. The new context is the next argument.
228 $new_context = shift;
230 # Instance method. The new context is $self.
231 $new_context = $self;
234 # Save the old context, if any, on the stack
235 push @context_stack, $context if defined($context);
237 # Set the new context
238 $context = $new_context;
241 =head2 restore_context
245 Restores the context set by C<&set_context>.
254 if ($#context_stack < 0)
257 die "Context stack underflow";
260 # Pop the old context and set it.
261 $context = pop @context_stack;
263 # FIXME - Should this return something, like maybe the context
264 # that was current when this was called?
269 $value = C4::Context->config("config_variable");
271 Returns the value of a variable specified in the configuration file
272 from which the current context was created.
277 my ($var, $term) = @_;
279 return unless defined $context and defined $context->{config};
281 return $context->{config}->get($var, $term);
285 return _common_config($_[1],'config');
288 return _common_config($_[1],'server');
293 $sys_preference = C4::Context->preference('some_variable');
295 Looks up the value of the given system preference in the
296 systempreferences table of the Koha database, and returns it. If the
297 variable is not set or does not exist, undef is returned.
299 In case of an error, this may return 0.
301 Note: It is impossible to tell the difference between system
302 preferences which do not exist, and those whose values are set to NULL
307 my $use_syspref_cache = 1;
310 my $var = shift; # The system preference to return
312 return Encode::decode_utf8($ENV{"OVERRIDE_SYSPREF_$var"})
313 if defined $ENV{"OVERRIDE_SYSPREF_$var"};
317 if ($use_syspref_cache) {
318 my $syspref_cache = Koha::Caches->get_instance('syspref');
319 my $cached_var = $syspref_cache->get_from_cache("syspref_$var");
320 return $cached_var if defined $cached_var;
324 eval { $syspref = Koha::Config::SysPrefs->find( lc $var ) };
325 my $value = $syspref ? $syspref->value() : undef;
327 if ( $use_syspref_cache ) {
328 my $syspref_cache = Koha::Caches->get_instance('syspref');
329 $syspref_cache->set_in_cache("syspref_$var", $value);
334 =head2 yaml_preference
336 Retrieves the required system preference value, and converts it
337 from YAML into a Perl data structure. It throws an exception if
338 the value cannot be properly decoded as YAML.
342 sub yaml_preference {
343 my ( $self, $preference ) = @_;
345 my $yaml = eval { YAML::XS::Load( Encode::encode_utf8( $self->preference( $preference ) ) ); };
347 warn "Unable to parse $preference syspref : $@";
351 # TODO Remove next line when enforced elsewhere
352 if( $yaml && lc($preference) eq 'itemsdeniedrenewal' and ref($yaml) ne 'HASH' ) { warn "Hashref expected for $preference"; return; }
356 =head2 enable_syspref_cache
358 C4::Context->enable_syspref_cache();
360 Enable the in-memory syspref cache used by C4::Context. This is the
365 sub enable_syspref_cache {
367 $use_syspref_cache = 1;
368 # We need to clear the cache to have it up-to-date
369 $self->clear_syspref_cache();
372 =head2 disable_syspref_cache
374 C4::Context->disable_syspref_cache();
376 Disable the in-memory syspref cache used by C4::Context. This should be
377 used with Plack and other persistent environments.
381 sub disable_syspref_cache {
383 $use_syspref_cache = 0;
384 $self->clear_syspref_cache();
387 =head2 clear_syspref_cache
389 C4::Context->clear_syspref_cache();
391 cleans the internal cache of sysprefs. Please call this method if
392 you update the systempreferences table. Otherwise, your new changes
393 will not be seen by this process.
397 sub clear_syspref_cache {
398 return unless $use_syspref_cache;
399 my $syspref_cache = Koha::Caches->get_instance('syspref');
400 $syspref_cache->flush_all;
403 =head2 set_preference
405 C4::Context->set_preference( $variable, $value, [ $explanation, $type, $options ] );
407 This updates a preference's value both in the systempreferences table and in
408 the sysprefs cache. If the optional parameters are provided, then the query
409 becomes a create. It won't update the parameters (except value) for an existing
415 my ( $self, $variable, $value, $explanation, $type, $options ) = @_;
417 my $variable_case = $variable;
418 $variable = lc $variable;
420 my $syspref = Koha::Config::SysPrefs->find($variable);
423 : $syspref ? $syspref->type
426 $value = 0 if ( $type && $type eq 'YesNo' && $value eq '' );
428 # force explicit protocol on OPACBaseURL
429 if ( $variable eq 'opacbaseurl' && $value && substr( $value, 0, 4 ) !~ /http/ ) {
430 $value = 'http://' . $value;
435 { ( defined $value ? ( value => $value ) : () ),
436 ( $explanation ? ( explanation => $explanation ) : () ),
437 ( $type ? ( type => $type ) : () ),
438 ( $options ? ( options => $options ) : () ),
442 $syspref = Koha::Config::SysPref->new(
443 { variable => $variable_case,
445 explanation => $explanation || undef,
447 options => $options || undef,
452 if ( $use_syspref_cache ) {
453 my $syspref_cache = Koha::Caches->get_instance('syspref');
454 $syspref_cache->set_in_cache( "syspref_$variable", $value );
460 =head2 delete_preference
462 C4::Context->delete_preference( $variable );
464 This deletes a system preference from the database. Returns a true value on
465 success. Failure means there was an issue with the database, not that there
466 was no syspref of the name.
470 sub delete_preference {
471 my ( $self, $var ) = @_;
473 if ( Koha::Config::SysPrefs->find( $var )->delete ) {
474 if ( $use_syspref_cache ) {
475 my $syspref_cache = Koha::Caches->get_instance('syspref');
476 $syspref_cache->clear_from_cache("syspref_$var");
486 $delimiter = C4::Context->csv_delimiter;
488 Returns preferred CSV delimiter, using system preference 'CSVDelimiter'.
489 If this preference is missing or empty, comma will be returned.
490 This method is needed because of special behavior for tabulation.
492 You can, optionally, pass a value parameter to this routine
493 in the case of existing delimiter.
498 my ( $self, $value ) = @_;
499 my $delimiter = $value || $self->preference('CSVDelimiter') || ',';
500 $delimiter = "\t" if $delimiter eq 'tabulation';
504 =head2 default_catalog_sort_by
506 $delimiter = C4::Context->default_catalog_sort_by;
508 Returns default sort by for catalog search.
509 For relevance no sort order is used.
511 For staff interface, depends on system preferences 'defaultSortField' and 'defaultSortOrder'.
512 For OPAC interface, depends on system preferences 'OPACdefaultSortField' and 'OPACdefaultSortOrder'.
516 sub default_catalog_sort_by {
518 my ( $sort_by, $sort_field, $sort_order );
519 if ( C4::Context->interface eq 'opac' ) {
520 $sort_field = C4::Context->preference('OPACdefaultSortField');
521 $sort_order = C4::Context->preference('OPACdefaultSortOrder');
523 $sort_field = C4::Context->preference('defaultSortField');
524 $sort_order = C4::Context->preference('defaultSortOrder');
526 if ( $sort_field && $sort_order ) {
527 if ( $sort_field eq 'relevance' ) {
528 $sort_by = $sort_field;
530 $sort_by = $sort_field . '_' . $sort_order;
538 $Zconn = C4::Context->Zconn
540 Returns a connection to the Zebra database
544 C<$server> one of the servers defined in the koha-conf.xml file
546 C<$async> whether this is a asynchronous connection
551 my ($self, $server, $async ) = @_;
552 my $cache_key = join ('::', (map { $_ // '' } ($server, $async )));
553 if ( (!defined($ENV{GATEWAY_INTERFACE})) && defined($context->{"Zconn"}->{$cache_key}) && (0 == $context->{"Zconn"}->{$cache_key}->errcode()) ) {
554 # if we are running the script from the commandline, lets try to use the caching
555 return $context->{"Zconn"}->{$cache_key};
557 $context->{"Zconn"}->{$cache_key}->destroy() if defined($context->{"Zconn"}->{$cache_key}); #destroy old connection before making a new one
558 $context->{"Zconn"}->{$cache_key} = &_new_Zconn( $server, $async );
559 return $context->{"Zconn"}->{$cache_key};
564 $context->{"Zconn"} = &_new_Zconn($server,$async);
566 Internal function. Creates a new database connection from the data given in the current context and returns it.
568 C<$server> one of the servers defined in the koha-conf.xml file
570 C<$async> whether this is a asynchronous connection
572 C<$auth> whether this connection has rw access (1) or just r access (0 or NULL)
577 my ( $server, $async ) = @_;
579 my $tried=0; # first attempt
580 my $Zconn; # connection object
584 $server //= "biblioserver";
587 $elementSetName = 'marcxml';
589 my $host = _common_config($server, 'listen')->{content};
590 my $serverinfo = _common_config($server, 'serverinfo');
591 my $user = $serverinfo->{user};
592 my $password = $serverinfo->{password};
595 my $o = ZOOM::Options->new();
596 $o->option(user => $user) if $user && $password;
597 $o->option(password => $password) if $user && $password;
598 $o->option(async => 1) if $async;
599 $o->option(cqlfile=> _common_config($server, 'server')->{cql2rpn});
600 $o->option(cclfile=> $serverinfo->{ccl2rpn});
601 $o->option(preferredRecordSyntax => $syntax);
602 $o->option(elementSetName => $elementSetName) if $elementSetName;
603 $o->option(databaseName => _common_config($server, 'config') || 'biblios');
604 my $timeout = C4::Context->config('zebra_connection_timeout') || 30;
605 $o->option(timeout => $timeout);
607 # create a new connection object
608 $Zconn= create ZOOM::Connection($o);
611 $Zconn->connect($host, 0);
613 # check for errors and warn
614 if ($Zconn->errcode() !=0) {
615 warn "something wrong with the connection: ". $Zconn->errmsg();
622 # Internal helper function (not a method!). This creates a new
623 # database connection from the data given in the current context, and
628 Koha::Database->schema({ new => 1 })->storage->dbh;
633 $dbh = C4::Context->dbh;
635 Returns a database handle connected to the Koha database for the
636 current context. If no connection has yet been made, this method
637 creates one, and connects to the database.
639 This database handle is cached for future use: if you call
640 C<C4::Context-E<gt>dbh> twice, you will get the same handle both
641 times. If you need a second database handle, use C<&new_dbh> and
642 possibly C<&set_dbh>.
652 unless ( $params->{new} ) {
653 return Koha::Database->schema->storage->dbh;
656 return Koha::Database->schema({ new => 1 })->storage->dbh;
661 $dbh = C4::Context->new_dbh;
663 Creates a new connection to the Koha database for the current context,
664 and returns the database handle (a C<DBI::db> object).
666 The handle is not saved anywhere: this method is strictly a
667 convenience function; the point is that it knows which database to
668 connect to so that the caller doesn't have to know.
677 return &dbh({ new => 1 });
682 $my_dbh = C4::Connect->new_dbh;
683 C4::Connect->set_dbh($my_dbh);
685 C4::Connect->restore_dbh;
687 C<&set_dbh> and C<&restore_dbh> work in a manner analogous to
688 C<&set_context> and C<&restore_context>.
690 C<&set_dbh> saves the current database handle on a stack, then sets
691 the current database handle to C<$my_dbh>.
693 C<$my_dbh> is assumed to be a good database handle.
703 # Save the current database handle on the handle stack.
704 # We assume that $new_dbh is all good: if the caller wants to
705 # screw himself by passing an invalid handle, that's fine by
707 push @{$context->{"dbh_stack"}}, $context->{"dbh"};
708 $context->{"dbh"} = $new_dbh;
713 C4::Context->restore_dbh;
715 Restores the database handle saved by an earlier call to
716 C<C4::Context-E<gt>set_dbh>.
725 if ($#{$context->{"dbh_stack"}} < 0)
728 die "DBH stack underflow";
731 # Pop the old database handle and set it.
732 $context->{"dbh"} = pop @{$context->{"dbh_stack"}};
734 # FIXME - If it is determined that restore_context should
735 # return something, then this function should, too.
740 C4::Context->userenv;
742 Retrieves a hash for user environment variables.
744 This hash shall be cached for future use: if you call
745 C<C4::Context-E<gt>userenv> twice, you will get the same hash without real DB access
751 my $var = $context->{"activeuser"};
752 if (defined $var and defined $context->{"userenv"}->{$var}) {
753 return $context->{"userenv"}->{$var};
761 C4::Context->set_userenv($usernum, $userid, $usercnum,
762 $userfirstname, $usersurname,
763 $userbranch, $branchname, $userflags,
764 $emailaddress, $shibboleth
765 $desk_id, $desk_name,
766 $register_id, $register_name);
768 Establish a hash of user environment variables.
770 set_userenv is called in Auth.pm
778 $usernum, $userid, $usercnum, $userfirstname,
779 $usersurname, $userbranch, $branchname, $userflags,
780 $emailaddress, $shibboleth, $desk_id, $desk_name,
781 $register_id, $register_name
784 my $var=$context->{"activeuser"} || '';
786 "number" => $usernum,
788 "cardnumber" => $usercnum,
789 "firstname" => $userfirstname,
790 "surname" => $usersurname,
792 #possibly a law problem
793 "branch" => $userbranch,
794 "branchname" => $branchname,
795 "flags" => $userflags,
796 "emailaddress" => $emailaddress,
797 "shibboleth" => $shibboleth,
798 "desk_id" => $desk_id,
799 "desk_name" => $desk_name,
800 "register_id" => $register_id,
801 "register_name" => $register_name
803 $context->{userenv}->{$var} = $cell;
809 C4::Context->_new_userenv($session); # FIXME: This calling style is wrong for what looks like an _internal function
811 Builds a hash for user environment variables.
813 This hash shall be cached for future use: if you call
814 C<C4::Context-E<gt>userenv> twice, you will get the same hash without real DB access
816 _new_userenv is called in Auth.pm
823 shift; # Useless except it compensates for bad calling style
825 $context->{"activeuser"}=$sessionID;
828 =head2 _unset_userenv
830 C4::Context->_unset_userenv;
832 Destroys the hash for activeuser user environment variables.
841 undef $context->{activeuser} if $sessionID && $context->{activeuser} && $context->{activeuser} eq $sessionID;
847 C4::Context->get_versions
849 Gets various version info, for core Koha packages, Currently called from carp handle_errors() sub, to send to browser if 'DebugLevel' syspref is set to '2'.
855 # A little example sub to show more debugging info for CGI::Carp
857 my ( %versions, $mysqlVersion );
858 $versions{kohaVersion} = Koha::version();
859 $versions{kohaDbVersion} = C4::Context->preference('version');
860 $versions{osVersion} = join(" ", POSIX::uname());
861 $versions{perlVersion} = $];
863 my $dbh = C4::Context->dbh;
864 $mysqlVersion = $dbh->get_info(18) if $dbh; # SQL_DBMS_VER
867 no warnings qw(exec); # suppress warnings if unable to find a program in $PATH
868 $mysqlVersion ||= `mysql -V`; # fallback to sql client version?
869 $versions{apacheVersion} = (`apache2ctl -v`)[0];
870 $versions{apacheVersion} = `httpd -v` unless $versions{apacheVersion} ;
871 $versions{apacheVersion} = `httpd2 -v` unless $versions{apacheVersion} ;
872 $versions{apacheVersion} = `apache2 -v` unless $versions{apacheVersion} ;
873 $versions{apacheVersion} = `/usr/sbin/apache2 -v` unless $versions{apacheVersion} ;
875 $versions{mysqlVersion} = $mysqlVersion;
883 Returns a DateTime::TimeZone object for the system timezone
889 if (!defined $context->{tz}) {
890 my $timezone = $context->{config}->timezone;
891 $context->{tz} = DateTime::TimeZone->new(name => $timezone);
893 return $context->{tz};
897 =head2 IsSuperLibrarian
899 C4::Context->IsSuperLibrarian();
903 sub IsSuperLibrarian {
904 my $userenv = C4::Context->userenv;
906 unless ( $userenv and exists $userenv->{flags} ) {
907 # If we reach this without a user environment,
908 # assume that we're running from a command-line script,
909 # and act as a superlibrarian.
910 carp("C4::Context->userenv not defined!");
914 return ($userenv->{flags}//0) % 2;
919 Sets the current interface for later retrieval in any Perl module
921 C4::Context->interface('opac');
922 C4::Context->interface('intranet');
923 my $interface = C4::Context->interface;
928 my ($class, $interface) = @_;
930 if (defined $interface) {
931 $interface = lc $interface;
932 if ( $interface eq 'api'
933 || $interface eq 'opac'
934 || $interface eq 'intranet'
935 || $interface eq 'sip'
936 || $interface eq 'cron'
937 || $interface eq 'commandline' )
939 $context->{interface} = $interface;
941 warn "invalid interface : '$interface'";
945 return $context->{interface} // 'opac';
948 # always returns a string for OK comparison via "eq" or "ne"
950 C4::Context->userenv or return '';
951 return C4::Context->userenv->{branch} || '';
954 =head2 only_my_library
956 my $test = C4::Context->only_my_library;
958 Returns true if you enabled IndependentBranches and the current user
959 does not have superlibrarian permissions.
963 sub only_my_library {
965 C4::Context->preference('IndependentBranches')
966 && C4::Context->userenv
967 && !C4::Context->IsSuperLibrarian()
968 && C4::Context->userenv->{branch};
971 =head3 temporary_directory
973 Returns root directory for temporary storage
977 sub temporary_directory {
979 return C4::Context->config('tmp_path') || File::Spec->tmpdir;
982 =head3 set_remote_address
984 set_remote_address should be called at the beginning of every script
985 that is *not* running under plack in order to the REMOTE_ADDR environment
986 variable to be set correctly.
990 sub set_remote_address {
991 if ( C4::Context->config('koha_trusted_proxies') ) {
993 my $header = CGI->http('HTTP_X_FORWARDED_FOR');
996 require Koha::Middleware::RealIP;
997 $ENV{REMOTE_ADDR} = Koha::Middleware::RealIP::get_real_ip( $ENV{REMOTE_ADDR}, $header );
1002 =head3 https_enabled
1004 https_enabled should be called when checking if a HTTPS connection
1007 Note that this depends on a HTTPS environmental variable being defined
1008 by the web server. This function may not return the expected result,
1009 if your web server or reverse proxies are not setting the correct
1010 X-Forwarded-Proto headers and HTTPS environmental variable.
1012 Note too that the HTTPS value can vary from web server to web server.
1013 We are relying on the convention of the value being "on" or "ON" here.
1018 my $https_enabled = 0;
1019 my $env_https = $ENV{HTTPS};
1021 if ($env_https =~ /^ON$/i){
1025 return $https_enabled;
1030 =head3 needs_install
1032 if ( $context->needs_install ) { ... }
1034 This method returns a boolean representing the install status of the Koha instance.
1040 return ($self->preference('Version')) ? 0 : 1;
1045 psgi_env returns true if there is an environmental variable
1046 prefixed with "psgi" or "plack". This is useful for detecting whether
1047 this is a PSGI app or a CGI app, and implementing code as appropriate.
1053 return any { /^(psgi\.|plack\.|PLACK_ENV$)/i } keys %ENV;
1056 =head3 is_internal_PSGI_request
1058 is_internal_PSGI_request is used to detect if this request was made
1059 from within the individual PSGI app or externally from the mounted PSGI
1064 #NOTE: This is not a very robust method but it's the best we have so far
1065 sub is_internal_PSGI_request {
1067 my $is_internal = 0;
1068 if( $self->psgi_env && ( $ENV{REQUEST_URI} !~ /^(\/intranet|\/opac)/ ) ) {
1071 return $is_internal;
1080 Specifies the configuration file to read.
1084 Andrew Arensburger <arensb at ooblick dot com>
1086 Joshua Ferraro <jmf at liblime dot com>