-
Notifications
You must be signed in to change notification settings - Fork 5
/
storeProgram.php
executable file
·64 lines (53 loc) · 1.65 KB
/
storeProgram.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/usr/bin/php
<?php
$script_path = dirname( __FILE__ );
chdir( $script_path );
include_once( $script_path . '/config.php');
$type = $argv[1]; // BS CS1 CS2 GR
$file = $argv[2]; // TSファイル
$key = "";
// プライオリティ低に
pcntl_setpriority(20);
include_once( INSTALL_PATH . '/DBRecord.class.php' );
include_once( INSTALL_PATH . '/Reservation.class.php' );
include_once( INSTALL_PATH . '/Keyword.class.php' );
include_once( INSTALL_PATH . '/Settings.class.php' );
include_once( INSTALL_PATH . '/storeProgram.inc.php' );
include_once( INSTALL_PATH . "/reclib.php" );
$settings = Settings::factory();
$xmlfile = "";
$cmdline = $settings->epgdump." ";
if( $type === "GR" ) {
$ch = $argv[3]; // channel
$xmlfile = $settings->temp_xml."_gr".$ch;
$cmdline .= $ch." ".$file." ".$xmlfile;
}
else if( $type === "CS1" ) {
$type = "CS";
$xmlfile = $settings->temp_xml."_cs1";
$cmdline .= "/CS ".$file." ".$xmlfile;
}
else if( $type === "CS2" ) {
$type = "CS";
$xmlfile = $settings->temp_xml."_cs2";
$cmdline .= "/CS ".$file." ".$xmlfile;
}
else if( $type === "BS" ) {
$xmlfile = $settings->temp_xml."_bs";
$cmdline .= "/BS ".$file." ".$xmlfile;
}
else exit();
exec( $cmdline );
if( file_exists( $xmlfile ) ) {
storeProgram( $type, $xmlfile );
@unlink( $xmlfile );
}
else {
reclog( "storeProgram:: 正常な".$xmlfile."が作成されなかった模様(放送間帯でないなら問題ありません)", EPGREC_WARN );
}
if( file_exists( $file ) ) @unlink( $file );
/*
garbageClean(); // 不要プログラム削除
doKeywordReservation(); // キーワード予約
*/
?>