initial commit

This commit is contained in:
yggverse 2024-04-09 09:20:34 +03:00
parent ad638650ac
commit 8c2cf42ca7
16 changed files with 541 additions and 0 deletions

11
src/Model/Database.php Normal file
View file

@ -0,0 +1,11 @@
<?php
declare(strict_types=1);
namespace Yggverse\Yoda\Model;
class Database
{
public function __construct()
{}
}

54
src/Model/File.php Normal file
View file

@ -0,0 +1,54 @@
<?php
declare(strict_types=1);
namespace Yggverse\Yoda\Model;
class File
{
public static function getConfig(): object
{
$filename = __DIR__ .
DIRECTORY_SEPARATOR . '..' .
DIRECTORY_SEPARATOR . '..' .
DIRECTORY_SEPARATOR . 'config.json';
if (file_exists($filename) && is_readable($filename))
{
$result = json_decode(
file_get_contents(
$filename
)
);
}
if (empty($result))
{
throw new \Exception(); // @TODO
}
return $result;
}
public static function getTheme(string $name): string
{
$filename = __DIR__ .
DIRECTORY_SEPARATOR . '..' .
DIRECTORY_SEPARATOR . 'Theme' .
DIRECTORY_SEPARATOR . $name . '.css';
if (file_exists($filename) && is_readable($filename))
{
$result = file_get_contents(
$filename
);
}
if (empty($result))
{
throw new \Exception(); // @TODO
}
return $result;
}
}

11
src/Model/Memory.php Normal file
View file

@ -0,0 +1,11 @@
<?php
declare(strict_types=1);
namespace Yggverse\Yoda\Model;
class Memory
{
public function __construct()
{}
}