Aggiunta ricerca per altre potenziali cartelle custom

Migliorie minori
This commit is contained in:
Luca 2020-06-11 12:59:33 +02:00
parent 99083268e2
commit 33f7fd1d7b
4 changed files with 58 additions and 4 deletions

View File

@ -11,9 +11,9 @@ switch (filter('op')) {
case 'check':
$result = UpdateHook::isAvailable();
Cache::get('Ultima versione di OpenSTAManager disponibile')->set($result);
Cache::get('Ultima versione di OpenSTAManager disponibile')->set($result[0].' ('.$result[1].')');
echo $result;
echo $result[0];
break;

View File

@ -26,6 +26,58 @@ function customStructure()
$results[] = $result;
}
}
$files = glob(DOCROOT.'/'.$dir.'/*/custom/src/*.{php,html}', GLOB_BRACE);
foreach ($files as $file) {
$file = str_replace(DOCROOT.'/', '', $file);
$result = explode('/custom/', $file)[0];
if (!in_array($result, $results)) {
$results[] = $result;
}
}
$files = glob(DOCROOT.'/'.$dir.'/*/custom/src/Components/*.{php,html}', GLOB_BRACE);
foreach ($files as $file) {
$file = str_replace(DOCROOT.'/', '', $file);
$result = explode('/custom/', $file)[0];
if (!in_array($result, $results)) {
$results[] = $result;
}
}
$files = glob(DOCROOT.'/'.$dir.'/*/custom/src/API/*.{php,html}', GLOB_BRACE);
foreach ($files as $file) {
$file = str_replace(DOCROOT.'/', '', $file);
$result = explode('/custom/', $file)[0];
if (!in_array($result, $results)) {
$results[] = $result;
}
}
$files = glob(DOCROOT.'/'.$dir.'/*/custom/ajax/*.{php,html}', GLOB_BRACE);
foreach ($files as $file) {
$file = str_replace(DOCROOT.'/', '', $file);
$result = explode('/custom/', $file)[0];
if (!in_array($result, $results)) {
$results[] = $result;
}
}
$files = glob(DOCROOT.'/'.$dir.'/*/custom/widgets/*.{php,html}', GLOB_BRACE);
foreach ($files as $file) {
$file = str_replace(DOCROOT.'/', '', $file);
$result = explode('/custom/', $file)[0];
if (!in_array($result, $results)) {
$results[] = $result;
}
}
}
return $results;

View File

@ -50,10 +50,11 @@ class UpdateHook extends CachedManager
$api = self::getAPI();
if (!$api['prerelease'] or setting('Abilita canale pre-release per aggiornamenti')) {
$version = ltrim($api['tag_name'], 'v');
$version[0] = ltrim($api['tag_name'], 'v');
$version[1] = (($api['prerelease']) ? 'prerelease' : 'stable' );
$current = Update::getVersion();
if (version_compare($current, $version) < 0) {
if (version_compare($current, $version[0]) < 0) {
return $version;
}
}

View File

@ -25,6 +25,7 @@ return [
'co_pianodeiconti2',
'co_pianodeiconti3',
'co_preventivi',
'co_riferimenti_righe',
'co_righe_contratti',
'co_righe_promemoria',
'co_righe_documenti',