Changeset 22271
- Timestamp:
- 09/23/09 08:42:26 (4 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
components/templating/trunk/lib/sfTemplateHelperAssets.php
r22269 r22271 93 93 * Gets the base URL. 94 94 * 95 * @param string $path The path 96 * 95 97 * @return string The base URL 96 98 */ 97 99 public function getBaseURL($path) 98 100 { 99 if (!$this->baseURLs) 101 $count = count($this->baseURLs); 102 103 if (0 === $count) 100 104 { 101 105 return ''; 102 106 } 103 elseif (1 == count($this->baseURLs)) 107 108 if (1 === $count) 104 109 { 105 110 return $this->baseURLs[0]; 106 111 } 107 else 108 { 109 return $this->baseURLs[fmod(hexdec(substr(md5($path), 0, 10)), count($this->baseURLs))]; 110 } 112 113 return $this->baseURLs[fmod(hexdec(substr(md5($path), 0, 10)), $count)]; 114 111 115 } 112 116