i have a thoery that will allow classes to be dynamic in the sense of libraries that are loaded:
have one class as a 'parent' class:
main.class.php:
<?php
class Open
{
/* includes basic mysql functions.... */
function Open($lib=false)
{
if($lib)
{
include("lib." . $lib . ".php");
return new $lib;
}
}
/* of course, more error checking would occur.... */
}
?>
and a library would look like this:
lib.site.php:
<?php
include("main.class.php");
class site extends Open
{
function test()
{
echo "this is the library";
}
}
?>
in case, this will work:
test.php:
<?php
include("main.class.php");
$obj = new Open("site");
/* $obj should now be a ref to site... */
$obj->test();
?>
Does anyone agree on this bit of logic of mine?