Exemplo n.º 1
0
 public function __construct($args, $db_infos)
 {
     OrmConfig::init($db_infos);
     $this->arguments = $args;
     $this->config();
 }
Exemplo n.º 2
0
<pre>
<?php 
require_once '../components/autoload/autoload.php';
use components\ORM\OrmConfig;
use src\Controller\DefaultController;
use components\tools\Yaml\Yaml;
if (!file_exists('../config/config.yml')) {
    echo "Please config database, execute commands: 'php lighten project:init'";
    exit;
}
$config = Yaml::parse(file_get_contents('../config/config.yml'));
$database = $config['database'];
OrmConfig::init($database);
$home = new DefaultController();