KT-personal-website/app/Utils/Config.php
2024-10-22 12:26:08 +02:00

28 lines
No EOL
677 B
PHP

<?php
namespace App\Utils;
class Config {
static $config = [
'siteName' => 'My super page',
'author' => 'Me !!!',
'useCache' => false,
'postPerPage' => 5,
'numberOfLastItem' => 5,
'debug' => false,
'fetching' => [],
'navLinks' => []
];
/**
* Loads the configuration from file
*
* @return array The configuration data
*/
static function loadConfig(): array {
if (file_exists(__DIR__ . "/../../datas/config.json")) {
self::$config = json_decode(file_get_contents(__DIR__ . '/../../datas/config.json'), true);
}
return self::$config;
}
}