mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 00:55:28 +00:00
initial commit
This commit is contained in:
parent
ad638650ac
commit
8c2cf42ca7
16 changed files with 541 additions and 0 deletions
11
src/Model/Database.php
Normal file
11
src/Model/Database.php
Normal 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
54
src/Model/File.php
Normal 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
11
src/Model/Memory.php
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yggverse\Yoda\Model;
|
||||
|
||||
class Memory
|
||||
{
|
||||
public function __construct()
|
||||
{}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue