2 use strict; use warnings;
3 use lib q|../../../perlmods/lib/|;
4 use Time::HiRes qw/time/;
5 use OpenILS::Application::Circ::ScriptBuilder;
6 require '../oils_header.pl';
7 use vars qw/ $user $authtoken $apputils /;
9 # ---------------------------------------------------------------------
11 # ----------------------------------------------------------------------
13 my $patronid = 1000502;
15 my $patron_items_out = 11;
16 my $patron_overdue_count = 11;
17 my $patron_fines = 20;
19 # these are not currently tested in the scripts
24 # ---------------------------------------------------------------------
31 die "$0: <bootstrap> <absolute_script_path>\n" unless $script;
35 ($path, $script) = ($script =~ m#(/.*/)(.*)#);
36 osrf_connect($bsconfig);
39 my $runner = OpenILS::Application::Circ::ScriptBuilder->build(
42 patron_id => $patronid,
43 fetch_patron_circ_info => 1,
44 flesh_age_protect => 1,
46 isNonCat => $is_non_cat,
47 isRenewal => $is_renewal,
48 nonCatType => $non_cat_type,
54 # ---------------------------------------------------------------------
55 # Override the default log functions for convenience
56 # ---------------------------------------------------------------------
57 $runner->insert(log_activity => sub { print "@_\n"; return 1;} );
58 $runner->insert(log_error => sub { print "@_\n"; return 1;} );
59 $runner->insert(log_warn => sub { print "@_\n"; return 1;} );
60 $runner->insert(log_info => sub { print "@_\n"; return 1;} );
61 $runner->insert(log_debug => sub { print "@_\n"; return 1;} );
62 $runner->insert(log_internal => sub { print "@_\n"; return 1;} );
65 #$runner->add_path('/openils/var/web/opac/common/js');
66 $runner->add_path($path);
67 $runner->add_path("$path/../");
68 #$runner->add_path("$path/../catalog/");
71 # ---------------------------------------------------------------------
73 # ---------------------------------------------------------------------
74 print "\nLoading script: $script\n";
75 print "\n" . '-'x70 . "\n";
77 $runner->load($script);
78 my $result = $runner->run or die "Script died: $@";
83 # ---------------------------------------------------------------------
84 # Print out any events that occurred
85 # ---------------------------------------------------------------------
86 print "\n" . '-'x70 . "\n";
88 my $events = $result->{events};
89 my $ievents = $result->{infoEvents};
90 my $fevents = $result->{fatalEvents};
92 print "events = @$events\n";
93 print "info events = @$ievents\n";
94 print "fatal events = @$fevents\n";
96 print "\ntime = $end\n";
103 if($e and @e = split(/,/, $e)) {
104 print "$t : $_\n" for @e;
107 print "No $t occurred\n";