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