This is a tricky one.
I am "emulating" ZF Bootstrapping (surface appearance). Don't ask me why, call it academic interest. So I have a Bootstrap Abstract with a method "run" that iterates over itself to locate any methods prefixed with "init".
The application looks for a user defined class which extends this class, in which the user can define any number of methods in this way. However, I want to prevent the user from being able to execute the "run" command of it's parent class, while still exposing the same command for the client code.
[edit] for clarity
class Bootstrap_Abstract{
protected final function run(){
// if method exists that starts 'init' - execute the method
}
}
class Bootstrap extends Bootstrap_Abstract(){
public function initSomething(){
//do something
}
//PREVENT THIS
public function initRun(){
$this->run();
}
}
//application code, not exposed to user - changes in behaviour require changes in this code directly
class Application(){
$Bootstrap = new Bootstrap();//load user bootstrap
$Bootstrap->run();
}
[/edit]
Anyone got any thoughts/advice/guidance? regards
SWK