Development

Changeset 8009

You must first sign up to be able to contribute.

Changeset 8009

Show
Ignore:
Timestamp:
03/20/08 23:01:55 (9 months ago)
Author:
dwhittle
Message:

1.1: fixed potential php notice (closes #3168)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.1/lib/view/sfViewCacheManager.class.php

    r7976 r8009  
    5959    // cache instance 
    6060    $this->cache = $cache; 
    61      
     61 
    6262    // routing instance 
    6363    $this->routing = $context->getRouting(); 
     
    118118      return call_user_func($callable, $internalUri, $hostName, $vary); 
    119119    } 
    120      
     120 
    121121    if (strpos($internalUri, '@') === 0 && strpos($internalUri, '@sf_cache_partial') === false) 
    122122    { 
    123123      throw new sfException('A cache key cannot be generated for an internal URI using the @rule syntax'); 
    124124    } 
    125      
     125 
    126126    $cacheKey = ''; 
    127      
     127 
    128128    if ($this->isContextual($internalUri)) 
    129129    { 
     
    151151      $cacheKey .= $this->convertParametersToKey($params); 
    152152    } 
    153      
     153 
    154154    // prefix with vary headers 
    155155    if (!$vary) 
     
    191191    return $cacheKey; 
    192192  } 
    193    
     193 
    194194  /** 
    195195   * Transforms an associative array of parameters from an URI into a unique key 
     
    211211    ksort($params); 
    212212    $cacheKey = sprintf('%s/%s', $module, $action); 
    213     foreach ($params as $key => $value)  
     213    foreach ($params as $key => $value) 
    214214    { 
    215215      $cacheKey .= sprintf('/%s/%s', $key, $value); 
    216216    } 
    217      
     217 
    218218    return $cacheKey; 
    219219  } 
    220    
     220 
    221221  /** 
    222222   * Adds a cache to the manager. 
     
    229229  { 
    230230    // normalize vary headers 
    231     foreach ($options['vary'] as $key => $name) 
    232     { 
    233       $options['vary'][$key] = strtr(strtolower($name), '_', '-'); 
     231    if (isset($options['vary'])) 
     232    { 
     233      foreach ($options['vary'] as $key => $name) 
     234      { 
     235        $options['vary'][$key] = strtr(strtolower($name), '_', '-'); 
     236      } 
    234237    } 
    235238 
     
    482485      $this->dispatcher->notify(new sfEvent($this, 'application.log', array(sprintf('Remove cache for "%s"', $internalUri)))); 
    483486    } 
    484      
     487 
    485488    $cacheKey = $this->generateCacheKey($internalUri, $hostName, $vary, $contextualPrefix); 
    486      
     489 
    487490    if(strpos($cacheKey, '*')) 
    488491    {