Changeset 18103 for branches/comu-ver2/data
- Timestamp:
- 2009/06/15 13:41:35 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/comu-ver2/data/class/pages/LC_Page.php
r18018 r18103 243 243 } 244 244 245 /** 246 * EC-CUBE のWEBルート(/html/)を / としたパスを返す 247 * 248 * @param string $path 結果を取得するためのパス 249 * @return string EC-CUBE のWEBルート(/html/)を / としたパス 250 */ 245 251 function getRootPath($path) { 252 // Windowsの場合は, ディレクトリの区切り文字を\から/に変換する 253 $path = str_replace('\\', '/', $path); 254 $htmlPath = str_replace('\\', '/', HTML_PATH); 255 246 256 // $path が / で始まっている場合 247 if (substr($path, 0, 1) == "/") {248 $realPath = realpath( HTML_PATH . substr_replace($path, "", 0, strlen(URL_DIR)));257 if (substr($path, 0, 1) == '/') { 258 $realPath = realpath($htmlPath . substr_replace($path, '', 0, strlen(URL_DIR))); 249 259 // 相対パスの場合 250 260 } else { 251 261 $realPath = realpath($path); 252 262 } 253 263 $realPath = str_replace('\\', '/', $realPath); 264 265 // $path が / で終わっている場合、realpath によって削られた末尾の / を復元する。 266 if (substr($path, -1, 1) == '/' && substr($realPath, -1, 1) != '/') { 267 $realPath .= '/'; 268 } 269 254 270 // HTML_PATH を削除した文字列を取得. 255 // Windowsの場合は, ディレクトリの区切り文字を\から/に変換する 256 $realPath = str_replace("\\", "/", $realPath); 257 $htmlPath = str_replace("\\", "/", HTML_PATH); 258 259 $htmlPath = rtrim($htmlPath, "/"); 260 $rootPath = str_replace($htmlPath, "", $realPath); 261 $rootPath = ltrim($rootPath, "/"); 262 271 $rootPath = str_replace($htmlPath, '', $realPath); 272 $rootPath = ltrim($rootPath, '/'); 273 263 274 return $rootPath; 264 275 }
Note: See TracChangeset
for help on using the changeset viewer.