Ich habe gerade mal mit Reflection rumgespielt. Die Namen der Methoden und Properties bekomme ich, aber nichts über die Parameter der Methoden.
$ref=new Reflectionclass('IPSModule');
echo $ref->__toString();
//bzw:
echo "Methods:
";
$meths=$ref->getMethods();
//var_dump($meths);
foreach($meths as $m) {
$n =$m->getName();
echo "$n:
";
var_dump($m);
print "Comment:".$m->getDocComment()."
";
print "Parameters:".$m->getNumberOfParameters()."
";
$pars=$m->getParameters();
var_dump($pars);
}
echo "Constants:
";
$cons=$ref->getConstants();
var_dump($cons);
Class [ class IPSModule ] {
- Static properties [0] {
}
- Properties [1] {
Property [ protected $InstanceID ]
}
- Methods [45] {
Method [ public method __construct ] {
}
Method [ public method Create ] {
}
Method [ public method Destroy ] {
}
Method [ protected method GetIDForIdent ] {
}
Method [ protected method RegisterPropertyBoolean ] {
}
Method [ protected method RegisterPropertyInteger ] {
}
Method [ protected method RegisterPropertyFloat ] {
}
Method [ protected method RegisterPropertyString ] {
}
Method [ protected method RegisterTimer ] {
}
Method [ protected method SetTimerInterval ] {
}
Method [ protected method RegisterScript ] {
}
Method [ protected method RegisterVariableBoolean ] {
}
Method [ protected method RegisterVariableInteger ] {
}
Method [ protected method RegisterVariableFloat ] {
}
…
Constructor Params:
array(0) {
}
Properties:
Property [ protected $InstanceID ]
Methods:
__construct:
object(ReflectionMethod)#4 (2) {
[„name“]=>
string(11) „__construct“
[„class“]=>
string(9) „IPSModule“
}
Comment:
Parameters:0
array(0) {
}
Create:
object(ReflectionMethod)#5 (2) {
[„name“]=>
string(6) „Create“
[„class“]=>
string(9) „IPSModule“
}
Comment:
Parameters:0
array(0) {
}
Destroy:
object(ReflectionMethod)#6 (2) {
[„name“]=>
string(7) „Destroy“
[„class“]=>
string(9) „IPSModule“
}
Comment:
Parameters:0
array(0) {
}
GetIDForIdent:
object(ReflectionMethod)#7 (2) {
[„name“]=>
string(13) „GetIDForIdent“
[„class“]=>
string(9) „IPSModule“
}
Comment:
Parameters:0
array(0) {
}
RegisterPropertyBoolean:
object(ReflectionMethod)#8 (2) {
[„name“]=>
string(23) „RegisterPropertyBoolean“
[„class“]=>
string(9) „IPSModule“
}
…
Tommi