Mercurial > epgrec.yaz
annotate recomplete.php @ 142:481e789605e3
mod: EPGの更新と同時に予約情報を更新するように変更、ログビューアの追加
author | epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp> |
---|---|
date | Sun, 21 Mar 2010 16:42:58 +0900 |
parents | 3bed74eca373 |
children | 5b192e94f49d |
rev | line source |
---|---|
1 | 1 #!/usr/bin/php |
2 <?php | |
111
3bed74eca373
change: EPG取得並列化が可能かどうかを判定するように変更
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
49
diff
changeset
|
3 $script_path = dirname( __FILE__ ); |
3bed74eca373
change: EPG取得並列化が可能かどうかを判定するように変更
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
49
diff
changeset
|
4 chdir( $script_path ); |
3bed74eca373
change: EPG取得並列化が可能かどうかを判定するように変更
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
49
diff
changeset
|
5 include_once( $script_path . '/config.php'); |
1 | 6 include_once( INSTALL_PATH . "/DBRecord.class.php" ); |
37
e5f9aa34d06f
change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents:
27
diff
changeset
|
7 include_once( INSTALL_PATH . "/Settings.class.php" ); |
142
481e789605e3
mod: EPGの更新と同時に予約情報を更新するように変更、ログビューアの追加
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
111
diff
changeset
|
8 include_once( INSTALL_PATH . "/recLog.inc.php" ); |
37
e5f9aa34d06f
change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents:
27
diff
changeset
|
9 |
e5f9aa34d06f
change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents:
27
diff
changeset
|
10 $settings = Settings::factory(); |
e5f9aa34d06f
change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents:
27
diff
changeset
|
11 |
1 | 12 $reserve_id = $argv[1]; |
13 | |
14 try{ | |
37
e5f9aa34d06f
change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents:
27
diff
changeset
|
15 $rrec = new DBRecord( RESERVE_TBL, "id" , $reserve_id ); |
142
481e789605e3
mod: EPGの更新と同時に予約情報を更新するように変更、ログビューアの追加
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
111
diff
changeset
|
16 $rrec->complete = '1'; |
1 | 17 |
37
e5f9aa34d06f
change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents:
27
diff
changeset
|
18 if( file_exists( INSTALL_PATH .$settings->spool . "/". $rrec->path ) ) { |
1 | 19 // 篋膣絎篋 |
142
481e789605e3
mod: EPGの更新と同時に予約情報を更新するように変更、ログビューアの追加
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
111
diff
changeset
|
20 reclog( "recomplete:: 篋膣ID". $rrec->id .":".$rrec->type.$rrec->channel.$rrec->title."牙祉絎篋" ); |
481e789605e3
mod: EPGの更新と同時に予約情報を更新するように変更、ログビューアの追加
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
111
diff
changeset
|
21 |
49 | 22 if( $settings->mediatomb_update == 1 ) { |
37
e5f9aa34d06f
change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents:
27
diff
changeset
|
23 // <c緇c鴻腆阪c純 |
e5f9aa34d06f
change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents:
27
diff
changeset
|
24 @exec("sync"); |
e5f9aa34d06f
change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents:
27
diff
changeset
|
25 sleep(15); |
e5f9aa34d06f
change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents:
27
diff
changeset
|
26 $dbh = mysql_connect( $settings->db_host, $settings->db_user, $settings->db_pass ); |
e5f9aa34d06f
change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents:
27
diff
changeset
|
27 if( $dbh !== false ) { |
e5f9aa34d06f
change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents:
27
diff
changeset
|
28 $sqlstr = "use ".$settings->db_name; |
e5f9aa34d06f
change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents:
27
diff
changeset
|
29 @mysql_query( $sqlstr ); |
e5f9aa34d06f
change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents:
27
diff
changeset
|
30 // ャ |
e5f9aa34d06f
change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents:
27
diff
changeset
|
31 $sqlstr = "set NAME utf8"; |
e5f9aa34d06f
change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents:
27
diff
changeset
|
32 @mysql_query( $sqlstr ); |
e5f9aa34d06f
change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents:
27
diff
changeset
|
33 $sqlstr = "update mt_cds_object set metadata='dc:description=".mysql_real_escape_string($rrec->description)."&epgrec:id=".$reserve_id."' where dc_title='".$rrec->path."'"; |
e5f9aa34d06f
change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents:
27
diff
changeset
|
34 @mysql_query( $sqlstr ); |
e5f9aa34d06f
change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents:
27
diff
changeset
|
35 $sqlstr = "update mt_cds_object set dc_title='".mysql_real_escape_string($rrec->title)."(".date("Y/m/d").")' where dc_title='".$rrec->path."'"; |
e5f9aa34d06f
change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents:
27
diff
changeset
|
36 @mysql_query( $sqlstr ); |
11
065d48346fff
support mediatomb db update (testing)
yoneda <yoneda@debian.localnet.mda.or.jp>
parents:
1
diff
changeset
|
37 } |
16
cf19005e65d1
added: mysql_real_escape_string
Sushi-k <epgrec@park.mda.or.jp>
parents:
13
diff
changeset
|
38 } |
1 | 39 } |
40 else { | |
41 // 篋膣紊掩 | |
142
481e789605e3
mod: EPGの更新と同時に予約情報を更新するように変更、ログビューアの追加
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
111
diff
changeset
|
42 reclog( "recomplete:: 篋膣ID". $rrec->id .":".$rrec->type.$rrec->channel.$rrec->title."牙祉紊掩罔≧", E_ERROR ); |
1 | 43 $rrec->delete(); |
44 } | |
45 } | |
46 catch( exception $e ) { | |
142
481e789605e3
mod: EPGの更新と同時に予約情報を更新するように変更、ログビューアの追加
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
111
diff
changeset
|
47 reclog( "recomplete:: 篋膣若≪祉鴻紊掩罔≧", E_ERROR ); |
481e789605e3
mod: EPGの更新と同時に予約情報を更新するように変更、ログビューアの追加
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
111
diff
changeset
|
48 reclog( "recomplete:: ".$e->getMessage()."" , E_ERROR ); |
1 | 49 exit( $e->getMessage() ); |
50 } | |
51 | |
49 | 52 ?> |