From 361b960d68e7bd6a0e4d5cc456db3f17e537057f Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 19 Jul 2021 11:00:52 +0200 Subject: [PATCH] Bug 28617: Remove kohalib.pl and rely on PERL5LIB The purpose of this script was to load the relevant Koha lib for the different scripts (installation, cronjob, CLI, etc.) However it is not used consistently and we prefer to rely on PERL5LIB. From bug 28617 comment 6 from Galen: """ Time marches on, and one of the motivations for having kohalib.pl - making it possible to install Koha without setting a single environment variable - has been obviated by the vast improvements in the ease of installing Koha. Consequently, I think kohalib.pl can go away. """ Test plan: confirm that the changes make sense and that kohalib.pl can be removed safely. --- Makefile.PL | 1 - misc/add_date_fields_to_marc_records.pl | 5 -- misc/batchCompareMARCvsFrameworks.pl | 6 --- misc/batchDeleteUnusedSubfields.pl | 6 --- misc/batchImportMARCWithBiblionumbers.pl | 6 --- misc/batchRebuildBiblioTables.pl | 7 --- misc/batchRepairMissingBiblionumbers.pl | 6 --- misc/commit_file.pl | 6 --- misc/cronjobs/advance_notices.pl | 6 --- misc/cronjobs/batch_anonymise.pl | 8 --- misc/cronjobs/build_browser_and_cloud.pl | 6 --- misc/cronjobs/cart_to_shelf.pl | 7 --- misc/cronjobs/cleanup_database.pl | 7 --- misc/cronjobs/delete_records_via_leader.pl | 8 --- misc/cronjobs/gather_print_notices.pl | 7 --- misc/cronjobs/holds/auto_unsuspend_holds.pl | 7 --- misc/cronjobs/holds/build_holds_queue.pl | 6 --- misc/cronjobs/holds/cancel_expired_holds.pl | 7 --- misc/cronjobs/holds/cancel_unfilled_holds.pl | 7 --- misc/cronjobs/holds/holds_reminder.pl | 8 --- misc/cronjobs/import_webservice_batch.pl | 8 --- misc/cronjobs/longoverdue.pl | 6 --- misc/cronjobs/membership_expiry.pl | 6 --- misc/cronjobs/overdue_notices.pl | 8 --- misc/cronjobs/patron_emailer.pl | 7 --- misc/cronjobs/process_message_queue.pl | 6 --- misc/cronjobs/purge_suggestions.pl | 7 --- misc/cronjobs/reconcile_balances.pl | 7 --- misc/cronjobs/runreport.pl | 7 --- misc/cronjobs/serialsUpdate.pl | 8 --- misc/cronjobs/staticfines.pl | 8 --- .../thirdparty/TalkingTech_itiva_inbound.pl | 8 --- .../thirdparty/TalkingTech_itiva_outbound.pl | 8 --- misc/cronjobs/update_patrons_category.pl | 7 --- misc/cronjobs/update_totalissues.pl | 8 --- misc/exportauth.pl | 6 --- misc/kohalib.pl | 52 ------------------- misc/link_bibs_to_authorities.pl | 8 --- misc/load_testing/benchmark_circulation.pl | 6 --- misc/load_testing/benchmark_staff.pl | 6 --- .../UNIMARC_fix_collectiontitle.pl | 5 -- ...MARC_sync_date_created_with_marc_biblio.pl | 5 -- .../borrowers-force-messaging-defaults.pl | 6 --- misc/maintenance/fix_accountlines_date.pl | 6 --- .../fix_accountlines_rmdupfines_bug8253.pl | 7 --- misc/maintenance/fix_mysql_constraints.pl | 7 --- misc/maintenance/touch_all_biblios.pl | 6 --- misc/maintenance/touch_all_items.pl | 6 --- .../22_to_30/convert_to_utf8.pl | 8 --- .../22_to_30/export_Authorities.pl | 6 --- .../22_to_30/export_Authorities_xml.pl | 6 --- .../22_to_30/missing090field.pl | 6 --- .../22_to_30/move_marc_to_authheader.pl | 6 --- .../22_to_30/move_marc_to_biblioitems.pl | 6 --- .../22_to_30/rebuild_leader.pl | 6 --- .../22_to_30/rebuild_unimarc_100.pl | 6 --- misc/migration_tools/bulkmarcimport.pl | 6 --- .../migration_tools/checkNonIndexedBiblios.pl | 8 --- misc/migration_tools/create_analytical_rel.pl | 6 --- misc/migration_tools/import_lexile.pl | 8 --- .../switch_marc21_series_info.pl | 7 --- misc/stage_file.pl | 6 --- t/db_dependent/00-strict.t | 1 - xt/yaml_valid.t | 5 -- 64 files changed, 459 deletions(-) delete mode 100755 misc/kohalib.pl diff --git a/Makefile.PL b/Makefile.PL index b044dd165ca..bd9c4eb11bc 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -693,7 +693,6 @@ $config{'BIB_RETRIEVAL_CFG'} = 'retrieval-info-bib-dom.xml'; if ($config{'INSTALL_MODE'} ne "dev") { push @{ $pl_files->{'rewrite-config.PL'} }, ( 'blib/PERL_MODULE_DIR/C4/Context.pm', - 'blib/SCRIPT_NONDEV_DIR/kohalib.pl' ); } diff --git a/misc/add_date_fields_to_marc_records.pl b/misc/add_date_fields_to_marc_records.pl index f619f521c44..c310350b6a7 100755 --- a/misc/add_date_fields_to_marc_records.pl +++ b/misc/add_date_fields_to_marc_records.pl @@ -17,11 +17,6 @@ use Modern::Perl; -BEGIN { - use FindBin (); - eval { require "$FindBin::Bin/../kohalib.pl" }; -} - use Koha::Script; use Getopt::Long qw( GetOptions ); diff --git a/misc/batchCompareMARCvsFrameworks.pl b/misc/batchCompareMARCvsFrameworks.pl index ca5c8617aca..ae2c2e54d2c 100755 --- a/misc/batchCompareMARCvsFrameworks.pl +++ b/misc/batchCompareMARCvsFrameworks.pl @@ -4,12 +4,6 @@ use strict; #use warnings; FIXME - Bug 2505 -BEGIN { - # find Koha's Perl modules - # test carefully before changing this - use FindBin (); - eval { require "$FindBin::Bin/kohalib.pl" }; -} # Koha modules used use Koha::Script; diff --git a/misc/batchDeleteUnusedSubfields.pl b/misc/batchDeleteUnusedSubfields.pl index 1cfaf3c473d..800465e5450 100755 --- a/misc/batchDeleteUnusedSubfields.pl +++ b/misc/batchDeleteUnusedSubfields.pl @@ -3,12 +3,6 @@ use strict; #use warnings; FIXME - Bug 2505 -BEGIN { - # find Koha's Perl modules - # test carefully before changing this - use FindBin (); - eval { require "$FindBin::Bin/kohalib.pl" }; -} # Koha modules used use Koha::Script; diff --git a/misc/batchImportMARCWithBiblionumbers.pl b/misc/batchImportMARCWithBiblionumbers.pl index b96e0122aa1..484f5171e53 100755 --- a/misc/batchImportMARCWithBiblionumbers.pl +++ b/misc/batchImportMARCWithBiblionumbers.pl @@ -3,12 +3,6 @@ # Written by TG on 10/04/2006 use strict; #use warnings; FIXME - Bug 2505 -BEGIN { - # find Koha's Perl modules - # test carefully before changing this - use FindBin (); - eval { require "$FindBin::Bin/kohalib.pl" }; -} # Koha modules used diff --git a/misc/batchRebuildBiblioTables.pl b/misc/batchRebuildBiblioTables.pl index ce4782f844e..cb936c0c92e 100755 --- a/misc/batchRebuildBiblioTables.pl +++ b/misc/batchRebuildBiblioTables.pl @@ -5,13 +5,6 @@ use strict; #use warnings; FIXME - Bug 2505 -BEGIN { - # find Koha's Perl modules - # test carefully before changing this - use FindBin (); - eval { require "$FindBin::Bin/kohalib.pl" }; -} - # Koha modules used use Koha::Script; use MARC::Record; diff --git a/misc/batchRepairMissingBiblionumbers.pl b/misc/batchRepairMissingBiblionumbers.pl index 32e9913fd6b..5a2d31fd308 100755 --- a/misc/batchRepairMissingBiblionumbers.pl +++ b/misc/batchRepairMissingBiblionumbers.pl @@ -4,12 +4,6 @@ # Revised by Joshua Ferraro on 03/31/2006 use strict; use warnings; -BEGIN { - # find Koha's Perl modules - # test carefully before changing this - use FindBin (); - eval { require "$FindBin::Bin/kohalib.pl" }; -} # Koha modules used use Koha::Script; diff --git a/misc/commit_file.pl b/misc/commit_file.pl index 2a243439d0a..a6a9141f209 100755 --- a/misc/commit_file.pl +++ b/misc/commit_file.pl @@ -2,12 +2,6 @@ use strict; use warnings; -BEGIN { - # find Koha's Perl modules - # test carefully before changing this - use FindBin (); - eval { require "$FindBin::Bin/kohalib.pl" }; -} use Koha::Script; use C4::Context; diff --git a/misc/cronjobs/advance_notices.pl b/misc/cronjobs/advance_notices.pl index c1d6ac6672a..2c8e6c2ecc1 100755 --- a/misc/cronjobs/advance_notices.pl +++ b/misc/cronjobs/advance_notices.pl @@ -40,12 +40,6 @@ use strict; use warnings; use Getopt::Long qw( GetOptions ); use Pod::Usage qw( pod2usage ); -BEGIN { - # find Koha's Perl modules - # test carefully before changing this - use FindBin (); - eval { require "$FindBin::Bin/../kohalib.pl" }; -} use Koha::Script -cron; use C4::Context; use C4::Letters; diff --git a/misc/cronjobs/batch_anonymise.pl b/misc/cronjobs/batch_anonymise.pl index 6e05d36ce98..edea4fa7ed5 100755 --- a/misc/cronjobs/batch_anonymise.pl +++ b/misc/cronjobs/batch_anonymise.pl @@ -20,14 +20,6 @@ use strict; use warnings; -BEGIN { - - # find Koha's Perl modules - # test carefully before changing this - use FindBin (); - eval { require "$FindBin::Bin/../kohalib.pl" }; -} - use Koha::Script -cron; use C4::Context; use Koha::Patrons; diff --git a/misc/cronjobs/build_browser_and_cloud.pl b/misc/cronjobs/build_browser_and_cloud.pl index 46551ca041a..8cd733a785d 100755 --- a/misc/cronjobs/build_browser_and_cloud.pl +++ b/misc/cronjobs/build_browser_and_cloud.pl @@ -3,12 +3,6 @@ use strict; #use warnings; FIXME - Bug 2505 -BEGIN { - # find Koha's Perl modules - # test carefully before changing this - use FindBin; - eval { require "$FindBin::Bin/../kohalib.pl" }; -} use Koha::Script -cron; use C4::Koha; diff --git a/misc/cronjobs/cart_to_shelf.pl b/misc/cronjobs/cart_to_shelf.pl index 264e9338049..3c7d12e22ba 100755 --- a/misc/cronjobs/cart_to_shelf.pl +++ b/misc/cronjobs/cart_to_shelf.pl @@ -32,13 +32,6 @@ use Koha::Script -cron; use C4::Items qw( CartToShelf ); use C4::Log qw( cronlogaction ); -BEGIN { - - # find Koha's Perl modules - # test carefully before changing this - use FindBin (); - eval { require "$FindBin::Bin/../kohalib.pl" }; -} use C4::Context; use Getopt::Long qw( GetOptions ); diff --git a/misc/cronjobs/cleanup_database.pl b/misc/cronjobs/cleanup_database.pl index 94a63016205..8f7c47cc129 100755 --- a/misc/cronjobs/cleanup_database.pl +++ b/misc/cronjobs/cleanup_database.pl @@ -28,13 +28,6 @@ use constant DEFAULT_SEARCHHISTORY_PURGEDAYS => 30; use constant DEFAULT_SHARE_INVITATION_EXPIRY_DAYS => 14; use constant DEFAULT_DEBARMENTS_PURGEDAYS => 30; -BEGIN { - # find Koha's Perl modules - # test carefully before changing this - use FindBin (); - eval { require "$FindBin::Bin/../kohalib.pl" }; -} - use Koha::Script -cron; use C4::Context; use C4::Search; diff --git a/misc/cronjobs/delete_records_via_leader.pl b/misc/cronjobs/delete_records_via_leader.pl index 8456f42c046..2794efb8d74 100755 --- a/misc/cronjobs/delete_records_via_leader.pl +++ b/misc/cronjobs/delete_records_via_leader.pl @@ -23,14 +23,6 @@ use Modern::Perl; binmode( STDOUT, ":encoding(UTF-8)" ); -BEGIN { - - # find Koha's Perl modules - # test carefully before changing this - use FindBin (); - eval { require "$FindBin::Bin/../kohalib.pl" }; -} - use Getopt::Long qw( GetOptions ); use Pod::Usage qw( pod2usage ); use Koha::Script -cron; diff --git a/misc/cronjobs/gather_print_notices.pl b/misc/cronjobs/gather_print_notices.pl index a777acbbcfd..488ce0791e7 100755 --- a/misc/cronjobs/gather_print_notices.pl +++ b/misc/cronjobs/gather_print_notices.pl @@ -2,13 +2,6 @@ use Modern::Perl; -BEGIN { - # find Koha's Perl modules - # test carefully before changing this - use FindBin (); - eval { require "$FindBin::Bin/../kohalib.pl" }; -} - use CGI; # NOT a CGI script, this is just to keep C4::Templates::gettemplate happy use Koha::Script -cron; use C4::Context; diff --git a/misc/cronjobs/holds/auto_unsuspend_holds.pl b/misc/cronjobs/holds/auto_unsuspend_holds.pl index fdaa350159f..a0b3724c981 100755 --- a/misc/cronjobs/holds/auto_unsuspend_holds.pl +++ b/misc/cronjobs/holds/auto_unsuspend_holds.pl @@ -20,13 +20,6 @@ use strict; use warnings; -BEGIN { - # find Koha's Perl modules - # test carefully before changing this - use FindBin (); - eval { require "$FindBin::Bin/../kohalib.pl" }; -} - # cancel all expired hold requests use Koha::Script -cron; diff --git a/misc/cronjobs/holds/build_holds_queue.pl b/misc/cronjobs/holds/build_holds_queue.pl index 6e1437dcd36..6ba476b585f 100755 --- a/misc/cronjobs/holds/build_holds_queue.pl +++ b/misc/cronjobs/holds/build_holds_queue.pl @@ -8,12 +8,6 @@ use strict; use warnings; -BEGIN { - # find Koha's Perl modules - # test carefully before changing this - use FindBin (); - eval { require "$FindBin::Bin/../kohalib.pl" }; -} use Koha::Script -cron; use C4::HoldsQueue qw(CreateQueue); diff --git a/misc/cronjobs/holds/cancel_expired_holds.pl b/misc/cronjobs/holds/cancel_expired_holds.pl index 0af02558e3f..b837aafca32 100755 --- a/misc/cronjobs/holds/cancel_expired_holds.pl +++ b/misc/cronjobs/holds/cancel_expired_holds.pl @@ -42,13 +42,6 @@ use Modern::Perl; use Getopt::Long qw( GetOptions ); use Pod::Usage qw( pod2usage ); -BEGIN { - # find Koha's Perl modules - # test carefully before changing this - use FindBin (); - eval { require "$FindBin::Bin/../kohalib.pl" }; -} - use Koha::Script -cron; use C4::Reserves; use C4::Log qw( cronlogaction ); diff --git a/misc/cronjobs/holds/cancel_unfilled_holds.pl b/misc/cronjobs/holds/cancel_unfilled_holds.pl index 10952695b5e..ea5d70ab485 100755 --- a/misc/cronjobs/holds/cancel_unfilled_holds.pl +++ b/misc/cronjobs/holds/cancel_unfilled_holds.pl @@ -18,13 +18,6 @@ use Modern::Perl; -BEGIN { - # find Koha's Perl modules - # test carefully before changing this - use FindBin (); - eval { require "$FindBin::Bin/../kohalib.pl" }; -} - use Getopt::Long qw( GetOptions ); use Pod::Usage qw( pod2usage ); diff --git a/misc/cronjobs/holds/holds_reminder.pl b/misc/cronjobs/holds/holds_reminder.pl index a255d8de6e7..38db8a07186 100755 --- a/misc/cronjobs/holds/holds_reminder.pl +++ b/misc/cronjobs/holds/holds_reminder.pl @@ -17,14 +17,6 @@ use Modern::Perl; -BEGIN { - - # find Koha's Perl modules - # test carefully before changing this - use FindBin (); - eval { require "$FindBin::Bin/../kohalib.pl" }; -} - use Getopt::Long qw( GetOptions ); use Pod::Usage qw( pod2usage ); use DateTime; diff --git a/misc/cronjobs/import_webservice_batch.pl b/misc/cronjobs/import_webservice_batch.pl index 5925be2ea69..5274410d73d 100755 --- a/misc/cronjobs/import_webservice_batch.pl +++ b/misc/cronjobs/import_webservice_batch.pl @@ -21,14 +21,6 @@ use strict; use warnings; use utf8; -BEGIN { - - # find Koha's Perl modules - # test carefully before changing this - use FindBin (); - eval { require "$FindBin::Bin/../kohalib.pl" }; -} - use Getopt::Long qw( GetOptions ); use Koha::Script -cron; use C4::ImportBatch qw( BatchCommitRecords ); diff --git a/misc/cronjobs/longoverdue.pl b/misc/cronjobs/longoverdue.pl index dd12b6c1044..457ddf4465c 100755 --- a/misc/cronjobs/longoverdue.pl +++ b/misc/cronjobs/longoverdue.pl @@ -27,12 +27,6 @@ longoverdue.pl cron script to set lost statuses on overdue materials. use strict; use warnings; -BEGIN { - # find Koha's Perl modules - # test carefully before changing this - use FindBin (); - eval { require "$FindBin::Bin/../kohalib.pl" }; -} use Getopt::Long qw( GetOptions ); use Pod::Usage qw( pod2usage ); diff --git a/misc/cronjobs/membership_expiry.pl b/misc/cronjobs/membership_expiry.pl index 7a043f8e365..0bbac3a6168 100755 --- a/misc/cronjobs/membership_expiry.pl +++ b/misc/cronjobs/membership_expiry.pl @@ -118,12 +118,6 @@ any field from the branches table use Modern::Perl; use Getopt::Long qw( GetOptions ); use Pod::Usage qw( pod2usage ); -BEGIN { - # find Koha's Perl modules - # test carefully before changing this - use FindBin (); - eval { require "$FindBin::Bin/../kohalib.pl" }; -} use Koha::Script -cron; use C4::Context; diff --git a/misc/cronjobs/overdue_notices.pl b/misc/cronjobs/overdue_notices.pl index a1c22116288..36fe458ecc6 100755 --- a/misc/cronjobs/overdue_notices.pl +++ b/misc/cronjobs/overdue_notices.pl @@ -20,14 +20,6 @@ use Modern::Perl; -BEGIN { - - # find Koha's Perl modules - # test carefully before changing this - use FindBin (); - eval { require "$FindBin::Bin/../kohalib.pl" }; -} - use Getopt::Long qw( GetOptions ); use Pod::Usage qw( pod2usage ); use Text::CSV_XS; diff --git a/misc/cronjobs/patron_emailer.pl b/misc/cronjobs/patron_emailer.pl index a265b762a98..a33600d528d 100755 --- a/misc/cronjobs/patron_emailer.pl +++ b/misc/cronjobs/patron_emailer.pl @@ -18,13 +18,6 @@ use Modern::Perl; -BEGIN { - # find Koha's Perl modules - # test carefully before changing this - use FindBin (); - eval { require "$FindBin::Bin/../kohalib.pl" }; -} - use Koha::Script -cron; use Getopt::Long qw( GetOptions ); use Pod::Usage qw( pod2usage ); diff --git a/misc/cronjobs/process_message_queue.pl b/misc/cronjobs/process_message_queue.pl index 5ad1b2f79bd..1722e4ef405 100755 --- a/misc/cronjobs/process_message_queue.pl +++ b/misc/cronjobs/process_message_queue.pl @@ -19,12 +19,6 @@ use strict; use warnings; -BEGIN { - # find Koha's Perl modules - # test carefully before changing this - use FindBin (); - eval { require "$FindBin::Bin/../kohalib.pl" }; -} use Koha::Script -cron; use C4::Letters qw( SendQueuedMessages ); diff --git a/misc/cronjobs/purge_suggestions.pl b/misc/cronjobs/purge_suggestions.pl index 881ad7d4eae..7b55efb1aa8 100755 --- a/misc/cronjobs/purge_suggestions.pl +++ b/misc/cronjobs/purge_suggestions.pl @@ -19,13 +19,6 @@ use Modern::Perl; -BEGIN { - # find Koha's Perl modules - # test carefully before changing this - use FindBin (); - eval { require "$FindBin::Bin/../kohalib.pl" }; -} - use Getopt::Long qw( GetOptions ); use Koha::Script -cron; diff --git a/misc/cronjobs/reconcile_balances.pl b/misc/cronjobs/reconcile_balances.pl index 4c558360919..ce95202b7ed 100755 --- a/misc/cronjobs/reconcile_balances.pl +++ b/misc/cronjobs/reconcile_balances.pl @@ -55,13 +55,6 @@ use Getopt::Long qw( GetOptions ); use Pod::Usage qw( pod2usage ); use Try::Tiny qw( catch try ); -BEGIN { - # find Koha's Perl modules - # test carefully before changing this - use FindBin (); - eval { require "$FindBin::Bin/../kohalib.pl" }; -} - use Koha::Script -cron; use C4::Log qw( cronlogaction ); diff --git a/misc/cronjobs/runreport.pl b/misc/cronjobs/runreport.pl index 710de44f3d8..b3ce9253502 100755 --- a/misc/cronjobs/runreport.pl +++ b/misc/cronjobs/runreport.pl @@ -38,13 +38,6 @@ use Encode qw( decode ); use JSON qw( to_json ); use Try::Tiny qw( catch try ); -BEGIN { - # find Koha's Perl modules - # test carefully before changing this - use FindBin (); - eval { require "$FindBin::Bin/../kohalib.pl" }; -} - =head1 NAME runreport.pl - Run pre-existing saved reports diff --git a/misc/cronjobs/serialsUpdate.pl b/misc/cronjobs/serialsUpdate.pl index 53d60071b41..26ebf25dde0 100755 --- a/misc/cronjobs/serialsUpdate.pl +++ b/misc/cronjobs/serialsUpdate.pl @@ -20,14 +20,6 @@ use strict; use warnings; -BEGIN { - - # find Koha's Perl modules - # test carefully before changing this - use FindBin (); - eval { require "$FindBin::Bin/../kohalib.pl" }; -} - use Koha::Script -cron; use C4::Context; use C4::Serials qw( GetSubscription GetNextDate ModSerialStatus ); diff --git a/misc/cronjobs/staticfines.pl b/misc/cronjobs/staticfines.pl index 6d7cf733c48..d4141b25f3b 100755 --- a/misc/cronjobs/staticfines.pl +++ b/misc/cronjobs/staticfines.pl @@ -27,14 +27,6 @@ use Modern::Perl; -BEGIN { - - # find Koha's Perl modules - # test carefully before changing this - use FindBin (); - eval { require "$FindBin::Bin/kohalib.pl" }; -} - use Date::Calc qw( Date_to_Days ); use Koha::Script -cron; diff --git a/misc/cronjobs/thirdparty/TalkingTech_itiva_inbound.pl b/misc/cronjobs/thirdparty/TalkingTech_itiva_inbound.pl index 6be02264338..6b876c9dbb1 100755 --- a/misc/cronjobs/thirdparty/TalkingTech_itiva_inbound.pl +++ b/misc/cronjobs/thirdparty/TalkingTech_itiva_inbound.pl @@ -20,14 +20,6 @@ use strict; use warnings; -BEGIN { - - # find Koha's Perl modules - # test carefully before changing this - use FindBin (); - eval { require "$FindBin::Bin/../kohalib.pl" }; -} - use Getopt::Long qw( GetOptions ); use Pod::Usage qw( pod2usage ); diff --git a/misc/cronjobs/thirdparty/TalkingTech_itiva_outbound.pl b/misc/cronjobs/thirdparty/TalkingTech_itiva_outbound.pl index fedc3cf888c..6a1456987fa 100755 --- a/misc/cronjobs/thirdparty/TalkingTech_itiva_outbound.pl +++ b/misc/cronjobs/thirdparty/TalkingTech_itiva_outbound.pl @@ -20,14 +20,6 @@ use strict; use warnings; -BEGIN { - - # find Koha's Perl modules - # test carefully before changing this - use FindBin (); - eval { require "$FindBin::Bin/../kohalib.pl" }; -} - use Getopt::Long qw( GetOptions ); use Pod::Usage qw( pod2usage ); diff --git a/misc/cronjobs/update_patrons_category.pl b/misc/cronjobs/update_patrons_category.pl index 542cc307c41..f75747e6ab4 100755 --- a/misc/cronjobs/update_patrons_category.pl +++ b/misc/cronjobs/update_patrons_category.pl @@ -17,13 +17,6 @@ use Modern::Perl; -BEGIN { - # find Koha's Perl modules - # test carefully before changing this - use FindBin (); - eval { require "$FindBin::Bin/../kohalib.pl" }; -} - use C4::Context; use Getopt::Long qw( GetOptions ); use Pod::Usage qw( pod2usage ); diff --git a/misc/cronjobs/update_totalissues.pl b/misc/cronjobs/update_totalissues.pl index b3a6c2f503a..a3f561bbf55 100755 --- a/misc/cronjobs/update_totalissues.pl +++ b/misc/cronjobs/update_totalissues.pl @@ -20,14 +20,6 @@ use strict; use warnings; -BEGIN { - - # find Koha's Perl modules - # test carefully before changing this - use FindBin (); - eval { require "$FindBin::Bin/../kohalib.pl" }; -} - use Getopt::Long qw( GetOptions ); use Pod::Usage qw( pod2usage ); diff --git a/misc/exportauth.pl b/misc/exportauth.pl index d2ccebf6142..14e30884d2d 100755 --- a/misc/exportauth.pl +++ b/misc/exportauth.pl @@ -5,12 +5,6 @@ use strict; #use warnings; FIXME - Bug 2505 -BEGIN { - # find Koha's Perl modules - # test carefully before changing this - use FindBin (); - eval { require "$FindBin::Bin/kohalib.pl" }; -} use Koha::Script; use C4::Context; diff --git a/misc/kohalib.pl b/misc/kohalib.pl deleted file mode 100755 index 6c20190e662..00000000000 --- a/misc/kohalib.pl +++ /dev/null @@ -1,52 +0,0 @@ -#!/usr/bin/perl - -# Copyright (C) 2007 LibLime -# -# This file is part of Koha. -# -# Koha is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. -# -# Koha is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Koha; if not, see . - -# This script is used by command-line utilities to set -# @INC properly -- specifically, to point to the directory -# containing the installed version of the C4 modules. -# -# This depends on the installer replacing the \_\_PERL_MODULE_DIR\_\_ -# string with the path to the Koha modules directory. This is done -# only during a 'standard' or 'single' mode installation. If Koha -# is being run from a git checkout (and thus installed in 'dev' mode), -# this is a no-op. -# -# To use this script, a command-line utility should do the following before -# 'use'ing any C4 modules. -# -# BEGIN { -# use FindBin; -# eval { require "$FindBin::Bin/kohalib.pl" }; -# # adjust path to point to kohalib.pl relative -# # to location of script -# } -# - -use strict; -#use warnings; FIXME - Bug 2505 - -my $module_dir; -BEGIN { - $module_dir = '__PERL_MODULE_DIR__'; - die if $module_dir =~ /^[_]{2}PERL_MODULE_DIR[_]{2}$/; -} - -use lib $module_dir; - -1; diff --git a/misc/link_bibs_to_authorities.pl b/misc/link_bibs_to_authorities.pl index 21e4cc31bb2..7dc52a9dc78 100755 --- a/misc/link_bibs_to_authorities.pl +++ b/misc/link_bibs_to_authorities.pl @@ -3,14 +3,6 @@ use strict; use warnings; -BEGIN { - - # find Koha's Perl modules - # test carefully before changing this - use FindBin (); - eval { require "$FindBin::Bin/kohalib.pl" }; -} - use Koha::Script; use C4::Context; use C4::Biblio qw( diff --git a/misc/load_testing/benchmark_circulation.pl b/misc/load_testing/benchmark_circulation.pl index 83ddea54618..0cedf19024a 100755 --- a/misc/load_testing/benchmark_circulation.pl +++ b/misc/load_testing/benchmark_circulation.pl @@ -4,12 +4,6 @@ use strict; use warnings; -BEGIN { - # find Koha's Perl modules - # test carefully before changing this - use FindBin (); - eval { require "$FindBin::Bin/kohalib.pl" }; -} use HTTPD::Bench::ApacheBench; use LWP::UserAgent; diff --git a/misc/load_testing/benchmark_staff.pl b/misc/load_testing/benchmark_staff.pl index f42c4d5eafe..9ff8e9b6762 100755 --- a/misc/load_testing/benchmark_staff.pl +++ b/misc/load_testing/benchmark_staff.pl @@ -4,12 +4,6 @@ use strict; use warnings; -BEGIN { - # find Koha's Perl modules - # test carefully before changing this - use FindBin (); - eval { require "$FindBin::Bin/kohalib.pl" }; -} use Getopt::Long qw( GetOptions ); use HTTPD::Bench::ApacheBench; diff --git a/misc/maintenance/UNIMARC_fix_collectiontitle.pl b/misc/maintenance/UNIMARC_fix_collectiontitle.pl index d28163a9b9d..0577878e91b 100755 --- a/misc/maintenance/UNIMARC_fix_collectiontitle.pl +++ b/misc/maintenance/UNIMARC_fix_collectiontitle.pl @@ -7,11 +7,6 @@ use strict; use warnings; -BEGIN { - use FindBin (); - eval { require "$FindBin::Bin/../kohalib.pl" }; -} - use Koha::Script; sub process { diff --git a/misc/maintenance/UNIMARC_sync_date_created_with_marc_biblio.pl b/misc/maintenance/UNIMARC_sync_date_created_with_marc_biblio.pl index 1a4b8648225..c787374eef8 100755 --- a/misc/maintenance/UNIMARC_sync_date_created_with_marc_biblio.pl +++ b/misc/maintenance/UNIMARC_sync_date_created_with_marc_biblio.pl @@ -7,11 +7,6 @@ use strict; use warnings; -BEGIN { - use FindBin (); - eval { require "$FindBin::Bin/../kohalib.pl" }; -} - use Koha::Script; use C4::Biblio qw( GetMarcBiblio ModBiblio ); use Getopt::Long qw( GetOptions ); diff --git a/misc/maintenance/borrowers-force-messaging-defaults.pl b/misc/maintenance/borrowers-force-messaging-defaults.pl index 9a0b1c0f085..7f2bba0c694 100755 --- a/misc/maintenance/borrowers-force-messaging-defaults.pl +++ b/misc/maintenance/borrowers-force-messaging-defaults.pl @@ -19,12 +19,6 @@ use strict; use warnings; -BEGIN { - # find Koha's Perl modules - # test carefully before changing this - use FindBin (); - eval { require "$FindBin::Bin/../kohalib.pl" }; -} use Koha::Script; use C4::Context; diff --git a/misc/maintenance/fix_accountlines_date.pl b/misc/maintenance/fix_accountlines_date.pl index fb9ceacf3da..670b35dc01f 100755 --- a/misc/maintenance/fix_accountlines_date.pl +++ b/misc/maintenance/fix_accountlines_date.pl @@ -19,12 +19,6 @@ use strict; use warnings; -BEGIN { - # find Koha's Perl modules - # test carefully before changing this - use FindBin (); - eval { require "$FindBin::Bin/../kohalib.pl" }; -} use Koha::Script; use C4::Context; diff --git a/misc/maintenance/fix_accountlines_rmdupfines_bug8253.pl b/misc/maintenance/fix_accountlines_rmdupfines_bug8253.pl index fd9d04751d6..608c6aaa7b6 100755 --- a/misc/maintenance/fix_accountlines_rmdupfines_bug8253.pl +++ b/misc/maintenance/fix_accountlines_rmdupfines_bug8253.pl @@ -20,13 +20,6 @@ use strict; use warnings; -BEGIN { - # find Koha's Perl modules - # test carefully before changing this - use FindBin (); - eval { require "$FindBin::Bin/../kohalib.pl" }; -} - use Koha::Script; use C4::Context; diff --git a/misc/maintenance/fix_mysql_constraints.pl b/misc/maintenance/fix_mysql_constraints.pl index b1784a01efb..79599cdac44 100755 --- a/misc/maintenance/fix_mysql_constraints.pl +++ b/misc/maintenance/fix_mysql_constraints.pl @@ -18,13 +18,6 @@ # along with Koha; if not, see . use Modern::Perl; -BEGIN { - # find Koha's Perl modules - # test carefully before changing this - use FindBin (); - my $lib = "$FindBin::Bin/../kohalib.pl"; - eval { require $lib }; -} use Getopt::Long qw( GetOptions ); use Pod::Usage qw( pod2usage ); diff --git a/misc/maintenance/touch_all_biblios.pl b/misc/maintenance/touch_all_biblios.pl index be349cfb193..93cfef9e64d 100755 --- a/misc/maintenance/touch_all_biblios.pl +++ b/misc/maintenance/touch_all_biblios.pl @@ -19,12 +19,6 @@ use strict; use warnings; -BEGIN { - # find Koha's Perl modules - # test carefully before changing this - use FindBin (); - eval { require "$FindBin::Bin/../kohalib.pl" }; -} # possible modules to use use Getopt::Long qw( GetOptions ); diff --git a/misc/maintenance/touch_all_items.pl b/misc/maintenance/touch_all_items.pl index 087914498ed..b23e5206d2b 100755 --- a/misc/maintenance/touch_all_items.pl +++ b/misc/maintenance/touch_all_items.pl @@ -19,12 +19,6 @@ use strict; use warnings; -BEGIN { - # find Koha's Perl modules - # test carefully before changing this - use FindBin (); - eval { require "$FindBin::Bin/../kohalib.pl" }; -} # possible modules to use use Getopt::Long qw( GetOptions ); diff --git a/misc/migration_tools/22_to_30/convert_to_utf8.pl b/misc/migration_tools/22_to_30/convert_to_utf8.pl index d854b0c6d37..8afbb4f541f 100755 --- a/misc/migration_tools/22_to_30/convert_to_utf8.pl +++ b/misc/migration_tools/22_to_30/convert_to_utf8.pl @@ -5,14 +5,6 @@ use strict; use warnings; -BEGIN { - - # find Koha's Perl modules - # test carefully before changing this - use FindBin (); - eval { require "$FindBin::Bin/../../kohalib.pl" }; -} - use C4::Context; my $dbh = C4::Context->dbh(); my $sth = $dbh->prepare("Show tables"); diff --git a/misc/migration_tools/22_to_30/export_Authorities.pl b/misc/migration_tools/22_to_30/export_Authorities.pl index d4531a3ffcd..eacb9bef8f6 100755 --- a/misc/migration_tools/22_to_30/export_Authorities.pl +++ b/misc/migration_tools/22_to_30/export_Authorities.pl @@ -1,11 +1,5 @@ #!/usr/bin/perl use Modern::Perl; -BEGIN { - # find Koha's Perl modules - # test carefully before changing this - use FindBin (); - eval { require "$FindBin::Bin/../../kohalib.pl" }; -} use C4::Context; #use MARC::File::XML(BinaryEncoding=>"utf8"); #use MARC::File::USMARC; diff --git a/misc/migration_tools/22_to_30/export_Authorities_xml.pl b/misc/migration_tools/22_to_30/export_Authorities_xml.pl index 4145fc33b03..af92d61c117 100755 --- a/misc/migration_tools/22_to_30/export_Authorities_xml.pl +++ b/misc/migration_tools/22_to_30/export_Authorities_xml.pl @@ -1,11 +1,5 @@ #!/usr/bin/perl use Modern::Perl; -BEGIN { - # find Koha's Perl modules - # test carefully before changing this - use FindBin (); - eval { require "$FindBin::Bin/../../kohalib.pl" }; -} use C4::Context; use MARC::File::XML(BinaryEncoding=>"utf8"); use C4::AuthoritiesMarc; diff --git a/misc/migration_tools/22_to_30/missing090field.pl b/misc/migration_tools/22_to_30/missing090field.pl index 80861b18653..a75fb24ead7 100755 --- a/misc/migration_tools/22_to_30/missing090field.pl +++ b/misc/migration_tools/22_to_30/missing090field.pl @@ -4,12 +4,6 @@ # Revised by Joshua Ferraro on 03/31/2006 use strict; #use warnings; FIXME - Bug 2505 -BEGIN { - # find Koha's Perl modules - # test carefully before changing this - use FindBin (); - eval { require "$FindBin::Bin/../../kohalib.pl" }; -} # Koha modules used diff --git a/misc/migration_tools/22_to_30/move_marc_to_authheader.pl b/misc/migration_tools/22_to_30/move_marc_to_authheader.pl index 8a5ffa9354c..53069bff01d 100755 --- a/misc/migration_tools/22_to_30/move_marc_to_authheader.pl +++ b/misc/migration_tools/22_to_30/move_marc_to_authheader.pl @@ -4,12 +4,6 @@ # scraped from updatedatabase for dev week by chris@katipo.co.nz use strict; #use warnings; FIXME - Bug 2505 -BEGIN { - # find Koha's Perl modules - # test carefully before changing this - use FindBin (); - eval { require "$FindBin::Bin/../../kohalib.pl" }; -} use C4::Context; use C4::AuthoritiesMarc; use MARC::Record; diff --git a/misc/migration_tools/22_to_30/move_marc_to_biblioitems.pl b/misc/migration_tools/22_to_30/move_marc_to_biblioitems.pl index e4429a7d9e6..417cc3a1f97 100755 --- a/misc/migration_tools/22_to_30/move_marc_to_biblioitems.pl +++ b/misc/migration_tools/22_to_30/move_marc_to_biblioitems.pl @@ -2,12 +2,6 @@ use Modern::Perl; # script to shift marc to biblioitems # scraped from updatedatabase for dev week by chris@katipo.co.nz -BEGIN { - # find Koha's Perl modules - # test carefully before changing this - use FindBin (); - eval { require "$FindBin::Bin/../../kohalib.pl" }; -} use C4::Context; use MARC::Record; use MARC::File::XML ( BinaryEncoding => 'utf8' ); diff --git a/misc/migration_tools/22_to_30/rebuild_leader.pl b/misc/migration_tools/22_to_30/rebuild_leader.pl index 885ba459b21..77475f0fa41 100755 --- a/misc/migration_tools/22_to_30/rebuild_leader.pl +++ b/misc/migration_tools/22_to_30/rebuild_leader.pl @@ -4,12 +4,6 @@ # Revised by Joshua Ferraro on 03/31/2006 use strict; #use warnings; FIXME - Bug 2505 -BEGIN { - # find Koha's Perl modules - # test carefully before changing this - use FindBin (); - eval { require "$FindBin::Bin/../../kohalib.pl" }; -} # Koha modules used diff --git a/misc/migration_tools/22_to_30/rebuild_unimarc_100.pl b/misc/migration_tools/22_to_30/rebuild_unimarc_100.pl index c9eddb5fc63..b9c976d71f4 100755 --- a/misc/migration_tools/22_to_30/rebuild_unimarc_100.pl +++ b/misc/migration_tools/22_to_30/rebuild_unimarc_100.pl @@ -4,12 +4,6 @@ # Revised by Joshua Ferraro on 03/31/2006 use strict; #use warnings; FIXME - Bug 2505 -BEGIN { - # find Koha's Perl modules - # test carefully before changing this - use FindBin (); - eval { require "$FindBin::Bin/../../kohalib.pl" }; -} # Koha modules used diff --git a/misc/migration_tools/bulkmarcimport.pl b/misc/migration_tools/bulkmarcimport.pl index b5ed5f0bed9..aad5c3c2385 100755 --- a/misc/migration_tools/bulkmarcimport.pl +++ b/misc/migration_tools/bulkmarcimport.pl @@ -3,12 +3,6 @@ use Modern::Perl; #use diagnostics; -BEGIN { - # find Koha's Perl modules - # test carefully before changing this - use FindBin (); - eval { require "$FindBin::Bin/../kohalib.pl" }; -} # Koha modules used use MARC::File::USMARC; diff --git a/misc/migration_tools/checkNonIndexedBiblios.pl b/misc/migration_tools/checkNonIndexedBiblios.pl index 25b58ea7e3c..490b2269120 100755 --- a/misc/migration_tools/checkNonIndexedBiblios.pl +++ b/misc/migration_tools/checkNonIndexedBiblios.pl @@ -23,14 +23,6 @@ use strict; -BEGIN { - - # find Koha's Perl modules - # test carefully before changing this - use FindBin (); - eval { require "$FindBin::Bin/kohalib.pl" }; -} - # Koha modules used use Koha::Script; use C4::Context; diff --git a/misc/migration_tools/create_analytical_rel.pl b/misc/migration_tools/create_analytical_rel.pl index dfdd10e26af..370d92b0e83 100755 --- a/misc/migration_tools/create_analytical_rel.pl +++ b/misc/migration_tools/create_analytical_rel.pl @@ -2,12 +2,6 @@ use strict; #use warnings; FIXME - Bug 2505 -BEGIN { - # find Koha's Perl modules - # test carefully before changing this - use FindBin (); - eval { require "$FindBin::Bin/../kohalib.pl" }; -} use Koha::Script; use C4::Context; diff --git a/misc/migration_tools/import_lexile.pl b/misc/migration_tools/import_lexile.pl index 265b07a8eb2..c2a02999e24 100755 --- a/misc/migration_tools/import_lexile.pl +++ b/misc/migration_tools/import_lexile.pl @@ -41,14 +41,6 @@ use Koha::Database; binmode STDOUT, ':encoding(UTF-8)'; -BEGIN { - - # find Koha's Perl modules - # test carefully before changing this - use FindBin (); - eval { require "$FindBin::Bin/../kohalib.pl" }; -} - my $help; my $confirm; my $test; diff --git a/misc/migration_tools/switch_marc21_series_info.pl b/misc/migration_tools/switch_marc21_series_info.pl index f3962e56493..39e0db1fdd3 100755 --- a/misc/migration_tools/switch_marc21_series_info.pl +++ b/misc/migration_tools/switch_marc21_series_info.pl @@ -22,13 +22,6 @@ use warnings; # Script to switch the MARC21 440$anv and 490$av information -BEGIN { - # find Koha's Perl modules - # test carefully before changing this - use FindBin (); - eval { require "$FindBin::Bin/../kohalib.pl" }; -} - use Koha::Script; use C4::Biblio qw( GetFrameworkCode GetMarcBiblio ModBiblioMarc ); use C4::Context; diff --git a/misc/stage_file.pl b/misc/stage_file.pl index f05be7a01d9..90d2b6ebc4b 100755 --- a/misc/stage_file.pl +++ b/misc/stage_file.pl @@ -20,12 +20,6 @@ # along with Koha; if not, see . use Modern::Perl; -BEGIN { - # find Koha's Perl modules - # test carefully before changing this - use FindBin (); - eval { require "$FindBin::Bin/kohalib.pl" }; -} use Koha::Script; use C4::Context; diff --git a/t/db_dependent/00-strict.t b/t/db_dependent/00-strict.t index 74212e8f8a9..eb2ea525374 100755 --- a/t/db_dependent/00-strict.t +++ b/t/db_dependent/00-strict.t @@ -35,7 +35,6 @@ my @dirs = ( ); $Test::Strict::TEST_STRICT = 0; -$Test::Strict::TEST_SKIP = [ 'misc/kohalib.pl' ]; my $ncpu; if ( $ENV{KOHA_PROVE_CPUS} ) { diff --git a/xt/yaml_valid.t b/xt/yaml_valid.t index b6f3c600d86..b37dbb4eaad 100755 --- a/xt/yaml_valid.t +++ b/xt/yaml_valid.t @@ -23,11 +23,6 @@ use File::Find; use Test::More; -BEGIN { - use FindBin; - eval { require "$FindBin::Bin/../misc/kohalib.pl" }; -} - my $filebase = "$FindBin::Bin/../koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences"; my @files; -- 2.20.1