mirror of
https://github.com/Vateron-Media/XC_VM.git
synced 2026-10-31 03:03:24 +01:00
Refactor various components for improved error handling and code clarity
- Added checks for file existence before unlinking files in CacheHandlerCommand and CacheEngineCronJob. - Suppressed errors for exec and shell_exec calls in WatchdogCommand, DaemonTrait, and SystemInfo. - Enhanced bouquet map retrieval in BouquetService and CacheEngineCronJob to handle potential unserialization issues. - Improved error handling in RootMysqlCronJob for MySQLD log parsing. - Updated UserRepository to safely retrieve user IDs and user info from files, ensuring file existence checks. - Refactored EpisodeService to handle stream sources and subtitles more robustly, including fallback mechanisms. - Adjusted API responses in PlayerApiController and admin views to ensure consistent data handling. - Enhanced server and line management views to prevent potential errors with undefined variables and arrays. - General code cleanup and consistency improvements across various files.
This commit is contained in:
@@ -134,16 +134,20 @@ class UserRepository {
|
||||
if ($rCached) {
|
||||
if (empty($rPassword) && empty($rUserID) && strlen($rUsername) == 32) {
|
||||
if ($rSettings['case_sensitive_line']) {
|
||||
$rUserID = intval(file_get_contents(LINES_TMP_PATH . 'line_t_' . $rUsername));
|
||||
$rTokenPath = LINES_TMP_PATH . 'line_t_' . $rUsername;
|
||||
$rUserID = (file_exists($rTokenPath) ? intval(file_get_contents($rTokenPath)) : 0);
|
||||
} else {
|
||||
$rUserID = intval(file_get_contents(LINES_TMP_PATH . 'line_t_' . strtolower($rUsername)));
|
||||
$rTokenPath = LINES_TMP_PATH . 'line_t_' . strtolower($rUsername);
|
||||
$rUserID = (file_exists($rTokenPath) ? intval(file_get_contents($rTokenPath)) : 0);
|
||||
}
|
||||
} else {
|
||||
if (!empty($rUsername) && !empty($rPassword)) {
|
||||
if ($rSettings['case_sensitive_line']) {
|
||||
$rUserID = intval(file_get_contents(LINES_TMP_PATH . 'line_c_' . $rUsername . '_' . $rPassword));
|
||||
$rCachePath = LINES_TMP_PATH . 'line_c_' . $rUsername . '_' . $rPassword;
|
||||
$rUserID = (file_exists($rCachePath) ? intval(file_get_contents($rCachePath)) : 0);
|
||||
} else {
|
||||
$rUserID = intval(file_get_contents(LINES_TMP_PATH . 'line_c_' . strtolower($rUsername) . '_' . strtolower($rPassword)));
|
||||
$rCachePath = LINES_TMP_PATH . 'line_c_' . strtolower($rUsername) . '_' . strtolower($rPassword);
|
||||
$rUserID = (file_exists($rCachePath) ? intval(file_get_contents($rCachePath)) : 0);
|
||||
}
|
||||
} else {
|
||||
if (empty($rUserID)) {
|
||||
@@ -153,7 +157,12 @@ class UserRepository {
|
||||
}
|
||||
|
||||
if ($rUserID) {
|
||||
$rUserInfo = igbinary_unserialize(file_get_contents(LINES_TMP_PATH . 'line_i_' . $rUserID));
|
||||
$rInfoPath = LINES_TMP_PATH . 'line_i_' . $rUserID;
|
||||
if (file_exists($rInfoPath)) {
|
||||
$rUserInfo = igbinary_unserialize(file_get_contents($rInfoPath));
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (empty($rPassword) && empty($rUserID) && strlen($rUsername) == 32) {
|
||||
@@ -309,16 +318,20 @@ class UserRepository {
|
||||
if ($rCached) {
|
||||
if (empty($rPassword) && empty($rUserID) && strlen($rUsername) == 32) {
|
||||
if ($rSettings['case_sensitive_line']) {
|
||||
$rUserID = intval(file_get_contents(LINES_TMP_PATH . 'line_t_' . $rUsername));
|
||||
$rTokenPath = LINES_TMP_PATH . 'line_t_' . $rUsername;
|
||||
$rUserID = (file_exists($rTokenPath) ? intval(file_get_contents($rTokenPath)) : 0);
|
||||
} else {
|
||||
$rUserID = intval(file_get_contents(LINES_TMP_PATH . 'line_t_' . strtolower($rUsername)));
|
||||
$rTokenPath = LINES_TMP_PATH . 'line_t_' . strtolower($rUsername);
|
||||
$rUserID = (file_exists($rTokenPath) ? intval(file_get_contents($rTokenPath)) : 0);
|
||||
}
|
||||
} else {
|
||||
if (!empty($rUsername) && !empty($rPassword)) {
|
||||
if ($rSettings['case_sensitive_line']) {
|
||||
$rUserID = intval(file_get_contents(LINES_TMP_PATH . 'line_c_' . $rUsername . '_' . $rPassword));
|
||||
$rCachePath = LINES_TMP_PATH . 'line_c_' . $rUsername . '_' . $rPassword;
|
||||
$rUserID = (file_exists($rCachePath) ? intval(file_get_contents($rCachePath)) : 0);
|
||||
} else {
|
||||
$rUserID = intval(file_get_contents(LINES_TMP_PATH . 'line_c_' . strtolower($rUsername) . '_' . strtolower($rPassword)));
|
||||
$rCachePath = LINES_TMP_PATH . 'line_c_' . strtolower($rUsername) . '_' . strtolower($rPassword);
|
||||
$rUserID = (file_exists($rCachePath) ? intval(file_get_contents($rCachePath)) : 0);
|
||||
}
|
||||
} else {
|
||||
if (!empty($rUserID)) {
|
||||
@@ -329,7 +342,12 @@ class UserRepository {
|
||||
}
|
||||
if (!$rUserID) {
|
||||
} else {
|
||||
$rUserInfo = igbinary_unserialize(file_get_contents(LINES_TMP_PATH . 'line_i_' . $rUserID));
|
||||
$rInfoPath = LINES_TMP_PATH . 'line_i_' . $rUserID;
|
||||
if (file_exists($rInfoPath)) {
|
||||
$rUserInfo = igbinary_unserialize(file_get_contents($rInfoPath));
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (empty($rPassword) && empty($rUserID) && strlen($rUsername) == 32) {
|
||||
|
||||
Reference in New Issue
Block a user