From svnnotify @ sourceforge.jp Sat Apr 4 14:26:58 2009 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Sat, 04 Apr 2009 14:26:58 +0900 Subject: [Frameworkspider-svn] spider-commit [22] release Message-ID: <1238822818.363761.25373.nullmailer@users.sourceforge.jp> Revision: 22 http://svn.sourceforge.jp/view?root=frameworkspider&view=rev&rev=22 Author: m_nakashima Date: 2009-04-04 14:26:58 +0900 (Sat, 04 Apr 2009) Log Message: ----------- release Added Paths: ----------- 1.0.0b3/ -------------- next part -------------- From svnnotify @ sourceforge.jp Sat Apr 4 17:15:20 2009 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Sat, 04 Apr 2009 17:15:20 +0900 Subject: [Frameworkspider-svn] =?utf-8?b?c3BpZGVyLWNvbW1pdCBbMjNdICDjg6Y=?= =?utf-8?b?44O844K244O844OH44Kj44Os44Kv44OI44Oq5LiL44Gn5Yip55So44GX44Gf?= =?utf-8?b?5pmC44Gr44OJ44Kt44Ol44Oh44Oz44OI44Or44O844OI44KS6Ieq5YuV5Yik?= =?utf-8?b?5a6a44Gn44GN44Gq44GL44Gj44Gf5ZWP6aGM44Gu5L+u5q2j?= Message-ID: <1238832920.341531.19509.nullmailer@users.sourceforge.jp> 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; From svnnotify @ sourceforge.jp Sat Apr 4 17:47:46 2009 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Sat, 04 Apr 2009 17:47:46 +0900 Subject: [Frameworkspider-svn] spider-commit [24] Message-ID: <1238834866.748525.26011.nullmailer@users.sourceforge.jp> Revision: 24 http://svn.sourceforge.jp/view?root=frameworkspider&view=rev&rev=24 Author: m_nakashima Date: 2009-04-04 17:47:46 +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 08:15:20 UTC (rev 23) +++ current/WWW_PUBLIC/spider.inc.php 2009-04-04 08:47:46 UTC (rev 24) @@ -32,10 +32,15 @@ if( isset($_SERVER['HTTPS']) && preg_match('/[oO][fF][fF]/', $_SERVER['HTTPS'] ) == 0 ) { $is_ssl = true; } +// ユーザーディレクトリをドキュメントルートにする +if( preg_match('/^\\/\\~[0-9a-zA-Z\\_]+\\//',$request_uri) > 0 ) { + $document_root = str_replace( str_replace( '/',DIRECTORY_SEPARATOR, $request_uri ), '', $script_filename ); +} if( isset($SPIDER_DEFINE_BASE_URI) && strlen($SPIDER_DEFINE_BASE_URI) > 0 ) { $spider_base_uri = $SPIDER_DEFINE_BASE_URI; } else { - $spider_base_uri = dirname($request_uri); + $spider_inc_path = str_replace( DIRECTORY_SEPARATOR, "/", __FILE__ ); + $spider_base_uri = dirname(str_replace( $document_root, "", $spider_inc_path )); } if( !preg_match('/\\/$/', $spider_base_uri ) ) { $spider_base_uri .= '/'; From svnnotify @ sourceforge.jp Sat Apr 4 17:59:52 2009 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Sat, 04 Apr 2009 17:59:52 +0900 Subject: [Frameworkspider-svn] spider-commit [25] Message-ID: <1238835592.855326.7274.nullmailer@users.sourceforge.jp> Revision: 25 http://svn.sourceforge.jp/view?root=frameworkspider&view=rev&rev=25 Author: m_nakashima Date: 2009-04-04 17:59:52 +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 08:47:46 UTC (rev 24) +++ current/WWW_PUBLIC/spider.inc.php 2009-04-04 08:59:52 UTC (rev 25) @@ -34,13 +34,19 @@ } // ユーザーディレクトリをドキュメントルートにする if( preg_match('/^\\/\\~[0-9a-zA-Z\\_]+\\//',$request_uri) > 0 ) { - $document_root = str_replace( str_replace( '/',DIRECTORY_SEPARATOR, $request_uri ), '', $script_filename ); + $user_request_uri = preg_replace('/^\\/\\~[^\\/]+\\//','/',$request_uri ); + $document_root = str_replace( str_replace( '/',DIRECTORY_SEPARATOR, $user_request_uri ), '', $script_filename ); } 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( DIRECTORY_SEPARATOR, "/", __FILE__ ); $spider_base_uri = dirname(str_replace( $document_root, "", $spider_inc_path )); + if( preg_match('/^\\/\\~[0-9a-zA-Z\\_]+\\//',$request_uri) > 0 ) { + // ユーザーディレクトリの場合リクエストURIの一つ目の要素をくっつける + $dirname_array = explode('/',$request_uri); + $spider_base_uri = '/'.$dirname_array[1].$spider_base_uri; + } } if( !preg_match('/\\/$/', $spider_base_uri ) ) { $spider_base_uri .= '/'; From svnnotify @ sourceforge.jp Mon Apr 6 11:12:20 2009 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Mon, 06 Apr 2009 11:12:20 +0900 Subject: [Frameworkspider-svn] =?utf-8?b?c3BpZGVyLWNvbW1pdCBbMjZdICDjg6Y=?= =?utf-8?b?44O844K244O844OH44Kj44Os44Kv44OI44Oq5LiL44Gn5Yip55So44GX44Gf?= =?utf-8?b?5pmC44Gr44OJ44Kt44Ol44Oh44Oz44OI44Or44O844OI44KS6Ieq5YuV5Yik?= =?utf-8?b?5a6a44Gn44GN44Gq44GL44Gj44Gf5ZWP6aGM44Gu5L+u5q2j?= Message-ID: <1238983940.798312.795.nullmailer@users.sourceforge.jp> Revision: 26 http://svn.sourceforge.jp/view?root=frameworkspider&view=rev&rev=26 Author: m_nakashima Date: 2009-04-06 11:12:20 +0900 (Mon, 06 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 08:59:52 UTC (rev 25) +++ current/WWW_PUBLIC/spider.inc.php 2009-04-06 02:12:20 UTC (rev 26) @@ -34,8 +34,9 @@ } // ユーザーディレクトリをドキュメントルートにする if( preg_match('/^\\/\\~[0-9a-zA-Z\\_]+\\//',$request_uri) > 0 ) { - $user_request_uri = preg_replace('/^\\/\\~[^\\/]+\\//','/',$request_uri ); - $document_root = str_replace( str_replace( '/',DIRECTORY_SEPARATOR, $user_request_uri ), '', $script_filename ); + $user_request_uri = preg_replace('/^\\/\\~[^\\/]+\\//','/',$_SERVER['PHP_SELF'] ); + $document_root = str_replace( '/',DIRECTORY_SEPARATOR, dirname($script_filename) ); + $document_root = str_replace( str_replace( '/',DIRECTORY_SEPARATOR, dirname($user_request_uri) ), '', $document_root ); } if( isset($SPIDER_DEFINE_BASE_URI) && strlen($SPIDER_DEFINE_BASE_URI) > 0 ) { $spider_base_uri = $SPIDER_DEFINE_BASE_URI; From svnnotify @ sourceforge.jp Mon Apr 6 11:42:49 2009 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Mon, 06 Apr 2009 11:42:49 +0900 Subject: [Frameworkspider-svn] spider-commit [27] Message-ID: <1238985769.700178.7576.nullmailer@users.sourceforge.jp> Revision: 27 http://svn.sourceforge.jp/view?root=frameworkspider&view=rev&rev=27 Author: m_nakashima Date: 2009-04-06 11:42:49 +0900 (Mon, 06 Apr 2009) Log Message: ----------- Modified Paths: -------------- current/README.txt -------------- next part -------------- Modified: current/README.txt =================================================================== --- current/README.txt 2009-04-06 02:12:20 UTC (rev 26) +++ current/README.txt 2009-04-06 02:42:49 UTC (rev 27) @@ -3,6 +3,10 @@ ** ** このファイルにはコミットごとに変更点とファイル名を記述します。 ** +-- 2009-04-06 +1) spider.inc.phpでユーザー公開ディレクトリに設置した場合にドキュメントルートの判別を + ホストのドキュメントルートにしていた為設置URIを正しく認識できなかった問題の修正 + -- 2009-03-31 1) .defaultファイルのタイムスタンプ比較及び存在確認がホットビルドから漏れていたので追加 DATA/lib/spider/Builder.class.php From svnnotify @ sourceforge.jp Tue Apr 7 10:25:09 2009 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Tue, 07 Apr 2009 10:25:09 +0900 Subject: [Frameworkspider-svn] spider-commit [28] Message-ID: <1239067509.157195.4379.nullmailer@users.sourceforge.jp> Revision: 28 http://svn.sourceforge.jp/view?root=frameworkspider&view=rev&rev=28 Author: m_nakashima Date: 2009-04-07 10:25:09 +0900 (Tue, 07 Apr 2009) Log Message: ----------- Modified Paths: -------------- current/DATA/lib/example/Hello.class.php current/DATA/lib/spider/ModuleBase.class.php current/DATA/lib/spider/module/AutoEncode.class.php current/DATA/lib/spider/module/NoCache.class.php -------------- next part -------------- Modified: current/DATA/lib/example/Hello.class.php =================================================================== --- current/DATA/lib/example/Hello.class.php 2009-04-06 02:42:49 UTC (rev 27) +++ current/DATA/lib/example/Hello.class.php 2009-04-07 01:25:09 UTC (rev 28) @@ -6,7 +6,7 @@ require_once(dirname(dirname(__FILE__)) .DIRECTORY_SEPARATOR.'spider' .DIRECTORY_SEPARATOR.'ModuleBase.class.php'); -class example_Hello extends ModuleBase { +class example_Hello extends spider_ModuleBase { /** * Constractor * Modified: current/DATA/lib/spider/ModuleBase.class.php =================================================================== --- current/DATA/lib/spider/ModuleBase.class.php 2009-04-06 02:42:49 UTC (rev 27) +++ current/DATA/lib/spider/ModuleBase.class.php 2009-04-07 01:25:09 UTC (rev 28) @@ -9,7 +9,7 @@ * @author Multimedia Digital Contents Systems.Co.,Ltd. m.nakashima * @since PHP 4.3 */ -class ModuleBase { +class spider_ModuleBase { var $controller_object; var $http_output_object; var $require_module_array = array(); @@ -17,7 +17,7 @@ /** * コンストラクタ */ - function ModuleBase() { + function spider_ModuleBase() { } /** * モジュールを実行します。 Modified: current/DATA/lib/spider/module/AutoEncode.class.php =================================================================== --- current/DATA/lib/spider/module/AutoEncode.class.php 2009-04-06 02:42:49 UTC (rev 27) +++ current/DATA/lib/spider/module/AutoEncode.class.php 2009-04-07 01:25:09 UTC (rev 28) @@ -11,7 +11,7 @@ * @author Multimedia Digital Contents Systems.Co.,Ltd. m.nakashima * @since PHP 4.3 */ -class spider_module_AutoEncode extends ModuleBase { +class spider_module_AutoEncode extends spider_ModuleBase { function spider_module_AutoEncode() { } function execute( & $request ) { Modified: current/DATA/lib/spider/module/NoCache.class.php =================================================================== --- current/DATA/lib/spider/module/NoCache.class.php 2009-04-06 02:42:49 UTC (rev 27) +++ current/DATA/lib/spider/module/NoCache.class.php 2009-04-07 01:25:09 UTC (rev 28) @@ -10,7 +10,7 @@ * @author Multimedia Digital Contents Systems.Co.,Ltd. m.nakashima * @since PHP 4.3 */ -class spider_module_NoCache extends ModuleBase { +class spider_module_NoCache extends spider_ModuleBase { function spider_module_NoCache(){ } From svnnotify @ sourceforge.jp Tue Apr 7 10:25:57 2009 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Tue, 07 Apr 2009 10:25:57 +0900 Subject: [Frameworkspider-svn] spider-commit [29] Message-ID: <1239067557.651057.4970.nullmailer@users.sourceforge.jp> Revision: 29 http://svn.sourceforge.jp/view?root=frameworkspider&view=rev&rev=29 Author: m_nakashima Date: 2009-04-07 10:25:57 +0900 (Tue, 07 Apr 2009) Log Message: ----------- Modified Paths: -------------- current/README.txt -------------- next part -------------- Modified: current/README.txt =================================================================== --- current/README.txt 2009-04-07 01:25:09 UTC (rev 28) +++ current/README.txt 2009-04-07 01:25:57 UTC (rev 29) @@ -3,6 +3,9 @@ ** ** このファイルにはコミットごとに変更点とファイル名を記述します。 ** +-- 2009-04-07 +1) ModuleBaseクラスの名称をspider_ModuleBaseクラスに変更しました。 + -- 2009-04-06 1) spider.inc.phpでユーザー公開ディレクトリに設置した場合にドキュメントルートの判別を ホストのドキュメントルートにしていた為設置URIを正しく認識できなかった問題の修正 From svnnotify @ sourceforge.jp Fri Apr 10 11:53:58 2009 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Fri, 10 Apr 2009 11:53:58 +0900 Subject: [Frameworkspider-svn] spider-commit [30] Message-ID: <1239332038.745844.23709.nullmailer@users.sourceforge.jp> Revision: 30 http://svn.sourceforge.jp/view?root=frameworkspider&view=rev&rev=30 Author: m_nakashima Date: 2009-04-10 11:53:58 +0900 (Fri, 10 Apr 2009) Log Message: ----------- Modified Paths: -------------- current/DATA/lib/spider/functions.inc.php current/DATA/lib/spider/module/AutoEncode.class.php current/DATA/lib/util/CharUtility.class.php current/DATA/lib/util/Mail.class.php current/DATA/lib/util/mail/PHP.class.php current/DATA/lib/util/mail/SMTP.class.php current/DATA/lib/util/mail/SendMail.class.php current/README.txt Added Paths: ----------- current/DATA/lib/spider/module/AutoFormat.class.php -------------- next part -------------- Modified: current/DATA/lib/spider/functions.inc.php =================================================================== --- current/DATA/lib/spider/functions.inc.php 2009-04-07 01:25:57 UTC (rev 29) +++ current/DATA/lib/spider/functions.inc.php 2009-04-10 02:53:58 UTC (rev 30) @@ -293,7 +293,7 @@ $column_value = preg_replace('/"$/','',$column_value ); $column_value = preg_replace('/""/','"',$column_value ); } - $column_value = mb_convert_kana($column_value,'KVa'); + $column_value = mb_convert_kana($column_value,'KVas'); array_push( $regist_columns, $column_value ); $column_value = ''; } Modified: current/DATA/lib/spider/module/AutoEncode.class.php =================================================================== --- current/DATA/lib/spider/module/AutoEncode.class.php 2009-04-07 01:25:57 UTC (rev 29) +++ current/DATA/lib/spider/module/AutoEncode.class.php 2009-04-10 02:53:58 UTC (rev 30) @@ -18,14 +18,28 @@ $strings = implode('',$_POST).implode('',$_GET); $input_charset = mb_detect_encoding($strings,'auto'); if( $input_charset != 'UTF-8' ) { + // POSTパラメータ foreach( $_POST as $key => $val ) { - if( preg_match('/^[aA][sS][cC][iI][iI]$/',mb_detect_encoding($val,'auto')) == 0 ) { - $_POST[$key] = mb_convert_encoding($val,'UTF-8',$input_charset); + if ( is_array($val) ) { + if( preg_match('/^[aA][sS][cC][iI][iI]$/',mb_detect_encoding($val,'auto')) == 0 ) { + $_POST[$key] = mb_convert_variables('UTF-8',$input_charset,$val); + } + } else { + if( preg_match('/^[aA][sS][cC][iI][iI]$/',mb_detect_encoding($val,'auto')) == 0 ) { + $_POST[$key] = mb_convert_encoding($val,'UTF-8',$input_charset); + } } } + // GETパラメータ foreach( $_GET as $key => $val ) { - if( preg_match('/^[aA][sS][cC][iI][iI]$/',mb_detect_encoding($val,'auto')) == 0 ) { - $_GET[$key] = mb_convert_encoding($val,'UTF-8',$input_charset); + if ( is_array($val) ) { + if( preg_match('/^[aA][sS][cC][iI][iI]$/',mb_detect_encoding($val,'auto')) == 0 ) { + $_GET[$key] = mb_convert_variables('UTF-8',$input_charset,$val); + } + } else { + if( preg_match('/^[aA][sS][cC][iI][iI]$/',mb_detect_encoding($val,'auto')) == 0 ) { + $_GET[$key] = mb_convert_encoding($val,'UTF-8',$input_charset); + } } } } Added: current/DATA/lib/spider/module/AutoFormat.class.php =================================================================== --- current/DATA/lib/spider/module/AutoFormat.class.php (rev 0) +++ current/DATA/lib/spider/module/AutoFormat.class.php 2009-04-10 02:53:58 UTC (rev 30) @@ -0,0 +1,60 @@ + http://www.md-systems.net/ + * @author Multimedia Digital Contents Systems.Co.,Ltd. m.nakashima + * @since PHP 5.2 + */ +class spider_module_AutoFormat extends spider_ModuleBase { + function spider_module_AutoFormat() { + } + function execute( & $request ) { + // POSTパラメータ + foreach( $_POST as $key => $val ) { + if ( is_array($val) ) { + // パラメータが配列の場合、各値を変換する + $value_array = array(); + foreach( $val as $value ) { + $value = mb_convert_kana($value,'KVas'); + array_push($value_array,$value); + } + $_POST[$key] = $value_array; + } else { + if ( strlen(trim($val))>0 ) { + $_POST[$key] = mb_convert_kana($val,'KVas'); + } else { + $_POST[$key] = ''; + } + } + } + // GETパラメータ + foreach( $_GET as $key => $val ) { + if ( is_array($val) ) { + // パラメータが配列の場合、各値を変換する + $value_array = array(); + foreach( $val as $value ) { + $value = mb_convert_kana($value,'KVas'); + array_push($value_array,$value); + } + $_GET[$key] = $value_array; + } else { + if ( strlen(trim($val))>0 ) { + $_GET[$key] = mb_convert_kana($val,'KVas'); + } else { + $_GET[$key] = ''; + } + } + } + } +} +?> Modified: current/DATA/lib/util/CharUtility.class.php =================================================================== --- current/DATA/lib/util/CharUtility.class.php 2009-04-07 01:25:57 UTC (rev 29) +++ current/DATA/lib/util/CharUtility.class.php 2009-04-10 02:53:58 UTC (rev 30) @@ -134,6 +134,7 @@ $str = str_replace('$', '\\$', $str); $str = str_replace('|', '\\|', $str); $str = str_replace('/', '\\/', $str); + $str = str_replace('_', '\\_', $str); return $str; } } Modified: current/DATA/lib/util/Mail.class.php =================================================================== --- current/DATA/lib/util/Mail.class.php 2009-04-07 01:25:57 UTC (rev 29) +++ current/DATA/lib/util/Mail.class.php 2009-04-10 02:53:58 UTC (rev 30) @@ -79,7 +79,7 @@ * 送信設定オプションの妥当性検査を行いエラーメッセージの配列を返します。 * エラーがない場合は要素0の配列を返します。 */ - function validate_options( $options = array() ) { + function validate_options( & $options ) { return array(); } /** Modified: current/DATA/lib/util/mail/PHP.class.php =================================================================== --- current/DATA/lib/util/mail/PHP.class.php 2009-04-07 01:25:57 UTC (rev 29) +++ current/DATA/lib/util/mail/PHP.class.php 2009-04-10 02:53:58 UTC (rev 30) @@ -28,7 +28,7 @@ * 送信設定オプションの妥当性検査を行いエラーメッセージの配列を返します。 * エラーがない場合は要素0の配列を返します。 */ - function validate_options( $options = array() ) { + function validate_options( & $options ) { $error_messages = array(); // TODO: オプションはないのでmail関数利用可能かチェックする return $error_messages; Modified: current/DATA/lib/util/mail/SMTP.class.php =================================================================== --- current/DATA/lib/util/mail/SMTP.class.php 2009-04-07 01:25:57 UTC (rev 29) +++ current/DATA/lib/util/mail/SMTP.class.php 2009-04-10 02:53:58 UTC (rev 30) @@ -81,8 +81,37 @@ * 送信設定オプションの妥当性検査を行いエラーメッセージの配列を返します。 * エラーがない場合は要素0の配列を返します。 */ - function validate_options( $options = array() ) { + function validate_options( & $options ) { $error_messages = array(); + if( !is_array($options) ) { + array_push($error_messages,'送信オプションを入力してください。'); + } else { + if( !isset($options['pear_path']) && isset($options[0]) ) { + $options['pear_path'] = trim(stripslashes($options[0])); + unset( $options[0] ); + } + if( !isset($options['smtp_host']) && isset($options[1]) ) { + $options['smtp_host'] = trim(stripslashes($options[1])); + unset( $options[1] ); + } + if( !isset($options['smtp_port']) && isset($options[2]) ) { + $options['smtp_port'] = trim(stripslashes($options[2])); + unset( $options[2] ); + } + if( !isset($options['smtp_auth']) && isset($options[3]) ) { + $options['smtp_auth'] = trim(stripslashes($options[3])); + unset( $options[3] ); + } + if( !isset($options['smtp_auth_user']) && isset($options[4]) ) { + $options['smtp_auth_user'] = trim(stripslashes($options[4])); + unset( $options[4] ); + } + if( !isset($options['smtp_auth_pass']) && isset($options[5]) ) { + $options['smtp_auth_pass'] = trim(stripslashes($options[5])); + unset( $options[5] ); + } + } + $pear_path = trim($options['pear_path']); $smtp_host = trim($options['smtp_host']); $smtp_port = trim($options['smtp_port']); Modified: current/DATA/lib/util/mail/SendMail.class.php =================================================================== --- current/DATA/lib/util/mail/SendMail.class.php 2009-04-07 01:25:57 UTC (rev 29) +++ current/DATA/lib/util/mail/SendMail.class.php 2009-04-10 02:53:58 UTC (rev 30) @@ -70,8 +70,16 @@ * 送信設定オプションの妥当性検査を行いエラーメッセージの配列を返します。 * エラーがない場合は要素0の配列を返します。 */ - function validate_options( $options = array() ) { + function validate_options( & $options ) { $error_messages = array(); + if( !is_array($options) ) { + array_push($error_messages,'送信オプションを入力してください。'); + } else { + if( !isset($options['sendmail_path']) && isset($options[0]) ) { + $options['sendmail_path'] = trim(stripslashes($options[0])); + unset( $options[0] ); + } + } // sendmail_pathが必須 $sendmail_path = trim($options['sendmail_path']); if( strlen(trim($sendmail_path)) == 0 ) { Modified: current/README.txt =================================================================== --- current/README.txt 2009-04-07 01:25:57 UTC (rev 29) +++ current/README.txt 2009-04-10 02:53:58 UTC (rev 30) @@ -3,6 +3,18 @@ ** ** このファイルにはコミットごとに変更点とファイル名を記述します。 ** +-- 2009-04-10 +1) 本体とはあまり関係ありませんがphp5でフォーム名からハッシュを入力できていない問題があるため + lib/util/Mail.class.php + lib/util/mail/PHP.class.php + lib/util/mail/Sendmail.class.php + lib/util/mail/SMTP.class.php + を変更しました。 + +2) 本体とはあまり関係ありませんが + lib/spider/module/AutoEncode.class.phpで配列入力をエンコード出来ていなかった問題を修正しました。 + lib/spider/module/AutoFormat.class.phpを追加しました。 + -- 2009-04-07 1) ModuleBaseクラスの名称をspider_ModuleBaseクラスに変更しました。 From svnnotify @ sourceforge.jp Fri Apr 10 12:18:51 2009 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Fri, 10 Apr 2009 12:18:51 +0900 Subject: [Frameworkspider-svn] spider-commit [31] Message-ID: <1239333531.021024.19084.nullmailer@users.sourceforge.jp> Revision: 31 http://svn.sourceforge.jp/view?root=frameworkspider&view=rev&rev=31 Author: m_nakashima Date: 2009-04-10 12:18:50 +0900 (Fri, 10 Apr 2009) Log Message: ----------- Modified Paths: -------------- current/DATA/define.inc.php current/DATA/lib/spider/ModuleBase.class.php current/README.txt -------------- next part -------------- Modified: current/DATA/define.inc.php =================================================================== --- current/DATA/define.inc.php 2009-04-10 02:53:58 UTC (rev 30) +++ current/DATA/define.inc.php 2009-04-10 03:18:50 UTC (rev 31) @@ -91,6 +91,13 @@ /* * システムレポートとメール通知設定 */ +// ログ出力レベルの定義 +define('SPIDER_LOG_LEVEL_FATAL', 0); +define('SPIDER_LOG_LEVEL_ERROR', 1); +define('SPIDER_LOG_LEVEL_INFO', 2); +define('SPIDER_LOG_LEVEL_REPORT', 3); +define('SPIDER_LOG_LEVEL_DEBUG', 4); + // システムメール定義ファイル名 define ( 'FILE_NAME_SYSTEM_DEFINITION', 'system.inc.php' ); // システムメール定義ファイルパス Modified: current/DATA/lib/spider/ModuleBase.class.php =================================================================== --- current/DATA/lib/spider/ModuleBase.class.php 2009-04-10 02:53:58 UTC (rev 30) +++ current/DATA/lib/spider/ModuleBase.class.php 2009-04-10 03:18:50 UTC (rev 31) @@ -115,50 +115,44 @@ * @param $message ログメッセージ * @param $log_level 出力するログのレベル */ - function write_log( $message, $log_level='info' ) { - $log_level = 3; + function write_log( $message, $log_level=SPIDER_LOG_LEVEL_INFO ) { + $system_log_level = SPIDER_LOG_LEVEL_INFO; if( defined('SYSTEM_LOG_LEVEL') && is_numeric(SYSTEM_LOG_LEVEL) && preg_match('/^[0-4]$/',SYSTEM_LOG_LEVEL) > 0 ) { - $log_level = SYSTEM_LOG_LEVEL; + $system_log_level = SYSTEM_LOG_LEVEL; } else if( defined('MODE_LOG') && is_numeric(MODE_LOG) && preg_match('/^[0-4]$/',MODE_LOG) > 0 ) { - $log_level = MODE_LOG; - } else { - $log_level = 3; + $system_log_level = MODE_LOG; } - if( $log_level == 4 && $log_level != 'fatal' ) { + // システム設定のログレベルより大きいレベルのログは出力しない + if( $log_level > $system_log_level ) { return true; - } else if ( $log_level == 3 - && $log_level != 'info' && $log_level != 'fatal' ) { - return true; - } else if ( $log_level == 2 - && $log_level != 'error' && $log_level != 'info' - && $log_level != 'fatal' ) { - return true; - } else if ( $log_level == 1 - && $log_level != 'report' && $log_level != 'error' - && $log_level != 'info' && $log_level != 'fatal' ) { - return true; } // ログファイル名の決定 - $log_file_path = DIR_PATH_LOG - . DIRECTORY_SEPARATOR . "sp_module" - ; + $log_file_path = DIR_PATH_LOG.DIRECTORY_SEPARATOR.'spider'; if( !file_exists( $log_file_path ) ) { - mkdir( $log_file_path, 0777 ); - chmod( $log_file_path, 0777 ); + if( @mkdir( $log_file_path, 0777 ) ) { + @chmod( $log_file_path, 0777 ); + } } - if( strlen(trim($log_level)) > 0 ) { - $log_file_path .= DIRECTORY_SEPARATOR . trim($log_level) - . "_" . date('Y_m') . ".log"; - } else { - $log_file_path .= DIRECTORY_SEPARATOR - . "info_" . date('Y_m') . ".log"; + $log_file_path = $log_file_path.DIRECTORY_SEPARATOR.date('Y'); + if( !file_exists( $log_file_path ) ) { + if( @mkdir( $log_file_path, 0777 ) ) { + @chmod( $log_file_path, 0777 ); + } } - if( strlen( $log_file_path ) > 2 && !file_exists($log_file_path) ) { - touch( $log_file_path, 0666 ); - chmod( $log_file_path, 0666 ); + $log_file_path = $log_file_path.DIRECTORY_SEPARATOR.date('m'); + if( !file_exists( $log_file_path ) ) { + if( @mkdir( $log_file_path, 0777 ) ) { + @chmod( $log_file_path, 0777 ); + } } + $log_file_path = $log_file_path.DIRECTORY_SEPARATOR.'system_'.date('d').'.log'; + if( !file_exists( $log_file_path ) ) { + if(@touch( $log_file_path, 0666 )){ + @chmod( $log_file_path, 0666 ); + } + } $message = str_replace( "\r\n", "\n", $message ); $message = str_replace( "\r", "\n", $message ); $message = str_replace( "\n", " ", $message ); @@ -178,35 +172,35 @@ * @param $message ログメッセージ */ function info($message){ - $this->write_log( $message, 'info' ); + $this->write_log( $message, SPIDER_LOG_LEVEL_INFO ); } /** * Reportレベルのログを出力します。 * @param $message ログメッセージ */ function report($message){ - $this->write_log( $message, 'report' ); + $this->write_log( $message, SPIDER_LOG_LEVEL_REPORT ); } /** * Errorレベルのログを出力します。 * @param $message ログメッセージ */ function error($message){ - $this->write_log( $message, 'error' ); + $this->write_log( $message, SPIDER_LOG_LEVEL_ERROR ); } /** * Fatalレベルのログを出力します。 * @param $message ログメッセージ */ function fatal($message){ - $this->write_log( $message, 'fatal' ); + $this->write_log( $message, SPIDER_LOG_LEVEL_FATAL ); } /** * Debugレベルのログを出力します。 * @param $message ログメッセージ */ function debug($message){ - $this->write_log( $message, 'debug' ); + $this->write_log( $message, SPIDER_LOG_LEVEL_DEBUG ); } } ?> Modified: current/README.txt =================================================================== --- current/README.txt 2009-04-10 02:53:58 UTC (rev 30) +++ current/README.txt 2009-04-10 03:18:50 UTC (rev 31) @@ -15,6 +15,8 @@ lib/spider/module/AutoEncode.class.phpで配列入力をエンコード出来ていなかった問題を修正しました。 lib/spider/module/AutoFormat.class.phpを追加しました。 +3) ModuleBase.class.phpのログ出力をdefineで定義して整えました。 + -- 2009-04-07 1) ModuleBaseクラスの名称をspider_ModuleBaseクラスに変更しました。 From svnnotify @ sourceforge.jp Mon Apr 13 15:49:56 2009 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Mon, 13 Apr 2009 15:49:56 +0900 Subject: [Frameworkspider-svn] spider-commit [32] Message-ID: <1239605396.791257.12705.nullmailer@users.sourceforge.jp> Revision: 32 http://svn.sourceforge.jp/view?root=frameworkspider&view=rev&rev=32 Author: m_nakashima Date: 2009-04-13 15:49:56 +0900 (Mon, 13 Apr 2009) Log Message: ----------- Modified Paths: -------------- current/DATA/lib/spider/tags/SetAttribute.class.php current/README.txt -------------- next part -------------- Modified: current/DATA/lib/spider/tags/SetAttribute.class.php =================================================================== --- current/DATA/lib/spider/tags/SetAttribute.class.php 2009-04-10 03:18:50 UTC (rev 31) +++ current/DATA/lib/spider/tags/SetAttribute.class.php 2009-04-13 06:49:56 UTC (rev 32) @@ -111,7 +111,9 @@ $rep_string .= '$type=gettype($tmp); '; list( $hash_key_strings ) = explode(']',$hash_key_strings ); $hash_key_strings = trim( $hash_key_strings ); - if( preg_match('/^\\".+?\\"$/',$hash_key_strings) || preg_match('/^\\\'.+?\\\\\'$/',$hash_key_strings) ){ + if( ( preg_match('/^"/',$hash_key_strings) > 0 && preg_match('/"$/',$hash_key_strings) > 0 ) + || ( preg_match('/^\'/',$hash_key_strings) > 0 && preg_match('/\'$/',$hash_key_strings) > 0 ) + ) { // キー文字列がクォートされているなら文字列としてそのまま利用 $rep_string .= 'if(\'array\'==$type) { $tmp=$tmp['.$hash_key_strings.']; } '; } else if( is_numeric($hash_key_strings) ) { Modified: current/README.txt =================================================================== --- current/README.txt 2009-04-10 03:18:50 UTC (rev 31) +++ current/README.txt 2009-04-13 06:49:56 UTC (rev 32) @@ -3,6 +3,10 @@ ** ** このファイルにはコミットごとに変更点とファイル名を記述します。 ** +-- 2009-04-13 +1) setタグでハッシュ、メンバの値がクォートされていた場合に正しく判別できていなかった問題を修正しました。 + lib/spider/tags/SetAttribute.class.php + -- 2009-04-10 1) 本体とはあまり関係ありませんがphp5でフォーム名からハッシュを入力できていない問題があるため lib/util/Mail.class.php From svnnotify @ sourceforge.jp Tue Apr 14 21:26:53 2009 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Tue, 14 Apr 2009 21:26:53 +0900 Subject: [Frameworkspider-svn] spider-commit [33] Message-ID: <1239712013.434818.27977.nullmailer@users.sourceforge.jp> Revision: 33 http://svn.sourceforge.jp/view?root=frameworkspider&view=rev&rev=33 Author: m_nakashima Date: 2009-04-14 21:26:53 +0900 (Tue, 14 Apr 2009) Log Message: ----------- Modified Paths: -------------- current/DATA/lib/spider/HttpRequest.class.php -------------- next part -------------- Modified: current/DATA/lib/spider/HttpRequest.class.php =================================================================== --- current/DATA/lib/spider/HttpRequest.class.php 2009-04-13 06:49:56 UTC (rev 32) +++ current/DATA/lib/spider/HttpRequest.class.php 2009-04-14 12:26:53 UTC (rev 33) @@ -10,6 +10,8 @@ * @author Multimedia Digital Contents Systems.Co.,Ltd. m.nakashima * @since PHP 4.3 */ +define( 'SPIDER_SESSION_SCOPE_GLOBAL', 'GLOBAL' ); +define( 'SPIDER_SESSION_SCOPE_AUTO', 'AUTO' ); require_once(dirname(dirname(__FILE__)).DIRECTORY_SEPARATOR.'util'.DIRECTORY_SEPARATOR.'CharUtility.class.php'); class spider_HttpRequest { /** Attributes */ @@ -132,5 +134,79 @@ function redirectTo($url) { $this->redirect_url = $url; } + /** + * セッション変数を設定します + * @param $key + * @param $value + * @param $scopse GLOBALまたは有効フォルダURI + */ + function setSession( $key, $value, $scope=SPIDER_SESSION_SCOPE_AUTO ) { + $this->optimizeSession(); + if( $scope == SPIDER_SESSION_SCOPE_AUTO ) { + $scope = dirname($_SERVER['REQUEST_URI']); + } + if( SPIDER_SESSION_SCOPE_GLOBAL == $scope ) { + $key = 'spider_GLOBAL.'.$key; + } else { + $key = str_replace('/','.s.',$scope).'.s.'.$key; + } + $session_var = new spider_HttpSessionVar( $value, $scope ); + $_SESSION[$key] = serialize( $session_var ); + } + /** + * セッション変数を取得します + * @param $key + */ + function getSession( $key ) { + $value = null; + $this->optimizeSession(); + $target_key = $this->getSessionCurrentScope().'.s.'.$key; + if( isset( $_SESSION ) && isset($_SESSION[$target_key]) ) { + $value = $_SESSION[$target_key]; + } else { + $target_key = 'spider_GLOBAL.'.$key; + if( isset( $_SESSION ) && isset($_SESSION[$target_key]) ) { + $value = $_SESSION[$target_key]; + } + } + return $value; + } + /** + * セッション変数が登録されているか確認します + * @param $key + */ + function existsSession( $key ) { + $this->optimizeSession(); + $target_key = $this->getSessionCurrentScope().'.s.'.$key; + if( isset( $_SESSION ) && isset($_SESSION[$target_key]) ) { + return true; + } else { + $target_key = 'spider_GLOBAL.'.$key; + if( isset( $_SESSION ) && isset($_SESSION[$target_key]) ) { + return true; + } + } + return false; + } + /** + * セッション登録済み情報を最適化します + */ + function optimizeSession() { + if( isset( $_SESSION ) && is_array( $_SESSION ) ) { + $current_scope = $this->getSessionCurrentScope(); + foreach( $_SESSION as $key => $value ) { + if( preg_match('/^spider_GLOBAL\\./',$key) == 0 + && preg_match('/^'.CharUtility::escape_regx_str($current_scope).'/',$key) == 0 ) { + unset( $_SESSION[$key] ); + } + } + } + } + /** + * リクエストURIからセッションスコープを取得します + */ + function getSessionCurrentScope() { + return str_replace('/','.s.',dirname($_SERVER['REQUEST_URI'])); + } } ?> From svnnotify @ sourceforge.jp Tue Apr 14 21:30:21 2009 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Tue, 14 Apr 2009 21:30:21 +0900 Subject: [Frameworkspider-svn] spider-commit [34] Message-ID: <1239712221.980687.563.nullmailer@users.sourceforge.jp> Revision: 34 http://svn.sourceforge.jp/view?root=frameworkspider&view=rev&rev=34 Author: m_nakashima Date: 2009-04-14 21:30:21 +0900 (Tue, 14 Apr 2009) Log Message: ----------- Modified Paths: -------------- current/README.txt -------------- next part -------------- Modified: current/README.txt =================================================================== --- current/README.txt 2009-04-14 12:26:53 UTC (rev 33) +++ current/README.txt 2009-04-14 12:30:21 UTC (rev 34) @@ -3,6 +3,12 @@ ** ** このファイルにはコミットごとに変更点とファイル名を記述します。 ** +-- 2009-04-14 +1) spider_HttpRequestクラスにセッション制御メソッドを追加しました + リクエストURIの階層ごとにセッションの有効無効を自動で制御できます。 + フォルダ階層を抜けた場合はセッションを無効化します。 + これによりモジュールで利用するセッション記憶域の無制限な増大を避けることができます。 + -- 2009-04-13 1) setタグでハッシュ、メンバの値がクォートされていた場合に正しく判別できていなかった問題を修正しました。 lib/spider/tags/SetAttribute.class.php From svnnotify @ sourceforge.jp Wed Apr 15 12:49:23 2009 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Wed, 15 Apr 2009 12:49:23 +0900 Subject: [Frameworkspider-svn] spider-commit [35] Message-ID: <1239767363.384096.31560.nullmailer@users.sourceforge.jp> Revision: 35 http://svn.sourceforge.jp/view?root=frameworkspider&view=rev&rev=35 Author: m_nakashima Date: 2009-04-15 12:49:23 +0900 (Wed, 15 Apr 2009) Log Message: ----------- Modified Paths: -------------- current/DATA/lib/spider/HttpRequest.class.php -------------- next part -------------- Modified: current/DATA/lib/spider/HttpRequest.class.php =================================================================== --- current/DATA/lib/spider/HttpRequest.class.php 2009-04-14 12:30:21 UTC (rev 34) +++ current/DATA/lib/spider/HttpRequest.class.php 2009-04-15 03:49:23 UTC (rev 35) @@ -146,9 +146,9 @@ $scope = dirname($_SERVER['REQUEST_URI']); } if( SPIDER_SESSION_SCOPE_GLOBAL == $scope ) { - $key = 'spider_GLOBAL.'.$key; + $key = $this->_getGlobalSessionKey( $key ); } else { - $key = str_replace('/','.s.',$scope).'.s.'.$key; + $key = $scope.'/'.$key; } $session_var = new spider_HttpSessionVar( $value, $scope ); $_SESSION[$key] = serialize( $session_var ); @@ -158,18 +158,24 @@ * @param $key */ function getSession( $key ) { - $value = null; $this->optimizeSession(); - $target_key = $this->getSessionCurrentScope().'.s.'.$key; - if( isset( $_SESSION ) && isset($_SESSION[$target_key]) ) { - $value = $_SESSION[$target_key]; - } else { - $target_key = 'spider_GLOBAL.'.$key; + $value = null; + $current_scope = dirname( $_SERVER['REQUEST_URI'] ); + while( strlen($current_scope) > 0 ) { + $target_key = $current_scope.'/'.$key; if( isset( $_SESSION ) && isset($_SESSION[$target_key]) ) { $value = $_SESSION[$target_key]; + return $value; } + $current_scope = dirname( $current_scope ); } - return $value; + $target_key = $this->_getGlobalSessionKey( $key ); + if( isset( $_SESSION ) && isset($_SESSION[$target_key]) ) { + $value = $_SESSION[$target_key]; + return $value; + } + + return null; } /** * セッション変数が登録されているか確認します @@ -177,15 +183,19 @@ */ function existsSession( $key ) { $this->optimizeSession(); - $target_key = $this->getSessionCurrentScope().'.s.'.$key; - if( isset( $_SESSION ) && isset($_SESSION[$target_key]) ) { - return true; - } else { - $target_key = 'spider_GLOBAL.'.$key; + $current_scope = dirname( $_SERVER['REQUEST_URI'] ); + while( strlen($current_scope) > 0 ) { + $target_key = $current_scope.'/'.$key; if( isset( $_SESSION ) && isset($_SESSION[$target_key]) ) { return true; } + $current_scope = dirname( $current_scope ); } + $target_key = $this->_getGlobalSessionKey( $key ); + if( isset( $_SESSION ) && isset($_SESSION[$target_key]) ) { + $value = $_SESSION[$target_key]; + return true; + } return false; } /** @@ -193,20 +203,17 @@ */ function optimizeSession() { if( isset( $_SESSION ) && is_array( $_SESSION ) ) { - $current_scope = $this->getSessionCurrentScope(); + $current_scope = dirname( $_SERVER['REQUEST_URI'] ); foreach( $_SESSION as $key => $value ) { - if( preg_match('/^spider_GLOBAL\\./',$key) == 0 + if( preg_match('/^spider\\_GLOBAL\\./',$key) == 0 && preg_match('/^'.CharUtility::escape_regx_str($current_scope).'/',$key) == 0 ) { unset( $_SESSION[$key] ); } } } } - /** - * リクエストURIからセッションスコープを取得します - */ - function getSessionCurrentScope() { - return str_replace('/','.s.',dirname($_SERVER['REQUEST_URI'])); + function _getGlobalSessionKey( $key ) { + return 'spider_GLOBAL.'.$key; } } ?> From svnnotify @ sourceforge.jp Wed Apr 15 12:49:56 2009 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Wed, 15 Apr 2009 12:49:56 +0900 Subject: [Frameworkspider-svn] spider-commit [36] Message-ID: <1239767396.367895.32131.nullmailer@users.sourceforge.jp> Revision: 36 http://svn.sourceforge.jp/view?root=frameworkspider&view=rev&rev=36 Author: m_nakashima Date: 2009-04-15 12:49:56 +0900 (Wed, 15 Apr 2009) Log Message: ----------- Modified Paths: -------------- current/DATA/lib/spider/HttpRequest.class.php -------------- next part -------------- Modified: current/DATA/lib/spider/HttpRequest.class.php =================================================================== --- current/DATA/lib/spider/HttpRequest.class.php 2009-04-15 03:49:23 UTC (rev 35) +++ current/DATA/lib/spider/HttpRequest.class.php 2009-04-15 03:49:56 UTC (rev 36) @@ -150,8 +150,7 @@ } else { $key = $scope.'/'.$key; } - $session_var = new spider_HttpSessionVar( $value, $scope ); - $_SESSION[$key] = serialize( $session_var ); + $_SESSION[$key] = serialize( $value ); } /** * セッション変数を取得します @@ -164,15 +163,13 @@ while( strlen($current_scope) > 0 ) { $target_key = $current_scope.'/'.$key; if( isset( $_SESSION ) && isset($_SESSION[$target_key]) ) { - $value = $_SESSION[$target_key]; - return $value; + return unserialize($_SESSION[$target_key]); } $current_scope = dirname( $current_scope ); } $target_key = $this->_getGlobalSessionKey( $key ); if( isset( $_SESSION ) && isset($_SESSION[$target_key]) ) { - $value = $_SESSION[$target_key]; - return $value; + return unserialize($_SESSION[$target_key]); } return null; @@ -193,7 +190,6 @@ } $target_key = $this->_getGlobalSessionKey( $key ); if( isset( $_SESSION ) && isset($_SESSION[$target_key]) ) { - $value = $_SESSION[$target_key]; return true; } return false; From svnnotify @ sourceforge.jp Wed Apr 15 13:20:54 2009 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Wed, 15 Apr 2009 13:20:54 +0900 Subject: [Frameworkspider-svn] spider-commit [37] Message-ID: <1239769254.507143.15055.nullmailer@users.sourceforge.jp> Revision: 37 http://svn.sourceforge.jp/view?root=frameworkspider&view=rev&rev=37 Author: m_nakashima Date: 2009-04-15 13:20:54 +0900 (Wed, 15 Apr 2009) Log Message: ----------- Removed Paths: ------------- current/WWW_PUBLIC/pre_module.inc.php -------------- next part -------------- From svnnotify @ sourceforge.jp Wed Apr 15 15:19:05 2009 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Wed, 15 Apr 2009 15:19:05 +0900 Subject: [Frameworkspider-svn] spider-commit [38] Message-ID: <1239776345.554743.8510.nullmailer@users.sourceforge.jp> Revision: 38 http://svn.sourceforge.jp/view?root=frameworkspider&view=rev&rev=38 Author: m_nakashima Date: 2009-04-15 15:19:05 +0900 (Wed, 15 Apr 2009) Log Message: ----------- Modified Paths: -------------- current/DATA/lib/spider/Controller.class.php current/DATA/lib/spider/HttpOutput.class.php current/DATA/lib/spider/functions.inc.php current/DATA/lib/spider/tags/UseSession.class.php current/DATA/lib/spider/tags/Write.class.php current/DATA/spider_command.inc.php current/DATA/spider_main.inc.php Added Paths: ----------- current/DATA/messages.inc.php -------------- next part -------------- Modified: current/DATA/lib/spider/Controller.class.php =================================================================== --- current/DATA/lib/spider/Controller.class.php 2009-04-15 04:20:54 UTC (rev 37) +++ current/DATA/lib/spider/Controller.class.php 2009-04-15 06:19:05 UTC (rev 38) @@ -87,7 +87,7 @@ include_once( $path . ".inc" ); } else { header('Content-Type: text/plain;charset=UTF-8'); - die('Core Error: 存在しないモジュール呼び出しです。[' . $module_name . ']'); + die($GLOBALS['spider.messages']['spider.controller.moduleisnotfound'].'[' . $module_name . ']'); } // 実行モジュールクラス名の取り出し $module_real_name = str_replace( ".", "_", $module_name ); Modified: current/DATA/lib/spider/HttpOutput.class.php =================================================================== --- current/DATA/lib/spider/HttpOutput.class.php 2009-04-15 04:20:54 UTC (rev 37) +++ current/DATA/lib/spider/HttpOutput.class.php 2009-04-15 06:19:05 UTC (rev 38) @@ -108,8 +108,7 @@ * コアエラーが起こった場合にエラーメッセージを出力して終了します。 */ function exitWithCoreError() { - spider_exitWithCoreError('Core Error: 現在アクセスが非常に混雑しています。' - .'しばらくたってからもう一度アクセスしてください。'); + spider_exitWithCoreError($GLOBALS['spider.messages']['spider.httpoutput.busy']); } } ?> \ No newline at end of file Modified: current/DATA/lib/spider/functions.inc.php =================================================================== --- current/DATA/lib/spider/functions.inc.php 2009-04-15 04:20:54 UTC (rev 37) +++ current/DATA/lib/spider/functions.inc.php 2009-04-15 06:19:05 UTC (rev 38) @@ -14,68 +14,68 @@ function spider_is_avairable_permittion() { $errors = array(); if( !file_exists(DIR_PATH_LIB) ) { - array_push( $errors, 'ライブラリディレクトリがありません。' ); + array_push( $errors, $GLOBALS['spider.messages']['spider.finctions.libdirisnotfound'] ); } if( !file_exists(DIR_PATH_TEMPLATES) ) { - array_push( $errors, 'テンプレートディレクトリがありません。' ); + array_push( $errors, $GLOBALS['spider.messages']['spider.finctions.templatedirisnotfound'] ); } if( !file_exists(DIR_PATH_WORK) ) { - array_push( $errors, ''.DIR_NAME_WORK.'ディレクトリがありません。' ); + array_push( $errors, $GLOBALS['spider.messages']['spider.finctions.workdirisnotfound'] ); } else if( !is_writable(DIR_PATH_WORK) ){ - array_push( $errors, 'ワークディレクトリが書き込み不能になっています。' ); + array_push( $errors, $GLOBALS['spider.messages']['spider.finctions.workdirisnotwritable'] ); } else { if( !file_exists(DIR_PATH_BIN) ) { if( @mkdir(DIR_PATH_BIN,0777) ) { @chmod(DIR_PATH_BIN,0777); } else { - array_push( $errors, 'ビルドファイル保存ディレクトリの作成に失敗しました。' ); + array_push( $errors, $GLOBALS['spider.messages']['spider.finctions.cantcreatebindir'] ); } } else if( !is_writable(DIR_PATH_BIN) ){ - array_push( $errors, 'ビルドファイル保存ディレクトリが書き込み不能になっています。' ); + array_push( $errors, $GLOBALS['spider.messages']['spider.finctions.bindirisnotwritable'] ); } if( !file_exists(DIR_PATH_LOCK) ) { if( @mkdir( DIR_PATH_LOCK, 0777 ) ) { @chmod( DIR_PATH_LOCK, 0777 ); } else { - array_push( $errors, 'プロセスロックディレクトリの作成に失敗しました。' ); + array_push( $errors, $GLOBALS['spider.messages']['spider.finctions.cantcreatelockdir'] ); } } else if( !is_writable(DIR_PATH_LOCK) ){ - array_push( $errors, 'プロセスロックディレクトリが書き込み不能になっています。' ); + array_push( $errors, $GLOBALS['spider.messages']['spider.finctions.lockdirisnotwritable'] ); } if( !file_exists(DIR_PATH_TMP) ) { if( @mkdir( DIR_PATH_TMP, 0777 ) ) { @chmod( DIR_PATH_TMP, 0777 ); } else { - array_push( $errors, '一時ディレクトリ作成に失敗しました。' ); + array_push( $errors, $GLOBALS['spider.messages']['spider.finctions.cantcreatetmpdir'] ); } } else if( !is_writable(DIR_PATH_TMP) ){ - array_push( $errors, '一時ディレクトリが書き込み不能になっています。' ); + array_push( $errors, $GLOBALS['spider.messages']['spider.finctions.tmpdirisnotwritable'] ); } if( !file_exists(DIR_PATH_CACHE) ) { if( @mkdir( DIR_PATH_CACHE, 0777 ) ) { @chmod( DIR_PATH_CACHE, 0777 ); } else { - array_push( $errors, 'キャッシュディレクトリ作成に失敗しました。' ); + array_push( $errors, $GLOBALS['spider.messages']['spider.finctions.cantcreatecachedir'] ); } } else if( !is_writable(DIR_PATH_CACHE) ){ - array_push( $errors, 'キャッシュディレクトリが書き込み不能になっています。' ); + array_push( $errors, $GLOBALS['spider.messages']['spider.finctions.cachedirisnotwritable'] ); } } if( !file_exists(DIR_PATH_DATA) ) { - array_push( $errors, 'データディレクトリがありません。' ); + array_push( $errors, $GLOBALS['spider.messages']['spider.finctions.datadirisnotfound'] ); } else if( !is_writable(DIR_PATH_DATA) ){ - array_push( $errors, 'データディレクトリが書き込み不能になっています。' ); + array_push( $errors, $GLOBALS['spider.messages']['spider.finctions.datadirisnotwritable'] ); } else { if( !file_exists(DIR_PATH_LOG) ) { if( @mkdir( DIR_PATH_LOG, 0777 ) ) { @chmod( DIR_PATH_LOG, 0777 ); } else { - array_push( $errors, 'ログ保存ディレクトリ作成に失敗しました。' ); + array_push( $errors, $GLOBALS['spider.messages']['spider.finctions.cantcreatelogdir'] ); } } else if( !is_writable(DIR_PATH_LOG) ){ - array_push( $errors, 'ログ保存ディレクトリが書き込み不能になっています。' ); + array_push( $errors, $GLOBALS['spider.messages']['spider.finctions.logdirisnotwritable'] ); } } return $errors; Modified: current/DATA/lib/spider/tags/UseSession.class.php =================================================================== --- current/DATA/lib/spider/tags/UseSession.class.php 2009-04-15 04:20:54 UTC (rev 37) +++ current/DATA/lib/spider/tags/UseSession.class.php 2009-04-15 06:19:05 UTC (rev 38) @@ -38,7 +38,7 @@ $process_code = "if( defined('SPIDER_USE_SPIDER_SESSION_ID') && SPIDER_USE_SPIDER_SESSION_ID ) {\n" . "if( !spider_session_start() ) {\n" . "header( 'Content-type: text/plain;charset=UTF-8' );\n" - . "die( 'Core Error : アプリケーションセッションを開始できませんでした。' );\n}\n" + . "die( '".$GLOBALS['spider.messages']['spider.tags.usesession.cantstart']."' );\n}\n" . "}else{\n" . "session_start();\n}" ; Modified: current/DATA/lib/spider/tags/Write.class.php =================================================================== --- current/DATA/lib/spider/tags/Write.class.php 2009-04-15 04:20:54 UTC (rev 37) +++ current/DATA/lib/spider/tags/Write.class.php 2009-04-15 06:19:05 UTC (rev 38) @@ -243,7 +243,8 @@ $str .= '} else if(\'object\'==gettype('.$tmp_name.')) {'."\n"; if( is_numeric($vparam) ) { // オブジェクトの場合、数値は許可できません。(変数名、メソッド名は数値から始められない) - $str .= "\t".'$request_object->addError(\'オブジェクトの添え字には数字を指定できません。\');'."\n"; + $str .= "\t".'$request_object->addError(\'' + .$GLOBALS['spider.messages']['spider.tags.write.objectcanthasnumericmember'].'\');'."\n"; } else if( strlen(trim($vparam)) > 0 ){ $str .= "\t".$tmp_name. '='.$tmp_name.'->'.$vparam.';'."\n"; } Added: current/DATA/messages.inc.php =================================================================== --- current/DATA/messages.inc.php (rev 0) +++ current/DATA/messages.inc.php 2009-04-15 06:19:05 UTC (rev 38) @@ -0,0 +1,29 @@ + 'Core Error: 存在しないモジュール呼び出しです。', + 'spider.httpoutput.busy' => 'Core Error: 現在アクセスが非常に混雑しています。しばらくたってからもう一度アクセスしてください。', + 'spider.finctions.libdirisnotfound' => 'Core Error : ライブラリディレクトリがありません。', + 'spider.finctions.templatedirisnotfound' => 'Core Error : テンプレートディレクトリがありません。', + 'spider.finctions.workdirisnotfound' => 'Core Error : ワークディレクトリがありません。', + 'spider.finctions.workdirisnotwritable' => 'Core Error : ワークディレクトリが書き込み不能になっています。', + 'spider.finctions.cantcreatebindir' => 'Core Error : ビルドファイル保存ディレクトリを作成できません。', + 'spider.finctions.bindirisnotwritable' => 'Core Error : ビルドファイル保存ディレクトリが書き込み不能になっています。', + 'spider.finctions.cantcreatelockdir' => 'Core Error : プロセスロックディレクトリを作成できません。', + 'spider.finctions.lockdirisnotwritable' => 'Core Error : プロセスロックディレクトリが書き込み不能になっています。', + 'spider.finctions.cantcreatetmpdir' => 'Core Error : 一時ディレクトリを作成できません。', + 'spider.finctions.tmpdirisnotwritable' => 'Core Error : 一時ディレクトリが書き込み不能になっています。', + 'spider.finctions.cantcreatecachedir' => 'Core Error : キャッシュディレクトリを作成できません。', + 'spider.finctions.cachedirisnotwritable' => 'Core Error : キャッシュディレクトリが書き込み不能になっています。', + 'spider.finctions.datadirisnotfound' => 'Core Error : データディレクトリがありません。', + 'spider.finctions.datadirisnotwritable' => 'Core Error : データディレクトリが書き込み不能になっています。', + 'spider.finctions.cantcreatelogdir' => 'Core Error : ログディレクトリを作成できません。', + 'spider.finctions.logdirisnotwritable' => 'Core Error : ログディレクトリが書き込み不能になっています。', + // tags + 'spider.tags.usesession.cantstart' => 'Core Error : アプリケーションセッションを開始できませんでした。', + 'spider.tags.write.objectcanthasnumericmember' => 'Core Error : オブジェクトの添え字には数字を指定できません。', +); +?> Modified: current/DATA/spider_command.inc.php =================================================================== --- current/DATA/spider_command.inc.php 2009-04-15 04:20:54 UTC (rev 37) +++ current/DATA/spider_command.inc.php 2009-04-15 06:19:05 UTC (rev 38) @@ -8,6 +8,7 @@ /* 設定ファイルの読み込み */ require_once( dirname(__FILE__).DIRECTORY_SEPARATOR.'define.inc.php' ); +require_once( dirname(__FILE__).DIRECTORY_SEPARATOR.'messages.inc.php' ); if ( file_exists( dirname( __FILE__ ).DIRECTORY_SEPARATOR.'unique_setting.inc.php' ) ) { include_once( dirname( __FILE__ ).DIRECTORY_SEPARATOR.'unique_setting.inc.php' ); } Modified: current/DATA/spider_main.inc.php =================================================================== --- current/DATA/spider_main.inc.php 2009-04-15 04:20:54 UTC (rev 37) +++ current/DATA/spider_main.inc.php 2009-04-15 06:19:05 UTC (rev 38) @@ -7,6 +7,7 @@ /* 設定ファイルの読み込み */ require_once( dirname(__FILE__).DIRECTORY_SEPARATOR.'define.inc.php' ); +require_once( dirname(__FILE__).DIRECTORY_SEPARATOR.'messages.inc.php' ); if ( file_exists( dirname( __FILE__ ).DIRECTORY_SEPARATOR.'unique_setting.inc.php' ) ) { include_once( dirname( __FILE__ ).DIRECTORY_SEPARATOR.'unique_setting.inc.php' ); } From svnnotify @ sourceforge.jp Wed Apr 15 15:21:42 2009 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Wed, 15 Apr 2009 15:21:42 +0900 Subject: [Frameworkspider-svn] spider-commit [39] Message-ID: <1239776502.660039.11210.nullmailer@users.sourceforge.jp> Revision: 39 http://svn.sourceforge.jp/view?root=frameworkspider&view=rev&rev=39 Author: m_nakashima Date: 2009-04-15 15:21:42 +0900 (Wed, 15 Apr 2009) Log Message: ----------- Property Changed: ---------------- current/DATA/data/ current/DATA/work/ -------------- next part -------------- Property changes on: current/DATA/data ___________________________________________________________________ Added: svn:ignore + logs Property changes on: current/DATA/work ___________________________________________________________________ Added: svn:ignore + bin cache lock tmp From svnnotify @ sourceforge.jp Wed Apr 15 15:21:50 2009 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Wed, 15 Apr 2009 15:21:50 +0900 Subject: [Frameworkspider-svn] spider-commit [40] Message-ID: <1239776510.356385.11297.nullmailer@users.sourceforge.jp> Revision: 40 http://svn.sourceforge.jp/view?root=frameworkspider&view=rev&rev=40 Author: m_nakashima Date: 2009-04-15 15:21:50 +0900 (Wed, 15 Apr 2009) Log Message: ----------- Modified Paths: -------------- current/README.txt -------------- next part -------------- Modified: current/README.txt =================================================================== --- current/README.txt 2009-04-15 06:21:42 UTC (rev 39) +++ current/README.txt 2009-04-15 06:21:50 UTC (rev 40) @@ -3,6 +3,9 @@ ** ** このファイルにはコミットごとに変更点とファイル名を記述します。 ** +-- 2009-04-15 +1) コアのエラーメッセージをDATA/messages.inc.phpにハッシュで定義しました。 + -- 2009-04-14 1) spider_HttpRequestクラスにセッション制御メソッドを追加しました リクエストURIの階層ごとにセッションの有効無効を自動で制御できます。 From svnnotify @ sourceforge.jp Wed Apr 15 15:22:17 2009 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Wed, 15 Apr 2009 15:22:17 +0900 Subject: [Frameworkspider-svn] spider-commit [41] Message-ID: <1239776537.693483.12519.nullmailer@users.sourceforge.jp> Revision: 41 http://svn.sourceforge.jp/view?root=frameworkspider&view=rev&rev=41 Author: m_nakashima Date: 2009-04-15 15:22:17 +0900 (Wed, 15 Apr 2009) Log Message: ----------- Property Changed: ---------------- current/WWW_PUBLIC/ -------------- next part -------------- Property changes on: current/WWW_PUBLIC ___________________________________________________________________ Added: svn:ignore + index.html From svnnotify @ sourceforge.jp Wed Apr 15 16:35:55 2009 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Wed, 15 Apr 2009 16:35:55 +0900 Subject: [Frameworkspider-svn] spider-commit [42] Message-ID: <1239780955.482784.14353.nullmailer@users.sourceforge.jp> Revision: 42 http://svn.sourceforge.jp/view?root=frameworkspider&view=rev&rev=42 Author: m_nakashima Date: 2009-04-15 16:35:55 +0900 (Wed, 15 Apr 2009) Log Message: ----------- Modified Paths: -------------- current/DATA/spider_command.inc.php current/DATA/spider_main.inc.php -------------- next part -------------- Modified: current/DATA/spider_command.inc.php =================================================================== --- current/DATA/spider_command.inc.php 2009-04-15 06:22:17 UTC (rev 41) +++ current/DATA/spider_command.inc.php 2009-04-15 07:35:55 UTC (rev 42) @@ -3,7 +3,7 @@ * framework-spider: コマンドプログラム用共通読み込みファイル */ // Framework Version -define( 'SPIDER_VERSION', '1.0.01' ); +define( 'SPIDER_VERSION', '1.0.00b3' ); define ( 'DIR_PATH_SPIDER_DATA', dirname(__FILE__) ); /* 設定ファイルの読み込み */ Modified: current/DATA/spider_main.inc.php =================================================================== --- current/DATA/spider_main.inc.php 2009-04-15 06:22:17 UTC (rev 41) +++ current/DATA/spider_main.inc.php 2009-04-15 07:35:55 UTC (rev 42) @@ -3,7 +3,7 @@ * framework-spider: Webページ利用用共通メイン実行ファイル */ // Framework Version -define( 'SPIDER_VERSION', '1.0.01' ); +define( 'SPIDER_VERSION', '1.0.00b3' ); /* 設定ファイルの読み込み */ require_once( dirname(__FILE__).DIRECTORY_SEPARATOR.'define.inc.php' ); From svnnotify @ sourceforge.jp Wed Apr 15 16:36:51 2009 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Wed, 15 Apr 2009 16:36:51 +0900 Subject: [Frameworkspider-svn] spider-commit [43] Message-ID: <1239781011.562134.15826.nullmailer@users.sourceforge.jp> Revision: 43 http://svn.sourceforge.jp/view?root=frameworkspider&view=rev&rev=43 Author: m_nakashima Date: 2009-04-15 16:36:51 +0900 (Wed, 15 Apr 2009) Log Message: ----------- Modified Paths: -------------- current/DATA/spider_command.inc.php current/DATA/spider_main.inc.php -------------- next part -------------- Modified: current/DATA/spider_command.inc.php =================================================================== --- current/DATA/spider_command.inc.php 2009-04-15 07:35:55 UTC (rev 42) +++ current/DATA/spider_command.inc.php 2009-04-15 07:36:51 UTC (rev 43) @@ -3,7 +3,7 @@ * framework-spider: コマンドプログラム用共通読み込みファイル */ // Framework Version -define( 'SPIDER_VERSION', '1.0.00b3' ); +define( 'SPIDER_VERSION', '1.0b3' ); define ( 'DIR_PATH_SPIDER_DATA', dirname(__FILE__) ); /* 設定ファイルの読み込み */ Modified: current/DATA/spider_main.inc.php =================================================================== --- current/DATA/spider_main.inc.php 2009-04-15 07:35:55 UTC (rev 42) +++ current/DATA/spider_main.inc.php 2009-04-15 07:36:51 UTC (rev 43) @@ -3,7 +3,7 @@ * framework-spider: Webページ利用用共通メイン実行ファイル */ // Framework Version -define( 'SPIDER_VERSION', '1.0.00b3' ); +define( 'SPIDER_VERSION', '1.0b3' ); /* 設定ファイルの読み込み */ require_once( dirname(__FILE__).DIRECTORY_SEPARATOR.'define.inc.php' ); From svnnotify @ sourceforge.jp Wed Apr 15 16:39:58 2009 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Wed, 15 Apr 2009 16:39:58 +0900 Subject: [Frameworkspider-svn] spider-commit [44] Message-ID: <1239781198.429241.20800.nullmailer@users.sourceforge.jp> Revision: 44 http://svn.sourceforge.jp/view?root=frameworkspider&view=rev&rev=44 Author: m_nakashima Date: 2009-04-15 16:39:58 +0900 (Wed, 15 Apr 2009) Log Message: ----------- Modified Paths: -------------- current/DATA/spider_command.inc.php current/DATA/spider_main.inc.php -------------- next part -------------- Modified: current/DATA/spider_command.inc.php =================================================================== --- current/DATA/spider_command.inc.php 2009-04-15 07:36:51 UTC (rev 43) +++ current/DATA/spider_command.inc.php 2009-04-15 07:39:58 UTC (rev 44) @@ -3,7 +3,7 @@ * framework-spider: コマンドプログラム用共通読み込みファイル */ // Framework Version -define( 'SPIDER_VERSION', '1.0b3' ); +define( 'SPIDER_VERSION', '1.0.0b3' ); define ( 'DIR_PATH_SPIDER_DATA', dirname(__FILE__) ); /* 設定ファイルの読み込み */ Modified: current/DATA/spider_main.inc.php =================================================================== --- current/DATA/spider_main.inc.php 2009-04-15 07:36:51 UTC (rev 43) +++ current/DATA/spider_main.inc.php 2009-04-15 07:39:58 UTC (rev 44) @@ -3,7 +3,7 @@ * framework-spider: Webページ利用用共通メイン実行ファイル */ // Framework Version -define( 'SPIDER_VERSION', '1.0b3' ); +define( 'SPIDER_VERSION', '1.0.0b3' ); /* 設定ファイルの読み込み */ require_once( dirname(__FILE__).DIRECTORY_SEPARATOR.'define.inc.php' ); From svnnotify @ sourceforge.jp Wed Apr 15 16:40:23 2009 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Wed, 15 Apr 2009 16:40:23 +0900 Subject: [Frameworkspider-svn] spider-commit [45] Message-ID: <1239781223.008351.22229.nullmailer@users.sourceforge.jp> Revision: 45 http://svn.sourceforge.jp/view?root=frameworkspider&view=rev&rev=45 Author: m_nakashima Date: 2009-04-15 16:40:22 +0900 (Wed, 15 Apr 2009) Log Message: ----------- Modified Paths: -------------- 1.0.0b3/DATA/spider_command.inc.php 1.0.0b3/DATA/spider_main.inc.php -------------- next part -------------- Modified: 1.0.0b3/DATA/spider_command.inc.php =================================================================== --- 1.0.0b3/DATA/spider_command.inc.php 2009-04-15 07:39:58 UTC (rev 44) +++ 1.0.0b3/DATA/spider_command.inc.php 2009-04-15 07:40:22 UTC (rev 45) @@ -3,7 +3,7 @@ * framework-spider: コマンドプログラム用共通読み込みファイル */ // Framework Version -define( 'SPIDER_VERSION', '1.0.01' ); +define( 'SPIDER_VERSION', '1.0.0b3' ); define ( 'DIR_PATH_SPIDER_DATA', dirname(__FILE__) ); /* 設定ファイルの読み込み */ Modified: 1.0.0b3/DATA/spider_main.inc.php =================================================================== --- 1.0.0b3/DATA/spider_main.inc.php 2009-04-15 07:39:58 UTC (rev 44) +++ 1.0.0b3/DATA/spider_main.inc.php 2009-04-15 07:40:22 UTC (rev 45) @@ -3,7 +3,7 @@ * framework-spider: Webページ利用用共通メイン実行ファイル */ // Framework Version -define( 'SPIDER_VERSION', '1.0.01' ); +define( 'SPIDER_VERSION', '1.0.0b3' ); /* 設定ファイルの読み込み */ require_once( dirname(__FILE__).DIRECTORY_SEPARATOR.'define.inc.php' ); From svnnotify @ sourceforge.jp Wed Apr 15 16:40:54 2009 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Wed, 15 Apr 2009 16:40:54 +0900 Subject: [Frameworkspider-svn] spider-commit [46] Message-ID: <1239781254.764174.22559.nullmailer@users.sourceforge.jp> Revision: 46 http://svn.sourceforge.jp/view?root=frameworkspider&view=rev&rev=46 Author: m_nakashima Date: 2009-04-15 16:40:54 +0900 (Wed, 15 Apr 2009) Log Message: ----------- Modified Paths: -------------- 1.0.0b2/.project 1.0.0b2/DATA/spider_command.inc.php 1.0.0b2/DATA/spider_main.inc.php -------------- next part -------------- Modified: 1.0.0b2/.project =================================================================== --- 1.0.0b2/.project 2009-04-15 07:40:22 UTC (rev 45) +++ 1.0.0b2/.project 2009-04-15 07:40:54 UTC (rev 46) @@ -1,6 +1,6 @@ - framework_spider_current + framework_spider_1.0.0b2 Modified: 1.0.0b2/DATA/spider_command.inc.php =================================================================== --- 1.0.0b2/DATA/spider_command.inc.php 2009-04-15 07:40:22 UTC (rev 45) +++ 1.0.0b2/DATA/spider_command.inc.php 2009-04-15 07:40:54 UTC (rev 46) @@ -3,7 +3,7 @@ * framework-spider: コマンドプログラム用共通読み込みファイル */ // Framework Version -define( 'SPIDER_VERSION', '1.0.01' ); +define( 'SPIDER_VERSION', '1.0.0b2' ); define ( 'DIR_PATH_SPIDER_DATA', dirname(__FILE__) ); /* 設定ファイルの読み込み */ Modified: 1.0.0b2/DATA/spider_main.inc.php =================================================================== --- 1.0.0b2/DATA/spider_main.inc.php 2009-04-15 07:40:22 UTC (rev 45) +++ 1.0.0b2/DATA/spider_main.inc.php 2009-04-15 07:40:54 UTC (rev 46) @@ -3,7 +3,7 @@ * framework-spider: Webページ利用用共通メイン実行ファイル */ // Framework Version -define( 'SPIDER_VERSION', '1.0.01' ); +define( 'SPIDER_VERSION', '1.0.0b2' ); /* 設定ファイルの読み込み */ require_once( dirname(__FILE__).DIRECTORY_SEPARATOR.'define.inc.php' ); From svnnotify @ sourceforge.jp Wed Apr 15 16:41:23 2009 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Wed, 15 Apr 2009 16:41:23 +0900 Subject: [Frameworkspider-svn] spider-commit [47] Message-ID: <1239781283.228182.22808.nullmailer@users.sourceforge.jp> Revision: 47 http://svn.sourceforge.jp/view?root=frameworkspider&view=rev&rev=47 Author: m_nakashima Date: 2009-04-15 16:41:23 +0900 (Wed, 15 Apr 2009) Log Message: ----------- Modified Paths: -------------- 1.0.0b3/.project -------------- next part -------------- Modified: 1.0.0b3/.project =================================================================== --- 1.0.0b3/.project 2009-04-15 07:40:54 UTC (rev 46) +++ 1.0.0b3/.project 2009-04-15 07:41:23 UTC (rev 47) @@ -1,6 +1,6 @@ - framework_spider_current + framework_spider_1.0.0b3 From svnnotify @ sourceforge.jp Wed Apr 15 16:43:06 2009 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Wed, 15 Apr 2009 16:43:06 +0900 Subject: [Frameworkspider-svn] spider-commit [48] Message-ID: <1239781386.764592.25268.nullmailer@users.sourceforge.jp> Revision: 48 http://svn.sourceforge.jp/view?root=frameworkspider&view=rev&rev=48 Author: m_nakashima Date: 2009-04-15 16:43:06 +0900 (Wed, 15 Apr 2009) Log Message: ----------- Modified Paths: -------------- 1.0.0b2/WWW_PUBLIC/spider.inc.php -------------- next part -------------- Modified: 1.0.0b2/WWW_PUBLIC/spider.inc.php =================================================================== --- 1.0.0b2/WWW_PUBLIC/spider.inc.php 2009-04-15 07:41:23 UTC (rev 47) +++ 1.0.0b2/WWW_PUBLIC/spider.inc.php 2009-04-15 07:43:06 UTC (rev 48) @@ -1,6 +1,9 @@ Revision: 49 http://svn.sourceforge.jp/view?root=frameworkspider&view=rev&rev=49 Author: m_nakashima Date: 2009-04-15 16:43:47 +0900 (Wed, 15 Apr 2009) Log Message: ----------- Modified Paths: -------------- 1.0.0b3/WWW_PUBLIC/spider.inc.php -------------- next part -------------- Modified: 1.0.0b3/WWW_PUBLIC/spider.inc.php =================================================================== --- 1.0.0b3/WWW_PUBLIC/spider.inc.php 2009-04-15 07:43:06 UTC (rev 48) +++ 1.0.0b3/WWW_PUBLIC/spider.inc.php 2009-04-15 07:43:47 UTC (rev 49) @@ -1,6 +1,9 @@ Revision: 50 http://svn.sourceforge.jp/view?root=frameworkspider&view=rev&rev=50 Author: m_nakashima Date: 2009-04-15 16:44:19 +0900 (Wed, 15 Apr 2009) Log Message: ----------- Removed Paths: ------------- 1.0.0b2/WWW_PUBLIC/pre_module.inc.php -------------- next part -------------- From svnnotify @ sourceforge.jp Wed Apr 15 16:44:35 2009 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Wed, 15 Apr 2009 16:44:35 +0900 Subject: [Frameworkspider-svn] spider-commit [51] Message-ID: <1239781475.866485.27203.nullmailer@users.sourceforge.jp> Revision: 51 http://svn.sourceforge.jp/view?root=frameworkspider&view=rev&rev=51 Author: m_nakashima Date: 2009-04-15 16:44:35 +0900 (Wed, 15 Apr 2009) Log Message: ----------- Removed Paths: ------------- 1.0.0b3/WWW_PUBLIC/pre_module.inc.php -------------- next part -------------- From svnnotify @ sourceforge.jp Wed Apr 15 16:45:36 2009 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Wed, 15 Apr 2009 16:45:36 +0900 Subject: [Frameworkspider-svn] spider-commit [52] Message-ID: <1239781536.269382.27942.nullmailer@users.sourceforge.jp> Revision: 52 http://svn.sourceforge.jp/view?root=frameworkspider&view=rev&rev=52 Author: m_nakashima Date: 2009-04-15 16:45:36 +0900 (Wed, 15 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-15 07:44:35 UTC (rev 51) +++ current/WWW_PUBLIC/spider.inc.php 2009-04-15 07:45:36 UTC (rev 52) @@ -1,6 +1,9 @@ Revision: 53 http://svn.sourceforge.jp/view?root=frameworkspider&view=rev&rev=53 Author: m_nakashima Date: 2009-04-15 16:48:17 +0900 (Wed, 15 Apr 2009) Log Message: ----------- Modified Paths: -------------- current/DATA/templates/default/public_default.php -------------- next part -------------- Modified: current/DATA/templates/default/public_default.php =================================================================== --- current/DATA/templates/default/public_default.php 2009-04-15 07:45:36 UTC (rev 52) +++ current/DATA/templates/default/public_default.php 2009-04-15 07:48:17 UTC (rev 53) @@ -3,18 +3,34 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - - - - - - + + + + + + - Welcome spider framework! This is sample template! + {write:page_title} + -
Welcome Spider framework! This is sample template!
- {page-contents} + +
+ {page-contents} +
+ \ No newline at end of file From svnnotify @ sourceforge.jp Wed Apr 15 16:49:35 2009 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Wed, 15 Apr 2009 16:49:35 +0900 Subject: [Frameworkspider-svn] spider-commit [54] Message-ID: <1239781775.318459.427.nullmailer@users.sourceforge.jp> Revision: 54 http://svn.sourceforge.jp/view?root=frameworkspider&view=rev&rev=54 Author: m_nakashima Date: 2009-04-15 16:49:35 +0900 (Wed, 15 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-15 07:48:17 UTC (rev 53) +++ current/WWW_PUBLIC/spider.inc.php 2009-04-15 07:49:35 UTC (rev 54) @@ -18,7 +18,7 @@ $script_filename = str_replace( '/', DIRECTORY_SEPARATOR, $_SERVER['SCRIPT_FILENAME'] ); if ( $script_filename == __FILE__ ) { header( 'Content-type: text/plain;charset=UTF-8' ); - die( 'コントロールファイルです' ); + die( 'You can\'t access this file direct!' ); } if( !isset( $DIR_PATH_SPIDER_DATA ) || strlen( trim( $DIR_PATH_SPIDER_DATA ) ) == 0 ) { From svnnotify @ sourceforge.jp Wed Apr 15 16:55:21 2009 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Wed, 15 Apr 2009 16:55:21 +0900 Subject: [Frameworkspider-svn] spider-commit [55] Message-ID: <1239782121.180907.8103.nullmailer@users.sourceforge.jp> Revision: 55 http://svn.sourceforge.jp/view?root=frameworkspider&view=rev&rev=55 Author: m_nakashima Date: 2009-04-15 16:55:21 +0900 (Wed, 15 Apr 2009) Log Message: ----------- Added Paths: ----------- 1.0.0b2/RELEASE.txt -------------- next part -------------- Added: 1.0.0b2/RELEASE.txt =================================================================== --- 1.0.0b2/RELEASE.txt (rev 0) +++ 1.0.0b2/RELEASE.txt 2009-04-15 07:55:21 UTC (rev 55) @@ -0,0 +1,9 @@ +# +# framework-spider ver.1.0.0b2 +# +# @auther Masanori Nakashima +# +# framework-spider is framework for php web application! +# you can use spider on PHP version 4.3 or grater version. +# + From svnnotify @ sourceforge.jp Wed Apr 15 16:55:38 2009 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Wed, 15 Apr 2009 16:55:38 +0900 Subject: [Frameworkspider-svn] spider-commit [56] Message-ID: <1239782138.699843.8197.nullmailer@users.sourceforge.jp> Revision: 56 http://svn.sourceforge.jp/view?root=frameworkspider&view=rev&rev=56 Author: m_nakashima Date: 2009-04-15 16:55:38 +0900 (Wed, 15 Apr 2009) Log Message: ----------- Added Paths: ----------- 1.0.0b3/RELEASE.txt -------------- next part -------------- Added: 1.0.0b3/RELEASE.txt =================================================================== --- 1.0.0b3/RELEASE.txt (rev 0) +++ 1.0.0b3/RELEASE.txt 2009-04-15 07:55:38 UTC (rev 56) @@ -0,0 +1,9 @@ +# +# framework-spider ver.1.0.0b3 +# +# @auther Masanori Nakashima +# +# framework-spider is framework for php web application! +# you can use spider on PHP version 4.3 or grater version. +# + From svnnotify @ sourceforge.jp Wed Apr 15 18:59:43 2009 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Wed, 15 Apr 2009 18:59:43 +0900 Subject: [Frameworkspider-svn] spider-commit [57] Message-ID: <1239789583.122375.3567.nullmailer@users.sourceforge.jp> Revision: 57 http://svn.sourceforge.jp/view?root=frameworkspider&view=rev&rev=57 Author: m_nakashima Date: 2009-04-15 18:59:43 +0900 (Wed, 15 Apr 2009) Log Message: ----------- Modified Paths: -------------- current/DATA/lib/util/mail/SMTP.class.php current/DATA/pages/default/index.php -------------- next part -------------- Modified: current/DATA/lib/util/mail/SMTP.class.php =================================================================== --- current/DATA/lib/util/mail/SMTP.class.php 2009-04-15 07:55:38 UTC (rev 56) +++ current/DATA/lib/util/mail/SMTP.class.php 2009-04-15 09:59:43 UTC (rev 57) @@ -55,7 +55,7 @@ "auth" => $this->options['smtp_auth'], "username" => $this->options['smtp_auth_user'], "password" => $this->options['smtp_auth_pass'], - "localhost" => $_SERVER['SERVER_NAME'] + "localhost" => $_SERVER['HOST_NAME'] ); $mailSendObj = & Mail::factory( 'smtp', $params ); Modified: current/DATA/pages/default/index.php =================================================================== --- current/DATA/pages/default/index.php 2009-04-15 07:55:38 UTC (rev 56) +++ current/DATA/pages/default/index.php 2009-04-15 09:59:43 UTC (rev 57) @@ -1,9 +1,9 @@

