more PHP 8. Thx Tom
This commit is contained in:
parent
71fd75eaf3
commit
56e0d92e36
@ -207,6 +207,7 @@ $(function(){
|
||||
<?else:?>
|
||||
// don't run this through the wrapper so that if it hangs up it won't delay anything else
|
||||
$.post("/plugins/<?=$plugin?>/include/exec.php",{action:'getPortsInUse'},function(data) {
|
||||
console.log(data);
|
||||
var ret = JSON.parse(data);
|
||||
portsInUse = ret.portsInUse;
|
||||
console.log("Ports In Use:" + portsInUse);
|
||||
@ -2217,6 +2218,7 @@ function postNoSpin(options,callback) {
|
||||
if ( typeof callback === "function" ) {
|
||||
$.post(URL,options,function(retval){
|
||||
try {
|
||||
console.log(retval);
|
||||
var result = JSON.parse(retval);
|
||||
if (result.error) {
|
||||
alert(result.error);
|
||||
|
@ -1,9 +1,9 @@
|
||||
55b88a5b18fb009fa94bf27e0504dd20 ./Apps.page
|
||||
65e7880ea50bfb83b9f93d857e7163ea ./Apps.page
|
||||
4e55f7483b661af21a25b677179baffe ./CA_notices.page
|
||||
4c5d4598e1bafa46bd90c27cbe302122 ./ca_settings.page
|
||||
e8d29607ec792ddf9f6832b10ee70fdc ./default.cfg
|
||||
69ab8fcb35d59d712aed59b50932efeb ./include/exec.php
|
||||
2f4e1cd95fd00cc9bfe47514a4fe2212 ./include/helpers.php
|
||||
9e9fde260f5584e852f6c99854e62301 ./include/exec.php
|
||||
fb6e4a99a8fa9401795178013b6c6b50 ./include/helpers.php
|
||||
116042a918060278e77379b0dd73482c ./include/paths.php
|
||||
532fffdf939594c143e679da02bd841e ./javascript/libraries.js
|
||||
71f911a818d88d3d567f8a2898094ee2 ./README.md
|
||||
@ -22,4 +22,4 @@ da3b4f9b73c5c3bf65be6c42d68b51f9 ./scripts/showStatistics.php
|
||||
34554a56611dfe625889c82afd5138de ./scripts/updatePluginSupport.php
|
||||
25bdaed6f62ac73f9ef7c3ce0c125ef7 ./skins/Narrow/css.php
|
||||
7eb021a105e2f7a15675ec8a14e6f05e ./skins/Narrow/skin.html
|
||||
dccf3c2eed22091d749bbf7f2e33a791 ./skins/Narrow/skin.php
|
||||
045031ef203b0c28479df81143733dcb ./skins/Narrow/skin.php
|
||||
|
@ -6,6 +6,9 @@
|
||||
# #
|
||||
###############################################################
|
||||
|
||||
error_reporting(E_ALL);
|
||||
ini_set('log_errors',TRUE);
|
||||
ini_set('error_log',"/tmp/php");
|
||||
$unRaidSettings = parse_ini_file("/etc/unraid-version");
|
||||
### Translations section has to be first so that nothing else winds up caching the file(s)
|
||||
|
||||
@ -30,7 +33,8 @@ $caSettings = parse_plugin_cfg("community.applications");
|
||||
|
||||
$caSettings['dockerSearch'] = "yes";
|
||||
$caSettings['unRaidVersion'] = $unRaidSettings['version'];
|
||||
$caSettings['favourite'] = str_replace("*","'",$caSettings['favourite']);
|
||||
$caSettings['favourite'] = isset($caSettings['favourite']) ? str_replace("*","'",$caSettings['favourite']) : "";
|
||||
|
||||
$caSettings['maxPerPage'] = (integer)$caSettings['maxPerPage'] ?: "24"; // Handle possible corruption on file
|
||||
if ( $caSettings['maxPerPage'] < 24 ) $caSettings['maxPerPage'] = 24;
|
||||
|
||||
@ -44,7 +48,7 @@ if ( is_file("/var/run/dockerd.pid") && is_dir("/proc/".@file_get_contents("/var
|
||||
$caSettings['dockerRunning'] = true;
|
||||
} else {
|
||||
$caSettings['dockerSearch'] = "no";
|
||||
unset($caSettings['dockerRunning']);
|
||||
$caSettings['dockerRunning'] = false;
|
||||
}
|
||||
|
||||
@mkdir($caPaths['tempFiles'],0777,true);
|
||||
@ -239,15 +243,15 @@ function DownloadApplicationFeed() {
|
||||
$i = 0;
|
||||
$lastUpdated['last_updated_timestamp'] = $ApplicationFeed['last_updated_timestamp'];
|
||||
writeJsonFile($caPaths['lastUpdated-old'],$lastUpdated);
|
||||
$myTemplates = [];
|
||||
/* $myTemplates = []; */
|
||||
|
||||
foreach ($ApplicationFeed['applist'] as $o) {
|
||||
if ( (! $o['Repository']) && (! $o['Plugin']) && (!$o['Language'])){
|
||||
if ( (! isset($o['Repository']) ) && (! isset($o['Plugin']) ) && (!isset($o['Language']) )){
|
||||
$invalidXML[] = $o;
|
||||
continue;
|
||||
}
|
||||
|
||||
unset($o['Category']);
|
||||
$o = addMissingVars($o);
|
||||
|
||||
if ( $o['CategoryList'] ) {
|
||||
foreach ($o['CategoryList'] as $cat) {
|
||||
$cat = str_replace("-",":",$cat);
|
||||
@ -256,6 +260,8 @@ function DownloadApplicationFeed() {
|
||||
$o['Category'] .= "$cat ";
|
||||
}
|
||||
}
|
||||
if ( $o['Category'] === null )
|
||||
$o['Category'] = "";
|
||||
$o['Category'] = trim($o['Category']);
|
||||
if ( ! $o['Category'] )
|
||||
$o['Category'] = "Other:";
|
||||
@ -284,7 +290,7 @@ function DownloadApplicationFeed() {
|
||||
|
||||
if ( $o['CAComment'] ) {
|
||||
$tmpComment = explode("‍",$o['CAComment']); // non printable delimiter character
|
||||
unset($o['CAComment']);
|
||||
$o['CAComment'] = "";
|
||||
foreach ($tmpComment as $comment) {
|
||||
if ( $comment )
|
||||
$o['CAComment'] .= tr($comment)." ";
|
||||
@ -293,10 +299,10 @@ function DownloadApplicationFeed() {
|
||||
if ( $o['RequiresFile'] ) $o['RequiresFile'] = trim($o['RequiresFile']);
|
||||
if ( $o['Requires'] ) $o['Requires'] = trim($o['Requires']);
|
||||
|
||||
$des = $o['OriginalOverview'] ?: $o['Overview'];
|
||||
$des = $o['OriginalOverview'] ?? $o['Overview'];
|
||||
$des = $o['Language'] ? $o['Description'] : $des;
|
||||
if ( ! $des && $o['Description'] ) $des = $o['Description'];
|
||||
if ( ! $Language ) {
|
||||
if ( ! $o['Language'] ) {
|
||||
$des = str_replace(["[","]"],["<",">"],$des);
|
||||
$des = str_replace("\n"," ",$des);
|
||||
$des = html_entity_decode($des);
|
||||
@ -310,7 +316,7 @@ function DownloadApplicationFeed() {
|
||||
$o['Blacklist'] = $o['CABlacklist'] ? true : $o['Blacklist'];
|
||||
$o['MinVer'] = max([$o['MinVer'],$o['UpdateMinVer']]);
|
||||
$tag = explode(":",$o['Repository']);
|
||||
if (! $tag[1])
|
||||
if (! isset($tag[1]))
|
||||
$tag[1] = "latest";
|
||||
$o['Path'] = $caPaths['templates-community']."/".alphaNumeric($o['RepoName'])."/".alphaNumeric($o['Author'])."-".alphaNumeric($o['Name'])."-{$tag[1]}";
|
||||
if ( file_exists($o['Path'].".xml") ) {
|
||||
@ -330,23 +336,28 @@ function DownloadApplicationFeed() {
|
||||
$o['Category'] = str_replace("Status:Stable","",$o['Category']);
|
||||
$myTemplates[$i] = $o;
|
||||
|
||||
if ( ! $o['DonateText'] && $ApplicationFeed['repositories'][$o['RepoName']]['DonateText'] )
|
||||
|
||||
|
||||
if ( ! $o['DonateText'] && ($ApplicationFeed['repositories'][$o['RepoName']]['DonateText'] ?? false) )
|
||||
$o['DonateText'] = $ApplicationFeed['repositories'][$o['RepoName']]['DonateText'];
|
||||
if ( ! $o['DonateLink'] && $ApplicationFeed['repositories'][$o['RepoName']]['DonateLink'] )
|
||||
if ( ! $o['DonateLink'] && ($ApplicationFeed['repositories'][$o['RepoName']]['DonateLink'] ?? false) )
|
||||
$o['DonateLink'] = $ApplicationFeed['repositories'][$o['RepoName']]['DonateLink'];
|
||||
|
||||
$ApplicationFeed['repositories'][$o['RepoName']]['downloads'] = $ApplicationFeed['repositories'][$o['RepoName']]['downloads'] ?? 0;
|
||||
$ApplicationFeed['repositories'][$o['RepoName']]['trending'] = $ApplicationFeed['repositories'][$o['RepoName']]['trending'] ?? 0;
|
||||
|
||||
$ApplicationFeed['repositories'][$o['RepoName']]['downloads']++;
|
||||
$ApplicationFeed['repositories'][$o['RepoName']]['trending'] += $o['trending'];
|
||||
if ( ! $o['ModeratorComment'] == "Duplicated Template" ) {
|
||||
if ( $ApplicationFeed['repositories'][$o['RepoName']]['FirstSeen'] ) {
|
||||
if ( $ApplicationFeed['repositories'][$o['RepoName']]['FirstSeen'] ?? false) {
|
||||
if ( $o['FirstSeen'] < $ApplicationFeed['repositories'][$o['RepoName']]['FirstSeen'])
|
||||
$ApplicationFeed['repositories'][$o['RepoName']]['FirstSeen'] = $o['firstSeen'];
|
||||
$ApplicationFeed['repositories'][$o['RepoName']]['FirstSeen'] = $o['FirstSeen'];
|
||||
} else {
|
||||
$ApplicationFeed['repositories'][$o['RepoName']]['FirstSeen'] = $o['FirstSeen'];
|
||||
}
|
||||
}
|
||||
if ( is_array($o['Branch']) ) {
|
||||
if ( ! $o['Branch'][0] ) {
|
||||
if ( ! isset($o['Branch'][0]) ) {
|
||||
$tmp = $o['Branch'];
|
||||
unset($o['Branch']);
|
||||
$o['Branch'][] = $tmp;
|
||||
@ -355,9 +366,9 @@ function DownloadApplicationFeed() {
|
||||
$i = ++$i;
|
||||
$subBranch = $o;
|
||||
$masterRepository = explode(":",$subBranch['Repository']);
|
||||
$o['BranchDefault'] = $masterRepository[1];
|
||||
$subBranch['Repository'] = $masterRepository[0].":".$branch['Tag']; #This takes place before any xml elements are overwritten by additional entries in the branch, so you can actually change the repo the app draws from
|
||||
$subBranch['BranchName'] = $branch['Tag'];
|
||||
$o['BranchDefault'] = $masterRepository[1] ?? null;
|
||||
$subBranch['Repository'] = $masterRepository[0].":". ($branch['Tag'] ?? ""); #This takes place before any xml elements are overwritten by additional entries in the branch, so you can actually change the repo the app draws from
|
||||
$subBranch['BranchName'] = $branch['Tag'] ?? "";
|
||||
$subBranch['BranchDescription'] = $branch['TagDescription'] ? $branch['TagDescription'] : $branch['Tag'];
|
||||
$subBranch['Path'] = $caPaths['templates-community']."/".$i.".xml";
|
||||
$subBranch['Displayable'] = false;
|
||||
@ -397,7 +408,7 @@ function DownloadApplicationFeed() {
|
||||
writeJsonFile($caPaths['categoryList'],$ApplicationFeed['categories']);
|
||||
|
||||
foreach ($ApplicationFeed['repositories'] as &$repo) {
|
||||
if ( $repo['downloads'] ) {
|
||||
if ( $repo['downloads'] ?? false ) {
|
||||
$repo['trending'] = $repo['trending'] / $repo['downloads'];
|
||||
}
|
||||
}
|
||||
@ -445,6 +456,7 @@ function updatePluginSupport($templates) {
|
||||
}
|
||||
|
||||
function getConvertedTemplates() {
|
||||
return;
|
||||
global $caPaths, $caSettings, $statistics;
|
||||
|
||||
# Start by removing any pre-existing private (converted templates)
|
||||
@ -452,8 +464,9 @@ function getConvertedTemplates() {
|
||||
|
||||
if ( empty($templates) ) return false;
|
||||
|
||||
$myTemplates = [];
|
||||
foreach ($templates as $template) {
|
||||
if ( ! $template['Private'] )
|
||||
if ( ! ($template['Private'] ?? true) )
|
||||
$myTemplates[] = $template;
|
||||
}
|
||||
$appCount = count($myTemplates);
|
||||
@ -469,7 +482,8 @@ function getConvertedTemplates() {
|
||||
|
||||
$privateTemplates = glob($caPaths['convertedTemplates']."*/*.xml");
|
||||
foreach ($privateTemplates as $template) {
|
||||
$o = readXmlFile($template);
|
||||
$o = addMissingVars(readXmlFile($template));
|
||||
|
||||
if ( ! $o['Repository'] ) continue;
|
||||
|
||||
$o['Private'] = true;
|
||||
@ -772,14 +786,14 @@ function get_content() {
|
||||
];
|
||||
foreach ($startupTypes as $type) {
|
||||
$display = [];
|
||||
$o['display'] = "";
|
||||
$caSettings['startup'] = $type['type'];
|
||||
$appsOfDay = appOfDay($file);
|
||||
|
||||
for ($i=0;$i<$caSettings['maxPerPage'];$i++) {
|
||||
if ( ! $appsOfDay[$i]) continue;
|
||||
if ( ! isset($appsOfDay[$i])) continue;
|
||||
$file[$appsOfDay[$i]]['NewApp'] = ($caSettings['startup'] != "random");
|
||||
$spot = $file[$appsOfDay[$i]];
|
||||
$spot['class'] = $type['class'];
|
||||
|
||||
$displayApplications['community'][] = $spot;
|
||||
$display[] = $spot;
|
||||
@ -963,14 +977,15 @@ function force_update() {
|
||||
$latestUpdate = download_json($caPaths['application-feed-last-updated'],$caPaths['lastUpdated'],"",5);
|
||||
if ( ! $latestUpdate['last_updated_timestamp'] )
|
||||
$latestUpdate = download_json($caPaths['application-feed-last-updatedBackup'],$caPaths['lastUpdated'],"",5);
|
||||
|
||||
if ( ! $latestUpdate['last_updated_timestamp'] ) {
|
||||
|
||||
$badDownload = false;
|
||||
if ( ! isset($latestUpdate['last_updated_timestamp']) ) {
|
||||
$latestUpdate['last_updated_timestamp'] = INF;
|
||||
$badDownload = true;
|
||||
@unlink($caPaths['lastUpdated']);
|
||||
}
|
||||
|
||||
if ( $latestUpdate['last_updated_timestamp'] > $lastUpdatedOld['last_updated_timestamp'] ) {
|
||||
if ( $latestUpdate['last_updated_timestamp'] ?? 0 > $lastUpdatedOld['last_updated_timestamp'] ?? 0) {
|
||||
if ( $latestUpdate['last_updated_timestamp'] != INF )
|
||||
copy($caPaths['lastUpdated'],$caPaths['lastUpdated-old']);
|
||||
|
||||
@ -980,7 +995,7 @@ function force_update() {
|
||||
}
|
||||
}
|
||||
|
||||
if (!file_exists($caPaths['community-templates-info']) || ! $$GLOBALS['templates']) {
|
||||
if (!file_exists($caPaths['community-templates-info']) || ! $GLOBALS['templates']) {
|
||||
$updatedSyncFlag = true;
|
||||
if (! DownloadApplicationFeed() ) {
|
||||
$o['script'] = "$('.onlyShowWithFeed').hide();";
|
||||
@ -1029,7 +1044,7 @@ function display_content() {
|
||||
|
||||
$displayedApps = readJsonFile($caPaths['community-templates-displayed']);
|
||||
$currentServer = @file_get_contents($caPaths['currentServer']);
|
||||
$o['script'] .= "feedWarning('$currentServer');";
|
||||
$o['script'] = "feedWarning('$currentServer');";
|
||||
postReturn($o);
|
||||
}
|
||||
|
||||
@ -1068,6 +1083,8 @@ function previous_apps() {
|
||||
$file = &$GLOBALS['templates'];
|
||||
$extraBlacklist = readJsonFile($caPaths['extraBlacklist']);
|
||||
$extraDeprecated = readJsonFile($caPaths['extraDeprecated']);
|
||||
$displayed = [];
|
||||
$updateCount = 0;
|
||||
|
||||
if ( is_file("/var/run/dockerd.pid") && is_dir("/proc/".@file_get_contents("/var/run/dockerd.pid")) ) {
|
||||
$dockerUpdateStatus = readJsonFile($caPaths['dockerUpdateStatus']);
|
||||
@ -1289,7 +1306,7 @@ function previous_apps() {
|
||||
}
|
||||
}
|
||||
}
|
||||
if ( is_array($displayed) ) {
|
||||
if ( isset($displayed) && is_array($displayed) ) {
|
||||
usort($displayed,"mySort");
|
||||
}
|
||||
$displayedApplications['community'] = $displayed;
|
||||
@ -1763,7 +1780,7 @@ function get_categories() {
|
||||
|
||||
foreach ($categories as $category) {
|
||||
$category['Des'] = tr($category['Des']);
|
||||
if ( is_array($category['Sub']) ) {
|
||||
if ( isset($category['Sub']) && is_array($category['Sub']) ) {
|
||||
unset($subCat);
|
||||
foreach ($category['Sub'] as $subcategory) {
|
||||
$subcategory['Des'] = tr($subcategory['Des']);
|
||||
@ -1777,9 +1794,10 @@ function get_categories() {
|
||||
$sortOrder['sortDir'] = "Up";
|
||||
usort($newCat,"mySort"); // Sort it alphabetically according to the language. May not work right in non-roman charsets
|
||||
|
||||
$cat = "";
|
||||
foreach ($newCat as $category) {
|
||||
$cat .= "<li class='categoryMenu caMenuItem nonDockerSearch' data-category='{$category['Cat']}'>".$category['Des']."</li>";
|
||||
if (is_array($category['Sub'])) {
|
||||
if (isset($category['Sub']) && is_array($category['Sub'])) {
|
||||
$cat .= "<ul class='subCategory'>";
|
||||
foreach($category['Sub'] as $subcategory) {
|
||||
$cat .= "<li class='categoryMenu caMenuItem nonDockerSearch' data-category='{$subcategory['Cat']}'>".$subcategory['Des']."</li>";
|
||||
@ -2304,6 +2322,7 @@ function changeMaxPerPage() {
|
||||
# Basically a duplicate of action centre code in previous apps #
|
||||
################################################################
|
||||
function enableActionCentre() {
|
||||
return;
|
||||
global $caPaths, $caSettings, $DockerClient;
|
||||
|
||||
# wait til check for updates is finished
|
||||
@ -2491,6 +2510,7 @@ function downloadStatistics() {
|
||||
# Logs Javascript errors being caught #
|
||||
#######################################
|
||||
function javascriptError() {
|
||||
return;
|
||||
global $caPaths, $caSettings;
|
||||
|
||||
debug("******* ERROR **********\n".print_r($_POST,true));
|
||||
|
@ -154,8 +154,8 @@ function mySort($a, $b) {
|
||||
if ( $sortOrder['sortBy'] == "Name" )
|
||||
$sortOrder['sortBy'] = "SortName";
|
||||
if ( $sortOrder['sortBy'] != "downloads" && $sortOrder['sortBy'] != "trendDelta") {
|
||||
$c = strtolower($a[$sortOrder['sortBy']]);
|
||||
$d = strtolower($b[$sortOrder['sortBy']]);
|
||||
$c = strtolower($a[$sortOrder['sortBy']] ?? "");
|
||||
$d = strtolower($b[$sortOrder['sortBy']] ?? "");
|
||||
} else {
|
||||
$c = $a[$sortOrder['sortBy']];
|
||||
$d = $b[$sortOrder['sortBy']];
|
||||
@ -214,10 +214,10 @@ function fixTemplates($template) {
|
||||
if ( ! $template['MinVer'] ) $template['MinVer'] = $template['Plugin'] ? "6.1" : "6.0";
|
||||
if ( ! $template['Date'] ) $template['Date'] = (is_numeric($template['DateInstalled'])) ? $template['DateInstalled'] : 0;
|
||||
$template['Date'] = max($template['Date'],$template['FirstSeen']);
|
||||
if ($template['Date'] == 1) unset($template['Date']);
|
||||
if ($template['Date'] == 1) $template['Date'] = null;
|
||||
if ( ($template['Date'] == $template['FirstSeen']) && ( $template['FirstSeen'] >= 1538357652 )) {# 1538357652 is when the new appfeed first started
|
||||
$template['BrandNewApp'] = true;
|
||||
unset($template['Date']);
|
||||
$template['Date'] = null;
|
||||
}
|
||||
|
||||
# fix where template author includes <Blacklist> or <Deprecated> entries in template (CA used booleans, but appfeed winds up saying "FALSE" which equates to be true
|
||||
@ -229,7 +229,7 @@ function fixTemplates($template) {
|
||||
|
||||
if ( version_compare($caSettings['unRaidVersion'],"6.10.0-beta4",">") ) {
|
||||
if ( $template['Config'] ) {
|
||||
if ( $template['Config']['@attributes'] ) {
|
||||
if ( $template['Config']['@attributes'] ?? false ) {
|
||||
if (preg_match("/^(Container Path:|Container Port:|Container Label:|Container Variable:|Container Device:)/",$template['Config']['@attributes']['Description']) ) {
|
||||
$template['Config']['@attributes']['Description'] = "";
|
||||
}
|
||||
@ -321,6 +321,7 @@ function readXmlFile($xmlfile,$generic=false,$stats=true) {
|
||||
if ( ! is_file($xmlfile) ) return false;
|
||||
$xml = file_get_contents($xmlfile);
|
||||
$o = TypeConverter::xmlToArray($xml,TypeConverter::XML_GROUP);
|
||||
$o = addMissingVars($o);
|
||||
if ( ! $o ) return false;
|
||||
if ( $generic ) return $o;
|
||||
|
||||
@ -329,17 +330,19 @@ function readXmlFile($xmlfile,$generic=false,$stats=true) {
|
||||
$o['Path'] = $xmlfile;
|
||||
$o['Author'] = getAuthor($o);
|
||||
$o['DockerHubName'] = strtolower($o['Name']);
|
||||
$o['Base'] = $o['BaseImage'];
|
||||
$o['Base'] = $o['BaseImage'] ?? "";
|
||||
$o['SortAuthor'] = $o['Author'];
|
||||
$o['SortName'] = $o['Name'];
|
||||
$o['Forum'] = $Repo['forum'];
|
||||
$o['Forum'] = $Repo['forum'] ?? "";
|
||||
# configure the config attributes to same format as appfeed
|
||||
# handle the case where there is only a single <Config> entry
|
||||
|
||||
if ( $o['Config']['@attributes'] )
|
||||
if ( isset($o['Config']['@attributes']) )
|
||||
$o['Config'] = ['@attributes'=>$o['Config']['@attributes'],'value'=>$o['Config']['value']];
|
||||
|
||||
if ( $stats) {
|
||||
$statistics['plugin'] = $statistics['plugin'] ?? 0;
|
||||
$statistics['docker'] = $statistics['docker'] ?? 0;
|
||||
if ( $o['Plugin'] ) {
|
||||
$o['Author'] = $o['PluginAuthor'];
|
||||
$o['Repository'] = $o['PluginURL'];
|
||||
@ -406,12 +409,15 @@ function pluginDupe() {
|
||||
$pluginList = [];
|
||||
$dupeList = [];
|
||||
foreach ($GLOBALS['templates'] as $template) {
|
||||
if ( $template['Plugin'] )
|
||||
if ( $template['Plugin'] ) {
|
||||
if ( ! isset($pluginList[basename($template['Repository'])]) )
|
||||
$pluginList[basename($template['Repository'])] = 0;
|
||||
$pluginList[basename($template['Repository'])]++;
|
||||
}
|
||||
}
|
||||
foreach (array_keys($pluginList) as $plugin) {
|
||||
if ( $pluginList[$plugin] > 1 )
|
||||
$dupeList[$plugin]++;
|
||||
$dupeList[$plugin] = 1;
|
||||
}
|
||||
writeJsonFile($caPaths['pluginDupes'],$dupeList);
|
||||
}
|
||||
@ -447,9 +453,9 @@ function isMobile() {
|
||||
# Returns the author from the Repository entry #
|
||||
################################################
|
||||
function getAuthor($template) {
|
||||
if ( $template['PluginURL'] ) return $template['PluginAuthor'];
|
||||
if ( isset($template['PluginURL']) ) return $template['PluginAuthor'];
|
||||
|
||||
if ( $template['Author'] ) return strip_tags($template['Author']);
|
||||
if ( isset($template['Author']) ) return strip_tags($template['Author']);
|
||||
$template['Repository'] = str_replace(["lscr.io/","ghcr.io/","registry.hub.docker.com/","library/"],"",$template['Repository']);
|
||||
$repoEntry = explode("/",$template['Repository']);
|
||||
if (count($repoEntry) < 2)
|
||||
@ -680,8 +686,10 @@ function portsUsed($template) {
|
||||
# Get the ports in use #
|
||||
########################
|
||||
function getPortsInUse() {
|
||||
return [];
|
||||
global $var, $caPaths;
|
||||
|
||||
|
||||
$addr = null;
|
||||
if ( !$var )
|
||||
$var = parse_ini_file($caPaths['unRaidVars']);
|
||||
|
||||
@ -708,6 +716,68 @@ function plain($ip) {
|
||||
return str_replace(['[',']'],'',$ip);
|
||||
}
|
||||
|
||||
##################################################################################
|
||||
# Adds in all the various missing entries from the templates for PHP8 compliance #
|
||||
##################################################################################
|
||||
function addMissingVars($o) {
|
||||
if ( ! is_array($o) )
|
||||
return $o;
|
||||
$vars = [
|
||||
'Category',
|
||||
'CategoryList',
|
||||
'CABlacklist',
|
||||
'Blacklist',
|
||||
'MinVer',
|
||||
'MaxVer',
|
||||
'UpdateMinVer',
|
||||
'Plugin',
|
||||
'PluginURL',
|
||||
'Date',
|
||||
'DonateText',
|
||||
'DonateLink',
|
||||
'Branch',
|
||||
'OriginalOverview',
|
||||
'DateInstalled',
|
||||
'Config',
|
||||
'trending',
|
||||
'CAComment',
|
||||
'ModeratorComment',
|
||||
'DeprecatedMaxVer',
|
||||
'downloads',
|
||||
'FirstSeen',
|
||||
'OriginalDescription',
|
||||
'Deprecated',
|
||||
'RecommendedRaw',
|
||||
'Language',
|
||||
'RequiresFile',
|
||||
'Requires',
|
||||
'trends',
|
||||
'Description',
|
||||
'OriginalDescription',
|
||||
'Overview',
|
||||
'Repository',
|
||||
'Tag',
|
||||
'Plugin',
|
||||
'CaComment',
|
||||
'IncompatibleVersion',
|
||||
'Private',
|
||||
'BranchName',
|
||||
'display',
|
||||
'RepositoryTemplate',
|
||||
'bio',
|
||||
'NoInstall'
|
||||
|
||||
|
||||
|
||||
];
|
||||
|
||||
foreach ($vars as $var) {
|
||||
$o[$var] = $o[$var] ?? null;
|
||||
}
|
||||
return $o;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @copyright Copyright 2006-2012, Miles Johnson - http://milesj.me
|
||||
* @license http://opensource.org/licenses/mit-license.php - Licensed under the MIT License
|
||||
|
@ -39,7 +39,7 @@ function my_display_apps($file,$pageNumber=1,$selectedApps=false,$startup=false)
|
||||
$info = getAllInfo();
|
||||
$dockerUpdateStatus = readJsonFile($caPaths['dockerUpdateStatus']);
|
||||
} else {
|
||||
unset($caSettings['dockerRunning']);
|
||||
$caSettings['dockerRunning'] = false;
|
||||
$info = [];
|
||||
$dockerUpdateStatus = [];
|
||||
}
|
||||
@ -47,7 +47,7 @@ function my_display_apps($file,$pageNumber=1,$selectedApps=false,$startup=false)
|
||||
if ( ! $selectedApps )
|
||||
$selectedApps = [];
|
||||
|
||||
$dockerWarningFlag = $dockerNotEnabled = (! $caSettings['dockerRunning'] && ! $caSettings['NoInstalls']) ? "true" : "false";
|
||||
$dockerWarningFlag = $dockerNotEnabled = (! $caSettings['dockerRunning'] && ! ($caSettings['NoInstalls'] ?? false) ) ? "true" : "false";
|
||||
|
||||
if ( $dockerNotEnabled == "true" ) {
|
||||
$unRaidVars = parse_ini_file($caPaths['unRaidVars']);
|
||||
@ -85,12 +85,12 @@ function my_display_apps($file,$pageNumber=1,$selectedApps=false,$startup=false)
|
||||
# Create entries for skins.
|
||||
foreach ($displayedTemplates as $template) {
|
||||
if ( ! $template['Blacklist'] ) {
|
||||
if ( $extraBlacklist[$template['Repository']] ) {
|
||||
if ( isset($extraBlacklist[$template['Repository']]) ) {
|
||||
$template['Blacklist'] = true;
|
||||
$template['ModeratorComment'] = $extraBlacklist[$template['Repository']];
|
||||
}
|
||||
}
|
||||
if ( ! $template['Deprecated'] && $extraDeprecated[$template['Repository']] ) {
|
||||
if ( ! $template['Deprecated'] && isset($extraDeprecated[$template['Repository']]) ) {
|
||||
$template['Deprecated'] = true;
|
||||
$template['ModeratorComment'] = $extraDeprecated[$template['Repository']];
|
||||
}
|
||||
@ -133,7 +133,7 @@ function my_display_apps($file,$pageNumber=1,$selectedApps=false,$startup=false)
|
||||
|
||||
$installComment = str_replace("\n","",$installComment);
|
||||
if ( ! $template['Language'] ) {
|
||||
if ( ! $template['NoInstall'] && ! $caSettings['NoInstalls']) {
|
||||
if ( ! $template['NoInstall'] && ! ($caSettings['NoInstalls'] ?? false) ) {
|
||||
if ( ! $template['Plugin'] ) {
|
||||
if ( $caSettings['dockerRunning'] ) {
|
||||
foreach ($info as $testDocker) {
|
||||
@ -317,9 +317,9 @@ function my_display_apps($file,$pageNumber=1,$selectedApps=false,$startup=false)
|
||||
|
||||
$template['ca_fav'] = $caSettings['favourite'] && ($caSettings['favourite'] == $template['RepoName']);
|
||||
if ( strpos($template['Repository'],"/") === false )
|
||||
$template['Pinned'] = $pinnedApps["library/{$template['Repository']}&{$template['SortName']}"];
|
||||
$template['Pinned'] = $pinnedApps["library/{$template['Repository']}&{$template['SortName']}"] ?? false;
|
||||
else
|
||||
$template['Pinned'] = $pinnedApps["{$template['Repository']}&{$template['SortName']}"];
|
||||
$template['Pinned'] = $pinnedApps["{$template['Repository']}&{$template['SortName']}"] ?? false;
|
||||
$template['Twitter'] = $template['Twitter'] ?: $repositories[$template['Repo']]['Twitter'];
|
||||
$template['Reddit'] = $template['Reddit'] ?: $repositories[$template['Repo']]['Reddit'];
|
||||
$template['Facebook'] = $template['Facebook'] ?: $repositories[$template['Repo']]['Facebook'];
|
||||
|
Loading…
x
Reference in New Issue
Block a user