i'm rewriting my problem correctly : i have some files and i want in my project one file controle all this files , and then i include only this file in the index and after using the functions of class every function has here self file and codes
<?php
interface Kernel_files_func {
public function cfg_Adm_kernel();
public function cfg_aspect();
public function cfg_class($class);
public function cfg_files();
public function cfg_function();
public function cfg_mysql($db,$host,$user,$PsUser,$t);
}
final class kernel implements Kernel_files_func{
public function cfg_Adm_kernel(){
include_once("cfg_Adm_kernel.php");
#return new c();
}
public function cfg_aspect(){
include_once("cfg_Adm_kernel.php");
}
public function cfg_class($class){
include_once("cfg_class.php");
return new $class();
}
public function cfg_files(){
include_once("cfg_files.php");
}
public function cfg_function(){
include_once ("cfg_function.php");
}
public function cfg_mysql($db,$host,$user,$PsUser,$t){
include_once("cfg_mysql.php");
$this->DBS = new DBmSQL($db,$host,$user,$PsUser,$t);
return $this->DBS;
}
public function new_table($type,$name,$array){
$this->DBS->create($type,$name,$array);
}
}
?>
now in the other file like cfg_class.php
<?PHP
class Home {
function test(){
echo "Seccesse";
}
}
class membership {
}
//....
?>
Now in my index.php :
<?PHP
include ("cfg_system.php");
$system = new kernel();
$system->cfg_class("Home")->test();
// after this i can call the other class of cfg_class.php without
// using $system->cfg_class("class name")->func name();
?>
i want my kernel class controle all the codes , i want to make only my kernel class can open my class and ... i know i just have to use the $system->cfg_class... without using it like $test = new .... ; but i want to make my kernel class like a real kernel for my project ....