* code for task#1541.

This commit is contained in:
zhujinyong
2013-07-13 08:43:57 +00:00
parent 9fe0ea4e19
commit 01eb11cb76
5 changed files with 49 additions and 11 deletions
+11
View File
@@ -21,11 +21,22 @@ class apiModel extends model
$method = new ReflectionMethod($className . $ext, $methodName);
$data = new stdClass();
$data->startLine = $method->getStartLine();
$data->endLine = $method->getEndLine();
$data->comment = $method->getDocComment();
$data->parameters = $method->getParameters();
$data->className = $className;
$data->methodName = $methodName;
$data->fileName = $fileName;
$data->post = false;
$file = file($fileName);
for($i = $data->startLine - 1; $i <= $data->endLine; $i++)
{
if(strpos($file[$i], '$this->post') or strpos($file[$i], 'fixer::input') or strpos($file[$i], '$_POST'))
{
$data->post = true;
}
}
return $data;
}
}