Development

Changeset 6173

You must first sign up to be able to contribute.

Changeset 6173

Show
Ignore:
Timestamp:
11/27/07 07:20:23 (1 year ago)
Author:
fabien
Message:

deprecated sfAction::getRequestMethods() and sfAction::getDefaultView() methods

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lib/action/sfAction.class.php

    r5813 r6173  
    278278  public function getDefaultView() 
    279279  { 
     280    if (!sfConfig::get('sf_compat_10')) 
     281    { 
     282      throw new sfConfigurationException('You must set "compat_10" to true if you want to use this method which is deprecated.'); 
     283    } 
     284 
    280285    return sfView::INPUT; 
    281286  } 
     
    297302  public function getRequestMethods() 
    298303  { 
     304    if (!sfConfig::get('sf_compat_10')) 
     305    { 
     306      throw new sfConfigurationException('You must set "compat_10" to true if you want to use this method which is deprecated.'); 
     307    } 
     308 
    299309    return sfRequest::GET 
    300310           | sfRequest::POST 
  • trunk/lib/filter/sfExecutionFilter.class.php

    r5814 r6173  
    3535    $actionInstance = $this->context->getController()->getActionStack()->getLastEntry()->getActionInstance(); 
    3636 
    37     // execute the action 
     37    // execute the action, execute and render the view 
    3838    if (sfConfig::get('sf_debug') && sfConfig::get('sf_logging_enabled')) 
    3939    { 
    4040      $timer = sfTimerManager::getTimer(sprintf('Action "%s/%s"', $actionInstance->getModuleName(), $actionInstance->getActionName())); 
    41     } 
    4241 
    43     $viewName = $this->handleAction($filterChain, $actionInstance); 
     42      $viewName = $this->handleAction($filterChain, $actionInstance); 
    4443 
    45     if (sfConfig::get('sf_debug') && sfConfig::get('sf_logging_enabled')) 
    46     { 
     44      $timer->addTime(); 
     45      $timer = sfTimerManager::getTimer(sprintf('View "%s" for "%s/%s"', $viewName, $actionInstance->getModuleName(), $actionInstance->getActionName())); 
     46 
     47      $this->handleView($filterChain, $actionInstance, $viewName); 
     48 
    4749      $timer->addTime(); 
    4850    } 
    49  
    50     // execute and render the view 
    51     if (sfConfig::get('sf_debug') && sfConfig::get('sf_logging_enabled')) 
     51    else 
    5252    { 
    53       $timer = sfTimerManager::getTimer(sprintf('View "%s" for "%s/%s"', $viewName, $actionInstance->getModuleName(), $actionInstance->getActionName())); 
    54     } 
    55  
    56     $this->handleView($filterChain, $actionInstance, $viewName); 
    57  
    58     if (sfConfig::get('sf_debug') && sfConfig::get('sf_logging_enabled')) 
    59     { 
    60       $timer->addTime(); 
     53      $viewName = $this->handleAction($filterChain, $actionInstance); 
     54      $this->handleView($filterChain, $actionInstance, $viewName); 
    6155    } 
    6256  } 
     
    7670      // action in cache, so go to the view 
    7771      return sfView::SUCCESS; 
    78     } 
    79  
    80     // get the request method 
    81     $method = $this->context->getRequest()->getMethod(); 
    82     if (($actionInstance->getRequestMethods() & $method) != $method) 
    83     { 
    84       // this action will skip execution for this method 
    85       // get the default view 
    86       return $actionInstance->getDefaultView(); 
    8772    } 
    8873