Lines 187-195
method or metadata value.
Link Here
|
187 |
The method and metadata parameters are optional. |
187 |
The method and metadata parameters are optional. |
188 |
If you pass multiple keys in the metadata hash, all keys must match. |
188 |
If you pass multiple keys in the metadata hash, all keys must match. |
189 |
|
189 |
|
190 |
If you pass errors (only used in plugins-home), we return two arrayrefs: |
190 |
If called in scalar context, a different data structure is returned: |
191 |
|
191 |
|
192 |
( $good, $bad ) = Koha::Plugins::GetPlugins( { errors => 1 } ); |
192 |
my $plugins = Koha::Plugins::GetPlugins({ |
|
|
193 |
method => 'some_method', |
194 |
metadata => { some_key => 'some_value' }, |
195 |
[ all => 1, errors => 1, verbose => 1 ], |
196 |
}); |
197 |
|
198 |
where I<$plugins> looks like: |
199 |
|
200 |
{ |
201 |
good => [ plugin_1, ... ], |
202 |
bad => [ { error => 1, name => 'PluginClass1 }, ... ] |
203 |
} |
204 |
|
205 |
The B<bad> part of the response will only get returned If you pass I<errors>. |
193 |
|
206 |
|
194 |
If you pass verbose, you can enable or disable explicitly warnings |
207 |
If you pass verbose, you can enable or disable explicitly warnings |
195 |
from Module::Load::Conditional. Disabled by default to not flood |
208 |
from Module::Load::Conditional. Disabled by default to not flood |
Lines 255-261
sub GetPlugins {
Link Here
|
255 |
} |
268 |
} |
256 |
} |
269 |
} |
257 |
|
270 |
|
258 |
return $errors ? ( \@plugins, \@failing ) : @plugins; |
271 |
return wantarray ? @plugins : { good => \@plugins, bad => \@failing }; |
259 |
} |
272 |
} |
260 |
|
273 |
|
261 |
=head2 InstallPlugins |
274 |
=head2 InstallPlugins |