comparison getepg.php @ 89:663521c2bf06

delete trailing whitespace
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Tue, 02 Mar 2010 23:00:04 +0900
parents 36ac7c416bd7
children 057ca53de6ca
comparison
equal deleted inserted replaced
88:3941ee5b3e63 89:663521c2bf06
3 include_once('config.php'); 3 include_once('config.php');
4 include_once( INSTALL_PATH . '/DBRecord.class.php' ); 4 include_once( INSTALL_PATH . '/DBRecord.class.php' );
5 include_once( INSTALL_PATH . '/Reservation.class.php' ); 5 include_once( INSTALL_PATH . '/Reservation.class.php' );
6 include_once( INSTALL_PATH . '/Keyword.class.php' ); 6 include_once( INSTALL_PATH . '/Keyword.class.php' );
7 include_once( INSTALL_PATH . '/Settings.class.php' ); 7 include_once( INSTALL_PATH . '/Settings.class.php' );
8 8
9 // 後方互換性 9 // 後方互換性
10 if( ! defined( "BS_EPG_CHANNEL" ) ) define( "BS_EPG_CHANNEL", "211" ); 10 if( ! defined( "BS_EPG_CHANNEL" ) ) define( "BS_EPG_CHANNEL", "211" );
11 if( ! defined( "CS1_EPG_CHANNEL" ) ) define( "CS1_EPG_CHANNEL", "CS8" ); 11 if( ! defined( "CS1_EPG_CHANNEL" ) ) define( "CS1_EPG_CHANNEL", "CS8" );
12 if( ! defined( "CS2_EPG_CHANNEL" ) ) define( "CS2_EPG_CHANNEL", "CS24" ); 12 if( ! defined( "CS2_EPG_CHANNEL" ) ) define( "CS2_EPG_CHANNEL", "CS24" );
13 13
14 14
15 function check_file( $file ) { 15 function check_file( $file ) {
16 // ファイルがないなら無問題 16 // ファイルがないなら無問題
17 if( ! file_exists( $file ) ) return true; 17 if( ! file_exists( $file ) ) return true;
18 18
19 // 1時間以上前のファイルなら削除してやり直す 19 // 1時間以上前のファイルなら削除してやり直す
20 if( (time() - filemtime( $file )) > 3600 ) { 20 if( (time() - filemtime( $file )) > 3600 ) {
21 @unlink( $file ); 21 @unlink( $file );
22 return true; 22 return true;
23 } 23 }
24 24
25 return false; 25 return false;
26 } 26 }
27 27
28 $settings = Settings::factory(); 28 $settings = Settings::factory();
29 29
30 $temp_xml_bs = $settings->temp_xml."_bs"; 30 $temp_xml_bs = $settings->temp_xml."_bs";
31 $temp_xml_cs1 = $settings->temp_xml."_cs1"; 31 $temp_xml_cs1 = $settings->temp_xml."_cs1";
32 $temp_xml_cs2 = $settings->temp_xml."_cs2"; 32 $temp_xml_cs2 = $settings->temp_xml."_cs2";
33 $temp_xml_gr = $settings->temp_xml."_gr"; 33 $temp_xml_gr = $settings->temp_xml."_gr";
34 34
35 if( file_exists( $settings->temp_data ) ) @unlink( $settings->temp_data ); 35 if( file_exists( $settings->temp_data ) ) @unlink( $settings->temp_data );
36 36
37 // BSを処理する 37 // BSを処理する
38 if( $settings->bs_tuners != 0 ) { 38 if( $settings->bs_tuners != 0 ) {
39 // 録画重複チェック 39 // 録画重複チェック
40 $num = DBRecord::countRecords( RESERVE_TBL, "WHERE complete = '0' AND (type = 'BS' OR type = 'CS') AND endtime > now() AND starttime < addtime( now(), '00:03:05')" ); 40 $num = DBRecord::countRecords( RESERVE_TBL, "WHERE complete = '0' AND (type = 'BS' OR type = 'CS') AND endtime > now() AND starttime < addtime( now(), '00:03:05')" );
41 if( $num < $settings->bs_tuners ) { //xxx 41 if( $num < $settings->bs_tuners ) { //xxx
89 exec( $cmdline ); 89 exec( $cmdline );
90 if( file_exists( $settings->temp_data ) ) @unlink( $settings->temp_data ); 90 if( file_exists( $settings->temp_data ) ) @unlink( $settings->temp_data );
91 } 91 }
92 } 92 }
93 } 93 }
94 94
95 ?> 95 ?>