using spl_autoload_register to load classes that extends to another class

Posted by Fred Gustavo on Stack Overflow See other posts from Stack Overflow or by Fred Gustavo
Published on 2013-07-02T03:29:33Z Indexed on 2013/07/02 5:05 UTC
Read the original article Hit count: 204

Filed under:

Well, i got this oop:

abstract class TestSystemUtils {

abstract public function __run();
/* utils funcs */

}

class TestSystem extends TestSystemUtils {
protected $body;
protected $out;
function __construct() { }
public function __run() { } 
}

I got a directory with many modules, each module is a class that extends TestSystem but i don't want to include all them modules then in method __run i make a dbconnection get these modules that will be used, but in this point idk the right way to 'include' these files i can use __autoload func but idk if i should call these classes inside the class TestSystem or not, all modules need to use these two variables 'body' and 'out' ... Well what's the right way to do it? someone could help me please.

Module classes look like:

class mod01 extends TestSystem { }

thanks.

© Stack Overflow or respective owner

Related posts about php