mirror of
https://github.com/slawkens/myaac.git
synced 2025-04-26 17:29:21 +02:00
Rewrite towns support for TFS 1.3
Won't show warning anymore
This commit is contained in:
parent
1f6bd975d0
commit
cd58008a0f
@ -180,7 +180,8 @@ else {
|
||||
// load towns from database (TFS 1.3) //
|
||||
////////////////////////////////////////
|
||||
|
||||
$towns = array();
|
||||
$tmp = '';
|
||||
$towns = [];
|
||||
if($cache->enabled() && $cache->fetch('towns', $tmp)) {
|
||||
$towns = unserialize($tmp);
|
||||
}
|
||||
@ -197,16 +198,13 @@ else {
|
||||
$cache->set('towns', serialize($towns), 600);
|
||||
}
|
||||
}
|
||||
else if($cache->enabled()) {
|
||||
$cache->set('towns', serialize(array()), 600);
|
||||
else {
|
||||
$towns = config('towns');
|
||||
}
|
||||
}
|
||||
|
||||
$configTowns = config('towns');
|
||||
if($configTowns !== null && (!isset($configTowns[1]) || $configTowns[1] !== 'Sample town')) {
|
||||
$towns = array_replace(
|
||||
$towns, $configTowns
|
||||
);
|
||||
if($cache->enabled()) {
|
||||
$cache->set('towns', serialize($towns), 600);
|
||||
}
|
||||
}
|
||||
|
||||
config(['towns', $towns]);
|
||||
|
Loading…
x
Reference in New Issue
Block a user