changeset 12:c4cb171f9453

new file: mediatomb.php
author yoneda <yoneda@debian.localnet.mda.or.jp>
date Mon, 13 Jul 2009 23:47:19 +0900
parents 065d48346fff
children b0fc647167f5
files mediatomb.php
diffstat 1 files changed, 29 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediatomb.php	Mon Jul 13 23:47:19 2009 +0900
@@ -0,0 +1,29 @@
+#!/usr/bin/php
+<?php
+
+include_once('config.php');
+include_once(INSTALL_PATH.'/DBRecord.class.php');
+
+try {
+
+  $recs = DBRecord::createRecords(TBL_PREFIX.RESERVE_TBL );
+
+// DB接続
+  $dbh = mysql_connect( DB_HOST, DB_USER, DB_PASS );
+  if( $dbh === false ) exit( "mysql connection fail" );
+  $sqlstr = "use ".DB_NAME;
+  mysql_query( $sqlstr );
+  $sqlstr = "set NAME utf8";
+  mysql_query( $sqlstr );
+
+  foreach( $recs as $rec ) {
+      $sqlstr = "update mt_cds_object set metadata='dc:description=".$rec->description."' where dc_title='".$rec->path."'";
+      mysql_query( $sqlstr );
+      $sqlstr = "update mt_cds_object set dc_title='".$rec->title."' where dc_title='".$rec->path."'";
+      mysql_query( $sqlstr );
+  }
+}
+catch( Exception $e ) {
+    exit( $e->getMessage() );
+}
+?>