okay after giving it some rest and thinking about it some more, i think
i've come up with a solution that adds *no overhead at all*
The principle is this: in app/config/core.php or in bootstrap.php the
user could put something like this:
$extensions = array('DAuth','CoolCake'));
This means cake knows there will/should exist app/extensions/d_auth and
app/extensions/cool_cake directories.
If this variable is empty, an empty array or non existing then cake
knows there are no extensions.
Now we create the convention that every class inside an extension has
to be named like this:
<extensionname><name of controller>Controller.
For example CoolCakeUsersController extends AppController if your
extension is called CoolCake.
there is offcourse the risk that the user might have a
CoolCakeUsersController in hir normal app, but i consider it the
responsability of the programmer of the app and of the extensions to
choose decent names for their classes.
So with a little php code cake can check whether the requested class
starts
with the name of an extension, *and* has a name after that, so it can
be sure about the directory in which, and the file that it has to open.
It doesn't have to *search* in directories. So actually this is even
more performant than specifying additional directories with
$controllerPaths and the likes.
The only potential problem is having twice the same name for a class,
but that problem would be the same when you just "merge in" code into
your app. It's the responsability of the 3rd party distributor to
choose pretty unique names. (and extensions will usually have a pretty
unique name anyway, since they are in fact some library that is able to
perform a special function -> a good name can be choosen)
the mechanism i explained would ofcourse also i apply to
models,components,helpers,...
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Cake PHP" 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/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---