On 4/9/10 6:10 PM, Iain Duncan wrote:
> Hmm, now I don't know which method to use though. Perhaps a good
> addition to that page would be  some brief insight on when one would use
> the global site manager vs the current site manager. I'm not clear
> whether I should tell bfg to use the global site manager and use that in
> the cousin code, or have the cousin code get the current one. Is there a
> reason not to use the global site manager for the bfg app? It seems
> cleaner than having my repoze.who plugin have to import from repoze.bfg,
> I think??? :-/

My standard answer about sharing registries: if your middleware requires ZCA 
access to the same ZCA registry (or any other configuration that doesn't come 
in the environ) as your application does to work, it is not middleware and 
probably shouldn't be written *as* middleware or a plugin to existing 

My standard answer about using the ZCA in a repoze.who plugin: don't, or at 
least think hard about not doing that.  r.who plugins aren't themselves meant 
to be plugged in to.  Plugins-in-plugins is a horrible model for 

All that said: if you insist.. pass in the result of getGlobalSiteManager() as 
the "registry" argument to the Configurator.  You won't be able to run more 
than one BFG app per process when you do this, but you can be certain that your 
BFG app will be using the same registry as code elsewhere that uses the global 

- C
Repoze-dev mailing list

Reply via email to