Mercurial > epgrec.yaz
annotate getepg.php @ 84:3ec5ca5e56ca
add: EPG取得並列化版を暫定的に標準に
author | yoneda <yoneda@recorder.localnet.mda.or.jp> |
---|---|
date | Mon, 01 Mar 2010 12:16:32 +0900 |
parents | 330c83ae8c95 |
children | 549d799d73ae |
rev | line source |
---|---|
1 | 1 #!/usr/bin/php |
2 <?php | |
3 include_once('config.php'); | |
4 include_once( INSTALL_PATH . '/DBRecord.class.php' ); | |
5 include_once( INSTALL_PATH . '/Reservation.class.php' ); | |
6 include_once( INSTALL_PATH . '/Keyword.class.php' ); | |
37
e5f9aa34d06f
change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents:
7
diff
changeset
|
7 include_once( INSTALL_PATH . '/Settings.class.php' ); |
1 | 8 |
37
e5f9aa34d06f
change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents:
7
diff
changeset
|
9 $settings = Settings::factory(); |
84
3ec5ca5e56ca
add: EPG取得並列化版を暫定的に標準に
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
82
diff
changeset
|
10 |
37
e5f9aa34d06f
change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents:
7
diff
changeset
|
11 if( file_exists( $settings->temp_data ) ) @unlink( $settings->temp_data ); |
84
3ec5ca5e56ca
add: EPG取得並列化版を暫定的に標準に
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
82
diff
changeset
|
12 |
1 | 13 // BS |
57 | 14 if( $settings->bs_tuners != 0 ) { |
1 | 15 // 牙脂茲с |
70
1363ac056197
fix: getepg get program information duaring CS/BS recording.
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
67
diff
changeset
|
16 $num = DBRecord::countRecords( RESERVE_TBL, "WHERE complete = '0' AND (type = 'BS' OR type = 'CS') AND endtime > now() AND starttime < addtime( now(), '00:03:05')" ); |
84
3ec5ca5e56ca
add: EPG取得並列化版を暫定的に標準に
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
82
diff
changeset
|
17 if( ($num == 0) && !file_exists($settings->temp_xml."_bs") ) { |
37
e5f9aa34d06f
change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents:
7
diff
changeset
|
18 $cmdline = "CHANNEL=211 DURATION=180 TYPE=BS TUNER=0 MODE=0 OUTPUT=".$settings->temp_data." ".DO_RECORD . " >/dev/null 2>&1"; |
1 | 19 exec( $cmdline ); |
84
3ec5ca5e56ca
add: EPG取得並列化版を暫定的に標準に
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
82
diff
changeset
|
20 $cmdline = $settings->epgdump." /BS ".$settings->temp_data." ".$settings->temp_xml."_bs"; |
1 | 21 exec( $cmdline ); |
84
3ec5ca5e56ca
add: EPG取得並列化版を暫定的に標準に
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
82
diff
changeset
|
22 $cmdline = INSTALL_PATH."/storeProgram.php BS ".$settings->temp_xml."_bs"; |
3ec5ca5e56ca
add: EPG取得並列化版を暫定的に標準に
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
82
diff
changeset
|
23 exec( $cmdline ); |
37
e5f9aa34d06f
change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents:
7
diff
changeset
|
24 if( file_exists( $settings->temp_data ) ) @unlink( $settings->temp_data ); |
82
330c83ae8c95
fix: CSのEPG取得時に予約重複チェックを行っていなかったのを修正
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
70
diff
changeset
|
25 } |
67
a2c4665b310c
add: CS support (thanks to dakku)
Sushi-k <epgrec@park.mda.or.jp>
parents:
64
diff
changeset
|
26 |
82
330c83ae8c95
fix: CSのEPG取得時に予約重複チェックを行っていなかったのを修正
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
70
diff
changeset
|
27 // CS |
330c83ae8c95
fix: CSのEPG取得時に予約重複チェックを行っていなかったのを修正
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
70
diff
changeset
|
28 if ($settings->cs_rec_flg != 0) { |
330c83ae8c95
fix: CSのEPG取得時に予約重複チェックを行っていなかったのを修正
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
70
diff
changeset
|
29 $num = DBRecord::countRecords( RESERVE_TBL, "WHERE complete = '0' AND (type = 'BS' OR type = 'CS') AND endtime > now() AND starttime < addtime( now(), '00:03:05')" ); |
84
3ec5ca5e56ca
add: EPG取得並列化版を暫定的に標準に
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
82
diff
changeset
|
30 if( ($num == 0) && !file_exists($settings->temp_xml."_cs01") ) { |
67
a2c4665b310c
add: CS support (thanks to dakku)
Sushi-k <epgrec@park.mda.or.jp>
parents:
64
diff
changeset
|
31 $cmdline = "CHANNEL=CS8 DURATION=120 TYPE=CS TUNER=0 MODE=0 OUTPUT=".$settings->temp_data." ".DO_RECORD . " >/dev/null 2>&1"; |
a2c4665b310c
add: CS support (thanks to dakku)
Sushi-k <epgrec@park.mda.or.jp>
parents:
64
diff
changeset
|
32 exec( $cmdline ); |
84
3ec5ca5e56ca
add: EPG取得並列化版を暫定的に標準に
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
82
diff
changeset
|
33 $cmdline = $settings->epgdump." /CS ".$settings->temp_data." ".$settings->temp_xml."_cs01"; |
67
a2c4665b310c
add: CS support (thanks to dakku)
Sushi-k <epgrec@park.mda.or.jp>
parents:
64
diff
changeset
|
34 exec( $cmdline ); |
84
3ec5ca5e56ca
add: EPG取得並列化版を暫定的に標準に
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
82
diff
changeset
|
35 $cmdline = INSTALL_PATH."/storeProgram.php CS ".$settings->temp_xml."_cs01"; |
3ec5ca5e56ca
add: EPG取得並列化版を暫定的に標準に
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
82
diff
changeset
|
36 exec( $cmdline ); |
67
a2c4665b310c
add: CS support (thanks to dakku)
Sushi-k <epgrec@park.mda.or.jp>
parents:
64
diff
changeset
|
37 if( file_exists( $settings->temp_data ) ) @unlink( $settings->temp_data ); |
82
330c83ae8c95
fix: CSのEPG取得時に予約重複チェックを行っていなかったのを修正
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
70
diff
changeset
|
38 } |
330c83ae8c95
fix: CSのEPG取得時に予約重複チェックを行っていなかったのを修正
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
70
diff
changeset
|
39 $num = DBRecord::countRecords( RESERVE_TBL, "WHERE complete = '0' AND (type = 'BS' OR type = 'CS') AND endtime > now() AND starttime < addtime( now(), '00:03:05')" ); |
84
3ec5ca5e56ca
add: EPG取得並列化版を暫定的に標準に
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
82
diff
changeset
|
40 if( ($num == 0) && !file_exists($settings->temp_xml."_cs02") ) { |
67
a2c4665b310c
add: CS support (thanks to dakku)
Sushi-k <epgrec@park.mda.or.jp>
parents:
64
diff
changeset
|
41 $cmdline = "CHANNEL=CS24 DURATION=120 TYPE=CS TUNER=0 MODE=0 OUTPUT=".$settings->temp_data." ".DO_RECORD . " >/dev/null 2>&1"; |
a2c4665b310c
add: CS support (thanks to dakku)
Sushi-k <epgrec@park.mda.or.jp>
parents:
64
diff
changeset
|
42 exec( $cmdline ); |
84
3ec5ca5e56ca
add: EPG取得並列化版を暫定的に標準に
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
82
diff
changeset
|
43 $cmdline = $settings->epgdump." /CS ".$settings->temp_data." ".$settings->temp_xml."_cs02"; |
67
a2c4665b310c
add: CS support (thanks to dakku)
Sushi-k <epgrec@park.mda.or.jp>
parents:
64
diff
changeset
|
44 exec( $cmdline ); |
84
3ec5ca5e56ca
add: EPG取得並列化版を暫定的に標準に
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
82
diff
changeset
|
45 $cmdline = INSTALL_PATH."/storeProgram.php CS ".$settings->temp_xml."_cs02"; |
3ec5ca5e56ca
add: EPG取得並列化版を暫定的に標準に
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
82
diff
changeset
|
46 exec( $cmdline ); |
67
a2c4665b310c
add: CS support (thanks to dakku)
Sushi-k <epgrec@park.mda.or.jp>
parents:
64
diff
changeset
|
47 if( file_exists( $settings->temp_data ) ) @unlink( $settings->temp_data ); |
a2c4665b310c
add: CS support (thanks to dakku)
Sushi-k <epgrec@park.mda.or.jp>
parents:
64
diff
changeset
|
48 } |
1 | 49 } |
50 } | |
51 | |
52 // 遺羈≪ | |
57 | 53 if( $settings->gr_tuners != 0 ) { |
1 | 54 foreach( $GR_CHANNEL_MAP as $key=>$value ){ |
55 // 牙脂茲с | |
37
e5f9aa34d06f
change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents:
7
diff
changeset
|
56 $num = DBRecord::countRecords( RESERVE_TBL, "WHERE complete = '0' AND type = 'GR' AND endtime > now() AND starttime < addtime( now(), '00:01:10')" ); |
84
3ec5ca5e56ca
add: EPG取得並列化版を暫定的に標準に
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
82
diff
changeset
|
57 if( ($num == 0) && !file_exists($settings->temp_xml."_".$value."") ) { |
37
e5f9aa34d06f
change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents:
7
diff
changeset
|
58 $cmdline = "CHANNEL=".$value." DURATION=60 TYPE=GR TUNER=0 MODE=0 OUTPUT=".$settings->temp_data." ".DO_RECORD . " >/dev/null 2>&1"; |
1 | 59 exec( $cmdline ); |
84
3ec5ca5e56ca
add: EPG取得並列化版を暫定的に標準に
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
82
diff
changeset
|
60 $cmdline = $settings->epgdump." ".$key." ".$settings->temp_data." ".$settings->temp_xml."_".$value.""; |
1 | 61 exec( $cmdline ); |
84
3ec5ca5e56ca
add: EPG取得並列化版を暫定的に標準に
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
82
diff
changeset
|
62 $cmdline = INSTALL_PATH."/storeProgram.php GR ".$settings->temp_xml."_".$value.""; |
3ec5ca5e56ca
add: EPG取得並列化版を暫定的に標準に
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
82
diff
changeset
|
63 exec( $cmdline ); |
3ec5ca5e56ca
add: EPG取得並列化版を暫定的に標準に
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
82
diff
changeset
|
64 if( file_exists( $settings->temp_data ) ) @unlink( $settings->temp_data ); |
1 | 65 } |
66 } | |
67 } | |
68 | |
84
3ec5ca5e56ca
add: EPG取得並列化版を暫定的に標準に
yoneda <yoneda@recorder.localnet.mda.or.jp>
parents:
82
diff
changeset
|
69 ?> |