svnno****@sourc*****
svnno****@sourc*****
2009年 4月 4日 (土) 17:15:20 JST
Revision: 23 http://svn.sourceforge.jp/view?root=frameworkspider&view=rev&rev=23 Author: m_nakashima Date: 2009-04-04 17:15:20 +0900 (Sat, 04 Apr 2009) Log Message: ----------- ユーザーディレクトリ下で利用した時にドキュメントルートを自動判定できなかった問題の修正 Modified Paths: -------------- current/WWW_PUBLIC/spider.inc.php -------------- next part -------------- Modified: current/WWW_PUBLIC/spider.inc.php =================================================================== --- current/WWW_PUBLIC/spider.inc.php 2009-04-04 05:26:58 UTC (rev 22) +++ current/WWW_PUBLIC/spider.inc.php 2009-04-04 08:15:20 UTC (rev 23) @@ -26,7 +26,7 @@ $request_protocol = $_SERVER['SERVER_PROTOCOL']; $request_port = $_SERVER['SERVER_PORT']; $request_server_name = $_SERVER['SERVER_NAME']; -$request_url = $_SERVER['REQUEST_URI']; +$request_uri = $_SERVER['REQUEST_URI']; $document_root = $_SERVER['DOCUMENT_ROOT']; $is_ssl = false; if( isset($_SERVER['HTTPS']) && preg_match('/[oO][fF][fF]/', $_SERVER['HTTPS'] ) == 0 ) { @@ -35,8 +35,7 @@ if( isset($SPIDER_DEFINE_BASE_URI) && strlen($SPIDER_DEFINE_BASE_URI) > 0 ) { $spider_base_uri = $SPIDER_DEFINE_BASE_URI; } else { - $spider_inc_path = str_replace( "\\", "/", __FILE__ ); - $spider_base_uri = dirname(str_replace( $document_root, "", $spider_inc_path )); + $spider_base_uri = dirname($request_uri); } if( !preg_match('/\\/$/', $spider_base_uri ) ) { $spider_base_uri .= '/'; @@ -50,10 +49,7 @@ if ( $request_port != 80 && $request_port != 443 ) { $target_port = ":" . $request_port; } -$app_base_url = $prtcl . $request_server_name . $target_port . $spider_base_uri; -if ( preg_match( '/\\/$/', $app_base_url ) ) { - $app_base_url = substr( $app_base_url, 0, strlen( $app_base_url ) - 1 ); -} +$app_base_url = $prtcl . $request_server_name . $target_port . $spider_base_uri; $app_nomal_url = "http://" . $request_server_name . $target_port . $spider_base_uri; $app_ssl_url = "https://" . $request_server_name . $target_port . $spider_base_uri;