Changeset 17569 for branches/comu-ver2/data/class/pages/LC_Page.php
- Timestamp:
- 2008/08/28 10:33:23 (18 years ago)
- File:
-
- 1 edited
-
branches/comu-ver2/data/class/pages/LC_Page.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/comu-ver2/data/class/pages/LC_Page.php
r17453 r17569 216 216 */ 217 217 function getLocation($path, $param = array(), $useSSL = "escape") { 218 219 // $path が / で始まっている場合 220 if (substr($path, 0, 1) == "/") { 221 $realPath = realpath(HTML_PATH . substr_replace($path, "", 0, strlen(URL_DIR))); 222 // 相対パスの場合 223 } else { 224 $realPath = realpath($path); 225 } 226 227 // FIXME OS依存の処理は別クラスに分ける? 228 // Windowsの場合は, ディレクトリの区切り文字を\から/に変換する 229 if (substr(PHP_OS, 0, 3) == 'WIN') { 230 $realPath = str_replace("\\", "/", $realPath); 231 $htmlPath = str_replace("\\", "/", HTML_PATH); 232 $rootPath = str_replace($htmlPath, "", $realPath); 233 } else { 234 // HTML_PATH を削除した文字列を取得. 235 $rootPath = str_replace(HTML_PATH, "", $realPath); 236 } 237 218 $rootPath = $this->getRootPath($path); 238 219 239 220 // スキーマを定義 … … 261 242 } 262 243 244 function getRootPath($path) { 245 // $path が / で始まっている場合 246 if (substr($path, 0, 1) == "/") { 247 $realPath = realpath(HTML_PATH . substr_replace($path, "", 0, strlen(URL_DIR))); 248 // 相対パスの場合 249 } else { 250 $realPath = realpath($path); 251 } 252 253 // HTML_PATH を削除した文字列を取得. 254 // FIXME OS依存の処理は別クラスに分ける? 255 // Windowsの場合は, ディレクトリの区切り文字を\から/に変換する 256 if (substr(PHP_OS, 0, 3) == 'WIN') { 257 $realPath = str_replace("\\", "/", $realPath); 258 $htmlPath = str_replace("\\", "/", HTML_PATH); 259 $rootPath = str_replace($htmlPath, "", $realPath); 260 } else { 261 $htmlPath = rtrim(HTML_PATH, "/"); 262 $rootPath = str_replace($htmlPath, "", $realPath); 263 $rootPath = ltrim($rootPath, "/"); 264 } 265 266 return $rootPath; 267 } 268 263 269 /** 264 270 * ページをリロードする.
Note: See TracChangeset
for help on using the changeset viewer.
