Changeset 17371
- Timestamp:
- 2008/06/24 18:32:36 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2/data/class/util/GC_Utils.php
r17177 r17371 179 179 // ログローテーションにて作成されたファイルを取得 180 180 if(ereg("^". $basename . "\." , $file)) { 181 $arr Log[] = $file;181 $arrFile[] = $file; 182 182 } 183 183 } 184 184 185 // ファイルログが最大個数なら以上なら古いファイルから削除する 186 $count = count($arrLog); 187 if($count >= $max_log) { 188 $diff = $count - $max_log; 189 for($i = 0; $diff >= $i ; $i++) { 190 unlink($dirname. "/" .array_pop($arrLog)); 185 // ローテーションにて作成されたログファイルが存在しない場合は実行しない 186 if(is_array($arrFile)) { 187 // ソートを行う 188 $arrLog = natcasesort($arrFile); 189 190 // ファイルログが最大個数なら以上なら古いファイルから削除する 191 $count = count($arrLog); 192 if($count >= $max_log) { 193 $diff = $count - $max_log; 194 for($i = 0; $diff >= $i ; $i++) { 195 unlink($dirname. "/" .array_pop($arrLog)); 196 } 191 197 } 192 } 193 194 // ログファイルの添え字をずらす 195 $count = count($arrLog); 196 for($i = $count; 1 <= $i; $i--) { 197 $move_number = $i + 1; 198 199 if(file_exists("$path.$move_number")) unlink("$path.$move_number"); 200 copy("$dirname/" . $arrLog[$i - 1], "$path.$move_number"); 201 198 199 // ログファイルの添え字をずらす 200 $count = count($arrLog); 201 for($i = $count; 1 <= $i; $i--) { 202 $move_number = $i + 1; 203 if(file_exists("$path.$move_number")) unlink("$path.$move_number"); 204 copy("$dirname/" . $arrLog[$i - 1], "$path.$move_number"); 205 } 202 206 } 203 207 $ret = copy($path, "$path.1"); … … 212 216 } 213 217 } 214 218 215 219 /*---------------------------------------------------------------------- 216 220 * [名称] gfMakePassword
Note: See TracChangeset
for help on using the changeset viewer.