From svnnotify @ sourceforge.jp Sat Jun 13 15:48:45 2009 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Sat, 13 Jun 2009 15:48:45 +0900 Subject: [Frameworkspider-svn] spider-commit [73] Message-ID: <1244875725.189831.6017.nullmailer@users.sourceforge.jp> Revision: 73 http://svn.sourceforge.jp/view?root=frameworkspider&view=rev&rev=73 Author: m_nakashima Date: 2009-06-13 15:48:45 +0900 (Sat, 13 Jun 2009) Log Message: ----------- Modified Paths: -------------- current/DATA/lib/spider/HttpOutput.class.php current/DATA/lib/spider/HttpRequest.class.php current/DATA/lib/util/CharUtility.class.php current/DATA/lib/util/Mail.class.php current/DATA/lib/util/ValidateFunctions.class.php current/DATA/lib/util/mail/SendMail.class.php Added Paths: ----------- current/DATA/lib/util/Date.class.php -------------- next part -------------- Modified: current/DATA/lib/spider/HttpOutput.class.php =================================================================== --- current/DATA/lib/spider/HttpOutput.class.php 2009-05-09 03:42:30 UTC (rev 72) +++ current/DATA/lib/spider/HttpOutput.class.php 2009-06-13 06:48:45 UTC (rev 73) @@ -35,6 +35,7 @@ // ユーザーエージェント分類をリクエストにセット $request->setAttribute('spider.access_agent_class',$build_information_object->agent_class); + $request->agentClass = $build_information_object->agent_class; // ビルドファイルパスを取得 $build_file_path = $build_information_object->getAgentPageBuildFilePath(); Modified: current/DATA/lib/spider/HttpRequest.class.php =================================================================== --- current/DATA/lib/spider/HttpRequest.class.php 2009-05-09 03:42:30 UTC (rev 72) +++ current/DATA/lib/spider/HttpRequest.class.php 2009-06-13 06:48:45 UTC (rev 73) @@ -30,7 +30,8 @@ var $redirect_url = null; /** Attribute Prefix */ var $attribute_prefix = null; - + /** Access User Agent Class */ + var $agentClass = null; /** * コンストラクタ */ @@ -155,7 +156,12 @@ } else { $key = $scope.'/'.$key; } - $_SESSION[$key] = serialize( $value ); + $spiderSession = new spider_Session(); + if( isset($_SESSION) && isset($_SESSION['spider_session_object']) ) { + $spiderSession = unserialize($_SESSION['spider_session_object']); + } + $spiderSession->setValue($key,$value); + $_SESSION['spider_session_object'] = serialize($spiderSession); } /** * セッション変数を取得します @@ -163,20 +169,23 @@ */ function getSession( $key ) { $this->optimizeSession(); + $spiderSession = new spider_Session(); + if( isset($_SESSION) && isset($_SESSION['spider_session_object']) ) { + $spiderSession = unserialize($_SESSION['spider_session_object']); + } $value = null; $current_scope = dirname( $_SERVER['PHP_SELF'] ); while( strlen($current_scope) > 1 ) { $target_key = $current_scope.'/'.$key; - if( isset( $_SESSION ) && isset($_SESSION[$target_key]) ) { - return unserialize($_SESSION[$target_key]); + if( false !== $spiderSession->getValue($target_key) ) { + return $spiderSession->getValue($target_key); } $current_scope = dirname( $current_scope ); } $target_key = $this->_getGlobalSessionKey( $key ); - if( isset( $_SESSION ) && isset($_SESSION[$target_key]) ) { - return unserialize($_SESSION[$target_key]); + if( false !== $spiderSession->getValue($target_key) ) { + return $spiderSession->getValue($target_key); } - return null; } /** @@ -185,16 +194,21 @@ */ function existsSession( $key ) { $this->optimizeSession(); + $spiderSession = new spider_Session(); + if( isset($_SESSION) && isset($_SESSION['spider_session_object']) ) { + $spiderSession = unserialize($_SESSION['spider_session_object']); + } + $value = null; $current_scope = dirname( $_SERVER['PHP_SELF'] ); while( strlen($current_scope) > 1 ) { $target_key = $current_scope.'/'.$key; - if( isset( $_SESSION ) && isset($_SESSION[$target_key]) ) { + if( false !== $spiderSession->getValue($target_key) ) { return true; } $current_scope = dirname( $current_scope ); } $target_key = $this->_getGlobalSessionKey( $key ); - if( isset( $_SESSION ) && isset($_SESSION[$target_key]) ) { + if( false !== $spiderSession->getValue($target_key) ) { return true; } return false; @@ -204,6 +218,10 @@ */ function removeSession( $key, $scope=SPIDER_SESSION_SCOPE_AUTO ) { $this->optimizeSession(); + $spiderSession = new spider_Session(); + if( isset($_SESSION) && isset($_SESSION['spider_session_object']) ) { + $spiderSession = unserialize($_SESSION['spider_session_object']); + } if( $scope == SPIDER_SESSION_SCOPE_AUTO ) { $scope = dirname($_SERVER['PHP_SELF']); } @@ -212,22 +230,26 @@ } else { $key = $scope.'/'.$key; } - if(isset($_SESSION[$key])) { - unset($_SESSION[$key]); - } + $spiderSession->removeValue($key); + $_SESSION['spider_session_object'] = serialize($spiderSession); } /** * セッション登録済み情報を最適化します */ function optimizeSession() { if( isset( $_SESSION ) && is_array( $_SESSION ) ) { + $spiderSession = new spider_Session(); + if( isset($_SESSION) && isset($_SESSION['spider_session_object']) ) { + $spiderSession = unserialize($_SESSION['spider_session_object']); + } $current_scope = dirname( $_SERVER['PHP_SELF'] ); foreach( $_SESSION as $key => $value ) { if( strlen($key) > 0 && preg_match('/^spider\\_GLOBAL\\./',$key) == 0 && preg_match('/^'.util_CharUtility::escape_regx_str($current_scope).'/',$key) == 0 ) { - unset( $_SESSION[$key] ); + $spiderSession->removeValue($key); } } + $_SESSION['spider_session_object'] = serialize($spiderSession); } } /** @@ -484,4 +506,27 @@ } } } +/** + * spider_HttpRequestクラスオブジェクトを経由したセッション保存用の + * 情報コンテナクラス + */ +class spider_Session { + var $valueHash = array(); + function spider_Session(){ + $this->valueHash = array(); + } + function setValue($key,$value) { + $this->valueHash[$key] = $value; + } + function getValue($key) { + if( isset($this->valueHash[$key]) ) { + return $this->valueHash[$key]; + } else { + return false; + } + } + function removeValue($key) { + unset($this->valueHash[$key]); + } +} ?> Modified: current/DATA/lib/util/CharUtility.class.php =================================================================== --- current/DATA/lib/util/CharUtility.class.php 2009-05-09 03:42:30 UTC (rev 72) +++ current/DATA/lib/util/CharUtility.class.php 2009-06-13 06:48:45 UTC (rev 73) @@ -116,6 +116,125 @@ return $ret_str; } /** + * 指定長のランダムアルファベットを生成して返します + */ + function createRundomAlphabet( $length, $type=0 ) { + $start = 65; + $end = 90; + if( 1==$type ) { + $start = 97; + $end = 122; + } + return util_CharUtility::createRundomAscii( $length, $start, $end ); + } + /** + * 指定範囲のASCII文字列からランダム文字列を生成します + */ + function createRundomAscii( $length=8, $start=33, $end=126 ) { + $string = ''; + for( $i=0; $i<$length; $i++ ) { + $num = rand( $start, $end ); + $string .= pack('C*',$num); + } + return $string; + } + /** + * 文字列を数字部分とアルファベット部分ごとの要素に分けて配列で戻します。 + */ + function explodeAN( $string, $alphSep=0 ) { + $elm = ''; + $elmArray = array(); + $prevChar = ''; + for( $pos=0; $pos 0 ) { + if( preg_match('/[0-9]/',$prevChar) >0 ) { + if( preg_match('/[0-9]/',$char) >0 ) { + $elm .= $char; + } else { + array_push( $elmArray, $elm ); + $elm = $char; + } + } else { + if( preg_match('/[0-9]/',$char) >0 ) { + array_push( $elmArray, $elm ); + $elm = $char; + } else { + if( $alphSep == 0 ) { + $elm .= $char; + } else { + if( strlen($elm) >= $alphSep ) { + array_push( $elmArray, $elm ); + $elm = $char; + } else { + $elm .= $char; + } + } + } + } + } else { + $elm .= $char; + } + $prevChar = $char; + } + if( strlen($elm) > 0 ) { + array_push( $elmArray, $elm ); + } + return $elmArray; + } + /** + * CSVデータラインを配列にして返します + */ + function csv2Array( $strings ) { + $strings = str_replace("\r\n","\n",$strings); + $strings = str_replace("\r","\n",$strings); + $columns = explode(',',$strings); + $regist_columns = array(); + $column_value = ''; + // カラム値を""と,の関係維持して正確に分割する + foreach( $columns as $val ) { + if( strlen($column_value) > 0 ) { + $column_value .= ','.$val; + } else { + $column_value .= $val; + } + $quote_count = substr_count( $column_value, '"' ); + if( $quote_count % 2 != 0 ) { + // クォータ数が偶数でない場合はカラムデータが完結していないので次の行へ + } else { + // 完結している場合はカラムとして処理 + if( preg_match('/^"/',$column_value) > 0 && preg_match( '/"$/', $column_value ) > 0 ) { + $column_value = preg_replace('/^"/','',$column_value ); + $column_value = preg_replace('/"$/','',$column_value ); + $column_value = preg_replace('/""/','"',$column_value ); + } + $column_value = mb_convert_kana($column_value,'KVas'); + array_push( $regist_columns, $column_value ); + $column_value = ''; + } + } + return $regist_columns; + } + /** + * CSVデータラインを指定定義のハッシュにして返します + */ + function csv2Hash( $orderDefinitionHash, $strings ) { + $dataArray = util_CharUtility::csv2Array( $strings ); + $returnHash = array(); + if( isset($orderDefinitionHash[0]) ) { + // キー0番目が格納されているならキーが順序の処理 + foreach( $orderDefinitionHash as $num => $keyName ) { + $returnHash[$keyName] = trim($dataArray[$num]); + } + } else { + // キーが数値でないなら値が順序の処理 + foreach( $orderDefinitionHash as $keyName => $order ) { + $returnHash[$keyName] = trim($dataArray[$order-1]); + } + } + return $returnHash; + } + /** * 正規表現で利用する為の文字パターン用にエスケープします。 */ function escape_regx_str($str){ Added: current/DATA/lib/util/Date.class.php =================================================================== --- current/DATA/lib/util/Date.class.php (rev 0) +++ current/DATA/lib/util/Date.class.php 2009-06-13 06:48:45 UTC (rev 73) @@ -0,0 +1,57 @@ +$wday); + } else { + $calendarHash[$vday] = $wday; + } + } + return $calendarHash; + } else { + return false; + } + } +} +?> \ No newline at end of file Modified: current/DATA/lib/util/Mail.class.php =================================================================== --- current/DATA/lib/util/Mail.class.php 2009-05-09 03:42:30 UTC (rev 72) +++ current/DATA/lib/util/Mail.class.php 2009-06-13 06:48:45 UTC (rev 73) @@ -1052,6 +1052,26 @@ } } } + /** + * 件名の特定置き換えワードを設定した文字列を返す。 + */ + function getReplacedTextSubject( $convert_encoding=true ) { + $subject = $this->subject; + foreach( $this->replace_words as $key => $val ) { + $subject = str_replace( "{".$key."}", $val, $subject ); + } + return $subject; + } + /** + * 本文の特定置き換えワードを設定した文字列を返す。 + */ + function getReplacedTextBody( $convert_encoding=true ) { + $text_body = $this->text_body; + foreach( $this->replace_words as $key => $val ) { + $text_body = str_replace( "{".$key."}", $val, $text_body ); + } + return $text_body; + } } // 本クラスで利用するグローバル変数定義 /** 文字コード変換ルール */ Modified: current/DATA/lib/util/ValidateFunctions.class.php =================================================================== --- current/DATA/lib/util/ValidateFunctions.class.php 2009-05-09 03:42:30 UTC (rev 72) +++ current/DATA/lib/util/ValidateFunctions.class.php 2009-06-13 06:48:45 UTC (rev 73) @@ -27,7 +27,7 @@ || !preg_match("/^[0-9]+$/", $month ) || !preg_match("/^[0-9]+$/", $day ) ){ return false; - } else if ( ( $year < 1900 || $year > 2050 ) + } else if ( ( $year < 1900 || $year > 2037 ) || ( $month < 1 || $month > 12 ) || ( $day < 1 || $day > 31 ) ) { return false; @@ -58,10 +58,88 @@ * @return boolean 有効であればtrue、無効であればfalse */ function isAvailableDateFormat( $date_string ) { - list( $year, $month, $day ) = explode('-',$date_string); - return isAvailableDate( $year, $month, $day ); + $elements = explode('-',$date_string); + if( count($elements) == 3 ) { + $year = array_shift($elements); + $month = array_shift($elements); + $day = array_shift($elements); + return ValidateFunctions::isAvailableDate( $year, $month, $day ); + } else { + return false; + } } /** + * 渡された時分秒が有効な時間であるか検査します。 + * 有効であればtrue、無効であればfalseを返します。 + * @param $hour 時 + * @param $min 分 + * @param $sec 秒 + * @return boolean 有効であればtrue、無効であればfalse + */ + function isAvailableTime( $hour, $min, $sec, $permit_decimal_sec=false ) { + if( preg_match('/^[0-9]{1,2}$/',$hour) == 0 ) { + return false; + } else if( $hour < 0 || $hour > 23 ) { + return false; + } + if( preg_match('/^[0-9]{1,2}$/',$min) == 0 ) { + return false; + } else if( $min < 0 || $min > 59 ) { + return false; + } + if( $permit_decimal_sec ) { + if( preg_match('/^[0-9]{1,2}(|\\.[0-9]+)$/',$sec) == 0 ) { + return false; + } else if( $sec < 0 || $sec >= 60 ) { + return false; + } + } else { + if( preg_match('/^[0-9]{1,2}$/',$sec) == 0 ) { + return false; + } else if( $sec < 0 || $sec >= 60 ) { + return false; + } + } + return true; + } + /** + * 渡された時分秒フォーマットが有効な時間であるか検査します。 + * 有効であればtrue、無効であればfalseを返します。 + * @param $time_string 日付フォーマット文字列 + * @return boolean 有効であればtrue、無効であればfalse + */ + function isAvailableTimeFormat( $time_string ) { + $elements = explode(':',$time_string); + if( count($elements) == 3 ) { + $hour = array_shift($elements); + $min = array_shift($elements); + $sec = array_shift($elements); + return ValidateFunctions::isAvailableTime( $hour, $min, $sec ); + } else { + return false; + } + } + /** + * 渡された文字列が日時フォーマットとして有効化検査します + * 有効であればtrue、無効であればfalseを返します。 + * @param $datetime_string 日時フォーマット文字列 + * @return boolean 有効であればtrue、無効であればfalse + */ + function isAvailableDatetimeFormat( $datetime_string ) { + $elements = explode(' ',$datetime_string); + if( count($elements) == 2 ) { + $date_string = array_shift($elements); + $time_string = array_shift($elements); + if( ValidateFunctions::isAvailableDateFormat($date_string) ) { + return ValidateFunctions::isAvailableTimeFormat($time_string); + } else { + return false; + } + } else { + return false; + } + } + /** * 電話番号の書式チェックを行います */ function validateTelephoneNumber( &$request, $telephone_area_code, $telephone_city_code, $telephone_code, $item_name ) { @@ -73,11 +151,13 @@ $telephone_city_code = ""; $telephone_code = ""; $telephone_number = ""; - } elseif ( $telephone_len > 0 ) { + } else if ( $telephone_len > 0 ) { if ( strlen( $telephone_area_code) == 0 || strlen( $telephone_city_code) == 0 || strlen( $telephone_code) == 0 ) { $request->addError($item_name.'は市外局番・市内局番・局番を全て半角数字で入力してください。'); + } else if( $telephone_len > 14 ) { + $request->addError($item_name.'の数字は合計14文字以下で入力してください。'); } else { $telephone_number = $telephone_area_code . "-" . $telephone_city_code Modified: current/DATA/lib/util/mail/SendMail.class.php =================================================================== --- current/DATA/lib/util/mail/SendMail.class.php 2009-05-09 03:42:30 UTC (rev 72) +++ current/DATA/lib/util/mail/SendMail.class.php 2009-06-13 06:48:45 UTC (rev 73) @@ -55,7 +55,7 @@ } $sendmail_path = trim($this->options['sendmail_path']); // コマンド文字列 - $command = $sendmail_path.' -t -f'.$envelope_from.' '. $to; + $command = $sendmail_path.' -f'.$envelope_from.' '. $to; // sendmailへパイプオープン $mp = popen($command, "w"); if( $mp ) { From svnnotify @ sourceforge.jp Sat Jun 13 16:05:12 2009 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Sat, 13 Jun 2009 16:05:12 +0900 Subject: [Frameworkspider-svn] spider-commit [74] Message-ID: <1244876712.045632.27262.nullmailer@users.sourceforge.jp> Revision: 74 http://svn.sourceforge.jp/view?root=frameworkspider&view=rev&rev=74 Author: m_nakashima Date: 2009-06-13 16:05:11 +0900 (Sat, 13 Jun 2009) Log Message: ----------- Modified Paths: -------------- current/DATA/lib/util/GetHTTPResponse.class.php -------------- next part -------------- Modified: current/DATA/lib/util/GetHTTPResponse.class.php =================================================================== --- current/DATA/lib/util/GetHTTPResponse.class.php 2009-06-13 06:48:45 UTC (rev 73) +++ current/DATA/lib/util/GetHTTPResponse.class.php 2009-06-13 07:05:11 UTC (rev 74) @@ -95,7 +95,7 @@ } } //$obj = new util_GetHTTPResponse(); -//if( $obj->get('http://www.md-systems.net/images/button/concept_button_01.jpg') ){ +//if( $obj->get('http://www.md-systems.net/') ){ //// foreach( $obj->response_headers as $key => $value ) { //// header($key.': '.$value); //// } From svnnotify @ sourceforge.jp Wed Jun 17 14:06:47 2009 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Wed, 17 Jun 2009 14:06:47 +0900 Subject: [Frameworkspider-svn] =?utf-8?b?c3BpZGVyLWNvbW1pdCBbNzVdICDjg5o=?= =?utf-8?b?44O844K45paH5a2X44Kz44O844OJ5oyH5a6a5pmC44Gu5LiN5YW35ZCI44KS?= =?utf-8?b?5L+u5q2j?= Message-ID: <1245215207.458197.21117.nullmailer@users.sourceforge.jp> Revision: 75 http://sourceforge.jp/projects/frameworkspider/svn/view?view=rev&revision=75 Author: m_nakashima Date: 2009-06-17 14:06:47 +0900 (Wed, 17 Jun 2009) Log Message: ----------- ページ文字コード指定時の不具合を修正 Modified Paths: -------------- current/DATA/lib/spider/Builder.class.php -------------- next part -------------- Modified: current/DATA/lib/spider/Builder.class.php =================================================================== --- current/DATA/lib/spider/Builder.class.php 2009-06-13 07:05:11 UTC (rev 74) +++ current/DATA/lib/spider/Builder.class.php 2009-06-17 05:06:47 UTC (rev 75) @@ -252,6 +252,8 @@ // 出力を文字列に取得する $string .= " Revision: 76 http://sourceforge.jp/projects/frameworkspider/svn/view?view=rev&revision=76 Author: m_nakashima Date: 2009-06-25 10:24:58 +0900 (Thu, 25 Jun 2009) Log Message: ----------- DATAディレクトリ検索機能部分の不具合を修正 コマンド用メインファイルでspider_HttpRequestオブジェクトをグローバル生成するように追加 DoCoMo2.0のファイルがなかったらDoCoMo1.0を見るように定義を追加 Modified Paths: -------------- current/DATA/define.inc.php current/DATA/spider_command.inc.php current/WWW_PUBLIC/spider.inc.php -------------- next part -------------- Modified: current/DATA/define.inc.php =================================================================== --- current/DATA/define.inc.php 2009-06-17 05:06:47 UTC (rev 75) +++ current/DATA/define.inc.php 2009-06-25 01:24:58 UTC (rev 76) @@ -21,6 +21,7 @@ $GLOBALS['SPIDER_USER_AGENT_CLASS_ALT_HASH'] = array( 'au' => 'docomo2', 'softbank' => 'docomo2', + 'docomo2' => 'docomo', ); // ユーザーエージェント正規表現による分岐タイプ 正規表現=>分類ID $GLOBALS['SPIDER_USER_AGENT_CLASS_REGX_HASH'] = array( Modified: current/DATA/spider_command.inc.php =================================================================== --- current/DATA/spider_command.inc.php 2009-06-17 05:06:47 UTC (rev 75) +++ current/DATA/spider_command.inc.php 2009-06-25 01:24:58 UTC (rev 76) @@ -33,6 +33,11 @@ die; } +require_once( DIR_PATH_LIB + . DIRECTORY_SEPARATOR . "spider" + . DIRECTORY_SEPARATOR . "HttpRequest.class.php" ); +$GLOBALS['request'] = new spider_HttpRequest(); + mb_language('japanese'); mb_internal_encoding('UTF-8'); ob_start('mb_output_handler'); Modified: current/WWW_PUBLIC/spider.inc.php =================================================================== --- current/WWW_PUBLIC/spider.inc.php 2009-06-17 05:06:47 UTC (rev 75) +++ current/WWW_PUBLIC/spider.inc.php 2009-06-25 01:24:58 UTC (rev 76) @@ -29,12 +29,26 @@ $rootPathLength = 3; } while( strlen($targetDir) > $rootPathLength ) { - $DIR_PATH_SPIDER_DATA = $targetDir.DIRECTORY_SEPARATOR.'DATA'; + $DIR_PATH_SPIDER_DATA = $targetDir.DIRECTORY_SEPARATOR.'spider'; if( is_dir( $DIR_PATH_SPIDER_DATA ) ) { break; + } else { + $DIR_PATH_SPIDER_DATA = null; } $targetDir = dirname($targetDir); } + if( is_null($DIR_PATH_SPIDER_DATA) ) { + $targetDir = dirname(__FILE__); + while( strlen($targetDir) > $rootPathLength ) { + $DIR_PATH_SPIDER_DATA = $targetDir.DIRECTORY_SEPARATOR.'DATA'; + if( is_dir( $DIR_PATH_SPIDER_DATA ) ) { + break; + } else { + $DIR_PATH_SPIDER_DATA = null; + } + $targetDir = dirname($targetDir); + } + } unset($targetDir); unset($rootPathLength); if( is_null( $DIR_PATH_SPIDER_DATA ) ) { From svnnotify @ sourceforge.jp Thu Jun 25 10:26:29 2009 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Thu, 25 Jun 2009 10:26:29 +0900 Subject: [Frameworkspider-svn] =?utf-8?q?spider-commit_=5B77=5D__util=5FGe?= =?utf-8?b?dEh0dHBSZXNwb25zZeOCr+ODqeOCueOBp1VSTOOBjEZRRE7jgafntYLkuoY=?= =?utf-8?b?44GX44Gm44KL5paH5a2X5YiX44Gu5aC05ZCI44Gr5o6l57aa44Ko44Op44O8?= =?utf-8?b?44Go44Gq44KL5ZWP6aGM44Gu5L+u5q2j?= Message-ID: <1245893189.919636.30947.nullmailer@users.sourceforge.jp> Revision: 77 http://sourceforge.jp/projects/frameworkspider/svn/view?view=rev&revision=77 Author: m_nakashima Date: 2009-06-25 10:26:29 +0900 (Thu, 25 Jun 2009) Log Message: ----------- util_GetHttpResponseクラスでURLがFQDNで終了してる文字列の場合に接続エラーとなる問題の修正 util_CharUtilityで正規表現関連のメソッド名を変更 Modified Paths: -------------- current/DATA/lib/util/CharUtility.class.php current/DATA/lib/util/GetHTTPResponse.class.php -------------- next part -------------- Modified: current/DATA/lib/util/CharUtility.class.php =================================================================== --- current/DATA/lib/util/CharUtility.class.php 2009-06-25 01:24:58 UTC (rev 76) +++ current/DATA/lib/util/CharUtility.class.php 2009-06-25 01:26:29 UTC (rev 77) @@ -238,6 +238,9 @@ * 正規表現で利用する為の文字パターン用にエスケープします。 */ function escape_regx_str($str){ + return util_CharUtility::escapeRegxStr($str); + } + function escapeRegxStr($str){ $str = str_replace('\\', '\\\\', $str); $str = str_replace('*', '\\*', $str); $str = str_replace('+', '\\+', $str); Modified: current/DATA/lib/util/GetHTTPResponse.class.php =================================================================== --- current/DATA/lib/util/GetHTTPResponse.class.php 2009-06-25 01:24:58 UTC (rev 76) +++ current/DATA/lib/util/GetHTTPResponse.class.php 2009-06-25 01:26:29 UTC (rev 77) @@ -20,6 +20,12 @@ list( $pr, $blank, $domain ) = explode('/',$url ); $uri = substr($url,strpos($url,$domain)); $uri = str_replace($domain,"",$uri); + if( strlen($uri) == 0 ) { + $uri = '/'; + } + if( preg_match('/^[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}/',gethostbyname($domain)) == 0 ) { + return false; + } return $this->get_response($domain,$uri,$header_params); } function get_response($host,$uri,$header_params=array()){ From svnnotify @ sourceforge.jp Thu Jun 25 12:13:31 2009 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Thu, 25 Jun 2009 12:13:31 +0900 Subject: [Frameworkspider-svn] =?utf-8?q?spider-commit_=5B78=5D__suPHP?= =?utf-8?b?44Gq44Gp44Gu54m55q6K55Kw5aKD44Gr5a++5b+c44GZ44KL54K644CBc3Bp?= =?utf-8?b?ZGVy44GM5YuV55qE44Gr5L2c5oiQ44GZ44KL5LiA5pmC44OV44Kh44Kk44Or?= =?utf-8?b?44KE5LiA5pmC44OV44Kp44Or44OA44Gu44OR44O844Of44OD44K344On44Oz?= =?utf-8?b?44KSZGVmaW5lIC5pbmMuIHBocOOBp+Wumue+qeOBp+OBjeOCi+OCiOOBhg==?= =?utf-8?b?44Gr44GX44G+44GX44Gf44CC?= Message-ID: <1245899611.099457.26149.nullmailer@users.sourceforge.jp> Revision: 78 http://sourceforge.jp/projects/frameworkspider/svn/view?view=rev&revision=78 Author: m_nakashima Date: 2009-06-25 12:13:31 +0900 (Thu, 25 Jun 2009) Log Message: ----------- suPHPなどの特殊環境に対応する為、spiderが動的に作成する一時ファイルや一時フォルダのパーミッションをdefine.inc.phpで定義できるようにしました。 Modified Paths: -------------- current/DATA/define.inc.php current/DATA/lib/spider/BuildInformation.class.php current/DATA/lib/spider/Builder.class.php current/DATA/lib/spider/HttpRequest.class.php current/DATA/lib/spider/functions.inc.php current/DATA/lib/spider/tags/OutputHtml.class.php current/DATA/lib/util/File.class.php current/DATA/lib/util/LockProcess.class.php current/README.txt -------------- next part -------------- Modified: current/DATA/define.inc.php =================================================================== --- current/DATA/define.inc.php 2009-06-25 01:26:29 UTC (rev 77) +++ current/DATA/define.inc.php 2009-06-25 03:13:31 UTC (rev 78) @@ -37,6 +37,11 @@ /* * 拡張設定 */ +// spiderコアが自動生成するファイルの標準パーミッション +define ( 'SPIDER_FILE_CREATE_PERMITTION', 0666 ); +// spiderコアが自動生成するフォルダの標準パーミッション +define ( 'SPIDER_FOLDER_CREATE_PERMITTION', 0777 ); + // ライブラリディレクトリ名 define ( 'DIR_NAME_LIB', 'lib' ); // テンプレート配置ディレクトリ名 Modified: current/DATA/lib/spider/BuildInformation.class.php =================================================================== --- current/DATA/lib/spider/BuildInformation.class.php 2009-06-25 01:26:29 UTC (rev 77) +++ current/DATA/lib/spider/BuildInformation.class.php 2009-06-25 03:13:31 UTC (rev 78) @@ -120,8 +120,8 @@ } } if( strlen($dir_path) > strlen(DIR_PATH_BIN) && !is_dir($dir_path) ) { - if( @mkdir( $dir_path, 0777 ) ) { - @chmod( $dir_path, 0777 ); + if( @mkdir( $dir_path, SPIDER_FOLDER_CREATE_PERMITTION ) ) { + @chmod( $dir_path, SPIDER_FOLDER_CREATE_PERMITTION ); } else { header('Content-Type: text/plain;charset=UTF-8'); die('Core Erorr! Can\'t create build file directoreis! '.$dir_path); Modified: current/DATA/lib/spider/Builder.class.php =================================================================== --- current/DATA/lib/spider/Builder.class.php 2009-06-25 01:26:29 UTC (rev 77) +++ current/DATA/lib/spider/Builder.class.php 2009-06-25 03:13:31 UTC (rev 78) @@ -289,10 +289,10 @@ fwrite( $fp, $string ); flock($fp, LOCK_UN); @fclose( $fp ); - @chmod( $bin_file_path, 0666 ); + @chmod( $bin_file_path, SPIDER_FILE_CREATE_PERMITTION ); } else { @fclose( $fp ); - @chmod( $bin_file_path, 0666 ); + @chmod( $bin_file_path, SPIDER_FILE_CREATE_PERMITTION ); die('Core Error: Can\'t create execute file!!'); } } else { @@ -332,10 +332,10 @@ fwrite( $fp, $string ); flock($fp, LOCK_UN); @fclose( $fp ); - @chmod( $build_file_path, 0666 ); + @chmod( $build_file_path, SPIDER_FILE_CREATE_PERMITTION ); } else { @fclose( $fp ); - @chmod( $build_file_path, 0666 ); + @chmod( $build_file_path, SPIDER_FILE_CREATE_PERMITTION ); die('Core Error: Can\'t create build file!!'); } } else { Modified: current/DATA/lib/spider/HttpRequest.class.php =================================================================== --- current/DATA/lib/spider/HttpRequest.class.php 2009-06-25 01:26:29 UTC (rev 77) +++ current/DATA/lib/spider/HttpRequest.class.php 2009-06-25 03:13:31 UTC (rev 78) @@ -329,26 +329,26 @@ // ログファイル名の決定 $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 ); + if( @mkdir( $log_file_path, SPIDER_FOLDER_CREATE_PERMITTION ) ) { + @chmod( $log_file_path, SPIDER_FOLDER_CREATE_PERMITTION ); } } $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( @mkdir( $log_file_path, SPIDER_FOLDER_CREATE_PERMITTION ) ) { + @chmod( $log_file_path, SPIDER_FOLDER_CREATE_PERMITTION ); } } $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 ); + if( @mkdir( $log_file_path, SPIDER_FOLDER_CREATE_PERMITTION ) ) { + @chmod( $log_file_path, SPIDER_FOLDER_CREATE_PERMITTION ); } } $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 ); + if(@touch( $log_file_path, SPIDER_FILE_CREATE_PERMITTION )){ + @chmod( $log_file_path, SPIDER_FILE_CREATE_PERMITTION ); } } error_log($log_message."\n" , 3, $log_file_path ); Modified: current/DATA/lib/spider/functions.inc.php =================================================================== --- current/DATA/lib/spider/functions.inc.php 2009-06-25 01:26:29 UTC (rev 77) +++ current/DATA/lib/spider/functions.inc.php 2009-06-25 03:13:31 UTC (rev 78) @@ -26,8 +26,8 @@ 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); + if( @mkdir(DIR_PATH_BIN,SPIDER_FOLDER_CREATE_PERMITTION) ) { + @chmod(DIR_PATH_BIN,SPIDER_FOLDER_CREATE_PERMITTION); } else { array_push( $errors, $GLOBALS['spider.messages']['spider.finctions.cantcreatebindir'] ); } @@ -35,8 +35,8 @@ 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 ); + if( @mkdir( DIR_PATH_LOCK, SPIDER_FOLDER_CREATE_PERMITTION ) ) { + @chmod( DIR_PATH_LOCK, SPIDER_FOLDER_CREATE_PERMITTION ); } else { array_push( $errors, $GLOBALS['spider.messages']['spider.finctions.cantcreatelockdir'] ); } @@ -44,8 +44,8 @@ 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 ); + if( @mkdir( DIR_PATH_TMP, SPIDER_FOLDER_CREATE_PERMITTION ) ) { + @chmod( DIR_PATH_TMP, SPIDER_FOLDER_CREATE_PERMITTION ); } else { array_push( $errors, $GLOBALS['spider.messages']['spider.finctions.cantcreatetmpdir'] ); } @@ -53,8 +53,8 @@ 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 ); + if( @mkdir( DIR_PATH_CACHE, SPIDER_FOLDER_CREATE_PERMITTION ) ) { + @chmod( DIR_PATH_CACHE, SPIDER_FOLDER_CREATE_PERMITTION ); } else { array_push( $errors, $GLOBALS['spider.messages']['spider.finctions.cantcreatecachedir'] ); } @@ -69,8 +69,8 @@ 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 ); + if( @mkdir( DIR_PATH_LOG, SPIDER_FOLDER_CREATE_PERMITTION ) ) { + @chmod( DIR_PATH_LOG, SPIDER_FOLDER_CREATE_PERMITTION ); } else { array_push( $errors, $GLOBALS['spider.messages']['spider.finctions.cantcreatelogdir'] ); } @@ -228,8 +228,8 @@ $lock_path = DIR_PATH_LOCK.DIRECTORY_SEPARATOR.'spider.orgsession.mainlock'; if( spider_pwait() ) { // ロックがかかっていないならロックディレクトリ作成 - mkdir( $lock_path, 0777 ); - chmod( $lock_path, 0777 ); + mkdir( $lock_path, SPIDER_FOLDER_CREATE_PERMITTION ); + chmod( $lock_path, SPIDER_FOLDER_CREATE_PERMITTION ); return true; } else { return false; Modified: current/DATA/lib/spider/tags/OutputHtml.class.php =================================================================== --- current/DATA/lib/spider/tags/OutputHtml.class.php 2009-06-25 01:26:29 UTC (rev 77) +++ current/DATA/lib/spider/tags/OutputHtml.class.php 2009-06-25 03:13:31 UTC (rev 78) @@ -92,7 +92,7 @@ $process_code .= 'flock($fp, LOCK_UN);'."\n"; $process_code .= '}'."\n"; $process_code .= '@fclose( $fp );'."\n"; - $process_code .= '@chmod( "'.$html_path.'", 0666 );'."\n"; + $process_code .= '@chmod( "'.$html_path.'", '.SPIDER_FILE_CREATE_PERMITTION.' );'."\n"; $process_code .= '}'."\n"; $process_code .= '}'."\n"; if( !isset($build_information->convert_view_process_hash) Modified: current/DATA/lib/util/File.class.php =================================================================== --- current/DATA/lib/util/File.class.php 2009-06-25 01:26:29 UTC (rev 77) +++ current/DATA/lib/util/File.class.php 2009-06-25 03:13:31 UTC (rev 78) @@ -19,8 +19,8 @@ if( preg_match('/^[dD][iI][rR]/', filetype($file_absolute_path) ) ) { // フォルダの場合なければ作成する if( !file_exists($destination_path) ) { - if( @mkdir( $destination_path, 0777 ) ) { - @chmod( $destination_path, 0777 ); + if( @mkdir( $destination_path, SPIDER_FOLDER_CREATE_PERMITTION ) ) { + @chmod( $destination_path, SPIDER_FOLDER_CREATE_PERMITTION ); } else { return false; } @@ -33,7 +33,7 @@ // 対象がファイルの場合なければコピー if( $force || !file_exists($destination_path) ) { if( @copy( $file_absolute_path, $destination_path ) ) { - @chmod( $destination_path, 0777 ); + @chmod( $destination_path, SPIDER_FOLDER_CREATE_PERMITTION ); } else { return false; } Modified: current/DATA/lib/util/LockProcess.class.php =================================================================== --- current/DATA/lib/util/LockProcess.class.php 2009-06-25 01:26:29 UTC (rev 77) +++ current/DATA/lib/util/LockProcess.class.php 2009-06-25 03:13:31 UTC (rev 78) @@ -41,8 +41,8 @@ // 現在ロックがかかっているか確認する if( $this->wait() ) { // ロックがかかっていないならロックディレクトリ作成 - mkdir( $this->lock_file_name, 0777 ); - chmod( $this->lock_file_name, 0777 ); + mkdir( $this->lock_file_name, SPIDER_FOLDER_CREATE_PERMITTION ); + chmod( $this->lock_file_name, SPIDER_FOLDER_CREATE_PERMITTION ); return true; } else { return false; Modified: current/README.txt =================================================================== --- current/README.txt 2009-06-25 01:26:29 UTC (rev 77) +++ current/README.txt 2009-06-25 03:13:31 UTC (rev 78) @@ -3,6 +3,10 @@ ** ** このファイルにはコミットごとに変更点とファイル名を記述します。 ** +-- 2009-06-25 +1) suPHPなどの特殊環境に対応する為、spiderが動的に作成する一時ファイルや一時フォルダのパーミッションを + define.inc.phpで定義できるようにしました。 + -- 2009-04-22 1) spiderのDATAフォルダをspider.inc.php配置フォルダからさかのぼって自動認識するようにしました。 2) HttpRequestのセッションの適正化メソッドで、セッションスコープの判断をREQUEST_URIで行っており From svnnotify @ sourceforge.jp Thu Jun 25 13:31:55 2009 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Thu, 25 Jun 2009 13:31:55 +0900 Subject: [Frameworkspider-svn] spider-commit [79] Message-ID: <1245904315.770039.18932.nullmailer@users.sourceforge.jp> Revision: 79 http://sourceforge.jp/projects/frameworkspider/svn/view?view=rev&revision=79 Author: m_nakashima Date: 2009-06-25 13:31:55 +0900 (Thu, 25 Jun 2009) Log Message: ----------- Modified Paths: -------------- current/README.txt Added Paths: ----------- current/spider/ Removed Paths: ------------- current/DATA/ -------------- next part -------------- Modified: current/README.txt =================================================================== --- current/README.txt 2009-06-25 03:13:31 UTC (rev 78) +++ current/README.txt 2009-06-25 04:31:55 UTC (rev 79) @@ -6,6 +6,7 @@ -- 2009-06-25 1) suPHPなどの特殊環境に対応する為、spiderが動的に作成する一時ファイルや一時フォルダのパーミッションを define.inc.phpで定義できるようにしました。 +2) DATAフォルダをspiderに名称変更しました。これまで通りDATAでも動作します -- 2009-04-22 1) spiderのDATAフォルダをspider.inc.php配置フォルダからさかのぼって自動認識するようにしました。 From svnnotify @ sourceforge.jp Mon Jun 29 12:07:17 2009 From: svnnotify @ sourceforge.jp (svnnotify @ sourceforge.jp) Date: Mon, 29 Jun 2009 12:07:17 +0900 Subject: [Frameworkspider-svn] =?utf-8?q?spider-commit_=5B80=5D__util=5FMa?= =?utf-8?b?aWzjgq/jg6njgrnjga7mt7vku5jjg5XjgqHjgqTjg6vlkI3jga7jgqjjg7M=?= =?utf-8?b?44Kz44O844OH44Kj44Oz44Kw44GM5q2j44GX44GP6KGM44KP44KM44Gm44GE?= =?utf-8?b?44Gq44GL44Gj44Gf5ZWP6aGM44Gu5L+u5q2j?= Message-ID: <1246244837.975329.18614.nullmailer@users.sourceforge.jp> Revision: 80 http://sourceforge.jp/projects/frameworkspider/svn/view?view=rev&revision=80 Author: m_nakashima Date: 2009-06-29 12:07:17 +0900 (Mon, 29 Jun 2009) Log Message: ----------- util_Mailクラスの添付ファイル名のエンコーディングが正しく行われていなかった問題の修正 Modified Paths: -------------- current/README.txt current/spider/lib/util/Mail.class.php -------------- next part -------------- Modified: current/README.txt =================================================================== --- current/README.txt 2009-06-25 04:31:55 UTC (rev 79) +++ current/README.txt 2009-06-29 03:07:17 UTC (rev 80) @@ -3,6 +3,9 @@ ** ** このファイルにはコミットごとに変更点とファイル名を記述します。 ** +-- 2009-06-29 +1) util_Mailクラスの添付ファイル名のエンコーディングが正しく行われていなかった問題の修正 + -- 2009-06-25 1) suPHPなどの特殊環境に対応する為、spiderが動的に作成する一時ファイルや一時フォルダのパーミッションを define.inc.phpで定義できるようにしました。 Modified: current/spider/lib/util/Mail.class.php =================================================================== --- current/spider/lib/util/Mail.class.php 2009-06-25 04:31:55 UTC (rev 79) +++ current/spider/lib/util/Mail.class.php 2009-06-29 03:07:17 UTC (rev 80) @@ -44,7 +44,7 @@ var $x_mailer = 'MDS.Co.,Ltd./Web Mailer v1.0.0/www.md-systems.net'; var $charset_header = 'ISO-2022-JP'; var $charset_body = 'ISO-2022-JP'; - var $charset_file_name = 'Shift_JIS'; + var $charset_filename = 'Shift_JIS'; var $replace_words = array(); /**