|
|
|
@ -4,14 +4,14 @@ class Settings
|
|
|
|
|
{
|
|
|
|
|
private $folks;
|
|
|
|
|
private $tags;
|
|
|
|
|
private $settings;
|
|
|
|
|
private static $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(
|
|
|
|
|
self::$settings = json_decode(
|
|
|
|
|
file_get_contents("../config/settings.json"),
|
|
|
|
|
true
|
|
|
|
|
);
|
|
|
|
@ -27,4 +27,19 @@ class Settings
|
|
|
|
|
return $this->folks;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static function getCurrentIndex()
|
|
|
|
|
{
|
|
|
|
|
$settings = self::$settings;
|
|
|
|
|
return $settings["library_stats"]["current_index"];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static function updateIndex()
|
|
|
|
|
{
|
|
|
|
|
$settings = self::$settings;
|
|
|
|
|
$index = $settings["library_stats"]["current_index"];
|
|
|
|
|
$settings["library_stats"]["current_index"] = $index + 1;
|
|
|
|
|
|
|
|
|
|
DocTools::writeSettings("../config/settings.json", $settings);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|