Hi,
I work on an open source project and wrote a small domain oriented
component to manage contexts.

I realized that this component can be included in symfony2 kernel and
may contribute to improve it.
So I pushed it on github and submit you the code, in hope it can help.
Git repository is here :
https://github.com/apieum/Context

What is it ?
The base class manages :
 - informations about context :
     * the subject (what ?)
     * the environment (where ?)
     * the moment (when ? or while ...)
 - descriptions that consists in contextual properties.
 - context identity depending on properties

This class is extended with behaviours management.
Behaviours helps to define how to call a function or method and how to
create an object within context.

Finally, a small template class is provided to replace vars in
strings, objects properties or array elements by context properties
(descriptions).

How integrate it in kernel ?
Kernel already uses contexts but in a different manner.
 - the subject can be either :
     * the name of kernel (property $name)
     * the current application
 - the environment is already used as is
 - moment refers to mode debug (while debugging) and can be extended
to "when we are in production", "while testing"...
 - Bundles can be descriptions of the context.

Why ?
It can help to share kernel properties without directly use kernel
object.
It separates responsibilities in a domain oriented manner.

Hope it helps.
As it's my first message here, I would thanks all for your great job,
regards,
Gregory







-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en

Reply via email to