mirror of
https://github.com/slawkens/myaac.git
synced 2025-10-17 11:13:27 +02:00
feat: Rewrite of the core: avoid globals where possible
Create services for: login, status, router, database, AnonymousStatistics Drop gesior.backward_support Drop compat/pages.php Drop part of compat/classes.php Move signature to routes
This commit is contained in:
@@ -33,7 +33,7 @@ class OTS_Groups_List implements IteratorAggregate, Countable
|
||||
*/
|
||||
public function __construct($file = '')
|
||||
{
|
||||
global $db;
|
||||
$db = app()->get('db');
|
||||
if($db->hasTable('groups')) { // read groups from database
|
||||
foreach($db->query('SELECT `id`, `name`, `access` FROM `groups`;') as $group)
|
||||
{
|
||||
@@ -47,10 +47,8 @@ class OTS_Groups_List implements IteratorAggregate, Countable
|
||||
return;
|
||||
}
|
||||
|
||||
if(!isset($file[0]))
|
||||
{
|
||||
global $config;
|
||||
$file = $config['data_path'] . 'XML/groups.xml';
|
||||
if(!isset($file[0])) {
|
||||
$file = config('data_path') . 'XML/groups.xml';
|
||||
}
|
||||
|
||||
if(!@file_exists($file)) {
|
||||
@@ -59,7 +57,7 @@ class OTS_Groups_List implements IteratorAggregate, Countable
|
||||
return;
|
||||
}
|
||||
|
||||
$cache = Cache::getInstance();
|
||||
$cache = app()->get('cache');
|
||||
|
||||
$data = array();
|
||||
if($cache->enabled())
|
||||
|
Reference in New Issue
Block a user