reflection and function parameters
Posted: Thu Nov 29, 2007 10:48 pm
I am trying to figure out if it's possible to use reflection to automate securing of parameters before sending to mysql_query...
I want to add something like the above to each and every mysql function in an application BUT I need to re-assign the parameters the mysql_escape_real_string value so their safe to pass to query.
I can't think of a way to accomplish this, so short of telling myself it's impossible, I figured I would throw this out there and see what ya'all might be ale to hack togather. No extensions please.
Code: Select all
$method = new ReflectionMethod(__CLASS__, __FUNCTION__);
foreach(new MyIterator($method->getParameters()) as $key => $variable){
$tmp_name = $variable->getName();
eval("${tmp_name} = 10;");
}I can't think of a way to accomplish this, so short of telling myself it's impossible, I figured I would throw this out there and see what ya'all might be ale to hack togather. No extensions please.