[FLOW3-general] Object Instance specific configuration/resources
Remco Overdijk
remco at maxserv.nl
Mon Nov 30 13:11:37 CET 2009
Hello!
First of all, great work on FLOW3. We're really excited about the features
it packs. We're now in the process of converting an application we were
developing to use FLOW3 as its base. A lot of features we used to
implement by hand are incorporated in the framework, so it should cut down
our development time and speed up the application while running.
So far things are going pretty well converting and running the software,
but there's one pretty big issue we're having. I'll try to explain the
issue using the Blog example that's used in the FLOW3 tutorial, as it
generally matches the circumstances we're under.
So, in the tutorial you've created a Blog, and refer to them using the
BlogRepository. So far so good, we're doing the same thing with our own
application.. we have a global website where users can register, and upon
registering a new 'Blog' instance is being created and added to the
Repository. We generate a new vhost for the new 'Blog' instance and route
the subdomain in the vhost to the correct Instance. This works.
What we're trying to achieve now is that we can 'autowire' resources and
PHP classes for each individual instance. E.G: for the Blog instance named
'myBlog' we have an overridden Post object that contains an alternate
method to render posts. So generally you'd create a Post Interface, refer
to the Interface while injecting Post objects, and specify a specific
implementation in the Objects.yaml. However, this sets the implementation
on all Blog objects instead of a particular one.
The same goes for resources being included, like a custom CSS file, or a
logo.jpg, but of course those aren't processed by the framework but
delivered to the browser instead. We can cheat this by writing an
.htaccess that checks for resources in an (instance specific)
subdirectory, and if it doesn't exist there just serve the 'base' resource
instead. However, it would be tidier (and most probably a lot faster) if
the framework would check for such changes, and would render the changes
inside the templates for example (or maybe physically update the local
resource).
Is there any way (now or in the future) that the framework could account
for such things? It seems to me that a lot of people could benefit from
such a feature, because fair is fair.. not every Blog instance is
identical. It could be really beneficial to be able to do custom settings
(using Settings.yaml for example), and have tailormade features for a
specific object instance. Maybe it's there already but I'm just
overlooking it (we've only worked with FLOW3 for about a week now).
Thanks in advance for any light you can shed on the situation!
Kind regards,
Remco Overdijk
Senior Software Engineer
MaxServ B.V. Netherlands
More information about the FLOW3-general
mailing list