Bugzilla – Attachment 136387 Details for
Bug 30999
Add a script to manage plugins from the command line
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
adds a very simple command line script for managing plugins
0001-Bug-30999-Add-a-script-to-manage-plugins-from-comman.patch (text/plain), 3.00 KB, created by
paxed
on 2022-06-21 07:41:56 UTC
(
hide
)
Description:
adds a very simple command line script for managing plugins
Filename:
MIME Type:
Creator:
paxed
Created:
2022-06-21 07:41:56 UTC
Size:
3.00 KB
patch
obsolete
>From 39750d1fee94c990dd7ef5aadfc4da72bdc54ee7 Mon Sep 17 00:00:00 2001 >From: Pasi Kallinen <pasi.kallinen@koha-suomi.fi> >Date: Tue, 21 Jun 2022 10:34:21 +0300 >Subject: [PATCH] Bug 30999: Add a script to manage plugins from command line > >This adds a very simple script that allows listing, enabling, and >disabling plugins from the command line. It should be helpful for >system admins to manage multiple koha instances. >--- > misc/devel/manage_plugins.pl | 100 +++++++++++++++++++++++++++++++++++ > 1 file changed, 100 insertions(+) > create mode 100644 misc/devel/manage_plugins.pl > >diff --git a/misc/devel/manage_plugins.pl b/misc/devel/manage_plugins.pl >new file mode 100644 >index 0000000000..b60a727a3f >--- /dev/null >+++ b/misc/devel/manage_plugins.pl >@@ -0,0 +1,100 @@ >+#!/usr/bin/perl >+ >+# This file is part of Koha. >+# >+# Copyright 2019 Koha Development Team >+# >+# 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 <http://www.gnu.org/licenses>. >+ >+use Modern::Perl; >+use Getopt::Long qw( GetOptions ); >+use Pod::Usage qw( pod2usage ); >+ >+use C4::Context; >+use Koha::Plugins; >+use Koha::Plugins::Handler; >+ >+my $method = "list"; >+my $class; >+my ($help); >+GetOptions( 'help|?' => \$help, >+ 'enable=s' => sub { $method = "enable"; $class = $_[1]; }, >+ 'disable=s' => sub { $method = "disable"; $class = $_[1]; }, >+ ); >+ >+pod2usage(1) if $help; >+ >+unless ( C4::Context->config("enable_plugins") ) { >+ print >+"The plugin system must be enabled for one to be able to manage plugins\n"; >+ exit 1; >+} >+ >+if ($method eq "enable" || $method eq "disable") { >+ Koha::Plugins::Handler->run({ >+ class => $class, >+ method => $method >+ }); >+} >+ >+my @plugins = Koha::Plugins->new()->GetPlugins( >+ { >+ method => undef, >+ all => 1, >+ errors => 1 >+ } >+ ); >+ >+foreach my $plugin (@plugins) { >+ print ($plugin->is_enabled ? "Enabled " : "Disabled"); >+ print " ".$plugin->{class}; >+ print "\n"; >+} >+ >+=head1 NAME >+ >+manage_plugins.pl - list, disable or enable plugins >+ >+=head1 SYNOPSIS >+ >+ manage_plugins.pl >+ >+Options: >+ -?|--help brief help message >+ --enable enable a plugin >+ --disable disable a plugin >+ >+=head1 OPTIONS >+ >+=over 8 >+ >+=item B<--help|-?> >+ >+Print a brief help message and exits >+ >+=item B<--enable> >+ >+Enables the plugin given as a parameter >+ >+=item B<--disable> >+ >+Disables the plugin given as a parameter >+ >+=back >+ >+=head1 DESCRIPTION >+ >+A simple script to manage plugins from the command line >+ >+=cut >-- >2.34.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 30999
: 136387