Zend Framework

duplicated new lines characters when calling Zend_Reflection_Method::getBody()

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Major 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

Activity

Hide
Matthew Weier O'Phinney added a comment -

Assigning to Ralph to triage.

Show
Matthew Weier O'Phinney added a comment - Assigning to Ralph to triage.
Hide
Ryan Schmidt added a comment -

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.

Show
Ryan Schmidt added a comment - 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.
Hide
Ralph Schindler added a comment -

Updated to "Major" priority, "Should Have" for "Next Mini Release".

Show
Ralph Schindler added a comment - Updated to "Major" priority, "Should Have" for "Next Mini Release".
Hide
Carlton Gibson added a comment -

Fix merged to release branch in r18165

Show
Carlton Gibson added a comment - Fix merged to release branch in r18165

People

Vote (1)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved:

Time Tracking

Estimated:
1h
Original Estimate - 1 hour
Remaining:
1h
Remaining Estimate - 1 hour
Logged:
Not Specified
Time Spent - Not Specified