Development

Changeset 19791

You must first sign up to be able to contribute.

Changeset 19791

Show
Ignore:
Timestamp:
07/01/09 16:29:39 (5 years ago)
Author:
fabien
Message:

[lime] fixed find_caller() method

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • tools/lime/trunk/lib/lime.php

    r19724 r19791  
    505505  protected function find_caller($traces) 
    506506  { 
     507    // find the first call to a method of an object that is an instance of lime_test 
     508    $t = array_reverse($traces); 
     509    foreach ($t as $trace) 
     510    { 
     511      if (isset($trace['object']) && $trace['object'] instanceof lime_test) 
     512      { 
     513        return array($trace['file'], $trace['line']); 
     514      } 
     515    } 
     516 
     517    // return the first call 
    507518    $last = count($traces) - 1; 
    508  
    509519    return array($traces[$last]['file'], $traces[$last]['line']); 
    510520  }