Mercurial > epgrec.yaz
comparison recomplete.php @ 37:e5f9aa34d06f
change: modify all script for web base setting
author | yoneda <epgrec@park.mda.or.jp> |
---|---|
date | Tue, 28 Jul 2009 00:00:04 +0900 |
parents | a34f2ff49097 |
children | 8965ef108821 |
comparison
equal
deleted
inserted
replaced
36:c2522d1df005 | 37:e5f9aa34d06f |
---|---|
1 #!/usr/bin/php | 1 #!/usr/bin/php |
2 <?php | 2 <?php |
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 . "/Settings.class.php" ); | |
6 | |
7 $settings = Settings::factory(); | |
8 | |
5 | 9 |
6 $reserve_id = $argv[1]; | 10 $reserve_id = $argv[1]; |
7 | 11 |
8 try{ | 12 try{ |
9 $rrec = new DBRecord( TBL_PREFIX.RESERVE_TBL, "id" , $reserve_id ); | 13 $rrec = new DBRecord( RESERVE_TBL, "id" , $reserve_id ); |
10 | 14 |
11 if( file_exists( INSTALL_PATH . SPOOL . "/". $rrec->path ) ) { | 15 if( file_exists( INSTALL_PATH .$settings->spool . "/". $rrec->path ) ) { |
12 // 予約完了 | 16 // 予約完了 |
13 $rrec->complete = '1'; | 17 $rrec->complete = '1'; |
14 if( defined("MEDIATOMB_UPDATE") ) { | 18 if( $settings->mediatomb_update ) { |
15 if( MEDIATOMB_UPDATE ) { | 19 // ちょっと待った方が確実っぽい |
16 // ちょっと待った方が確実っぽい | 20 @exec("sync"); |
17 @exec("sync"); | 21 sleep(15); |
18 sleep(15); | 22 $dbh = mysql_connect( $settings->db_host, $settings->db_user, $settings->db_pass ); |
19 $dbh = mysql_connect( DB_HOST, DB_USER, DB_PASS ); | 23 if( $dbh !== false ) { |
20 if( $dbh !== false ) { | 24 $sqlstr = "use ".$settings->db_name; |
21 $sqlstr = "use ".DB_NAME; | 25 @mysql_query( $sqlstr ); |
22 mysql_query( $sqlstr ); | 26 // 別にやらなくてもいいが |
23 // 別にやらなくてもいいが | 27 $sqlstr = "set NAME utf8"; |
24 $sqlstr = "set NAME utf8"; | 28 @mysql_query( $sqlstr ); |
25 mysql_query( $sqlstr ); | 29 $sqlstr = "update mt_cds_object set metadata='dc:description=".mysql_real_escape_string($rrec->description)."&epgrec:id=".$reserve_id."' where dc_title='".$rrec->path."'"; |
26 $sqlstr = "update mt_cds_object set metadata='dc:description=".mysql_real_escape_string($rrec->description)."&epgrec:id=".$reserve_id."' where dc_title='".$rrec->path."'"; | 30 @mysql_query( $sqlstr ); |
27 mysql_query( $sqlstr ); | 31 $sqlstr = "update mt_cds_object set dc_title='".mysql_real_escape_string($rrec->title)."(".date("Y/m/d").")' where dc_title='".$rrec->path."'"; |
28 $sqlstr = "update mt_cds_object set dc_title='".mysql_real_escape_string($rrec->title)."(".date("Y/m/d").")' where dc_title='".$rrec->path."'"; | 32 @mysql_query( $sqlstr ); |
29 mysql_query( $sqlstr ); | |
30 } | |
31 } | 33 } |
32 } | 34 } |
33 } | 35 } |
34 else { | 36 else { |
35 // 予約失敗 | 37 // 予約失敗 |