This is framework spider example page!

-
+

Widget example =>

- +
@@ -19,13 +19,17 @@
Dynamic Widget
+
- +

write scolar example =>

{write:example.Hello.message}

+
+ +

use array example =>

you can use 'foreach' tag like this!

    @@ -39,6 +43,9 @@ 3 = {write:example.Hello.message_array[3]}

    +
+ +

use hash example =>

you can use 'foreach' tag like this!

    @@ -53,5 +60,32 @@

- - \ No newline at end of file + +
+

use 2D hash example =>

+

you can use 'foreach' tag like this!

+ + + + + + + {foreach:example.Hello.person_hash person_name person_information} + + + + + {/foreach} + +
NameInformation
{write:person_name} + {foreach:person_information key value} + {if:key='sex'} + oh! > {write:key}={write:value}
+ {else-if:key='prefecture'} + yeah! > {write:key}={write:value}
+ {/if} + {/foreach} +
+
+ + \ No newline at end of file From svnnotify @ sourceforge.jp Thu Apr 16 20:40:19 2009 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Thu, 16 Apr 2009 20:40:19 +0900 Subject: [Frameworkspider-svn] spider-commit [58] Message-ID: <1239882019.369668.8543.nullmailer@users.sourceforge.jp> Revision: 58 http://svn.sourceforge.jp/view?root=frameworkspider&view=rev&rev=58 Author: m_nakashima Date: 2009-04-16 20:40:19 +0900 (Thu, 16 Apr 2009) Log Message: ----------- Modified Paths: -------------- current/DATA/lib/spider/Builder.class.php current/README.txt -------------- next part -------------- Modified: current/DATA/lib/spider/Builder.class.php =================================================================== --- current/DATA/lib/spider/Builder.class.php 2009-04-15 09:59:43 UTC (rev 57) +++ current/DATA/lib/spider/Builder.class.php 2009-04-16 11:40:19 UTC (rev 58) @@ -91,7 +91,7 @@ $folder_path = dirname($build_information_object->execute_file_path); // 存在しなかった場合の存在確認比較ファイルパス $confirm_default_path_array = array(); - while( strlen($folder_path) > strlen(APPLICATION_BASE_PATH) ) { + while( strlen($folder_path) >= strlen(APPLICATION_BASE_PATH) ) { $folder_default_path = $folder_path.DIRECTORY_SEPARATOR.'.default'; if( file_exists( $folder_default_path ) ) { break; Modified: current/README.txt =================================================================== --- current/README.txt 2009-04-15 09:59:43 UTC (rev 57) +++ current/README.txt 2009-04-16 11:40:19 UTC (rev 58) @@ -3,6 +3,10 @@ ** ** このファイルにはコミットごとに変更点とファイル名を記述します。 ** +-- 2009-04-16 +1) 公開フォルダ直下に配置した.defaultファイルが有効にならない問題の修正 + lib/spider/Builder.class.phpを修正しました。 + -- 2009-04-15 1) コアのエラーメッセージをDATA/messages.inc.phpにハッシュで定義しました。 From svnnotify @ sourceforge.jp Thu Apr 16 22:12:19 2009 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Thu, 16 Apr 2009 22:12:19 +0900 Subject: [Frameworkspider-svn] spider-commit [59] Message-ID: <1239887539.128780.29871.nullmailer@users.sourceforge.jp> Revision: 59 http://svn.sourceforge.jp/view?root=frameworkspider&view=rev&rev=59 Author: m_nakashima Date: 2009-04-16 22:12:19 +0900 (Thu, 16 Apr 2009) Log Message: ----------- Modified Paths: -------------- current/DATA/lib/spider/ModuleBase.class.php -------------- next part -------------- Modified: current/DATA/lib/spider/ModuleBase.class.php =================================================================== --- current/DATA/lib/spider/ModuleBase.class.php 2009-04-16 11:40:19 UTC (rev 58) +++ current/DATA/lib/spider/ModuleBase.class.php 2009-04-16 13:12:19 UTC (rev 59) @@ -51,11 +51,11 @@ function report_mailto($subject,$message,$mailto=null) { $mailto_addresses = array(); if( is_null( $mailto ) || strlen(trim($mailto)) == 0 ) { - if( !is_array( $GLOBALS['MAIL_SYSTEM_REPORT_TO'] ) ) { + if( !is_array( $GLOBALS['SYSTEM_MAIL_REPORT_TO_ADDRESSES'] ) ) { $this->error( "mailto:no defined:" . $subject . ":" . $message ); return false; } else { - $mailto_addresses = $GLOBALS['MAIL_SYSTEM_REPORT_TO']; + $mailto_addresses = $GLOBALS['SYSTEM_MAIL_REPORT_TO_ADDRESSES']; } } else { array_push($mailto_addresses, $mailto); @@ -63,8 +63,8 @@ if( $send_object = $this->get_system_mailer() ) { // 送信 foreach( $mailto_addresses as $address ) { - $result = $send_object->send( $address, MAIL_SYSTEM_SUBJECT_PREFIX.$subject, $message, - MAIL_SYSTEM_FROM_NAME.' <'.MAIL_SYSTEM_FROM_ADDRESS.'>', MAIL_SYSTEM_REPLYTO, MAIL_SYSTEM_RETURN ); + $result = $send_object->send( $address, SYSTEM_MAIL_SUBJECT_PREFIX.$subject, $message, + SYSTEM_MAIL_FROM_NAME.' <'.SYSTEM_MAIL_FROM_ADDRESS.'>', SYSTEM_MAIL_REPLY_ADDRESS, SYSTEM_MAIL_RETURN_ADDRESS ); if( $result ) { $this->report( "mailto:" . $address . ":" . $subject . ":" . $message ); } @@ -78,7 +78,7 @@ * システム設定された値でメール送信オブジェクトを作成して取得します。 */ function get_system_mailer() { - if( defined('MAIL_METHOD') ) { + if( defined('SYSTEM_MAIL_SEND_METHOD') ) { require_once( dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . "util" . DIRECTORY_SEPARATOR . "Mail.class.php" ); @@ -86,19 +86,12 @@ $params = array(); // 送信方法の決定 $class_name = 'PHP'; - if( preg_match('/^[sS][mM][tT][pP]$/',MAIL_METHOD) > 0 ) { + if( preg_match('/^[sS][mM][tT][pP]$/',SYSTEM_MAIL_SEND_METHOD) > 0 ) { $class_name = 'SMTP'; - $params = array( - 'smtp_host' => MAIL_SMTP_HOST, - 'smtp_port' => MAIL_SMTP_PORT, - 'smtp_auth' => MAIL_SMTP_AUTH, - 'smtp_auth_user' => MAIL_SMTP_USER, - 'smtp_auth_pass' => MAIL_SMTP_PASS - ); - } else if( preg_match('/^[sS][eE][nN][dD][mM][aA][iI][lL]$/',MAIL_METHOD) > 0 ) { + } else if( preg_match('/^[sS][eE][nN][dD][mM][aA][iI][lL]$/',SYSTEM_MAIL_SEND_METHOD) > 0 ) { $class_name = 'SendMail'; - $params = array('sendmail_path'=>MAIL_SENDMAIL_PATH); } + $params = $GLOBALS['SYSTEM_MAIL_SEND_METHOD_OPTIONS']; // 送信オブジェクト作成 $send_object = util_Mail::get_instance( $class_name, $params ); if( $send_object === false ) { @@ -120,9 +113,6 @@ if( defined('SYSTEM_LOG_LEVEL') && is_numeric(SYSTEM_LOG_LEVEL) && preg_match('/^[0-4]$/',SYSTEM_LOG_LEVEL) > 0 ) { $system_log_level = SYSTEM_LOG_LEVEL; - } else if( defined('MODE_LOG') && is_numeric(MODE_LOG) - && preg_match('/^[0-4]$/',MODE_LOG) > 0 ) { - $system_log_level = MODE_LOG; } // システム設定のログレベルより大きいレベルのログは出力しない if( $log_level > $system_log_level ) { From svnnotify @ sourceforge.jp Fri Apr 17 11:24:18 2009 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Fri, 17 Apr 2009 11:24:18 +0900 Subject: [Frameworkspider-svn] spider-commit [60] Message-ID: <1239935058.053786.25675.nullmailer@users.sourceforge.jp> Revision: 60 http://svn.sourceforge.jp/view?root=frameworkspider&view=rev&rev=60 Author: m_nakashima Date: 2009-04-17 11:24:17 +0900 (Fri, 17 Apr 2009) Log Message: ----------- Modified Paths: -------------- current/DATA/define.inc.php current/DATA/lib/spider/Controller.class.php current/DATA/lib/spider/HttpRequest.class.php current/DATA/lib/spider/ModuleBase.class.php -------------- next part -------------- Modified: current/DATA/define.inc.php =================================================================== --- current/DATA/define.inc.php 2009-04-16 13:12:19 UTC (rev 59) +++ current/DATA/define.inc.php 2009-04-17 02:24:17 UTC (rev 60) @@ -94,8 +94,8 @@ // ログ出力レベルの定義 define('SPIDER_LOG_LEVEL_FATAL', 0); define('SPIDER_LOG_LEVEL_ERROR', 1); -define('SPIDER_LOG_LEVEL_INFO', 2); -define('SPIDER_LOG_LEVEL_REPORT', 3); +define('SPIDER_LOG_LEVEL_WARNING', 2); +define('SPIDER_LOG_LEVEL_INFO', 3); define('SPIDER_LOG_LEVEL_DEBUG', 4); // システムメール定義ファイル名 Modified: current/DATA/lib/spider/Controller.class.php =================================================================== --- current/DATA/lib/spider/Controller.class.php 2009-04-16 13:12:19 UTC (rev 59) +++ current/DATA/lib/spider/Controller.class.php 2009-04-17 02:24:17 UTC (rev 60) @@ -98,8 +98,9 @@ if( is_null( $module_obj ) ) { // モジュールがスタックにない場合は新規作成して実行 $module_obj = new $module_real_name; - $module_obj->controller_object = & $this; - $module_obj->http_output_object = & $this->http_output_object; + $module_obj->controller_object = & $this; + $module_obj->http_output_object = & $this->http_output_object; + $module_obj->http_request_object = & $this->request_object; // 要求モジュールが存在して未実行の場合は先に強制実行する if( is_array( $module_obj->require_module_array ) ) { foreach( $module_obj->require_module_array as $require_module_name ) { Modified: current/DATA/lib/spider/HttpRequest.class.php =================================================================== --- current/DATA/lib/spider/HttpRequest.class.php 2009-04-16 13:12:19 UTC (rev 59) +++ current/DATA/lib/spider/HttpRequest.class.php 2009-04-17 02:24:17 UTC (rev 60) @@ -47,6 +47,7 @@ $reg_key = $key; $callstack = debug_backtrace(); $caller_file = $callstack[0]['file']; + unset($callstack); if( strpos($caller_file,DIR_PATH_LIB) !== false && strpos($caller_file,DIR_PATH_LIB.DIRECTORY_SEPARATOR.'spider') === false ) { // 呼び出し元がlib内のファイルの場合 @@ -208,8 +209,202 @@ } } } + /** + * グローバルセッションキー + */ function _getGlobalSessionKey( $key ) { return 'spider_GLOBAL.'.$key; } + /** + * ログを出力します + * @param $message ログメッセージ + */ + function writeLog( $message, $log_level=SPIDER_LOG_LEVEL_INFO ) { + $system_log_level = SPIDER_LOG_LEVEL_INFO; + if( defined('SYSTEM_LOG_LEVEL') && is_numeric(SYSTEM_LOG_LEVEL) + && preg_match('/^[0-4]$/',SYSTEM_LOG_LEVEL) > 0 ) { + $system_log_level = SYSTEM_LOG_LEVEL; + } + // システム設定のログレベルより大きいレベルのログは出力しない + if( $log_level > $system_log_level ) { + return true; + } + + // ログファイル名の決定 + $log_file_path = DIR_PATH_LOG.DIRECTORY_SEPARATOR.'spider'; + if( !file_exists( $log_file_path ) ) { + if( @mkdir( $log_file_path, 0777 ) ) { + @chmod( $log_file_path, 0777 ); + } + } + $log_file_path = $log_file_path.DIRECTORY_SEPARATOR.date('Y'); + if( !file_exists( $log_file_path ) ) { + if( @mkdir( $log_file_path, 0777 ) ) { + @chmod( $log_file_path, 0777 ); + } + } + $log_file_path = $log_file_path.DIRECTORY_SEPARATOR.date('m'); + if( !file_exists( $log_file_path ) ) { + if( @mkdir( $log_file_path, 0777 ) ) { + @chmod( $log_file_path, 0777 ); + } + } + $log_file_path = $log_file_path.DIRECTORY_SEPARATOR.'system_'.date('d').'.log'; + if( !file_exists( $log_file_path ) ) { + if(@touch( $log_file_path, 0666 )){ + @chmod( $log_file_path, 0666 ); + } + } + $message = str_replace( "\r\n", "\n", $message ); + $message = str_replace( "\r", "\n", $message ); + $message = str_replace( "\n", " ", $message ); + + $callstack = debug_backtrace(); + $caller_file = $callstack[0]['file']; + $caller_line = $callstack[0]['line']; + unset($callstack); + + error_log( + "[". date('Y-m-d H:i:s')."]" + . "\t".$message + . "\t"."[".$caller_file."] " + . "\t"."[".$caller_line."] " + . "\t" . $_SERVER['REMOTE_ADDR'] + . "\t" . $_SERVER['REMOTE_HOST'] + . "\t" . $_SERVER['HTTP_USER_AGENT'] + . "\n" + , 3, $log_file_path ); + return true; + } + /** + * Fatalレベルのログを出力します。 + * @param $message ログメッセージ + */ + function fatal($message){ + $this->writeLog( $message, SPIDER_LOG_LEVEL_FATAL ); + } + /** + * Errorレベルのログを出力します。 + * @param $message ログメッセージ + */ + function error($message){ + $this->writeLog( $message, SPIDER_LOG_LEVEL_ERROR ); + } + /** + * Warningレベルのログを出力します。 + * @param $message ログメッセージ + */ + function warn($message){ + $this->writeLog( $message, SPIDER_LOG_LEVEL_WARNING ); + } + /** + * Infoレベルのログを出力します。 + * @param $message ログメッセージ + */ + function info($message){ + $this->writeLog( $message, SPIDER_LOG_LEVEL_INFO ); + } + /** + * Debugレベルのログを出力します。 + * @param $message ログメッセージ + */ + function debug($message){ + $this->writeLog( $message, SPIDER_LOG_LEVEL_DEBUG ); + } + /** + * システム設定された値でメール送信オブジェクトを作成して取得します。 + */ + function getSystemMailer() { + if( defined('SYSTEM_MAIL_SEND_METHOD') ) { + require_once( dirname(dirname(__FILE__)) + . DIRECTORY_SEPARATOR . "util" + . DIRECTORY_SEPARATOR . "Mail.class.php" ); + // 送信オプション + $params = array(); + // 送信方法の決定 + $class_name = 'PHP'; + if( preg_match('/^[sS][mM][tT][pP]$/',SYSTEM_MAIL_SEND_METHOD) > 0 ) { + $class_name = 'SMTP'; + } else if( preg_match('/^[sS][eE][nN][dD][mM][aA][iI][lL]$/',SYSTEM_MAIL_SEND_METHOD) > 0 ) { + $class_name = 'SendMail'; + } + $params = $GLOBALS['SYSTEM_MAIL_SEND_METHOD_OPTIONS']; + // 送信オブジェクト作成 + $send_object = util_Mail::get_instance( $class_name, $params ); + if( $send_object === false ) { + return false; + } else { + return $send_object; + } + } else { + return false; + } + } + /** + * メールを送信します。 + * @param $subject メール件名 + * @param $message メール本文 + * @param $mailto 宛て先メールアドレス + */ + function mailTo($subject,$message,$mailto=null,$from=null,$reply=null,$return=null) { + $mailto_addresses = array(); + if( isset($GLOBALS['SYSTEM_MAIL_REPORT_TO_ADDRESSES']) + && is_array($GLOBALS['SYSTEM_MAIL_REPORT_TO_ADDRESSES']) ) { + $mailto_addresses = $GLOBALS['SYSTEM_MAIL_REPORT_TO_ADDRESSES']; + } + $mailto = trim($mailto); + if(!is_null($mailto) && strlen($mailto) > 0 ) { + array_push($mailto_addresses, $mailto); + } + if(count($mailto_addresses)==0){ + $this->warn('HttpRequest->MailTo: derivery mail address is required!: '.$subject.':'.$message); + return false; + } + if(defined('SYSTEM_MAIL_SUBJECT_PREFIX')){ + $subject = SYSTEM_MAIL_SUBJECT_PREFIX.$subject; + } + if( is_null($from) || strlen($from) == 0 ) { + if(defined('SYSTEM_MAIL_FROM_ADDRESS') && strlen(SYSTEM_MAIL_FROM_ADDRESS)>0 ) { + if(defined('SYSTEM_MAIL_FROM_NAME') && strlen(SYSTEM_MAIL_FROM_NAME)>0 ) { + $from = SYSTEM_MAIL_FROM_NAME.' <'.SYSTEM_MAIL_FROM_ADDRESS.'>'; + } else { + $from = SYSTEM_MAIL_FROM_ADDRESS; + } + } else { + $this->warn('HttpRequest->MailTo: from address is required!: '.$subject.':'.$message); + return false; + } + } + if( is_null($reply) || strlen($reply) == 0 ) { + if(defined('SYSTEM_MAIL_REPLY_ADDRESS') && strlen(SYSTEM_MAIL_REPLY_ADDRESS)>0 ) { + $reply = SYSTEM_MAIL_REPLY_ADDRESS; + } else { + $reply = $from; + } + } + if( is_null($return) || strlen($return) == 0 ) { + if(defined('SYSTEM_MAIL_RETURN_ADDRESS') && strlen(SYSTEM_MAIL_RETURN_ADDRESS)>0 ) { + $return = SYSTEM_MAIL_RETURN_ADDRESS; + } else { + $return = $from; + } + } + + if( $send_object = $this->getSystemMailer() ) { + foreach( $mailto_addresses as $address ) { + $result = $send_object->send( $address, $subject, $message, $from, $reply, $return ); + if( $result ) { + $this->info( 'HttpRequest->MailTo: '.$address.':'.$subject.':'.$message ); + return true; + } else { + $this->warn('HttpRequest->MailTo: delivey error: '.$subject.':'.$message); + return false; + } + } + } else { + $this->warning( 'HttpRequest->MailTo: can\'t create mailer instance!: '.$mailto.':'.$subject.':'.$message ); + return false; + } + } } ?> Modified: current/DATA/lib/spider/ModuleBase.class.php =================================================================== --- current/DATA/lib/spider/ModuleBase.class.php 2009-04-16 13:12:19 UTC (rev 59) +++ current/DATA/lib/spider/ModuleBase.class.php 2009-04-17 02:24:17 UTC (rev 60) @@ -10,9 +10,15 @@ * @since PHP 4.3 */ class spider_ModuleBase { + /** Controllerクラスオブジェクトへの参照 */ var $controller_object; + /** HttpOutputクラスオブジェクトへの参照 */ var $http_output_object; + /** HttpRequestクラスオブジェクトへの参照 */ + var $http_request_object; + /** 要求モジュール配列 */ var $require_module_array = array(); + /** 後実行モジュール配列 */ var $post_module_array = array(); /** * コンストラクタ @@ -47,150 +53,87 @@ } /** * メールレポートを送信します。 + * @param $subject + * @param $message + * @param $maito + * @deprecated v1.0.00 - 2009/04/17 正式リリース前の仕様です。HttpRequestクラスオブジェクトのmailToメソッドを利用してください。 */ function report_mailto($subject,$message,$mailto=null) { - $mailto_addresses = array(); - if( is_null( $mailto ) || strlen(trim($mailto)) == 0 ) { - if( !is_array( $GLOBALS['SYSTEM_MAIL_REPORT_TO_ADDRESSES'] ) ) { - $this->error( "mailto:no defined:" . $subject . ":" . $message ); - return false; - } else { - $mailto_addresses = $GLOBALS['SYSTEM_MAIL_REPORT_TO_ADDRESSES']; - } - } else { - array_push($mailto_addresses, $mailto); + if(is_object($this->http_request_object)){ + return $this->http_request_object->mailTo($subject,$message,$mailto); } - if( $send_object = $this->get_system_mailer() ) { - // 送信 - foreach( $mailto_addresses as $address ) { - $result = $send_object->send( $address, SYSTEM_MAIL_SUBJECT_PREFIX.$subject, $message, - SYSTEM_MAIL_FROM_NAME.' <'.SYSTEM_MAIL_FROM_ADDRESS.'>', SYSTEM_MAIL_REPLY_ADDRESS, SYSTEM_MAIL_RETURN_ADDRESS ); - if( $result ) { - $this->report( "mailto:" . $address . ":" . $subject . ":" . $message ); - } - } - return true; - } - $this->error( "mailto:" . $mailto . ":" . $subject . ":" . $message ); return false; } /** * システム設定された値でメール送信オブジェクトを作成して取得します。 + * @deprecated v1.0.00 - 2009/04/17 正式リリース前の仕様です。HttpRequestクラスオブジェクトのmailToメソッドを利用してください。 */ function get_system_mailer() { - if( defined('SYSTEM_MAIL_SEND_METHOD') ) { - require_once( dirname(dirname(__FILE__)) - . DIRECTORY_SEPARATOR . "util" - . DIRECTORY_SEPARATOR . "Mail.class.php" ); - // 送信オプション - $params = array(); - // 送信方法の決定 - $class_name = 'PHP'; - if( preg_match('/^[sS][mM][tT][pP]$/',SYSTEM_MAIL_SEND_METHOD) > 0 ) { - $class_name = 'SMTP'; - } else if( preg_match('/^[sS][eE][nN][dD][mM][aA][iI][lL]$/',SYSTEM_MAIL_SEND_METHOD) > 0 ) { - $class_name = 'SendMail'; - } - $params = $GLOBALS['SYSTEM_MAIL_SEND_METHOD_OPTIONS']; - // 送信オブジェクト作成 - $send_object = util_Mail::get_instance( $class_name, $params ); - if( $send_object === false ) { - return false; - } else { - return $send_object; - } - } else { - return false; + if(is_object($this->http_request_object)){ + return $this->http_request_object->getSystemMailer(); } + return false; } /** * ログを出力します。 * @param $message ログメッセージ * @param $log_level 出力するログのレベル + * @deprecated v1.0.00 - 2009/04/17 正式リリース前の仕様です。HttpRequestクラスオブジェクトのwriteLogメソッドを利用してください。 */ function write_log( $message, $log_level=SPIDER_LOG_LEVEL_INFO ) { - $system_log_level = SPIDER_LOG_LEVEL_INFO; - if( defined('SYSTEM_LOG_LEVEL') && is_numeric(SYSTEM_LOG_LEVEL) - && preg_match('/^[0-4]$/',SYSTEM_LOG_LEVEL) > 0 ) { - $system_log_level = SYSTEM_LOG_LEVEL; + if(is_object($this->http_request_object)){ + $this->http_request_object->writeLog($message,$log_level); } - // システム設定のログレベルより大きいレベルのログは出力しない - if( $log_level > $system_log_level ) { - return true; - } - // ログファイル名の決定 - $log_file_path = DIR_PATH_LOG.DIRECTORY_SEPARATOR.'spider'; - if( !file_exists( $log_file_path ) ) { - if( @mkdir( $log_file_path, 0777 ) ) { - @chmod( $log_file_path, 0777 ); - } - } - $log_file_path = $log_file_path.DIRECTORY_SEPARATOR.date('Y'); - if( !file_exists( $log_file_path ) ) { - if( @mkdir( $log_file_path, 0777 ) ) { - @chmod( $log_file_path, 0777 ); - } - } - $log_file_path = $log_file_path.DIRECTORY_SEPARATOR.date('m'); - if( !file_exists( $log_file_path ) ) { - if( @mkdir( $log_file_path, 0777 ) ) { - @chmod( $log_file_path, 0777 ); - } - } - $log_file_path = $log_file_path.DIRECTORY_SEPARATOR.'system_'.date('d').'.log'; - if( !file_exists( $log_file_path ) ) { - if(@touch( $log_file_path, 0666 )){ - @chmod( $log_file_path, 0666 ); - } - } - $message = str_replace( "\r\n", "\n", $message ); - $message = str_replace( "\r", "\n", $message ); - $message = str_replace( "\n", " ", $message ); - error_log( - "[". date('Y-m-d H:i:s')."]" - ."[".get_class($this)."] " - .$message - . "\t" . $_SERVER['REMOTE_ADDR'] - . "\t" . $_SERVER['REMOTE_HOST'] - . "\t" . $_SERVER['HTTP_USER_AGENT'] - . "\n" - , 3, $log_file_path ); - return true; } /** - * Infoレベルのログを出力します。 + * Fatalレベルのログを出力します。 * @param $message ログメッセージ + * @deprecated v1.0.00 - 2009/04/17 正式リリース前の仕様です。HttpRequestクラスオブジェクトのfatalメソッドを利用してください。 */ - function info($message){ - $this->write_log( $message, SPIDER_LOG_LEVEL_INFO ); + function fatal($message){ + if(is_object($this->http_request_object)){ + $this->http_request_object->writeLog($message,SPIDER_LOG_LEVEL_FATAL); + } } /** - * Reportレベルのログを出力します。 + * Errorレベルのログを出力します。 * @param $message ログメッセージ + * @deprecated v1.0.00 - 2009/04/17 正式リリース前の仕様です。HttpRequestクラスオブジェクトのerrorメソッドを利用してください。 */ - function report($message){ - $this->write_log( $message, SPIDER_LOG_LEVEL_REPORT ); + function error($message){ + if(is_object($this->http_request_object)){ + $this->http_request_object->writeLog($message,SPIDER_LOG_LEVEL_ERROR); + } } /** - * Errorレベルのログを出力します。 + * Warningレベルのログを出力します。 * @param $message ログメッセージ + * @deprecated v1.0.00 - 2009/04/17 正式リリース前の仕様です。HttpRequestクラスオブジェクトのwarnメソッドを利用してください。 */ - function error($message){ - $this->write_log( $message, SPIDER_LOG_LEVEL_ERROR ); + function warn($message){ + if(is_object($this->http_request_object)){ + $this->http_request_object->writeLog($message,SPIDER_LOG_LEVEL_WARNING); + } } /** - * Fatalレベルのログを出力します。 + * Infoレベルのログを出力します。 * @param $message ログメッセージ + * @deprecated v1.0.00 - 2009/04/17 正式リリース前の仕様です。HttpRequestクラスオブジェクトのinfoメソッドを利用してください。 */ - function fatal($message){ - $this->write_log( $message, SPIDER_LOG_LEVEL_FATAL ); + function info($message){ + if(is_object($this->http_request_object)){ + $this->http_request_object->writeLog($message,SPIDER_LOG_LEVEL_INFO); + } } /** * Debugレベルのログを出力します。 * @param $message ログメッセージ + * @deprecated v1.0.00 - 2009/04/17 正式リリース前の仕様です。HttpRequestクラスオブジェクトのdebugメソッドを利用してください。 */ function debug($message){ - $this->write_log( $message, SPIDER_LOG_LEVEL_DEBUG ); + if(is_object($this->http_request_object)){ + $this->http_request_object->writeLog($message,SPIDER_LOG_LEVEL_DEBUG); + } } } ?> From svnnotify @ sourceforge.jp Fri Apr 17 12:32:12 2009 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Fri, 17 Apr 2009 12:32:12 +0900 Subject: [Frameworkspider-svn] spider-commit [61] Message-ID: <1239939132.642047.3728.nullmailer@users.sourceforge.jp> Revision: 61 http://svn.sourceforge.jp/view?root=frameworkspider&view=rev&rev=61 Author: m_nakashima Date: 2009-04-17 12:32:12 +0900 (Fri, 17 Apr 2009) Log Message: ----------- Modified Paths: -------------- current/DATA/lib/spider/HttpRequest.class.php -------------- next part -------------- Modified: current/DATA/lib/spider/HttpRequest.class.php =================================================================== --- current/DATA/lib/spider/HttpRequest.class.php 2009-04-17 02:24:17 UTC (rev 60) +++ current/DATA/lib/spider/HttpRequest.class.php 2009-04-17 03:32:12 UTC (rev 61) @@ -342,9 +342,20 @@ } /** * メールを送信します。 + * 宛先、配信元、返信先、戻り先のメールアドレスを指定しなかった場合、下記に定義された定数もしはグローバル配列を探して + * 定義済みの変数を元に送信を実行します。定義がなかった場合はfalseを返します。 + * + * 宛て先メールアドレス $GLOBALS['SYSTEM_MAIL_REPORT_TO_ADDRESSES'] 配列で定義してください。 + * 配信元メールアドレス SYSTEM_MAIL_FROM_ADDRESS 文字列で定義してください。 + * 配信先メールアドレス SYSTEM_MAIL_REPLY_ADDRESS 指定がない場合はSYSTEM_MAIL_FROM_ADDRESSを利用します。 + * 戻り先メールアドレス SYSTEM_MAIL_RETURN_ADDRESS 指定がない場合はSYSTEM_MAIL_FROM_ADDRESSを利用します。 + * * @param $subject メール件名 * @param $message メール本文 * @param $mailto 宛て先メールアドレス + * @param $from 配信元メールアドレス指定 + * @param $reply 返信先メールアドレス指定 + * @param $return エラー戻り先メールアドレス指定 */ function mailTo($subject,$message,$mailto=null,$from=null,$reply=null,$return=null) { $mailto_addresses = array(); From svnnotify @ sourceforge.jp Fri Apr 17 12:33:31 2009 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Fri, 17 Apr 2009 12:33:31 +0900 Subject: [Frameworkspider-svn] spider-commit [62] Message-ID: <1239939211.638450.4688.nullmailer@users.sourceforge.jp> Revision: 62 http://svn.sourceforge.jp/view?root=frameworkspider&view=rev&rev=62 Author: m_nakashima Date: 2009-04-17 12:33:31 +0900 (Fri, 17 Apr 2009) Log Message: ----------- Modified Paths: -------------- current/DATA/lib/spider/HttpRequest.class.php -------------- next part -------------- Modified: current/DATA/lib/spider/HttpRequest.class.php =================================================================== --- current/DATA/lib/spider/HttpRequest.class.php 2009-04-17 03:32:12 UTC (rev 61) +++ current/DATA/lib/spider/HttpRequest.class.php 2009-04-17 03:33:31 UTC (rev 62) @@ -313,6 +313,7 @@ } /** * システム設定された値でメール送信オブジェクトを作成して取得します。 + * @return mixed util_Mailクラスの実装オブジェクト・インスタンスを作成できなかった場合はfalse */ function getSystemMailer() { if( defined('SYSTEM_MAIL_SEND_METHOD') ) { @@ -356,6 +357,7 @@ * @param $from 配信元メールアドレス指定 * @param $reply 返信先メールアドレス指定 * @param $return エラー戻り先メールアドレス指定 + * @return boolean */ function mailTo($subject,$message,$mailto=null,$from=null,$reply=null,$return=null) { $mailto_addresses = array(); From svnnotify @ sourceforge.jp Fri Apr 17 12:37:52 2009 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Fri, 17 Apr 2009 12:37:52 +0900 Subject: [Frameworkspider-svn] spider-commit [63] Message-ID: <1239939472.848022.10313.nullmailer@users.sourceforge.jp> Revision: 63 http://svn.sourceforge.jp/view?root=frameworkspider&view=rev&rev=63 Author: m_nakashima Date: 2009-04-17 12:37:52 +0900 (Fri, 17 Apr 2009) Log Message: ----------- Modified Paths: -------------- current/DATA/lib/spider/HttpRequest.class.php current/README.txt -------------- next part -------------- Modified: current/DATA/lib/spider/HttpRequest.class.php =================================================================== --- current/DATA/lib/spider/HttpRequest.class.php 2009-04-17 03:33:31 UTC (rev 62) +++ current/DATA/lib/spider/HttpRequest.class.php 2009-04-17 03:37:52 UTC (rev 63) @@ -90,9 +90,13 @@ /** * エラーメッセージを追加します。 * @param $message エラーメッセージ + * @param $log_level ログ出力を同時に行う場合に指定します。falseを指定すると記録しません。デフォルトはfalseです。 */ - function addError( $message ) { + function addError( $message, $log_level=false ) { array_push( $this->errors, $message ); + if( false !== $log_level && is_numeric($log_level) ) { + $this->writeLog( $message, $log_level ); + } } /** * エラーがあるか確認します。 Modified: current/README.txt =================================================================== --- current/README.txt 2009-04-17 03:33:31 UTC (rev 62) +++ current/README.txt 2009-04-17 03:37:52 UTC (rev 63) @@ -3,6 +3,9 @@ ** ** このファイルにはコミットごとに変更点とファイル名を記述します。 ** +-- 2009-04-17 +1) ログ出力周りの整理を行いました。ModuleBaseにあったログ出力機能をHttpRequestに移しました。 + -- 2009-04-16 1) 公開フォルダ直下に配置した.defaultファイルが有効にならない問題の修正 lib/spider/Builder.class.phpを修正しました。 From svnnotify @ sourceforge.jp Fri Apr 17 19:50:56 2009 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Fri, 17 Apr 2009 19:50:56 +0900 Subject: [Frameworkspider-svn] =?utf-8?b?c3BpZGVyLWNvbW1pdCBbNjRdICDjg60=?= =?utf-8?b?44Kw5Ye65Yqb44Os44OZ44Or5a6a576p44Gu5aSJ5pu0IOmWk+OBq+aVsA==?= =?utf-8?b?5YCk44KS5oy/5YWl44Gn44GN44KL44KI44GG5pWw5YCk44GrMTDjga7jgqQ=?= =?utf-8?b?44Oz44K/44O844OQ44Or44KS6Kit44GR44G+44GX44Gf44CC?= Message-ID: <1239965456.235462.20601.nullmailer@users.sourceforge.jp> Revision: 64 http://svn.sourceforge.jp/view?root=frameworkspider&view=rev&rev=64 Author: m_nakashima Date: 2009-04-17 19:50:56 +0900 (Fri, 17 Apr 2009) Log Message: ----------- ログ出力レベル定義の変更 間に数値を挿入できるよう数値に10のインターバルを設けました。 Modified Paths: -------------- current/DATA/define.inc.php current/README.txt -------------- next part -------------- Modified: current/DATA/define.inc.php =================================================================== --- current/DATA/define.inc.php 2009-04-17 03:37:52 UTC (rev 63) +++ current/DATA/define.inc.php 2009-04-17 10:50:56 UTC (rev 64) @@ -93,10 +93,10 @@ */ // ログ出力レベルの定義 define('SPIDER_LOG_LEVEL_FATAL', 0); -define('SPIDER_LOG_LEVEL_ERROR', 1); -define('SPIDER_LOG_LEVEL_WARNING', 2); -define('SPIDER_LOG_LEVEL_INFO', 3); -define('SPIDER_LOG_LEVEL_DEBUG', 4); +define('SPIDER_LOG_LEVEL_ERROR', 10); +define('SPIDER_LOG_LEVEL_WARNING', 20); +define('SPIDER_LOG_LEVEL_INFO', 30); +define('SPIDER_LOG_LEVEL_DEBUG', 40); // システムメール定義ファイル名 define ( 'FILE_NAME_SYSTEM_DEFINITION', 'system.inc.php' ); Modified: current/README.txt =================================================================== --- current/README.txt 2009-04-17 03:37:52 UTC (rev 63) +++ current/README.txt 2009-04-17 10:50:56 UTC (rev 64) @@ -5,6 +5,7 @@ ** -- 2009-04-17 1) ログ出力周りの整理を行いました。ModuleBaseにあったログ出力機能をHttpRequestに移しました。 +2) ログ出力レベルの定義を追加・変更しました。 -- 2009-04-16 1) 公開フォルダ直下に配置した.defaultファイルが有効にならない問題の修正 From svnnotify @ sourceforge.jp Fri Apr 17 20:46:49 2009 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Fri, 17 Apr 2009 20:46:49 +0900 Subject: [Frameworkspider-svn] spider-commit [65] Message-ID: <1239968809.146936.25068.nullmailer@users.sourceforge.jp> Revision: 65 http://svn.sourceforge.jp/view?root=frameworkspider&view=rev&rev=65 Author: m_nakashima Date: 2009-04-17 20:46:49 +0900 (Fri, 17 Apr 2009) Log Message: ----------- Modified Paths: -------------- current/DATA/define.inc.php current/DATA/lib/spider/HttpRequest.class.php current/README.txt -------------- next part -------------- Modified: current/DATA/define.inc.php =================================================================== --- current/DATA/define.inc.php 2009-04-17 10:50:56 UTC (rev 64) +++ current/DATA/define.inc.php 2009-04-17 11:46:49 UTC (rev 65) @@ -95,8 +95,12 @@ define('SPIDER_LOG_LEVEL_FATAL', 0); define('SPIDER_LOG_LEVEL_ERROR', 10); define('SPIDER_LOG_LEVEL_WARNING', 20); -define('SPIDER_LOG_LEVEL_INFO', 30); -define('SPIDER_LOG_LEVEL_DEBUG', 40); +define('SPIDER_LOG_LEVEL_NOTICE', 30); +define('SPIDER_LOG_LEVEL_INFO', 40); +define('SPIDER_LOG_LEVEL_DEBUG', 50); +// ログ出力先の定義 +define('SPIDER_LOG_TYPE_FILE', 0); +define('SPIDER_LOG_TYPE_SYSLOG', 10); // システムメール定義ファイル名 define ( 'FILE_NAME_SYSTEM_DEFINITION', 'system.inc.php' ); Modified: current/DATA/lib/spider/HttpRequest.class.php =================================================================== --- current/DATA/lib/spider/HttpRequest.class.php 2009-04-17 10:50:56 UTC (rev 64) +++ current/DATA/lib/spider/HttpRequest.class.php 2009-04-17 11:46:49 UTC (rev 65) @@ -234,31 +234,6 @@ return true; } - // ログファイル名の決定 - $log_file_path = DIR_PATH_LOG.DIRECTORY_SEPARATOR.'spider'; - if( !file_exists( $log_file_path ) ) { - if( @mkdir( $log_file_path, 0777 ) ) { - @chmod( $log_file_path, 0777 ); - } - } - $log_file_path = $log_file_path.DIRECTORY_SEPARATOR.date('Y'); - if( !file_exists( $log_file_path ) ) { - if( @mkdir( $log_file_path, 0777 ) ) { - @chmod( $log_file_path, 0777 ); - } - } - $log_file_path = $log_file_path.DIRECTORY_SEPARATOR.date('m'); - if( !file_exists( $log_file_path ) ) { - if( @mkdir( $log_file_path, 0777 ) ) { - @chmod( $log_file_path, 0777 ); - } - } - $log_file_path = $log_file_path.DIRECTORY_SEPARATOR.'system_'.date('d').'.log'; - if( !file_exists( $log_file_path ) ) { - if(@touch( $log_file_path, 0666 )){ - @chmod( $log_file_path, 0666 ); - } - } $message = str_replace( "\r\n", "\n", $message ); $message = str_replace( "\r", "\n", $message ); $message = str_replace( "\n", " ", $message ); @@ -268,16 +243,77 @@ $caller_line = $callstack[0]['line']; unset($callstack); - error_log( - "[". date('Y-m-d H:i:s')."]" + $log_message = date('Y-m-d H:i:s') . "\t".$message . "\t"."[".$caller_file."] " . "\t"."[".$caller_line."] " . "\t" . $_SERVER['REMOTE_ADDR'] . "\t" . $_SERVER['REMOTE_HOST'] - . "\t" . $_SERVER['HTTP_USER_AGENT'] - . "\n" - , 3, $log_file_path ); + . "\t" . $_SERVER['HTTP_USER_AGENT']; + + $log_type = SPIDER_LOG_TYPE_FILE; + if( defined('SYSTEM_LOG_TYPE') && is_numeric(SYSTEM_LOG_TYPE) ) { + if( SPIDER_LOG_TYPE_SYSLOG == SYSTEM_LOG_TYPE ) { + $log_type = SPIDER_LOG_TYPE_SYSLOG; + } + } + if( SPIDER_LOG_TYPE_SYSLOG == $log_type ) { + // syslogdに出力する場合 + openlog('spiderLog', LOG_PID | LOG_NDELAY, LOG_SYSLOG); + $log_level = LOG_INFO; + switch ($log_level) { + case SPIDER_LOG_LEVEL_DEBUG: + $log_level = LOG_DEBUG; + break; + case SPIDER_LOG_LEVEL_INFO: + $log_level = LOG_INFO; + break; + case SPIDER_LOG_LEVEL_NOTICE: + $log_level = LOG_NOTICE; + break; + case SPIDER_LOG_LEVEL_WARNING: + $log_level = LOG_WARNING; + break; + case SPIDER_LOG_LEVEL_ERROR: + $log_level = LOG_ERR; + break; + case SPIDER_LOG_LEVEL_FATAL: + $log_level = LOG_CRIT; + break; + default: + break; + } + syslog($log_level, $log_message); + closelog(); + } else { + // ファイルに出力する + // ログファイル名の決定 + $log_file_path = DIR_PATH_LOG.DIRECTORY_SEPARATOR.'spider'; + if( !file_exists( $log_file_path ) ) { + if( @mkdir( $log_file_path, 0777 ) ) { + @chmod( $log_file_path, 0777 ); + } + } + $log_file_path = $log_file_path.DIRECTORY_SEPARATOR.date('Y'); + if( !file_exists( $log_file_path ) ) { + if( @mkdir( $log_file_path, 0777 ) ) { + @chmod( $log_file_path, 0777 ); + } + } + $log_file_path = $log_file_path.DIRECTORY_SEPARATOR.date('m'); + if( !file_exists( $log_file_path ) ) { + if( @mkdir( $log_file_path, 0777 ) ) { + @chmod( $log_file_path, 0777 ); + } + } + $log_file_path = $log_file_path.DIRECTORY_SEPARATOR.'system_'.date('d').'.log'; + if( !file_exists( $log_file_path ) ) { + if(@touch( $log_file_path, 0666 )){ + @chmod( $log_file_path, 0666 ); + } + } + error_log($log_message."\n" , 3, $log_file_path ); + } return true; } /** @@ -302,6 +338,13 @@ $this->writeLog( $message, SPIDER_LOG_LEVEL_WARNING ); } /** + * Noticeレベルのログを出力します。 + * @param $message ログメッセージ + */ + function notice($message){ + $this->writeLog( $message, SPIDER_LOG_LEVEL_NOTICE ); + } + /** * Infoレベルのログを出力します。 * @param $message ログメッセージ */ Modified: current/README.txt =================================================================== --- current/README.txt 2009-04-17 10:50:56 UTC (rev 64) +++ current/README.txt 2009-04-17 11:46:49 UTC (rev 65) @@ -6,6 +6,9 @@ -- 2009-04-17 1) ログ出力周りの整理を行いました。ModuleBaseにあったログ出力機能をHttpRequestに移しました。 2) ログ出力レベルの定義を追加・変更しました。 + 併せてsyslogdへのログ出力にも対応しました。定数SYSTEM_LOG_TYPEを定義してSPIDER_LOG_TYPE_SYSLOGを設定すれば + システムログへのログ送出へ切り替わります。unique_setting.inc.php内もしくは他ファイルを読み込ませて定義してください。 + 本バージョンではsyslogdへのident文字列はspiderで固定です。 -- 2009-04-16 1) 公開フォルダ直下に配置した.defaultファイルが有効にならない問題の修正 From svnnotify @ sourceforge.jp Fri Apr 17 21:03:14 2009 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Fri, 17 Apr 2009 21:03:14 +0900 Subject: [Frameworkspider-svn] =?utf-8?b?c3BpZGVyLWNvbW1pdCBbNjZdICDjg5A=?= =?utf-8?b?44O844K444On44Oz55Wq5Y+344KSMSAuMC4gMDDjgajjgZfmraPlvI/jg6o=?= =?utf-8?b?44Oq44O844K544Go44GX44G+44GZ44CC?= Message-ID: <1239969794.474150.19884.nullmailer@users.sourceforge.jp> Revision: 66 http://svn.sourceforge.jp/view?root=frameworkspider&view=rev&rev=66 Author: m_nakashima Date: 2009-04-17 21:03:14 +0900 (Fri, 17 Apr 2009) Log Message: ----------- バージョン番号を1.0.00とし正式リリースとします。 以降の機能追加・変更はマイナーバージョンアップとしバグフィックス対応をメジャー・マイナーバージョンをあげない メンテナンスフェーズに入ります。 Modified Paths: -------------- current/DATA/spider_command.inc.php current/DATA/spider_main.inc.php current/README.txt current/WWW_PUBLIC/spider.inc.php -------------- next part -------------- Modified: current/DATA/spider_command.inc.php =================================================================== --- current/DATA/spider_command.inc.php 2009-04-17 11:46:49 UTC (rev 65) +++ current/DATA/spider_command.inc.php 2009-04-17 12:03:14 UTC (rev 66) @@ -3,7 +3,7 @@ * framework-spider: コマンドプログラム用共通読み込みファイル */ // Framework Version -define( 'SPIDER_VERSION', '1.0.0b3' ); +define( 'SPIDER_VERSION', '1.0.00' ); define ( 'DIR_PATH_SPIDER_DATA', dirname(__FILE__) ); /* 設定ファイルの読み込み */ Modified: current/DATA/spider_main.inc.php =================================================================== --- current/DATA/spider_main.inc.php 2009-04-17 11:46:49 UTC (rev 65) +++ current/DATA/spider_main.inc.php 2009-04-17 12:03:14 UTC (rev 66) @@ -3,7 +3,7 @@ * framework-spider: Webページ利用用共通メイン実行ファイル */ // Framework Version -define( 'SPIDER_VERSION', '1.0.0b3' ); +define( 'SPIDER_VERSION', '1.0.00' ); /* 設定ファイルの読み込み */ require_once( dirname(__FILE__).DIRECTORY_SEPARATOR.'define.inc.php' ); Modified: current/README.txt =================================================================== --- current/README.txt 2009-04-17 11:46:49 UTC (rev 65) +++ current/README.txt 2009-04-17 12:03:14 UTC (rev 66) @@ -4,6 +4,11 @@ ** このファイルにはコミットごとに変更点とファイル名を記述します。 ** -- 2009-04-17 +バージョン番号を1.0.00とし正式リリースとします。 +以降の機能追加・変更はマイナーバージョンアップとしバグフィックス対応をメジャー・マイナーバージョンをあげない +メンテナンスフェーズに入ります。 + +-- 2009-04-17 1) ログ出力周りの整理を行いました。ModuleBaseにあったログ出力機能をHttpRequestに移しました。 2) ログ出力レベルの定義を追加・変更しました。 併せてsyslogdへのログ出力にも対応しました。定数SYSTEM_LOG_TYPEを定義してSPIDER_LOG_TYPE_SYSLOGを設定すれば Modified: current/WWW_PUBLIC/spider.inc.php =================================================================== --- current/WWW_PUBLIC/spider.inc.php 2009-04-17 11:46:49 UTC (rev 65) +++ current/WWW_PUBLIC/spider.inc.php 2009-04-17 12:03:14 UTC (rev 66) @@ -1,7 +1,7 @@ Revision: 67 http://svn.sourceforge.jp/view?root=frameworkspider&view=rev&rev=67 Author: m_nakashima Date: 2009-04-21 10:51:00 +0900 (Tue, 21 Apr 2009) Log Message: ----------- Modified Paths: -------------- current/DATA/lib/spider/HttpRequest.class.php current/README.txt -------------- next part -------------- Modified: current/DATA/lib/spider/HttpRequest.class.php =================================================================== --- current/DATA/lib/spider/HttpRequest.class.php 2009-04-17 12:03:14 UTC (rev 66) +++ current/DATA/lib/spider/HttpRequest.class.php 2009-04-21 01:51:00 UTC (rev 67) @@ -186,7 +186,7 @@ function existsSession( $key ) { $this->optimizeSession(); $current_scope = dirname( $_SERVER['REQUEST_URI'] ); - while( strlen($current_scope) > 0 ) { + while( strlen($current_scope) > 1 ) { $target_key = $current_scope.'/'.$key; if( isset( $_SESSION ) && isset($_SESSION[$target_key]) ) { return true; @@ -200,6 +200,23 @@ return false; } /** + * セッション登録済みの変数を削除します + */ + function removeSession( $key, $scope=SPIDER_SESSION_SCOPE_AUTO ) { + $this->optimizeSession(); + if( $scope == SPIDER_SESSION_SCOPE_AUTO ) { + $scope = dirname($_SERVER['REQUEST_URI']); + } + if( SPIDER_SESSION_SCOPE_GLOBAL == $scope ) { + $key = $this->_getGlobalSessionKey( $key ); + } else { + $key = $scope.'/'.$key; + } + if(isset($_SESSION[$key])) { + unset($_SESSION[$key]); + } + } + /** * セッション登録済み情報を最適化します */ function optimizeSession() { Modified: current/README.txt =================================================================== --- current/README.txt 2009-04-17 12:03:14 UTC (rev 66) +++ current/README.txt 2009-04-21 01:51:00 UTC (rev 67) @@ -3,6 +3,10 @@ ** ** このファイルにはコミットごとに変更点とファイル名を記述します。 ** +-- 2009-04-21 +1) HttpRequestにてセッション取得メソッドで無限ループが発生する不具合を修正しました。 + 併せてセッション変数を削除するメソッドを追加しました。 + -- 2009-04-17 バージョン番号を1.0.00とし正式リリースとします。 以降の機能追加・変更はマイナーバージョンアップとしバグフィックス対応をメジャー・マイナーバージョンをあげない From svnnotify @ sourceforge.jp Tue Apr 21 11:03:55 2009 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Tue, 21 Apr 2009 11:03:55 +0900 Subject: [Frameworkspider-svn] spider-commit [68] Message-ID: <1240279435.999876.23310.nullmailer@users.sourceforge.jp> Revision: 68 http://svn.sourceforge.jp/view?root=frameworkspider&view=rev&rev=68 Author: m_nakashima Date: 2009-04-21 11:03:55 +0900 (Tue, 21 Apr 2009) Log Message: ----------- Modified Paths: -------------- current/DATA/lib/spider/HttpRequest.class.php -------------- next part -------------- Modified: current/DATA/lib/spider/HttpRequest.class.php =================================================================== --- current/DATA/lib/spider/HttpRequest.class.php 2009-04-21 01:51:00 UTC (rev 67) +++ current/DATA/lib/spider/HttpRequest.class.php 2009-04-21 02:03:55 UTC (rev 68) @@ -165,7 +165,7 @@ $this->optimizeSession(); $value = null; $current_scope = dirname( $_SERVER['REQUEST_URI'] ); - while( strlen($current_scope) > 0 ) { + while( strlen($current_scope) > 1 ) { $target_key = $current_scope.'/'.$key; if( isset( $_SESSION ) && isset($_SESSION[$target_key]) ) { return unserialize($_SESSION[$target_key]); From svnnotify @ sourceforge.jp Wed Apr 22 11:08:32 2009 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Wed, 22 Apr 2009 11:08:32 +0900 Subject: [Frameworkspider-svn] spider-commit [69] Message-ID: <1240366112.394094.17095.nullmailer@users.sourceforge.jp> Revision: 69 http://svn.sourceforge.jp/view?root=frameworkspider&view=rev&rev=69 Author: m_nakashima Date: 2009-04-22 11:08:32 +0900 (Wed, 22 Apr 2009) Log Message: ----------- Modified Paths: -------------- current/DATA/spider_command.inc.php current/DATA/spider_main.inc.php current/WWW_PUBLIC/spider.inc.php -------------- next part -------------- Modified: current/DATA/spider_command.inc.php =================================================================== --- current/DATA/spider_command.inc.php 2009-04-21 02:03:55 UTC (rev 68) +++ current/DATA/spider_command.inc.php 2009-04-22 02:08:32 UTC (rev 69) @@ -3,7 +3,7 @@ * framework-spider: コマンドプログラム用共通読み込みファイル */ // Framework Version -define( 'SPIDER_VERSION', '1.0.00' ); +define( 'SPIDER_VERSION', '1.0.01' ); define ( 'DIR_PATH_SPIDER_DATA', dirname(__FILE__) ); /* 設定ファイルの読み込み */ Modified: current/DATA/spider_main.inc.php =================================================================== --- current/DATA/spider_main.inc.php 2009-04-21 02:03:55 UTC (rev 68) +++ current/DATA/spider_main.inc.php 2009-04-22 02:08:32 UTC (rev 69) @@ -3,7 +3,7 @@ * framework-spider: Webページ利用用共通メイン実行ファイル */ // Framework Version -define( 'SPIDER_VERSION', '1.0.00' ); +define( 'SPIDER_VERSION', '1.0.01' ); /* 設定ファイルの読み込み */ require_once( dirname(__FILE__).DIRECTORY_SEPARATOR.'define.inc.php' ); Modified: current/WWW_PUBLIC/spider.inc.php =================================================================== --- current/WWW_PUBLIC/spider.inc.php 2009-04-21 02:03:55 UTC (rev 68) +++ current/WWW_PUBLIC/spider.inc.php 2009-04-22 02:08:32 UTC (rev 69) @@ -1,7 +1,7 @@ 0 ) { + $rootPathLength = 3; + } + while( strlen($targetDir) > $rootPathLength ) { + $DIR_PATH_SPIDER_DATA = $targetDir.DIRECTORY_SEPARATOR.'DATA'; + if( is_dir( $DIR_PATH_SPIDER_DATA ) ) { + break; + } + $targetDir = dirname($targetDir); + } + unset($targetDir); + unset($rootPathLength); + if( is_null( $DIR_PATH_SPIDER_DATA ) ) { + header( 'Content-type: text/plain;charset=UTF-8' ); + die( 'Spider DATA Folder is not found!' ); + } else { + define ( 'DIR_PATH_SPIDER_DATA', $DIR_PATH_SPIDER_DATA ); + } } else { - define ( "DIR_PATH_SPIDER_DATA", $DIR_PATH_SPIDER_DATA ); + define ( 'DIR_PATH_SPIDER_DATA', $DIR_PATH_SPIDER_DATA ); } $request_protocol = $_SERVER['SERVER_PROTOCOL']; $request_port = $_SERVER['SERVER_PORT']; @@ -44,8 +64,8 @@ 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( DIRECTORY_SEPARATOR, "/", __FILE__ ); - $spider_base_uri = dirname(str_replace( $document_root, "", $spider_inc_path )); + $spider_inc_path = str_replace( DIRECTORY_SEPARATOR, '/', __FILE__ ); + $spider_base_uri = dirname(str_replace( $document_root, '', $spider_inc_path )); if( preg_match('/^\\/\\~[0-9a-zA-Z\\_]+\\//',$request_uri) > 0 ) { // ユーザーディレクトリの場合リクエストURIの一つ目の要素をくっつける $dirname_array = explode('/',$request_uri); @@ -56,28 +76,31 @@ $spider_base_uri .= '/'; } -$prtcl = "http://"; +$prtcl = 'http://'; if( $is_ssl ) { - $prtcl = "https://"; + $prtcl = 'https://'; } -$target_port = ""; +$target_port = ''; if ( $request_port != 80 && $request_port != 443 ) { - $target_port = ":" . $request_port; + $target_port = ':' . $request_port; } $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; +$app_nomal_url = 'http://' . $request_server_name . $target_port . $spider_base_uri; +$app_ssl_url = 'https://' . $request_server_name . $target_port . $spider_base_uri; -define( "APPLICATION_BASE_URL", $app_base_url ); -define( "APPLICATION_NML_URL", $app_nomal_url ); -define( "APPLICATION_SSL_URL", $app_ssl_url ); +define( 'APPLICATION_BASE_URL', $app_base_url ); +define( 'APPLICATION_NML_URL', $app_nomal_url ); +define( 'APPLICATION_SSL_URL', $app_ssl_url ); $app_base_uri = $spider_base_uri; if ( !preg_match( '/\\/$/', $app_base_uri ) ) { $app_base_uri .= '/'; } -define( "APPLICATION_BASE_URI", $app_base_uri ); -define( "APPLICATION_BASE_PATH", dirname(__FILE__ ) ); +define( 'APPLICATION_BASE_URI', $app_base_uri ); +define( 'APPLICATION_BASE_PATH', dirname(__FILE__ ) ); +unset($app_base_url); +unset($app_nomal_url); +unset($app_ssl_url); +unset($spider_base_uri); +require_once( DIR_PATH_SPIDER_DATA . DIRECTORY_SEPARATOR . 'spider_main.inc.php' ); -require_once( DIR_PATH_SPIDER_DATA . DIRECTORY_SEPARATOR . "spider_main.inc.php" ); - ?> From svnnotify @ sourceforge.jp Wed Apr 22 11:09:50 2009 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Wed, 22 Apr 2009 11:09:50 +0900 Subject: [Frameworkspider-svn] spider-commit [70] Message-ID: <1240366190.471947.18803.nullmailer@users.sourceforge.jp> Revision: 70 http://svn.sourceforge.jp/view?root=frameworkspider&view=rev&rev=70 Author: m_nakashima Date: 2009-04-22 11:09:50 +0900 (Wed, 22 Apr 2009) Log Message: ----------- Modified Paths: -------------- current/README.txt -------------- next part -------------- Modified: current/README.txt =================================================================== --- current/README.txt 2009-04-22 02:08:32 UTC (rev 69) +++ current/README.txt 2009-04-22 02:09:50 UTC (rev 70) @@ -3,6 +3,9 @@ ** ** このファイルにはコミットごとに変更点とファイル名を記述します。 ** +-- 2009-04-22 +1) spiderのDATAフォルダをspider.inc.php配置フォルダからさかのぼって自動認識するようにしました。 + -- 2009-04-21 1) HttpRequestにてセッション取得メソッドで無限ループが発生する不具合を修正しました。 併せてセッション変数を削除するメソッドを追加しました。 From svnnotify @ sourceforge.jp Wed Apr 22 17:06:38 2009 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Wed, 22 Apr 2009 17:06:38 +0900 Subject: [Frameworkspider-svn] =?utf-8?q?spider-commit_=5B71=5D_1=29__spid?= =?utf-8?b?ZXLjga5EQVRB44OV44Kp44Or44OA44KSc3BpZGVyIC5pbmMuIHBocOmFjQ==?= =?utf-8?b?572u44OV44Kp44Or44OA44GL44KJ44GV44GL44Gu44G844Gj44Gm6Ieq5YuV?= =?utf-8?b?6KqN6K2Y44GZ44KL44KI44GG44Gr44GX44G+44GX44Gf44CC?= Message-ID: <1240387598.465900.6074.nullmailer@users.sourceforge.jp> Revision: 71 http://svn.sourceforge.jp/view?root=frameworkspider&view=rev&rev=71 Author: m_nakashima Date: 2009-04-22 17:06:38 +0900 (Wed, 22 Apr 2009) Log Message: ----------- 1) spiderのDATAフォルダをspider.inc.php配置フォルダからさかのぼって自動認識するようにしました。 2) HttpRequestのセッションの適正化メソッドで、セッションスコープの判断をREQUEST_URIで行っており ディレクトリインデックスにファイル名なしでアクセスした場合のセッション挙動が同フォルダ内にも関わらずひとつ 上の階層と判断されてしまい問題が発生する為PHP_SELFで判断するよう修正しました。 Modified Paths: -------------- current/DATA/lib/spider/HttpRequest.class.php current/README.txt -------------- next part -------------- Modified: current/DATA/lib/spider/HttpRequest.class.php =================================================================== --- current/DATA/lib/spider/HttpRequest.class.php 2009-04-22 02:09:50 UTC (rev 70) +++ current/DATA/lib/spider/HttpRequest.class.php 2009-04-22 08:06:38 UTC (rev 71) @@ -148,7 +148,7 @@ function setSession( $key, $value, $scope=SPIDER_SESSION_SCOPE_AUTO ) { $this->optimizeSession(); if( $scope == SPIDER_SESSION_SCOPE_AUTO ) { - $scope = dirname($_SERVER['REQUEST_URI']); + $scope = dirname($_SERVER['PHP_SELF']); } if( SPIDER_SESSION_SCOPE_GLOBAL == $scope ) { $key = $this->_getGlobalSessionKey( $key ); @@ -164,7 +164,7 @@ function getSession( $key ) { $this->optimizeSession(); $value = null; - $current_scope = dirname( $_SERVER['REQUEST_URI'] ); + $current_scope = dirname( $_SERVER['PHP_SELF'] ); while( strlen($current_scope) > 1 ) { $target_key = $current_scope.'/'.$key; if( isset( $_SESSION ) && isset($_SESSION[$target_key]) ) { @@ -185,7 +185,7 @@ */ function existsSession( $key ) { $this->optimizeSession(); - $current_scope = dirname( $_SERVER['REQUEST_URI'] ); + $current_scope = dirname( $_SERVER['PHP_SELF'] ); while( strlen($current_scope) > 1 ) { $target_key = $current_scope.'/'.$key; if( isset( $_SESSION ) && isset($_SESSION[$target_key]) ) { @@ -205,7 +205,7 @@ function removeSession( $key, $scope=SPIDER_SESSION_SCOPE_AUTO ) { $this->optimizeSession(); if( $scope == SPIDER_SESSION_SCOPE_AUTO ) { - $scope = dirname($_SERVER['REQUEST_URI']); + $scope = dirname($_SERVER['PHP_SELF']); } if( SPIDER_SESSION_SCOPE_GLOBAL == $scope ) { $key = $this->_getGlobalSessionKey( $key ); @@ -221,9 +221,9 @@ */ function optimizeSession() { if( isset( $_SESSION ) && is_array( $_SESSION ) ) { - $current_scope = dirname( $_SERVER['REQUEST_URI'] ); + $current_scope = dirname( $_SERVER['PHP_SELF'] ); foreach( $_SESSION as $key => $value ) { - if( preg_match('/^spider\\_GLOBAL\\./',$key) == 0 + if( strlen($key) > 0 && preg_match('/^spider\\_GLOBAL\\./',$key) == 0 && preg_match('/^'.CharUtility::escape_regx_str($current_scope).'/',$key) == 0 ) { unset( $_SESSION[$key] ); } Modified: current/README.txt =================================================================== --- current/README.txt 2009-04-22 02:09:50 UTC (rev 70) +++ current/README.txt 2009-04-22 08:06:38 UTC (rev 71) @@ -5,6 +5,9 @@ ** -- 2009-04-22 1) spiderのDATAフォルダをspider.inc.php配置フォルダからさかのぼって自動認識するようにしました。 +2) HttpRequestのセッションの適正化メソッドで、セッションスコープの判断をREQUEST_URIで行っており + ディレクトリインデックスにファイル名なしでアクセスした場合のセッション挙動が同フォルダ内にも関わらずひとつ + 上の階層と判断されてしまい問題が発生する為PHP_SELFで判断するよう修正しました。 -- 2009-04-21 1) HttpRequestにてセッション取得メソッドで無限ループが発生する不具合を修正しました。