mirror of
https://github.com/Lukas0025/YAGS.git
synced 2025-04-10 17:32:17 +01:00
Added support for seeds detect
This commit is contained in:
parent
e51e7babe6
commit
6cb2b42edb
14
web/DAL/system.php
Normal file
14
web/DAL/system.php
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
<?php
|
||||||
|
namespace DAL;
|
||||||
|
|
||||||
|
class station extends \wsos\database\core\row {
|
||||||
|
public \wsos\database\types\text $name;
|
||||||
|
public \wsos\database\types\text $value;
|
||||||
|
|
||||||
|
function __construct($id = null, $name = "", $value = "") {
|
||||||
|
parent::__construct($id);
|
||||||
|
$this->name = new \wsos\database\types\text($name);
|
||||||
|
$this->value = new \wsos\database\types\text($value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
@ -49,9 +49,16 @@
|
|||||||
$container->register("auth", $auth);
|
$container->register("auth", $auth);
|
||||||
$container->register("router", $router);
|
$container->register("router", $router);
|
||||||
|
|
||||||
// seeds DB
|
$system = new \DAL\system();
|
||||||
// do not do this in release!!
|
|
||||||
//include "seeds.php";
|
// detect if is seeded
|
||||||
|
if (!$system->find("name", "seeds")) {
|
||||||
|
include "seeds.php";
|
||||||
|
|
||||||
|
$system->name = "seeds";
|
||||||
|
$system->value = "true";
|
||||||
|
$system->commit();
|
||||||
|
}
|
||||||
|
|
||||||
$router->route($url);
|
$router->route($url);
|
||||||
?>
|
?>
|
Loading…
x
Reference in New Issue
Block a user