28 lines
677 B
PHP
28 lines
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;
|
||
|
}
|
||
|
}
|