mirror of
https://github.com/nidebr/as-stats-gui.git
synced 2025-02-20 11:23:18 +08:00
fix error when topinterval is not defined
This commit is contained in:
parent
52e4ea172b
commit
8db3267904
@ -5,6 +5,8 @@
|
||||
"twig/extensions": "~1.5",
|
||||
"symfony/twig-bridge": "^3.3",
|
||||
"symfony/yaml": "^3.3",
|
||||
"symfony/translation": "^3.3",
|
||||
"symfony/config": "^3.3",
|
||||
"ddesrosiers/silex-annotation-provider": "~2.0",
|
||||
"doctrine/dbal": "~2.5",
|
||||
"mobiledetect/mobiledetectlib": "^2.8",
|
||||
|
@ -17,10 +17,12 @@ class DbsProvider
|
||||
}
|
||||
|
||||
$dbs = ConfigApplication::getTopInterval();
|
||||
foreach ($dbs as $key => $val)
|
||||
{
|
||||
$db[$key."statsfile"]['path'] = $val['statsfile'];
|
||||
$db[$key."statsfile"]['driver'] = 'pdo_sqlite';
|
||||
if ( $dbs ) {
|
||||
foreach ($dbs as $key => $val)
|
||||
{
|
||||
$db[$key."statsfile"]['path'] = $val['statsfile'];
|
||||
$db[$key."statsfile"]['driver'] = 'pdo_sqlite';
|
||||
}
|
||||
}
|
||||
|
||||
return $db;
|
||||
|
@ -150,21 +150,28 @@ class Func
|
||||
|
||||
public function statsFileForHours($hours)
|
||||
{
|
||||
foreach (ConfigApplication::getTopInterval() as $key => $interval) {
|
||||
if ($interval['hours'] == $hours) {
|
||||
return $key."statsfile";
|
||||
}
|
||||
}
|
||||
$top = ConfigApplication::getTopInterval();
|
||||
if ( $top ) {
|
||||
foreach ($top as $key => $interval) {
|
||||
if ($interval['hours'] == $hours) {
|
||||
return $key."statsfile";
|
||||
}
|
||||
}
|
||||
}
|
||||
return "daystatsfile";
|
||||
}
|
||||
|
||||
public function statsLabelForHours($hours)
|
||||
{
|
||||
foreach (ConfigApplication::getTopInterval() as $key => $interval) {
|
||||
if ($interval['hours'] == $hours) {
|
||||
return $interval['label'];
|
||||
}
|
||||
}
|
||||
return (int)$hours . " hours";
|
||||
$top = ConfigApplication::getTopInterval();
|
||||
|
||||
if ( $top ) {
|
||||
foreach ($top as $key => $interval) {
|
||||
if ($interval['hours'] == $hours) {
|
||||
return $interval['label'];
|
||||
}
|
||||
}
|
||||
}
|
||||
return (int)$hours . " hours";
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user