Changeset 16349


Ignore:
Timestamp:
2007/10/09 17:33:55 (16 years ago)
Author:
nanasess
Message:

DocumentRoot? に依存しないよう修正

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/feature-module-update/data/class/pages/LC_Page.php

    r16134 r16349  
    186186     *                         SITE_URL を使用する場合 false, 
    187187     *                         デフォルト "escape" 現在のスキーマを使用 
    188      * @param string $documentRoot DocumentRoot の文字列. 指定しない場合は, 
    189      *                              $_SERVER['DOCUMENT_ROOT'] が付与される. 
    190188     * @return string $path の存在する http(s):// から始まる絶対パス 
    191189     * @see Net_URL 
    192190     */ 
    193     function getLocation($path, $param = array(), $useSSL = "escape", $documentRoot = "") { 
    194  
    195         // TODO $_SERVER['DOCUMENT_ROOT'] をインストーラでチェックする. 
    196         if (empty($documentRoot)) { 
    197             $documentRoot = $_SERVER['DOCUMENT_ROOT']; 
    198  
    199             if (empty($documentRoot)) { 
    200                 die("[BUG] can't get DOCUMENT_ROOT"); 
    201             } 
    202         } 
     191    function getLocation($path, $param = array(), $useSSL = "escape") { 
    203192 
    204193        // $path が / で始まっている場合 
     
    216205        } 
    217206 
    218         // DocumentRoot を削除した文字列を取得. 
    219         $root = str_replace($documentRoot, "", $realPath); 
    220         // 先頭の / を削除 
    221         $root = substr_replace($root, "", 0, 1); 
     207        // HTML_PATH を削除した文字列を取得. 
     208        $root = str_replace(HTML_PATH, "", $realPath); 
    222209 
    223210        // スキーマを定義 
Note: See TracChangeset for help on using the changeset viewer.