fipamo/brain/data/Settings.inc.php

31 lines
719 B
PHP
Raw Normal View History

2020-11-17 23:27:25 +01:00
<?php
use function _\find;
2020-11-17 23:27:25 +01:00
class Settings
{
private $folks;
private $tags;
private $settings;
public function __construct()
{
//gets all settings files and converts to php objects
$this->folks = json_decode(file_get_contents("../config/folks.json"), true);
$this->tags = json_decode(file_get_contents("../config/tags.json"), true);
$this->settings = json_decode(
file_get_contents("../config/settings.json"),
true
);
}
public function getFolks($key = null)
{
if (isset($key)) {
$member = Session::get("member");
$found = find($this->folks, ["handle" => $member["handle"]]);
return $found[$key];
} else {
return $this->folks;
}
}
}