diff storeProgram.inc.php @ 135:9c5e597ef6c6

mod: ログ機能を追加
author epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
date Sat, 20 Mar 2010 23:59:01 +0900
parents ef3df87f3c7d
children 481e789605e3
line wrap: on
line diff
--- a/storeProgram.inc.php	Sat Mar 20 00:49:37 2010 +0900
+++ b/storeProgram.inc.php	Sat Mar 20 23:59:01 2010 +0900
@@ -9,7 +9,12 @@
 	
 	// 8ヤ札筝若帥井
 	$arr = array();
-	$arr = DBRecord::createRecords(  PROGRAM_TBL, "WHERE starttime  > adddate( now(), 8 )" );
+	$arr = DBRecord::createRecords(  PROGRAM_TBL, "WHERE starttime  > adddate( now(), 8 ) ");
+	foreach( $arr as $val ) $val->delete();
+
+	// 8ヤ札筝違羔
+	$arr = array();
+	$arr = DBRecord::createRecords(  LOG_TBL, "WHERE endtime < subdate( now(), 8 )" );
 	foreach( $arr as $val ) $val->delete();
 }
 
@@ -20,9 +25,10 @@
 	foreach( $arr as $val ) {
 		try {
 			$val->reservation();
+			reclog( "getepg::若若ID".$val->id."篋膣");
 		}
 		catch( Exception $e ) {
-		// ∴
+			// ∴
 		}
 	}
 }
@@ -39,6 +45,7 @@
 	// XML parse
   	$xml = @simplexml_load_file( $xmlfile );
 	if( $xml === false ) {
+		reclog( "getepg::".$xmlfile."篏c罔≧", E_ERROR );
 		return;	// XML茯水篏
 	}
 	// channel遵
@@ -64,7 +71,7 @@
 		}
 	 }
 	 catch( Exception $e ) {
-		// ∴
+		reclog( "getepg::DB・膓障c潟若吾莨若帥紊掩", E_ERROR );
 	 }
 	}
 	// channel 腟篋
@@ -82,7 +89,7 @@
 			$channel_rec = new DBRecord(CHANNEL_TBL, "channel_disc", "$channel_disc" );
 		}
 		catch( Exception $e ) {
-			// ∴
+			reclog( "getepg::c潟潟若肴с", E_ERROR );
 		}
 		if( $channel_rec == null ) continue;	// 緇莎激
 		if( $channel_rec->skip == 1 ) continue;	// 篆<c潟
@@ -129,13 +136,15 @@
 					try {
 						$reserve = new DBRecord(RESERVE_TBL, "program_id", $rec->id );
 						if( $reserve->autorec ) {
+							reclog( "getepg::牙ID".$reserve->id."紊眼醇с篋膣羔");
 							Reservation::cancel( $reserve->id );
 						}
 					}
 					catch( Exception $e ) {
-						//∴
+						// ∴
 					}
 					// 腟
+					reclog( "getepg::冗茲榊腟ID".$rec->id."" );
 					$rec->delete();
 				}
 			}
@@ -161,9 +170,10 @@
 		 }
 		}
 		catch(Exception $e) {
+			reclog( "getepg::DBュ阪馹罔≧", E_ERROR );
 			exit( $e->getMessage() );
 		}
 	}
 	// Programme緇絎篋
 }
-?>
\ No newline at end of file
+?>