Development

#3529: patch.diff

You must first sign up to be able to contribute.

Ticket #3529: patch.diff

File patch.diff, 0.9 kB (added by w.piekutowski, 7 months ago)

Improve checking if debug mode is enabled and exceptions usage

  • lib/sfPropelFinder.php

    old new  
    7373  public function getLatestQuery() 
    7474  { 
    7575    $con = Propel::getConnection(); 
    76     if(method_exists($con, 'getLastExecutedQuery')
     76    if (SF_DEBUG === TRUE
    7777    { 
    7878      return $this->latestQuery; 
    7979    } 
    8080    else 
    8181    { 
    82       throw new Exception('getLatestQuery() only works when debug mode is enabled'); 
     82      throw new RuntimeException('sfPropelFinder#getLatestQuery() only works when debug mode is enabled'); 
    8383    } 
    8484  } 
    8585   
    8686  public function updateLatestQuery() 
    8787  { 
    8888    $con = Propel::getConnection(); 
    89     if(method_exists($con, 'getLastExecutedQuery')
     89    if (SF_DEBUG === TRUE
    9090    { 
    9191      $this->latestQuery = $con->getLastExecutedQuery(); 
    9292    }