Mercurial > epgrec.yaz
annotate recomplete.php @ 116:f268d7d10590
fix: マルチバイトmb_str_replaceをネットからいただいて追加
author | yoneda <epgrec@park.mda.or.jp> |
---|---|
date | Sat, 13 Mar 2010 23:30:11 +0900 |
parents | 3bed74eca373 |
children | 481e789605e3 |
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" ); |
e5f9aa34d06f
change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents:
27
diff
changeset
|
8 |
e5f9aa34d06f
change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents:
27
diff
changeset
|
9 $settings = Settings::factory(); |
e5f9aa34d06f
change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents:
27
diff
changeset
|
10 |
1 | 11 $reserve_id = $argv[1]; |
12 | |
13 try{ | |
37
e5f9aa34d06f
change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents:
27
diff
changeset
|
14 $rrec = new DBRecord( RESERVE_TBL, "id" , $reserve_id ); |
1 | 15 |
37
e5f9aa34d06f
change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents:
27
diff
changeset
|
16 if( file_exists( INSTALL_PATH .$settings->spool . "/". $rrec->path ) ) { |
1 | 17 // 篋膣絎篋 |
18 $rrec->complete = '1'; | |
49 | 19 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
|
20 // <c緇c鴻腆阪c純 |
e5f9aa34d06f
change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents:
27
diff
changeset
|
21 @exec("sync"); |
e5f9aa34d06f
change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents:
27
diff
changeset
|
22 sleep(15); |
e5f9aa34d06f
change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents:
27
diff
changeset
|
23 $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
|
24 if( $dbh !== false ) { |
e5f9aa34d06f
change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents:
27
diff
changeset
|
25 $sqlstr = "use ".$settings->db_name; |
e5f9aa34d06f
change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents:
27
diff
changeset
|
26 @mysql_query( $sqlstr ); |
e5f9aa34d06f
change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents:
27
diff
changeset
|
27 // ャ |
e5f9aa34d06f
change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents:
27
diff
changeset
|
28 $sqlstr = "set NAME utf8"; |
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 $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
|
31 @mysql_query( $sqlstr ); |
e5f9aa34d06f
change: modify all script for web base setting
yoneda <epgrec@park.mda.or.jp>
parents:
27
diff
changeset
|
32 $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
|
33 @mysql_query( $sqlstr ); |
11
065d48346fff
support mediatomb db update (testing)
yoneda <yoneda@debian.localnet.mda.or.jp>
parents:
1
diff
changeset
|
34 } |
16
cf19005e65d1
added: mysql_real_escape_string
Sushi-k <epgrec@park.mda.or.jp>
parents:
13
diff
changeset
|
35 } |
1 | 36 } |
37 else { | |
38 // 篋膣紊掩 | |
39 $rrec->delete(); | |
40 } | |
41 } | |
42 catch( exception $e ) { | |
43 exit( $e->getMessage() ); | |
44 } | |
45 | |
49 | 46 ?> |