- Enhancement, new admin "cronjob" dashboard on /setup page, closed #871

- Improved `/setup` page, show DB table `charset`/`collation` info
- Upgraded "[_Peity_](http://benpickles.github.io/peity)" js lib `v3.2.1` → `v3.3.0`
This commit is contained in:
Mark Friedrich
2019-10-30 23:12:25 +01:00
parent b6149e2d35
commit 964dd0f7c9
66 changed files with 2401 additions and 395 deletions

View File

@@ -805,6 +805,26 @@ class Controller {
Monolog::instance()->log();
}
/**
* simple counter with "static" store
* -> called within tpl render
* @return \Closure
*/
protected function counter() : \Closure {
$store = [];
return function(string $action = 'increment', string $type = 'default', $val = 0) use (&$store){
$return = null;
switch($action){
case 'increment': $store[$type]++; break;
case 'add': $store[$type] += (int)$val; break;
case 'get': $return = $store[$type] ? : null; break;
case 'reset': unset($store[$type]); break;
}
return $return;
};
}
/**
* get controller by class name
* -> controller class is searched within all controller directories