Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.8.0
-
Fix Version/s: 1.9.3
-
Component/s: Zend_Reflection
-
Labels:None
Description
When I run zf.sh to add a new action to an existing controller, I saw it added extra new line characters to my existing methods. Trying to figure out how to solve it, I saw the cause was in Zend_Reflection_Method::getBody().
Making a call to file(), returns a array with a line (included "\n") for each index. So, in the getBody() return statment, the implode ("\n", $lines) adds an extra "\n" character. I solve it in local replacing:
file($this->getDeclaringClass()->getFileName())
for
file($this->getDeclaringClass()->getFileName(), FILE_IGNORE_NEW_LINES)
Now it works fine for me.
I'm running zf 1.8.0 and Zend Core under Kubuntu 9.04
Assigning to Ralph to triage.