annotate recorder.php @ 166:68f6b36e7c01

mod: デバッグバージョン
author Sushi-k <epgrec@park.mda.or.jp>
date Fri, 16 Apr 2010 17:31:18 +0900
parents b3095425e613
children b307e3749e80
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
153
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
1 #!/usr/bin/php
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
2 <?php
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
3 $script_path = dirname( __FILE__ );
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
4 chdir( $script_path );
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
5 include_once( $script_path . '/config.php');
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
6 include_once( INSTALL_PATH . "/DBRecord.class.php" );
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
7 include_once( INSTALL_PATH . "/Settings.class.php" );
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
8 include_once( INSTALL_PATH . "/recLog.inc.php" );
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
9 include_once( INSTALL_PATH . "/reclib.php" );
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
10
166
68f6b36e7c01 mod: デバッグバージョン
Sushi-k <epgrec@park.mda.or.jp>
parents: 163
diff changeset
11 define("DEBUG", true );
68f6b36e7c01 mod: デバッグバージョン
Sushi-k <epgrec@park.mda.or.jp>
parents: 163
diff changeset
12
153
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
13 // 緇剛
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
14
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
15 if( ! defined( RECORDER_CMD ) ) {
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
16 define( "RECORDER_CMD", INSTALL_PATH . "/recorder.php" );
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
17 }
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
18
161
84220382fea8 mod: 録画中のキャンセルを可能にした(動作確認、まだ不完全かも)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents: 153
diff changeset
19 $settings = Settings::factory();
84220382fea8 mod: 録画中のキャンセルを可能にした(動作確認、まだ不完全かも)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents: 153
diff changeset
20 $reserve_id = $argv[1];
84220382fea8 mod: 録画中のキャンセルを可能にした(動作確認、まだ不完全かも)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents: 153
diff changeset
21 $msgh_r = null; // 篆∞<祉若吾潟
84220382fea8 mod: 録画中のキャンセルを可能にした(動作確認、まだ不完全かも)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents: 153
diff changeset
22 $msgh_w = null; // 篆∞<祉若吾潟
84220382fea8 mod: 録画中のキャンセルを可能にした(動作確認、まだ不完全かも)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents: 153
diff changeset
23
166
68f6b36e7c01 mod: デバッグバージョン
Sushi-k <epgrec@park.mda.or.jp>
parents: 163
diff changeset
24 $logfile = INSTALL_PATH."/settings/recorder_".$reserve_id.".log";
153
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
25
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
26 // 潟潟違<祉若後篆
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
27
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
28 function epgrec_get_message() {
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
29 global $msgh_r, $reserve_id;
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
30
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
31 $r = msg_receive($msgh_r, (int)$reserve_id , $msgtype, 1024, $message, TRUE, MSG_IPC_NOWAIT | MSG_NOERROR);
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
32 if( $r ) return $message;
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
33
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
34 return null;
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
35 }
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
36
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
37 // <祉若檎篆
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
38
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
39 function epgrec_send_message( $msg ) {
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
40 global $msgh_w, $reserve_id;
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
41
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
42 msg_send( $msgh_w, (int)$reserve_id, $msg );
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
43 sleep(1); // 御篆<緇
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
44 }
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
45
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
46
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
47 function epgrec_exec( $cmd ) {
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
48 $descspec = array(
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
49 0 => array( 'file','/dev/null','r' ),
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
50 1 => array( 'file','/dev/null','w' ),
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
51 2 => array( 'file','/dev/null','w' ),
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
52 );
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
53 $p = proc_open( $cmd, $descspec, $pipes );
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
54 if( is_resource( $p ) ) return $p;
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
55
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
56 return false;
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
57 }
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
58
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
59 // 絎祉鴻潟絖祉鴻pid鴻菴
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
60 // 鴻鐚
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
61 //
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
62 function epgrec_childproc( $p )
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
63 {
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
64 $st = proc_get_status( $p );
161
84220382fea8 mod: 録画中のキャンセルを可能にした(動作確認、まだ不完全かも)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents: 153
diff changeset
65 $ppid = $st['pid'];
153
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
66
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
67 // ps 絎茵
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
68 $d = array(
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
69 0 => array( 'file','/dev/null','r' ),
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
70 1 => array( 'pipe','w' ),
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
71 2 => array( 'file','/dev/null','w' ),
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
72 );
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
73
166
68f6b36e7c01 mod: デバッグバージョン
Sushi-k <epgrec@park.mda.or.jp>
parents: 163
diff changeset
74 $ps = proc_open( "/bin/ps -o pid,ppid ax" , $d, $pipes );
153
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
75 do {
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
76 $st = proc_get_status( $ps );
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
77 }while( $st['running'] );
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
78
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
79 // 罔羣阪茯
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
80 $cpids = array();
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
81 while( ! feof( $pipes[1] ) ) {
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
82 $line = fgets( $pipes[1] );
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
83 $pids = preg_split( "/[\s]+/", $line );
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
84 if( $pids[1] == $ppid ) {
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
85 array_push( $cpids, $pids[0] );
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
86 }
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
87 }
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
88 fclose( $pipes[1] );
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
89 proc_close( $ps );
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
90
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
91 return $cpids;
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
92 }
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
93
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
94 // 絎祉鴻潟絖祉鴻腟篋
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
95
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
96 function epgrec_termproc( $p )
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
97 {
166
68f6b36e7c01 mod: デバッグバージョン
Sushi-k <epgrec@park.mda.or.jp>
parents: 163
diff changeset
98 if( DEBUG ) {
68f6b36e7c01 mod: デバッグバージョン
Sushi-k <epgrec@park.mda.or.jp>
parents: 163
diff changeset
99 global $logfile;
68f6b36e7c01 mod: デバッグバージョン
Sushi-k <epgrec@park.mda.or.jp>
parents: 163
diff changeset
100 system( "ps ax >>".$logfile );
68f6b36e7c01 mod: デバッグバージョン
Sushi-k <epgrec@park.mda.or.jp>
parents: 163
diff changeset
101 system( "echo ------- >>".$logfile );
68f6b36e7c01 mod: デバッグバージョン
Sushi-k <epgrec@park.mda.or.jp>
parents: 163
diff changeset
102 }
68f6b36e7c01 mod: デバッグバージョン
Sushi-k <epgrec@park.mda.or.jp>
parents: 163
diff changeset
103
153
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
104 $cpids = epgrec_childproc( $p );
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
105
166
68f6b36e7c01 mod: デバッグバージョン
Sushi-k <epgrec@park.mda.or.jp>
parents: 163
diff changeset
106 if( DEBUG ) {
68f6b36e7c01 mod: デバッグバージョン
Sushi-k <epgrec@park.mda.or.jp>
parents: 163
diff changeset
107 global $logfile;
68f6b36e7c01 mod: デバッグバージョン
Sushi-k <epgrec@park.mda.or.jp>
parents: 163
diff changeset
108
68f6b36e7c01 mod: デバッグバージョン
Sushi-k <epgrec@park.mda.or.jp>
parents: 163
diff changeset
109 foreach( $cpids as $cpid ) {
68f6b36e7c01 mod: デバッグバージョン
Sushi-k <epgrec@park.mda.or.jp>
parents: 163
diff changeset
110 system( "echo ".$cpid." >>".$logfile );
68f6b36e7c01 mod: デバッグバージョン
Sushi-k <epgrec@park.mda.or.jp>
parents: 163
diff changeset
111 }
68f6b36e7c01 mod: デバッグバージョン
Sushi-k <epgrec@park.mda.or.jp>
parents: 163
diff changeset
112 system( "echo ------- >>".$logfile );
68f6b36e7c01 mod: デバッグバージョン
Sushi-k <epgrec@park.mda.or.jp>
parents: 163
diff changeset
113 }
68f6b36e7c01 mod: デバッグバージョン
Sushi-k <epgrec@park.mda.or.jp>
parents: 163
diff changeset
114
153
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
115 @proc_terminate( $p );
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
116 sleep(1);
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
117 @proc_terminate( $p ); // 2綺
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
118
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
119 foreach( $cpids as $cpid ) {
166
68f6b36e7c01 mod: デバッグバージョン
Sushi-k <epgrec@park.mda.or.jp>
parents: 163
diff changeset
120 $ret = posix_kill( $cpid, SIGTERM ); // sigterm
68f6b36e7c01 mod: デバッグバージョン
Sushi-k <epgrec@park.mda.or.jp>
parents: 163
diff changeset
121 usleep(100*1000);
68f6b36e7c01 mod: デバッグバージョン
Sushi-k <epgrec@park.mda.or.jp>
parents: 163
diff changeset
122 if( ! $ret ) posix_kill( $cpid, SIGKILL ); // sigkill
153
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
123 }
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
124
166
68f6b36e7c01 mod: デバッグバージョン
Sushi-k <epgrec@park.mda.or.jp>
parents: 163
diff changeset
125 if( DEBUG ) {
68f6b36e7c01 mod: デバッグバージョン
Sushi-k <epgrec@park.mda.or.jp>
parents: 163
diff changeset
126 global $logfile;
68f6b36e7c01 mod: デバッグバージョン
Sushi-k <epgrec@park.mda.or.jp>
parents: 163
diff changeset
127 system( "ps ax >>".$logfile );
68f6b36e7c01 mod: デバッグバージョン
Sushi-k <epgrec@park.mda.or.jp>
parents: 163
diff changeset
128 system( "echo ------- >>".$logfile );
68f6b36e7c01 mod: デバッグバージョン
Sushi-k <epgrec@park.mda.or.jp>
parents: 163
diff changeset
129 }
68f6b36e7c01 mod: デバッグバージョン
Sushi-k <epgrec@park.mda.or.jp>
parents: 163
diff changeset
130
68f6b36e7c01 mod: デバッグバージョン
Sushi-k <epgrec@park.mda.or.jp>
parents: 163
diff changeset
131 foreach( $cpids as $cpid ) {
68f6b36e7c01 mod: デバッグバージョン
Sushi-k <epgrec@park.mda.or.jp>
parents: 163
diff changeset
132 $ret = posix_kill( $cpid, SIGTERM ); // sigterm
68f6b36e7c01 mod: デバッグバージョン
Sushi-k <epgrec@park.mda.or.jp>
parents: 163
diff changeset
133 if( $ret ) return false; // 祉鴻絖с
68f6b36e7c01 mod: デバッグバージョン
Sushi-k <epgrec@park.mda.or.jp>
parents: 163
diff changeset
134 }
153
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
135 return true; // 篆荐若с
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
136 }
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
137
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
138 ////// 膩
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
139
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
140 // <祉若吾潟緇
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
141 $ipc_key = ftok( RECORDER_CMD, "R" );
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
142 $msgh_r = msg_get_queue( $ipc_key );
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
143
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
144 $ipc_key = ftok( RECORDER_CMD, "W" );
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
145 $msgh_w = msg_get_queue( $ipc_key );
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
146
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
147 try{
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
148 $rrec = new DBRecord( RESERVE_TBL, "id" , $reserve_id );
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
149
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
150 // 祉緇
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
151 $starttime = toTimestamp($rrec->starttime);
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
152 $endtime = toTimestamp($rrec->endtime);
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
153
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
154 if( time() > $starttime ) {
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
155 // サ牙私膣
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
156 $rrec->complete = 1; // 腟c
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
157 throw new RecException("recorder:: サ牙私膣絎茵", EPGREC_ERROR );
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
158 }
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
159 reclog("recorder:: 牙ID".$rrec->id .":".$rrec->type.$rrec->channel.$rrec->title."牙祉吾с紮" );
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
160
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
161 // 牙脂紮障у
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
162 while( time() < $starttime ) {
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
163 if( ($message = epgrec_get_message() ) != null ) {
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
164 switch( $message ) {
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
165 case "terminate": // 腟篋腓
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
166 epgrec_send_message("success");
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
167 $rrec->complete = 1; // 腟c
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
168 throw new RecException("recorder:: 牙ID".$rrec->id .":".$rrec->type.$rrec->channel.$rrec->title."牙祉筝" );
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
169 break;
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
170
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
171 case "stat":
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
172 epgrec_send_message("alive");
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
173 break;
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
174
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
175 default:
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
176 break;
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
177 }
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
178 }
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
179 usleep( 50 * 1000 ); // 50腱緇
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
180 }
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
181
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
182 // 牙脂紮
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
183
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
184 $proch = false;
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
185 if( ( $proch = epgrec_exec(DO_RECORD) ) !== false ) {
163
b3095425e613 fix: 録画中にEPGの変更があったときにキャンセルされないよう変更
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents: 161
diff changeset
186 reclog("recorder:: 牙ID".$rrec->id .":".$rrec->type.$rrec->channel.$rrec->title."牙脂紮" );
153
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
187 // 牙糸篋緇
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
188 $rec_cont = true;
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
189 while( $rec_cont ){
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
190 $st = proc_get_status($proch);
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
191 if(! $st['running'] ) $rec_cont = false; // 牙糸篋
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
192
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
193 if( ($message = epgrec_get_message() ) != null ) {
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
194 switch( $message ) {
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
195 case "terminate": // 腟篋腓
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
196 if( epgrec_termproc( $proch ) == false ) {
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
197 epgrec_send_message("error");
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
198 reclog( "牙祉潟潟罩≪с障", EPGREC_WARN );
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
199 }
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
200 else {
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
201 epgrec_send_message("success");
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
202 reclog("recorder:: 牙ID".$rrec->id .":".$rrec->type.$rrec->channel.$rrec->title."牙祉筝" );
161
84220382fea8 mod: 録画中のキャンセルを可能にした(動作確認、まだ不完全かも)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents: 153
diff changeset
203 $rec_cont = false;
153
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
204 }
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
205 break;
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
206
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
207 case "stat":
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
208 epgrec_send_message("alive");
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
209 break;
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
210
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
211 default:
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
212 break;
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
213 }
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
214 }
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
215 sleep(1);
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
216 }
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
217 proc_close( $proch );
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
218 $proch = false;
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
219 }
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
220 else {
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
221 $rrec->complete = 1; // 腟c
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
222 throw new RecException("recorder:: 牙祉潟潟絎茵紊掩", EPGREC_ERROR );
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
223 }
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
224
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
225 // 篋絎腟篋憜吾
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
226 if( time() < $endtime ) {
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
227 $rrec->endtime = toDatetime( time() );
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
228 }
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
229
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
230 // 絎篋違腴
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
231 $rrec->complete = '1';
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
232
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
233 // <c緇c鴻腆阪c純
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
234 sleep(15);
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
235 @exec("sync");
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
236
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
237 if( file_exists( INSTALL_PATH .$settings->spool . "/". $rrec->path ) ) {
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
238 // 篋膣絎篋
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
239 reclog( "recorder:: 篋膣ID". $rrec->id .":".$rrec->type.$rrec->channel.$rrec->title."牙紫篋" );
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
240
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
241 // 泣若篏
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
242 if( $settings->use_thumbs == 1 ) {
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
243 $gen_thumbnail = INSTALL_PATH."/gen-thumbnail.sh";
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
244 if( defined("GEN_THUMBNAIL") )
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
245 $gen_thumbnail = GEN_THUMBNAIL;
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
246 @exec($gen_thumbnail);
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
247 }
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
248
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
249 if( $settings->mediatomb_update == 1 ) {
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
250 $dbh = mysql_connect( $settings->db_host, $settings->db_user, $settings->db_pass );
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
251 if( $dbh !== false ) {
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
252 $sqlstr = "use ".$settings->db_name;
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
253 @mysql_query( $sqlstr );
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
254 // ャ
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
255 $sqlstr = "set NAME utf8";
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
256 @mysql_query( $sqlstr );
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
257 $sqlstr = "update mt_cds_object set metadata='dc:description=".mysql_real_escape_string($rrec->description)."&epgrec:id=".$reserve_id."' where dc_title='".$rrec->path."'";
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
258 @mysql_query( $sqlstr );
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
259 $sqlstr = "update mt_cds_object set dc_title='".mysql_real_escape_string($rrec->title)."(".date("Y/m/d").")' where dc_title='".$rrec->path."'";
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
260 @mysql_query( $sqlstr );
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
261 }
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
262 }
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
263 }
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
264 else { // 篋膣紊掩
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
265 reclog( "recomplete:: 篋膣ID". $rrec->id .":".$rrec->type.$rrec->channel.$rrec->title."牙祉紊掩罔≧", EPGREC_ERROR );
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
266 }
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
267 }
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
268 catch( Exception $e ) {
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
269 reclog( "recorder:: ".$e->getMessage(), $e->getLevel() );
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
270 }
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
271
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
272 msg_remove_queue( $msgh_r ); // <祉若吾潟
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
273 msg_remove_queue( $msgh_w ); // <祉若吾潟
4099ae0393eb mod: do-record.shラッパを追加(まだ途中)
epgrec@park.mda.or.jp <yoneda@recorder.localnet.mda.or.jp>
parents:
diff changeset
274 ?>