Mercurial > epgrec.yaz
annotate recomplete.php @ 11:065d48346fff
support mediatomb db update (testing)
| author | yoneda <yoneda@debian.localnet.mda.or.jp> |
|---|---|
| date | Mon, 13 Jul 2009 23:46:20 +0900 |
| parents | f5a9f0eb4858 |
| children | b0fc647167f5 |
| rev | line source |
|---|---|
| 1 | 1 #!/usr/bin/php |
| 2 <?php | |
| 3 include_once( "config.php" ); | |
| 4 include_once( INSTALL_PATH . "/DBRecord.class.php" ); | |
| 5 | |
| 6 $reserve_id = $argv[1]; | |
| 7 | |
| 8 try{ | |
| 9 $rrec = new DBRecord( TBL_PREFIX.RESERVE_TBL, "id" , $reserve_id ); | |
| 10 | |
| 11 if( file_exists( INSTALL_PATH . SPOOL . "/". $rrec->path ) ) { | |
| 12 // 予約完了 | |
| 13 $rrec->complete = '1'; | |
|
11
065d48346fff
support mediatomb db update (testing)
yoneda <yoneda@debian.localnet.mda.or.jp>
parents:
1
diff
changeset
|
14 if( MEDIATOMB_UPDATE) { |
|
065d48346fff
support mediatomb db update (testing)
yoneda <yoneda@debian.localnet.mda.or.jp>
parents:
1
diff
changeset
|
15 $dbh = mysql_connect( DB_HOST, DB_USER, DB_PASS ); |
|
065d48346fff
support mediatomb db update (testing)
yoneda <yoneda@debian.localnet.mda.or.jp>
parents:
1
diff
changeset
|
16 if( $dbh !== false ) { |
|
065d48346fff
support mediatomb db update (testing)
yoneda <yoneda@debian.localnet.mda.or.jp>
parents:
1
diff
changeset
|
17 $sqlstr = "use ".DB_NAME; |
|
065d48346fff
support mediatomb db update (testing)
yoneda <yoneda@debian.localnet.mda.or.jp>
parents:
1
diff
changeset
|
18 mysql_query( $sqlstr ); |
|
065d48346fff
support mediatomb db update (testing)
yoneda <yoneda@debian.localnet.mda.or.jp>
parents:
1
diff
changeset
|
19 // 別にやらなくてもいいが |
|
065d48346fff
support mediatomb db update (testing)
yoneda <yoneda@debian.localnet.mda.or.jp>
parents:
1
diff
changeset
|
20 $sqlstr = "set NAME utf8"; |
|
065d48346fff
support mediatomb db update (testing)
yoneda <yoneda@debian.localnet.mda.or.jp>
parents:
1
diff
changeset
|
21 mysql_query( $sqlstr ); |
|
065d48346fff
support mediatomb db update (testing)
yoneda <yoneda@debian.localnet.mda.or.jp>
parents:
1
diff
changeset
|
22 $sqlstr = "update mt_cds_object set metadata='dc:description=".$rrec->description."' where dc_title='".$rrec->path."'"; |
|
065d48346fff
support mediatomb db update (testing)
yoneda <yoneda@debian.localnet.mda.or.jp>
parents:
1
diff
changeset
|
23 mysql_query( $sqlstr ); |
|
065d48346fff
support mediatomb db update (testing)
yoneda <yoneda@debian.localnet.mda.or.jp>
parents:
1
diff
changeset
|
24 $sqlstr = "update mt_cds_object set dc_title='".$rrec->title."' where dc_title='".$rrec->path."'"; |
|
065d48346fff
support mediatomb db update (testing)
yoneda <yoneda@debian.localnet.mda.or.jp>
parents:
1
diff
changeset
|
25 mysql_query( $sqlstr ); |
|
065d48346fff
support mediatomb db update (testing)
yoneda <yoneda@debian.localnet.mda.or.jp>
parents:
1
diff
changeset
|
26 } |
|
065d48346fff
support mediatomb db update (testing)
yoneda <yoneda@debian.localnet.mda.or.jp>
parents:
1
diff
changeset
|
27 } |
| 1 | 28 } |
| 29 else { | |
| 30 // 予約失敗 | |
| 31 $rrec->delete(); | |
| 32 } | |
| 33 } | |
| 34 catch( exception $e ) { | |
| 35 exit( $e->getMessage() ); | |
| 36 } | |
| 37 | |
| 38 ?> |
