Changeset 6652

Show
Ignore:
Timestamp:
09/11/08 22:10:50 (4 months ago)
Author:
daybreaker
Message:

refs #1085

  • setup.php가 IIS를 인식하고 이에 맞게 진행하도록 함
  • IIS7 전용 RewriteModule에 대한 한글 URL workaround 제거하고 공식적으로는 Isapi Rewrite Filter만 지원함.
Location:
trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/rewrite.php

    r6644 r6652  
    1010    } 
    1111    if (!empty($_SERVER['PRELOAD_CONFIG']) && file_exists('config.php')) require_once ROOT."/config.php"; 
    12     // IIS 7.0 and URL Rewrite Module CTP 
    13     if (isset($_SERVER['HTTP_X_ORIGINAL_URL'])) 
    14         $_SERVER['REQUEST_URI'] = @iconv('cp949', 'utf-8', $_SERVER['HTTP_X_ORIGINAL_URL']); 
    15     // IIS 5.x/6.0 and Ionics ISAPI Rewrite Filter 
    16     if (isset($_SERVER['HTTP_X_REWRITE_URL'])) 
     12    // IIS 7.0 and URL Rewrite Module CTP, but non-ASCII URLs are NOT supported. 
     13    if (isset($_SERVER['HTTP_X_ORIGINAL_URL'])) { 
     14        $_SERVER['REQUEST_URI'] = $_SERVER['HTTP_X_ORIGINAL_URL']; 
     15    } // IIS 5.x/6.0/7.0 and Ionics ISAPI Rewrite Filter 
     16    else if (isset($_SERVER['HTTP_X_REWRITE_URL'])) { 
    1717        $_SERVER['REQUEST_URI'] = urldecode($_SERVER['HTTP_X_REWRITE_URL']); 
     18    } 
    1819    /* Retrieve Access Parameter Information. */ 
    1920    $accessInfo = array( 
  • trunk/setup.php

    r6623 r6652  
    382382                } 
    383383            } 
    384             if (!empty($_POST['checked'])) 
     384            if (!empty($_POST['checked']) && $_POST['checked'] == 'yes') 
    385385                return true; 
    386386        } 
     
    773773        if ($step == 33) { 
    774774            $error = 16; 
     775            if (checkIIS()) { 
     776?> 
     777    <h3><?php echo _t('IIS Rewrite Module');?></h3> 
     778    <ul style="color:red"> 
     779        <li><?php echo _t('현재 IIS에서의 설치는 실험적으로만 지원하고 있으며 별도의 Rewrite 모듈을 사용해야 합니다.').' '._t('만약 이 페이지를 보고 계시다면 Apache mod_rewrite와 호환되지 않는 모듈을 사용 중이거나 아예 모듈이 없는 경우입니다.'); ?></li> 
     780        <li><?php echo _t('텍스트큐브와 호환되는 IIS용 Rewrite 모듈을 설치하려면, 오픈스소 무료 모듈을 제공하고 있는 <a href="http://www.codeplex.com/IIRF" target="_blank">Ionics Isapi Rewrite Filter 홈페이지</a>를 방문하십시오.'); ?></li> 
     781        <li><?php echo _t('여기서 계속 진행하여 설치를 완료한 후, 생성된 <b>.htaccess</b> 파일의 내용을 위 모듈의 설정파일(<b>IsapiRewrite4.ini</b>)에 복사하시기 바랍니다.'); ?></li> 
     782        <input type="hidden" name="rewriteIIS" value="yes" /> 
     783    </ul> 
     784<?php 
     785                $error = 0; 
     786            } else { 
    775787?> 
    776788    <h3><?php echo _t('Apache Rewrite Engine');?></h3> 
     
    802814    </ul> 
    803815<?php 
     816            } 
    804817        } 
    805818?> 
     
    810823  </div> 
    811824  </div> 
    812   <input type="hidden" name="checked" value="<?php echo ($error ? '' : 'checked');?>" /> 
     825  <input type="hidden" name="checked" value="<?php echo ($error > 0 ? 'no' : 'yes');?>" /> 
    813826<?php 
    814827    } 
     
    819832        } 
    820833        // mod_rewrite routine. 
    821         if(empty($_POST['disableRewrite'])) { 
     834        if(empty($_POST['disableRewrite']) && empty($_POST['rewriteIIS'])) { 
    822835            $filename = $root . '/.htaccess'; 
    823836            $fp = fopen($filename, 'w+'); 
     
    847860            } 
    848861            @unlink($filename); 
     862        } else if (!empty($_POST['rewriteIIS'])) { 
     863            $rewrite = -1; 
    849864        } else { 
    850865            $rewrite = 0; 
     
    867882    <table class="inputs"> 
    868883<?php 
    869         if ($rewrite >= 1) { 
     884        if ($rewrite != 0) { 
    870885?> 
    871886      <tr> 
     
    881896            } 
    882897?> 
    883         <label for="type2"><input type="radio" id="type2" name="type" value="path"<?php echo ($rewrite == 1 ? ' checked="checked"' : '');?> onclick="show('typePath');" /> 
     898        <label for="type2"><input type="radio" id="type2" name="type" value="path"<?php echo (($rewrite == 1 || $rewrite == -1) ? ' checked="checked"' : '');?> onclick="show('typePath');" /> 
    884899        <?php echo _t('하위 경로(Path)로 블로그 식별');?></label></td> 
    885900      </tr> 
     
    16111626            $fp = fopen($filename, 'w+'); 
    16121627         
    1613         $htaccessContent =  
     1628        if (checkIIS()) { 
     1629            // Users must copy these rules to IsapiRewrite4.ini 
     1630            $htaccessContent =  
     1631"RewriteCond %{REQUEST_FILENAME} -f 
     1632RewriteRule ^$path/(cache)+/+(.+[^/])\.(cache|xml|txt|log)$ - [NC,F,L,U] 
     1633RewriteCond %{REQUEST_FILENAME} -d 
     1634RewriteRule ^$path/([^?]+[^/])$ $path/$1/ [L,U] 
     1635RewriteCond %{REQUEST_FILENAME} !-f 
     1636RewriteRule ^$path/(thumbnail)/([0-9]+/.+)$ $path/cache/$1/$2 [L,U] 
     1637RewriteCond %{QUERY_STRING} ^$ 
     1638RewriteRule ^$path/(.*)$ $path/rewrite.php [L,U] 
     1639RewriteRule ^$path/(.*)$ $path/rewrite.php?%{QUERY_STRING} [L,U] 
     1640"; 
     1641        } else { 
     1642            $htaccessContent =  
    16141643"#<IfModule mod_url.c> 
    16151644#CheckURL Off 
     
    16181647RewriteEngine On 
    16191648RewriteBase $path/ 
    1620 RewriteRule ^(thumbnail)/([0-9]+/.+)$ cache/$1/$2 [L] 
    16211649RewriteCond %{REQUEST_FILENAME} -f 
    16221650RewriteRule ^(cache)+/+(.+[^/])\.(cache|xml|txt|log)$ - [NC,F,L] 
     
    16241652RewriteRule ^(.+[^/])$ $1/ [L] 
    16251653RewriteCond %{REQUEST_FILENAME} !-f 
     1654RewriteRule ^(thumbnail)/([0-9]+/.+)$ cache/$1/$2 [L] 
    16261655RewriteRule ^(.*)$ rewrite.php [L,QSA] 
    16271656"; 
     1657        } 
    16281658 
    16291659            if ($fp) { 
     
    16601690      </ul> 
    16611691      <p> 
     1692        <?php if (checkIIS()) echo _t('<b>IIS Rewrtie Filter 설정</b>을 해주십시오.<br />'); ?> 
    16621693        <?php echo _t('텍스트큐브 관리 툴로 로그인 하신 후 필요사항을 수정해 주십시오.');?><br /> 
    16631694        <?php echo _t('텍스트큐브를 이용해 주셔서 감사합니다.');?> 
     
    18971928        return testMyself_socket($host,$path,$port); 
    18981929    } 
     1930    return false; 
     1931} 
     1932 
     1933function checkIIS() { 
     1934    if (strpos($_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS') !== FALSE) 
     1935        return true; 
    18991936    return false; 
    19001937}