@@ -, +, @@ --- Koha/Script.pm | 97 +++++++++++++++++++++++++++++++++++++++++++++++++ t/Koha/Script.t | 27 +++++++++++++- t/Koha/sleep.pl | 19 ++++++++++ 3 files changed, 142 insertions(+), 1 deletion(-) create mode 100755 t/Koha/sleep.pl --- a/Koha/Script.pm +++ a/Koha/Script.pm @@ -35,7 +35,12 @@ This class should be used in all scripts. It sets the interface and userenv appr =cut +use File::Basename; +use Fcntl qw(:flock); + use C4::Context; +use Koha::Exceptions; +use Koha::Exceptions::Exception; sub import { my $class = shift; @@ -67,6 +72,98 @@ sub import { } } +=head1 API + +=head2 Class methods + +=head3 new + + my $script = Koha::Script->new( + { + script => $0, # mandatory + [ lock_name => 'my_script' ] + } + ); + +Create a new Koha::Script object. The I