46 lines
1.1 KiB
PHP
46 lines
1.1 KiB
PHP
<?php
|
|
|
|
$root = dirname(__DIR__, 2);
|
|
$servicePath = $root . '/server/app/common/service/match/MatchLiveService.php';
|
|
|
|
if (!is_file($servicePath)) {
|
|
fwrite(STDERR, "missing service file\n");
|
|
exit(1);
|
|
}
|
|
|
|
$service = file_get_contents($servicePath);
|
|
$requiredTokens = [
|
|
'class MatchLiveService',
|
|
'public static function syncLegacyLiveUrl',
|
|
'public static function getLiveListForApi',
|
|
'public static function buildStreamOptions',
|
|
'source_url',
|
|
'update_time',
|
|
"order('create_time', 'asc')",
|
|
"order('id', 'asc')",
|
|
'play_url_m3u8',
|
|
'play_url_hd_m3u8',
|
|
'play_url_flv',
|
|
'play_url_hd_flv',
|
|
'M3U8',
|
|
'HD M3U8',
|
|
'FLV',
|
|
'HD FLV',
|
|
"if (\$url === '')",
|
|
'default_play_url',
|
|
];
|
|
|
|
foreach ($requiredTokens as $needle) {
|
|
if (strpos($service, $needle) === false) {
|
|
fwrite(STDERR, "missing service token: {$needle}\n");
|
|
exit(1);
|
|
}
|
|
}
|
|
|
|
if (strpos($service, "whereNull('delete_time')") === false && strpos($service, 'SoftDelete') === false) {
|
|
fwrite(STDERR, "missing non-deleted row guard\n");
|
|
exit(1);
|
|
}
|
|
|
|
echo "service static checks passed\n";
|