Updated Project Source code (I don't remember what i did.)
This commit is contained in:
parent
fc2e4d5a73
commit
4879fdf36d
10 changed files with 289 additions and 10 deletions
27
src/Socialbox/Classes/Configuration.php
Normal file
27
src/Socialbox/Classes/Configuration.php
Normal file
|
@ -0,0 +1,27 @@
|
|||
<?php
|
||||
|
||||
namespace Socialbox\Classes;
|
||||
|
||||
class Configuration
|
||||
{
|
||||
private static ?array $configuration = null;
|
||||
|
||||
public static function getConfiguration(): array
|
||||
{
|
||||
if(self::$configuration === null)
|
||||
{
|
||||
$config = new \ConfigLib\Configuration('net.nosial.socialbox');
|
||||
|
||||
$config->setDefault('database.host', '127.0.0.1');
|
||||
$config->setDefault('database.port', 3306);
|
||||
$config->setDefault('database.username', 'root');
|
||||
$config->setDefault('database.password', null);
|
||||
$config->setDefault('database.name', 'test');
|
||||
$config->save();
|
||||
|
||||
self::$configuration = $config->getConfiguration();
|
||||
}
|
||||
|
||||
return self::$configuration;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue