X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=lib%2FCatalyst.pm;h=8480fca3450b072bbcd3c819277b1c21f2f3af49;hp=4cf485d0e99a0685744f7dab227f139c86aef751;hb=3fb903fd7b2a932d4a124dbb3c364275b665858d;hpb=cc95842fedcac58b2dc12c6ce547e22d3170351c diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index 4cf485d..8480fca 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -1,7 +1,12 @@ package Catalyst; -use strict; -use base 'Catalyst::Component'; +# we don't need really need this, but if we load it before MRO::Compat gets +# loaded (via Moose and Class::MOP), we can avoid some nasty warnings +use Class::C3; + +use Moose; +use Class::MOP::Object (); +extends 'Catalyst::Component'; use bytes; use Catalyst::Exception; use Catalyst::Log; @@ -13,55 +18,70 @@ use Catalyst::Controller; use Devel::InnerPackage (); use File::stat; use Module::Pluggable::Object (); -use NEXT; use Text::SimpleTable (); use Path::Class::Dir (); use Path::Class::File (); use Time::HiRes qw/gettimeofday tv_interval/; use URI (); +use URI::http; +use URI::https; use Scalar::Util qw/weaken blessed/; use Tree::Simple qw/use_weak_refs/; use Tree::Simple::Visitor::FindByUID; use attributes; use utf8; -use Carp qw/croak/; +use Carp qw/croak carp/; BEGIN { require 5.008001; } -__PACKAGE__->mk_accessors( - qw/counter request response state action stack namespace stats/ -); - -attributes->import( __PACKAGE__, \&namespace, 'lvalue' ); +has stack => (is => 'rw', default => sub { [] }); +has stash => (is => 'rw', default => sub { {} }); +has state => (is => 'rw', default => 0); +has stats => (is => 'rw'); +has action => (is => 'rw'); +has counter => (is => 'rw', default => sub { {} }); +has request => (is => 'rw', default => sub { $_[0]->request_class->new({}) }, required => 1, lazy => 1); +has response => (is => 'rw', default => sub { $_[0]->response_class->new({}) }, required => 1, lazy => 1); +has namespace => (is => 'rw'); sub depth { scalar @{ shift->stack || [] }; } +sub comp { shift->component(@_) } -# Laziness++ -*comp = \&component; -*req = \&request; -*res = \&response; +sub req { + # carp "the use of req() is deprecated in favour of request()"; + my $self = shift; return $self->request(@_); +} +sub res { + # carp "the use of res() is deprecated in favour of response()"; + my $self = shift; return $self->response(@_); +} # For backwards compatibility -*finalize_output = \&finalize_body; +sub finalize_output { shift->finalize_body(@_) }; # For statistics our $COUNT = 1; our $START = time; our $RECURSION = 1000; our $DETACH = "catalyst_detach\n"; +our $GO = "catalyst_go\n"; +#I imagine that very few of these really need to be class variables. if any. +#maybe we should just make them attributes with a default? __PACKAGE__->mk_classdata($_) for qw/components arguments dispatcher engine log dispatcher_class - engine_class context_class request_class response_class setup_finished/; + engine_class context_class request_class response_class stats_class + setup_finished/; __PACKAGE__->dispatcher_class('Catalyst::Dispatcher'); __PACKAGE__->engine_class('Catalyst::Engine::CGI'); __PACKAGE__->request_class('Catalyst::Request'); __PACKAGE__->response_class('Catalyst::Response'); +__PACKAGE__->stats_class('Catalyst::Stats'); # Remember to update this in Catalyst::Runtime as well! -our $VERSION = '5.7006'; +our $VERSION = '5.8000_04'; sub import { my ( $class, @arguments ) = @_; @@ -70,11 +90,17 @@ sub import { # callers @ISA. return unless $class eq 'Catalyst'; - my $caller = caller(0); + my $caller = caller(); + return if $caller eq 'main'; + my $meta = Moose::Meta::Class->initialize($caller); + #Moose->import({ into => $caller }); #do we want to do this? unless ( $caller->isa('Catalyst') ) { - no strict 'refs'; - push @{"$caller\::ISA"}, $class, 'Catalyst::Controller'; + my @superclasses = ($meta->superclasses, $class, 'Catalyst::Controller'); + $meta->superclasses(@superclasses); + } + unless( $meta->has_method('meta') ){ + $meta->add_method(meta => sub { Moose::Meta::Class->initialize("${caller}") } ); } $caller->arguments( [@arguments] ); @@ -87,12 +113,15 @@ Catalyst - The Elegant MVC Web Application Framework =head1 SYNOPSIS +See the L distribution for comprehensive +documentation and tutorials. + # Install Catalyst::Devel for helpers and other development tools # use the helper to create a new application catalyst.pl MyApp # add models, views, controllers - script/myapp_create.pl model MyDatabase DBIC::Schema create=dynamic dbi:SQLite:/path/to/db + script/myapp_create.pl model MyDatabase DBIC::Schema create=static dbi:SQLite:/path/to/db script/myapp_create.pl view MyTemplate TT script/myapp_create.pl controller Search @@ -106,7 +135,7 @@ Catalyst - The Elegant MVC Web Application Framework ### in lib/MyApp.pm use Catalyst qw/-Debug/; # include plugins here as well - ### In lib/MyApp/Controller/Root.pm (autocreated) + ### In lib/MyApp/Controller/Root.pm (autocreated) sub foo : Global { # called for /foo, /foo/1, /foo/1/2, etc. my ( $self, $c, @args ) = @_; # args are qw/1 2/ for /foo/1/2 $c->stash->{template} = 'foo.tt'; # set the template @@ -235,6 +264,17 @@ MYAPP_WEB_HOME. If both variables are set, the MYAPP_HOME one will be used. Specifies log level. +=head2 -Stats + +Enables statistics collection and reporting. You can also force this setting +from the system environment with CATALYST_STATS or _STATS. The +environment settings override the application, with _STATS having the +highest priority. + +e.g. + + use Catalyst qw/-Stats=1/ + =head1 METHODS =head2 INFORMATION ABOUT THE CURRENT REQUEST @@ -294,7 +334,7 @@ your code like this: =cut -sub forward { my $c = shift; $c->dispatcher->forward( $c, @_ ) } +sub forward { my $c = shift; no warnings 'recursion'; $c->dispatcher->forward( $c, @_ ) } =head2 $c->detach( $action [, \@arguments ] ) @@ -311,6 +351,40 @@ When called with no arguments it escapes the processing chain entirely. sub detach { my $c = shift; $c->dispatcher->detach( $c, @_ ) } +=head2 $c->visit( $action [, \@arguments ] ) + +=head2 $c->visit( $class, $method, [, \@arguments ] ) + +Almost the same as C, but does a full dispatch, instead of just +calling the new C<$action> / C<$class-E$method>. This means that C, +C and the method you go to are called, just like a new request. + +C<$c-Estash> is kept unchanged. + +In effect, C allows you to "wrap" another action, just as it +would have been called by dispatching from a URL, while the analogous +C allows you to transfer control to another action as if it had +been reached directly from a URL. + +=cut + +sub visit { my $c = shift; $c->dispatcher->visit( $c, @_ ) } + +=head2 $c->go( $action [, \@arguments ] ) + +=head2 $c->go( $class, $method, [, \@arguments ] ) + +Almost the same as C, but does a full dispatch like C, +instead of just calling the new C<$action> / +C<$class-E$method>. This means that C, C and the +method you visit are called, just like a new request. + +C<$c-Estash> is kept unchanged. + +=cut + +sub go { my $c = shift; $c->dispatcher->go( $c, @_ ) } + =head2 $c->response =head2 $c->res @@ -336,17 +410,21 @@ Catalyst). =cut -sub stash { +around stash => sub { + my $orig = shift; my $c = shift; + my $stash = $orig->($c); if (@_) { - my $stash = @_ > 1 ? {@_} : $_[0]; - croak('stash takes a hash or hashref') unless ref $stash; - foreach my $key ( keys %$stash ) { - $c->{stash}->{$key} = $stash->{$key}; + my $new_stash = @_ > 1 ? {@_} : $_[0]; + croak('stash takes a hash or hashref') unless ref $new_stash; + foreach my $key ( keys %$new_stash ) { + $stash->{$key} = $new_stash->{$key}; } } - return $c->{stash}; -} + + return $stash; +}; + =head2 $c->error @@ -356,7 +434,7 @@ sub stash { Returns an arrayref containing error messages. If Catalyst encounters an error while processing a request, it stores the error in $c->error. This -method should not be used to store non-fatal error messages. +method should only be used to store fatal error messages. my @error = @{ $c->error }; @@ -398,87 +476,66 @@ sub clear_errors { $c->error(0); } +# search components given a name and some prefixes +sub _comp_search_prefixes { + my ( $c, $name, @prefixes ) = @_; + my $appclass = ref $c || $c; + my $filter = "^${appclass}::(" . join( '|', @prefixes ) . ')::'; -# search via regex -sub _comp_search { - my ( $c, @names ) = @_; + # map the original component name to the sub part that we will search against + my %eligible = map { my $n = $_; $n =~ s{^$appclass\::[^:]+::}{}; $_ => $n; } + grep { /$filter/ } keys %{ $c->components }; - foreach my $name (@names) { - foreach my $component ( keys %{ $c->components } ) { - return $c->components->{$component} if $component =~ /$name/i; - } - } + # undef for a name will return all + return keys %eligible if !defined $name; - return undef; -} + my $query = ref $name ? $name : qr/^$name$/i; + my @result = grep { $eligible{$_} =~ m{$query} } keys %eligible; -# try explicit component names -sub _comp_explicit { - my ( $c, @names ) = @_; + return map { $c->components->{ $_ } } @result if @result; - foreach my $try (@names) { - return $c->components->{$try} if ( exists $c->components->{$try} ); - } + # if we were given a regexp to search against, we're done. + return if ref $name; - return undef; -} - -# like component, but try just these prefixes before regex searching, -# and do not try to return "sort keys %{ $c->components }" -sub _comp_prefixes { - my ( $c, $name, @prefixes ) = @_; + # regexp fallback + $query = qr/$name/i; + @result = map { $c->components->{ $_ } } grep { $eligible{ $_ } =~ m{$query} } keys %eligible; - my $appclass = ref $c || $c; + # no results? try against full names + if( !@result ) { + @result = map { $c->components->{ $_ } } grep { m{$query} } keys %eligible; + } - my @names = map { "${appclass}::${_}::${name}" } @prefixes; + # don't warn if we didn't find any results, it just might not exist + if( @result ) { + $c->log->warn( qq(Found results for "${name}" using regexp fallback.) ); + $c->log->warn( 'Relying on the regexp fallback behavior for component resolution is unreliable and unsafe.' ); + $c->log->warn( 'If you really want to search, pass in a regexp as the argument.' ); + } - my $comp = $c->_comp_explicit(@names); - return $comp if defined($comp); - $comp = $c->_comp_search($name); - return $comp; + return @result; } # Find possible names for a prefix - sub _comp_names { my ( $c, @prefixes ) = @_; - my $appclass = ref $c || $c; - my @pre = map { "${appclass}::${_}::" } @prefixes; - - my @names; - - COMPONENT: foreach my $comp ($c->component) { - foreach my $p (@pre) { - if ($comp =~ s/^$p//) { - push(@names, $comp); - next COMPONENT; - } - } - } + my $filter = "^${appclass}::(" . join( '|', @prefixes ) . ')::'; + my @names = map { s{$filter}{}; $_; } $c->_comp_search_prefixes( undef, @prefixes ); return @names; } -# Return a component if only one matches. -sub _comp_singular { - my ( $c, @prefixes ) = @_; - - my $appclass = ref $c || $c; - - my ( $comp, $rest ) = - map { $c->_comp_search("^${appclass}::${_}::") } @prefixes; - return $comp unless $rest; -} - # Filter a component before returning by calling ACCEPT_CONTEXT if available sub _filter_component { my ( $c, $comp, @args ) = @_; + if ( eval { $comp->can('ACCEPT_CONTEXT'); } ) { return $comp->ACCEPT_CONTEXT( $c, @args ); } - else { return $comp } + + return $comp; } =head2 COMPONENT ACCESSORS @@ -492,13 +549,23 @@ Gets a L instance by name. If the name is omitted, will return the controller for the dispatched action. +If you want to search for controllers, pass in a regexp as the argument. + + # find all controllers that start with Foo + my @foo_controllers = $c->controller(qr{^Foo}); + + =cut sub controller { my ( $c, $name, @args ) = @_; - return $c->_filter_component( $c->_comp_prefixes( $name, qw/Controller C/ ), - @args ) - if ($name); + + if( $name ) { + my @result = $c->_comp_search_prefixes( $name, qw/Controller C/ ); + return map { $c->_filter_component( $_, @args ) } @result if ref $name; + return $c->_filter_component( $result[ 0 ], @args ); + } + return $c->component( $c->action->class ); } @@ -508,40 +575,50 @@ Gets a L instance by name. $c->model('Foo')->do_stuff; +Any extra arguments are directly passed to ACCEPT_CONTEXT. + If the name is omitted, it will look for - - a model object in $c->stash{current_model_instance}, then + - a model object in $c->stash->{current_model_instance}, then - a model name in $c->stash->{current_model}, then - a config setting 'default_model', or - check if there is only one model, and return it if that's the case. +If you want to search for models, pass in a regexp as the argument. + + # find all models that start with Foo + my @foo_models = $c->model(qr{^Foo}); + =cut sub model { my ( $c, $name, @args ) = @_; - return $c->_filter_component( $c->_comp_prefixes( $name, qw/Model M/ ), - @args ) - if $name; + + if( $name ) { + my @result = $c->_comp_search_prefixes( $name, qw/Model M/ ); + return map { $c->_filter_component( $_, @args ) } @result if ref $name; + return $c->_filter_component( $result[ 0 ], @args ); + } + if (ref $c) { return $c->stash->{current_model_instance} if $c->stash->{current_model_instance}; return $c->model( $c->stash->{current_model} ) if $c->stash->{current_model}; - return $c->model( $c->config->{default_model} ) - if $c->config->{default_model}; } - return $c->_filter_component( $c->_comp_singular(qw/Model M/), @args ); + return $c->model( $c->config->{default_model} ) + if $c->config->{default_model}; -} + my( $comp, $rest ) = $c->_comp_search_prefixes( undef, qw/Model M/); -=head2 $c->controllers - -Returns the available names which can be passed to $c->controller - -=cut + if( $rest ) { + $c->log->warn( 'Calling $c->model() will return a random model unless you specify one of:' ); + $c->log->warn( '* $c->config->{default_model} # the name of the default model to use' ); + $c->log->warn( '* $c->stash->{current_model} # the name of the model to use for this request' ); + $c->log->warn( '* $c->stash->{current_model_instance} # the instance of the model to use for this request' ); + $c->log->warn( 'NB: in version 5.80, the "random" behavior will not work at all.' ); + } -sub controllers { - my ( $c ) = @_; - return $c->_comp_names(qw/Controller C/); + return $c->_filter_component( $comp ); } @@ -551,28 +628,61 @@ Gets a L instance by name. $c->view('Foo')->do_stuff; +Any extra arguments are directly passed to ACCEPT_CONTEXT. + If the name is omitted, it will look for - - a view object in $c->stash{current_view_instance}, then + - a view object in $c->stash->{current_view_instance}, then - a view name in $c->stash->{current_view}, then - a config setting 'default_view', or - check if there is only one view, and return it if that's the case. +If you want to search for views, pass in a regexp as the argument. + + # find all views that start with Foo + my @foo_views = $c->view(qr{^Foo}); + =cut sub view { my ( $c, $name, @args ) = @_; - return $c->_filter_component( $c->_comp_prefixes( $name, qw/View V/ ), - @args ) - if $name; + + if( $name ) { + my @result = $c->_comp_search_prefixes( $name, qw/View V/ ); + return map { $c->_filter_component( $_, @args ) } @result if ref $name; + return $c->_filter_component( $result[ 0 ], @args ); + } + if (ref $c) { return $c->stash->{current_view_instance} if $c->stash->{current_view_instance}; return $c->view( $c->stash->{current_view} ) if $c->stash->{current_view}; - return $c->view( $c->config->{default_view} ) - if $c->config->{default_view}; } - return $c->_filter_component( $c->_comp_singular(qw/View V/) ); + return $c->view( $c->config->{default_view} ) + if $c->config->{default_view}; + + my( $comp, $rest ) = $c->_comp_search_prefixes( undef, qw/View V/); + + if( $rest ) { + $c->log->warn( 'Calling $c->view() will return a random view unless you specify one of:' ); + $c->log->warn( '* $c->config->{default_view} # the name of the default view to use' ); + $c->log->warn( '* $c->stash->{current_view} # the name of the view to use for this request' ); + $c->log->warn( '* $c->stash->{current_view_instance} # the instance of the view to use for this request' ); + $c->log->warn( 'NB: in version 5.80, the "random" behavior will not work at all.' ); + } + + return $c->_filter_component( $comp ); +} + +=head2 $c->controllers + +Returns the available names which can be passed to $c->controller + +=cut + +sub controllers { + my ( $c ) = @_; + return $c->_comp_names(qw/Controller C/); } =head2 $c->models @@ -607,35 +717,52 @@ unless you want to get a specific component by full class. C<< $c->controller >>, C<< $c->model >>, and C<< $c->view >> should be used instead. +If C<$name> is a regexp, a list of components matched against the full +component name will be returned. + =cut sub component { - my $c = shift; + my ( $c, $name, @args ) = @_; - if (@_) { + if( $name ) { + my $comps = $c->components; - my $name = shift; + if( !ref $name ) { + # is it the exact name? + return $c->_filter_component( $comps->{ $name }, @args ) + if exists $comps->{ $name }; - my $appclass = ref $c || $c; + # perhaps we just omitted "MyApp"? + my $composed = ( ref $c || $c ) . "::${name}"; + return $c->_filter_component( $comps->{ $composed }, @args ) + if exists $comps->{ $composed }; - my @names = ( - $name, "${appclass}::${name}", - map { "${appclass}::${_}::${name}" } - qw/Model M Controller C View V/ - ); + # search all of the models, views and controllers + my( $comp ) = $c->_comp_search_prefixes( $name, qw/Model M Controller C View V/ ); + return $c->_filter_component( $comp, @args ) if $comp; + } + + # This is here so $c->comp( '::M::' ) works + my $query = ref $name ? $name : qr{$name}i; - my $comp = $c->_comp_explicit(@names); - return $c->_filter_component( $comp, @_ ) if defined($comp); + my @result = grep { m{$query} } keys %{ $c->components }; + return map { $c->_filter_component( $_, @args ) } @result if ref $name; + + if( $result[ 0 ] ) { + $c->log->warn( qq(Found results for "${name}" using regexp fallback.) ); + $c->log->warn( 'Relying on the regexp fallback behavior for component resolution' ); + $c->log->warn( 'is unreliable and unsafe. You have been warned' ); + return $c->_filter_component( $result[ 0 ], @args ); + } - $comp = $c->_comp_search($name); - return $c->_filter_component( $comp, @_ ) if defined($comp); + # I would expect to return an empty list here, but that breaks back-compat } + # fallback return sort keys %{ $c->components }; } - - =head2 CLASS DATA AND HELPER CLASSES =head2 $c->config @@ -654,14 +781,15 @@ L. =cut -sub config { +around config => sub { + my $orig = shift; my $c = shift; $c->log->warn("Setting config after setup has been run is not a good idea.") if ( @_ and $c->setup_finished ); - $c->NEXT::config(@_); -} + $c->$orig(@_); +}; =head2 $c->log @@ -767,7 +895,6 @@ Catalyst> line. sub setup { my ( $class, @arguments ) = @_; - $class->log->warn("Running setup twice is not a good idea.") if ( $class->setup_finished ); @@ -804,6 +931,7 @@ sub setup { $class->setup_plugins( delete $flags->{plugins} ); $class->setup_dispatcher( delete $flags->{dispatcher} ); $class->setup_engine( delete $flags->{engine} ); + $class->setup_stats( delete $flags->{stats} ); for my $flag ( sort keys %{$flags} ) { @@ -875,7 +1003,9 @@ EOF } # Add our self to components, since we are also a component - $class->components->{$class} = $class; + if( $class->isa('Catalyst::Controller') ){ + $class->components->{$class} = $class; + } $class->setup_actions; @@ -888,30 +1018,35 @@ EOF $class->setup_finished(1); } +=head2 $c->uri_for( $action, \@captures?, @args?, \%query_values? ) + =head2 $c->uri_for( $path, @args?, \%query_values? ) -Merges path with C<< $c->request->base >> for absolute URIs and with -C<< $c->namespace >> for relative URIs, then returns a normalized L -object. If any args are passed, they are added at the end of the path. -If the last argument to C is a hash reference, it is assumed to -contain GET parameter key/value pairs, which will be appended to the URI -in standard fashion. +=over + +=item $action + +A Catalyst::Action object representing the Catalyst action you want to +create a URI for. To get one for an action in the current controller, +use C<< $c->action('someactionname') >>. To get one from different +controller, fetch the controller using C<< $c->controller() >>, then +call C on it. + +You can maintain the arguments captured by an action (e.g.: Regex, Chained) +using C<< $c->req->captures >>. + + # For the current action + $c->uri_for($c->action, $c->req->captures); + + # For the Foo action in the Bar controller + $c->uri_for($c->controller->('Bar')->action_for('Foo'), $c->req->captures); -Instead of C<$path>, you can also optionally pass a C<$action> object -which will be resolved to a path using -C<< $c->dispatcher->uri_for_action >>; if the first element of -C<@args> is an arrayref it is treated as a list of captures to be passed -to C. +=back =cut sub uri_for { my ( $c, $path, @args ) = @_; - my $base = $c->request->base->clone; - my $basepath = $base->path; - $basepath =~ s/\/$//; - $basepath .= '/'; - my $namespace = $c->namespace || ''; if ( Scalar::Util::blessed($path) ) { # action object my $captures = ( scalar @args && ref $args[0] eq 'ARRAY' @@ -922,32 +1057,53 @@ sub uri_for { $path = '/' if $path eq ''; } - # massage namespace, empty if absolute path - $namespace =~ s/^\/// if $namespace; - $namespace .= '/' if $namespace; - $path ||= ''; - $namespace = '' if $path =~ /^\//; - $path =~ s/^\///; - $path =~ s/\?/%3F/g; + undef($path) if (defined $path && $path eq ''); my $params = ( scalar @args && ref $args[$#args] eq 'HASH' ? pop @args : {} ); - for my $value ( values %$params ) { - next unless defined $value; - for ( ref $value eq 'ARRAY' ? @$value : $value ) { - $_ = "$_"; - utf8::encode( $_ ); + carp "uri_for called with undef argument" if grep { ! defined $_ } @args; + s/([^$URI::uric])/$URI::Escape::escapes{$1}/go for @args; + + unshift(@args, $path); + + unless (defined $path && $path =~ s!^/!!) { # in-place strip + my $namespace = $c->namespace; + if (defined $path) { # cheesy hack to handle path '../foo' + $namespace =~ s{(?:^|/)[^/]+$}{} while $args[0] =~ s{^\.\./}{}; } - }; + unshift(@args, $namespace || ''); + } # join args with '/', or a blank string - my $args = ( scalar @args ? '/' . join( '/', map {s/\?/%3F/g; $_} @args ) : '' ); - $args =~ s/^\/// unless $path; - my $res = - URI->new_abs( URI->new_abs( "$path$args", "$basepath$namespace" ), $base ) - ->canonical; - $res->query_form(%$params); + my $args = join('/', grep { defined($_) } @args); + $args =~ s/\?/%3F/g; # STUPID STUPID SPECIAL CASE + $args =~ s!^/+!!; + my $base = $c->req->base; + my $class = ref($base); + $base =~ s{(?{$_}; + s/([;\/?:@&=+,\$\[\]%])/$URI::Escape::escapes{$1}/go; + s/ /+/g; + my $key = $_; + $val = '' unless defined $val; + (map { + $_ = "$_"; + utf8::encode( $_ ) if utf8::is_utf8($_); + # using the URI::Escape pattern here so utf8 chars survive + s/([^A-Za-z0-9\-_.!~*'() ])/$URI::Escape::escapes{$1}/go; + s/ /+/g; + "${key}=$_"; } ( ref $val eq 'ARRAY' ? @$val : $val )); + } @keys); + } + + my $res = bless(\"${base}${args}${query}", $class); $res; } @@ -968,8 +1124,8 @@ sub welcome_message { "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - - + + $name on Catalyst $VERSION