Changeset 8009
- Timestamp:
- 03/20/08 23:01:55 (9 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.1/lib/view/sfViewCacheManager.class.php
r7976 r8009 59 59 // cache instance 60 60 $this->cache = $cache; 61 61 62 62 // routing instance 63 63 $this->routing = $context->getRouting(); … … 118 118 return call_user_func($callable, $internalUri, $hostName, $vary); 119 119 } 120 120 121 121 if (strpos($internalUri, '@') === 0 && strpos($internalUri, '@sf_cache_partial') === false) 122 122 { 123 123 throw new sfException('A cache key cannot be generated for an internal URI using the @rule syntax'); 124 124 } 125 125 126 126 $cacheKey = ''; 127 127 128 128 if ($this->isContextual($internalUri)) 129 129 { … … 151 151 $cacheKey .= $this->convertParametersToKey($params); 152 152 } 153 153 154 154 // prefix with vary headers 155 155 if (!$vary) … … 191 191 return $cacheKey; 192 192 } 193 193 194 194 /** 195 195 * Transforms an associative array of parameters from an URI into a unique key … … 211 211 ksort($params); 212 212 $cacheKey = sprintf('%s/%s', $module, $action); 213 foreach ($params as $key => $value) 213 foreach ($params as $key => $value) 214 214 { 215 215 $cacheKey .= sprintf('/%s/%s', $key, $value); 216 216 } 217 217 218 218 return $cacheKey; 219 219 } 220 220 221 221 /** 222 222 * Adds a cache to the manager. … … 229 229 { 230 230 // 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 } 234 237 } 235 238 … … 482 485 $this->dispatcher->notify(new sfEvent($this, 'application.log', array(sprintf('Remove cache for "%s"', $internalUri)))); 483 486 } 484 487 485 488 $cacheKey = $this->generateCacheKey($internalUri, $hostName, $vary, $contextualPrefix); 486 489 487 490 if(strpos($cacheKey, '*')) 488 491 {