| | 182 | * Returns the published path of a file path. |
| | 183 | * This method does not perform any publishing. It merely tells you |
| | 184 | * if the file path is published, where it will go. |
| | 185 | * @param string directory or file path being published |
| | 186 | * @return string the published file path |
| | 187 | */ |
| | 188 | public function getPublishedPath($path) |
| | 189 | { |
| | 190 | $path=realpath($path); |
| | 191 | if(is_file($path)) |
| | 192 | return $this->_basePath.'/'.$this->hash(dirname($path)).'/'.basename($path); |
| | 193 | else |
| | 194 | return $this->_basePath.'/'.$this->hash($path); |
| | 195 | } |
| | 196 | |
| | 197 | /** |
| | 198 | * Returns the URL of a published file path. |
| | 199 | * This method does not perform any publishing. It merely tells you |
| | 200 | * if the file path is published, what the URL will be to access it. |
| | 201 | * @param string directory or file path being published |
| | 202 | * @return string the published URL for the file path |
| | 203 | */ |
| | 204 | public function getPublishedUrl($path) |
| | 205 | { |
| | 206 | $path=realpath($path); |
| | 207 | if(is_file($path)) |
| | 208 | return $this->_baseUrl.'/'.$this->hash(dirname($path)).'/'.basename($path); |
| | 209 | else |
| | 210 | return $this->_baseUrl.'/'.$this->hash($path); |
| | 211 | } |
| | 212 | |
| | 213 | /** |