annotate getepg.old.php @ 136:6754b6aa50cf

mod: ログ機能のためにconfig.phpを変更
author epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
date Sun, 21 Mar 2010 00:00:58 +0900
parents 2646140c5ba7
children 43f74519bd52
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
84
3ec5ca5e56ca add: EPG取得並列化版を暫定的に標準に
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
1 #!/usr/bin/php
3ec5ca5e56ca add: EPG取得並列化版を暫定的に標準に
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
2 <?php
111
3bed74eca373 change: EPG取得並列化が可能かどうかを判定するように変更
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents: 95
diff changeset
3 $script_path = dirname( __FILE__ );
3bed74eca373 change: EPG取得並列化が可能かどうかを判定するように変更
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents: 95
diff changeset
4 chdir( $script_path );
3bed74eca373 change: EPG取得並列化が可能かどうかを判定するように変更
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents: 95
diff changeset
5 include_once( $script_path . '/config.php');
84
3ec5ca5e56ca add: EPG取得並列化版を暫定的に標準に
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
6 include_once( INSTALL_PATH . '/DBRecord.class.php' );
3ec5ca5e56ca add: EPG取得並列化版を暫定的に標準に
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
7 include_once( INSTALL_PATH . '/Reservation.class.php' );
3ec5ca5e56ca add: EPG取得並列化版を暫定的に標準に
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
8 include_once( INSTALL_PATH . '/Keyword.class.php' );
3ec5ca5e56ca add: EPG取得並列化版を暫定的に標準に
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
9 include_once( INSTALL_PATH . '/Settings.class.php' );
131
2646140c5ba7 mod: 積み残し関係の修正
Sushi-k <epgrec@park.mda.or.jp>
parents: 111
diff changeset
10 include_once( INSTALL_PATH . '/storeProgram.inc.php' );
2646140c5ba7 mod: 積み残し関係の修正
Sushi-k <epgrec@park.mda.or.jp>
parents: 111
diff changeset
11
84
3ec5ca5e56ca add: EPG取得並列化版を暫定的に標準に
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
12
3ec5ca5e56ca add: EPG取得並列化版を暫定的に標準に
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
13 $settings = Settings::factory();
3ec5ca5e56ca add: EPG取得並列化版を暫定的に標準に
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
14
3ec5ca5e56ca add: EPG取得並列化版を暫定的に標準に
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
15 if( file_exists( $settings->temp_data ) ) @unlink( $settings->temp_data );
3ec5ca5e56ca add: EPG取得並列化版を暫定的に標準に
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
16 if( file_exists( $settings->temp_xml ) ) @unlink( $settings->temp_xml );
3ec5ca5e56ca add: EPG取得並列化版を暫定的に標準に
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
17
3ec5ca5e56ca add: EPG取得並列化版を暫定的に標準に
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
18 // BS
3ec5ca5e56ca add: EPG取得並列化版を暫定的に標準に
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
19 if( $settings->bs_tuners != 0 ) {
3ec5ca5e56ca add: EPG取得並列化版を暫定的に標準に
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
20 // 牙脂茲с
3ec5ca5e56ca add: EPG取得並列化版を暫定的に標準に
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
21 $num = DBRecord::countRecords( RESERVE_TBL, "WHERE complete = '0' AND (type = 'BS' OR type = 'CS') AND endtime > now() AND starttime < addtime( now(), '00:03:05')" );
3ec5ca5e56ca add: EPG取得並列化版を暫定的に標準に
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
22 if( $num == 0 ) {
3ec5ca5e56ca add: EPG取得並列化版を暫定的に標準に
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
23 $cmdline = "CHANNEL=211 DURATION=180 TYPE=BS TUNER=0 MODE=0 OUTPUT=".$settings->temp_data." ".DO_RECORD . " >/dev/null 2>&1";
3ec5ca5e56ca add: EPG取得並列化版を暫定的に標準に
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
24 exec( $cmdline );
3ec5ca5e56ca add: EPG取得並列化版を暫定的に標準に
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
25 $cmdline = $settings->epgdump." /BS ".$settings->temp_data." ".$settings->temp_xml;
3ec5ca5e56ca add: EPG取得並列化版を暫定的に標準に
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
26 exec( $cmdline );
3ec5ca5e56ca add: EPG取得並列化版を暫定的に標準に
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
27 storeProgram( "BS", $settings->temp_xml );
3ec5ca5e56ca add: EPG取得並列化版を暫定的に標準に
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
28 if( file_exists( $settings->temp_data ) ) @unlink( $settings->temp_data );
3ec5ca5e56ca add: EPG取得並列化版を暫定的に標準に
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
29 if( file_exists( $settings->temp_xml ) ) @unlink( $settings->temp_xml );
3ec5ca5e56ca add: EPG取得並列化版を暫定的に標準に
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
30 }
3ec5ca5e56ca add: EPG取得並列化版を暫定的に標準に
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
31
3ec5ca5e56ca add: EPG取得並列化版を暫定的に標準に
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
32 // CS
3ec5ca5e56ca add: EPG取得並列化版を暫定的に標準に
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
33 if ($settings->cs_rec_flg != 0) {
3ec5ca5e56ca add: EPG取得並列化版を暫定的に標準に
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
34 $num = DBRecord::countRecords( RESERVE_TBL, "WHERE complete = '0' AND (type = 'BS' OR type = 'CS') AND endtime > now() AND starttime < addtime( now(), '00:03:05')" );
3ec5ca5e56ca add: EPG取得並列化版を暫定的に標準に
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
35 if( $num == 0 ) {
3ec5ca5e56ca add: EPG取得並列化版を暫定的に標準に
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
36 $cmdline = "CHANNEL=CS8 DURATION=120 TYPE=CS TUNER=0 MODE=0 OUTPUT=".$settings->temp_data." ".DO_RECORD . " >/dev/null 2>&1";
3ec5ca5e56ca add: EPG取得並列化版を暫定的に標準に
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
37 exec( $cmdline );
3ec5ca5e56ca add: EPG取得並列化版を暫定的に標準に
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
38 $cmdline = $settings->epgdump." /CS ".$settings->temp_data." ".$settings->temp_xml;
3ec5ca5e56ca add: EPG取得並列化版を暫定的に標準に
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
39 exec( $cmdline );
3ec5ca5e56ca add: EPG取得並列化版を暫定的に標準に
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
40 storeProgram( "CS", $settings->temp_xml );
3ec5ca5e56ca add: EPG取得並列化版を暫定的に標準に
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
41 if( file_exists( $settings->temp_data ) ) @unlink( $settings->temp_data );
3ec5ca5e56ca add: EPG取得並列化版を暫定的に標準に
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
42 if( file_exists( $settings->temp_xml ) ) @unlink( $settings->temp_xml );
3ec5ca5e56ca add: EPG取得並列化版を暫定的に標準に
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
43 }
3ec5ca5e56ca add: EPG取得並列化版を暫定的に標準に
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
44 $num = DBRecord::countRecords( RESERVE_TBL, "WHERE complete = '0' AND (type = 'BS' OR type = 'CS') AND endtime > now() AND starttime < addtime( now(), '00:03:05')" );
3ec5ca5e56ca add: EPG取得並列化版を暫定的に標準に
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
45 if( $num == 0 ) {
3ec5ca5e56ca add: EPG取得並列化版を暫定的に標準に
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
46 $cmdline = "CHANNEL=CS24 DURATION=120 TYPE=CS TUNER=0 MODE=0 OUTPUT=".$settings->temp_data." ".DO_RECORD . " >/dev/null 2>&1";
3ec5ca5e56ca add: EPG取得並列化版を暫定的に標準に
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
47 exec( $cmdline );
3ec5ca5e56ca add: EPG取得並列化版を暫定的に標準に
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
48 $cmdline = $settings->epgdump." /CS ".$settings->temp_data." ".$settings->temp_xml;
3ec5ca5e56ca add: EPG取得並列化版を暫定的に標準に
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
49 exec( $cmdline );
3ec5ca5e56ca add: EPG取得並列化版を暫定的に標準に
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
50 storeProgram( "CS", $settings->temp_xml );
3ec5ca5e56ca add: EPG取得並列化版を暫定的に標準に
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
51 if( file_exists( $settings->temp_data ) ) @unlink( $settings->temp_data );
3ec5ca5e56ca add: EPG取得並列化版を暫定的に標準に
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
52 if( file_exists( $settings->temp_xml ) ) @unlink( $settings->temp_xml );
3ec5ca5e56ca add: EPG取得並列化版を暫定的に標準に
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
53 }
3ec5ca5e56ca add: EPG取得並列化版を暫定的に標準に
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
54 }
3ec5ca5e56ca add: EPG取得並列化版を暫定的に標準に
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
55 }
3ec5ca5e56ca add: EPG取得並列化版を暫定的に標準に
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
56
3ec5ca5e56ca add: EPG取得並列化版を暫定的に標準に
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
57 // 遺羈≪
3ec5ca5e56ca add: EPG取得並列化版を暫定的に標準に
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
58 if( $settings->gr_tuners != 0 ) {
3ec5ca5e56ca add: EPG取得並列化版を暫定的に標準に
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
59 foreach( $GR_CHANNEL_MAP as $key=>$value ){
3ec5ca5e56ca add: EPG取得並列化版を暫定的に標準に
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
60 // 牙脂茲с
3ec5ca5e56ca add: EPG取得並列化版を暫定的に標準に
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
61 $num = DBRecord::countRecords( RESERVE_TBL, "WHERE complete = '0' AND type = 'GR' AND endtime > now() AND starttime < addtime( now(), '00:01:10')" );
3ec5ca5e56ca add: EPG取得並列化版を暫定的に標準に
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
62 if( $num == 0 ) {
3ec5ca5e56ca add: EPG取得並列化版を暫定的に標準に
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
63 $cmdline = "CHANNEL=".$value." DURATION=60 TYPE=GR TUNER=0 MODE=0 OUTPUT=".$settings->temp_data." ".DO_RECORD . " >/dev/null 2>&1";
3ec5ca5e56ca add: EPG取得並列化版を暫定的に標準に
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
64 exec( $cmdline );
3ec5ca5e56ca add: EPG取得並列化版を暫定的に標準に
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
65 $cmdline = $settings->epgdump." ".$key." ".$settings->temp_data." ".$settings->temp_xml;
3ec5ca5e56ca add: EPG取得並列化版を暫定的に標準に
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
66 exec( $cmdline );
3ec5ca5e56ca add: EPG取得並列化版を暫定的に標準に
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
67 storeProgram( "GR", $settings->temp_xml );
3ec5ca5e56ca add: EPG取得並列化版を暫定的に標準に
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
68 if( file_exists( $settings->temp_data ) ) @unlink( $settings->temp_data );
3ec5ca5e56ca add: EPG取得並列化版を暫定的に標準に
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
69 if( file_exists( $settings->temp_xml ) ) @unlink( $settings->temp_xml );
3ec5ca5e56ca add: EPG取得並列化版を暫定的に標準に
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
70 }
3ec5ca5e56ca add: EPG取得並列化版を暫定的に標準に
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
71 }
3ec5ca5e56ca add: EPG取得並列化版を暫定的に標準に
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
72 }
3ec5ca5e56ca add: EPG取得並列化版を暫定的に標準に
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
73
131
2646140c5ba7 mod: 積み残し関係の修正
Sushi-k <epgrec@park.mda.or.jp>
parents: 111
diff changeset
74 garbageClean(); // 筝荀違
2646140c5ba7 mod: 積み残し関係の修正
Sushi-k <epgrec@park.mda.or.jp>
parents: 111
diff changeset
75 doKeywordReservation(); // 若若篋膣
84
3ec5ca5e56ca add: EPG取得並列化版を暫定的に標準に
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
76 exit();
131
2646140c5ba7 mod: 積み残し関係の修正
Sushi-k <epgrec@park.mda.or.jp>
parents: 111
diff changeset
77 ?>