Bugzilla – Attachment 103389 Details for
Bug 25222
Add ability to let plugins live in individual subdirectories
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25222: Add ability to let plugins live in individual subdirectories
Bug-25222-Add-ability-to-let-plugins-live-in-indiv.patch (text/plain), 2.84 KB, created by
Josef Moravec
on 2020-04-21 15:42:18 UTC
(
hide
)
Description:
Bug 25222: Add ability to let plugins live in individual subdirectories
Filename:
MIME Type:
Creator:
Josef Moravec
Created:
2020-04-21 15:42:18 UTC
Size:
2.84 KB
patch
obsolete
>From e750b7d862c113a68fa4d416356d6bf569f961a2 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Mon, 20 Apr 2020 14:21:18 -0400 >Subject: [PATCH] Bug 25222: Add ability to let plugins live in individual > subdirectories > >From Tomas: "We really need to put each plugin in its own subdirectory >(to identify them individually) and have a metadata file we can refer >to." > >This would make things much more manageable. Right now, plugins get all >mixed together in the plugins directory. For example, installing the >kitchen sink plugin results in >Koha/Plugin/Com/ByWaterSolutions/KitchenSink.pm being created in the >plugins directory. Installing CoverFlow will create CoverFlow.pm in the >same directory as KitchenSink.pm. > >There is no reason that plugins cannot be created to install in a >subdirectory directly in the kpz file. In that case, the plugins >directory would contain something like >kitchen-sink/Koha/Plugin/Com/ByWaterSolutions/KitchenSink.pm, while >CoverFlow would live in >coverflow/Koha/Plugin/Com/ByWaterSolutions/CoverFlow.pm. > >Test Plan: >1) Apply this patch >2) Restart all the things! >3) Download the Kitchen Sink plugin >4) Rename it from kzp to zip >5) Unzip the plugin >6) Create a new directory kitchen-sink >7) move the Koha directory from the plugin into kitchen-sink >8) Zip the new kitchen-sink directory, include that directory in the zip file >9) Change the file suffix from zip to kpz >10) Install the plugin in Koha >11) The plugin should load! > >Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com> > >Signed-off-by: Josef Moravec <josef.moravec@gmail.com> >--- > Koha/Plugins.pm | 10 +++++++++- > cpanfile | 1 + > 2 files changed, 10 insertions(+), 1 deletion(-) > >diff --git a/Koha/Plugins.pm b/Koha/Plugins.pm >index 9dc42c5155..52d0e70d64 100644 >--- a/Koha/Plugins.pm >+++ b/Koha/Plugins.pm >@@ -20,6 +20,7 @@ package Koha::Plugins; > use Modern::Perl; > > use Class::Inspector; >+use File::Find::Rule; > use List::MoreUtils qw(any); > use Module::Load::Conditional qw(can_load); > use Module::Load qw(load); >@@ -32,7 +33,14 @@ use Koha::Plugins::Methods; > BEGIN { > my $pluginsdir = C4::Context->config("pluginsdir"); > my @pluginsdir = ref($pluginsdir) eq 'ARRAY' ? @$pluginsdir : $pluginsdir; >- push( @INC, @pluginsdir ); >+ foreach my $dir ( @pluginsdir ) { >+ my @dirs = File::Find::Rule->new >+ ->maxdepth(1) >+ ->directory >+ ->in($dir); >+ >+ push( @INC, @dirs ); >+ } > pop @INC if $INC[-1] eq '.'; > } > >diff --git a/cpanfile b/cpanfile >index f7d69c3f84..3067a1d11e 100644 >--- a/cpanfile >+++ b/cpanfile >@@ -39,6 +39,7 @@ requires 'Email::Date', '1.103'; > requires 'Email::MessageID', '1.406'; > requires 'Email::Valid', '0.190'; > requires 'Exception::Class', '1.38'; >+requires 'File::Find::Rule', '1.34'; > requires 'File::Slurp', '9999.13'; > requires 'Font::TTF', '0.45'; > requires 'GD', '2.39'; >-- >2.11.0
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 25222
:
103311
|
103317
| 103389 |
103495
|
103496