ZF-6544: duplicated new lines characters when calling Zend_Reflection_Method::getBody()
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
Comments
Posted by Matthew Weier O'Phinney (matthew) on 2009-05-05T12:22:48.000+0000
Assigning to Ralph to triage.
Posted by Ryan Schmidt (ryandesign) on 2009-08-19T03:11:12.000+0000
Can you please fix this? I am just starting to use Zend Framework (1.9.1) and ran into this issue (on Mac OS X 10.4.11 Intel with PHP 5.3.0). It seems straightforward enough to fix.
Posted by Ralph Schindler (ralph) on 2009-08-19T07:09:48.000+0000
Updated to "Major" priority, "Should Have" for "Next Mini Release".
Posted by Carlton Gibson (carlton) on 2009-09-17T06:42:10.000+0000
Fix merged to release branch in r18165