- Timestamp:
- 05/14/08 11:46:55 (5 years ago)
- Location:
- dan/perl/closxop
- Files:
-
- 2 modified
-
lib/Closxop.pm (modified) (4 diffs)
-
plugins/Closxop/Plugin/Echo.pm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
dan/perl/closxop/lib/Closxop.pm
r11557 r11559 6 6 7 7 use CGI; 8 use YAML; 8 9 use Path::Class; 9 10 use Class::Component; 11 12 use Closxop::Stash; 13 use Closxop::Config; 10 14 11 15 __PACKAGE__->mk_accessors( qw/config plugins stash/ ); … … 27 31 my $config = shift; 28 32 29 $self->stash( {});33 $self->stash(Closxop::Stash->new); 30 34 $self->setup_config($config); 31 35 $self->setup_plugins; 32 36 33 $self->stash-> {cgi}= CGI->new;34 $self->stash-> {config} = $self->config->{global};37 $self->stash->cgi = CGI->new; 38 $self->stash->config = $self->config->global; 35 39 36 40 $self; … … 52 56 53 57 $config->{global} ||= {}; 54 58 $config = Closxop::Config->new($config); 55 59 $self->config($config); 56 60 … … 60 64 sub setup_plugins { 61 65 my $self = shift; 62 my $path = sprintf "%s/%s/Plugin", $self->config-> {global}->{plugin_dir}, ref $self;66 my $path = sprintf "%s/%s/Plugin", $self->config->global->plugin_dir, ref $self; 63 67 64 $self->{plugins} = []; 65 68 $self->plugins([]); 66 69 if ( -d $path && -r _ ) { 67 unshift @INC, $self->config-> {global}->{plugin_dir};70 unshift @INC, $self->config->global->plugin_dir; 68 71 69 72 $self->{plugin_dir} = Path::Class::Dir->new($path); 70 $self->find_plugin($self->{plugin_dir})->load_plugins(@{$self-> {plugins}});73 $self->find_plugin($self->{plugin_dir})->load_plugins(@{$self->plugins}); 71 74 72 75 shift @INC; -
dan/perl/closxop/plugins/Closxop/Plugin/Echo.pm
r11557 r11559 9 9 my $self = shift; 10 10 my $context = shift; 11 warn $context->stash->cgi; 11 12 } 12 13
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)