On 17 Aug 2004 at 13:13, Simon Cozens wrote:
> David R. Baird:
> > - my $config = $calling_class->config;
> > + my %inherited_config = %{ $calling_class->config };
> > + my $config = \%inherited_config;
> > + $calling_class->config($config);
> > $config->{model} ||= "Maypole::Model::CDBI";
>
> I think what I'm missing is that this is precisely what
> Class::Data::Inheritable is meant to do. And I have no problems running about
> five or six different Maypole apps on the same server anyway.
You've set the config slot to store a ref, so when you change things
stored in the config hashref, Class::Data::Inheritable doesn't see
the change and therefore doesn't set a 'local' version of config in
the current package. Using the ref short-circuits the inheritance
mechanism. This patch retrieves the ref, converts it to a different
ref, and sends that back to Class::Data::Inheritable, which can now
see the change (even though the underlying data hasn't changed) and
implements its inheritance magic.
Are your apps on the same website? When I try to run multiple Maypole
apps on the same virtual host, I get the config of the last app
overwriting the previous ones. I don't know if that would happen if
the apps were running in different virtual hosts, I haven't tried
that yet.
d.
-- Dr. David R. Baird Riverside Content Management Systems dave at riverside-cms.co.uk http://www.riverside-cms.co.uk_______________________________________________ maypole-dev mailing list maypole-dev at lists.netthink.co.uk http://lists.netthink.co.uk/listinfo/maypole-dev
This archive was generated by hypermail 2.1.3 : Thu Feb 24 2005 - 22:25:56 GMT