[wellwell-devel] [wellwell/zoom] Add plugin_search_component function to WellWell::Core.

Stefan Hornburg wellwell-devel at rt.icdevgroup.org
Sun Oct 24 19:50:43 UTC 2010


commit f8e4d13f29603de76ba80738ed97801d6d12c284
Author: Stefan Hornburg (Racke) <racke at linuxia.de>
Date:   Sun Oct 24 21:27:36 2010 +0200

    Add plugin_search_component function to WellWell::Core.

 lib/WellWell/Core.pm |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)
---
diff --git a/lib/WellWell/Core.pm b/lib/WellWell/Core.pm
index 920cc2e..908e2e3 100644
--- a/lib/WellWell/Core.pm
+++ b/lib/WellWell/Core.pm
@@ -22,6 +22,12 @@ package WellWell::Core;
 use strict;
 use warnings;
 
+use vars qw/@ISA @EXPORT_OK/;
+
+require Exporter;
+our @ISA = qw(Exporter);
+our @EXPORT_OK = qw/plugin_search_component/;
+
 use Vend::Config;
 
 use WellWell::Cart;
@@ -79,6 +85,20 @@ sub plugin_scan_sub {
 				 "$plref->{$plugin}->{directory}/pages");
 		}
 	}
+
+	# store in catalog configuration
+	$Vend::Cfg->{PluginRepository} = $plref;
+}
+
+sub plugin_search_component {
+	my ($name) = @_;
+	my ($plugin, $ref);
+	
+	while (($plugin, $ref) = each %{$Vend::Cfg->{PluginRepository}}) {
+		if (-f "$ref->{directory}/components/$name") {
+			return $ref;
+		}
+	}
 }
 
 sub hooks {



More information about the wellwell-devel mailing list