Bu sefer, gerçekten garip bir sorunla karşı karşıyayım. Ben aşağıdaki kodu var:
$xml = simplexml_load_file($this->interception_file);
foreach($xml->children() as $class) {
$path = str_replace('__CLASS_DIR__',CLASS_DIR,$class['path']);
if(!is_file($path)) {
throw new Exception('Bad configuration: file '.$path.' not found');
}
$className = pathinfo($path,PATHINFO_FILENAME);
foreach($class as $method) {
$method_name = $method['name'];
$obj = new $className();
var_dump(in_array($method_name,get_class_methods($className)));exit;
echo $obj->$method_name();### not a method ???
}
}
As you can see, I get the class name and method name from an XML file. I can create an instance of the class without any problem. The var_dump at the end returns true, that means $method_name (which has 2 optional parameters) is a method of $className.
ANCAK, ve ben çalıştığınızda sözdizimi, doğru olduğundan eminim: $ obj-> $ Method_Name () alıyorum:
Fatal error: Yöntem adı bir dize olmalıdır
If you have any ideas, pleaaaaase tell me :) Thanks in advance, Rolf