<?php

namespace \werx\Core\Modules;

use \werx\Core\Model;
use \werx\Core\WerxApp;
use \werx\Core\Database;

class Database extends Module
{
	public function handle(WerxApp $app)
	{
		$app->config->load('database', true);
		Database::init($app->config->database('default'));
		$this->handleNext($app);
	}
}


<?php

namespace \werx\Core\Modules;

use \werx\Core\Model;
use \werx\Core\WerxApp;
use \werx\Core\Database;

class Database extends Module
{
	public function __construct($config = 'database', $item = 'default')

	public function handle(WerxApp $app)
	{
		$app->config->load($config, true);
		Database::init($app->config->get($item, null, $config));
		$this->handleNext($app);
	}
}


Choose were to init the database from
Choose were to init the database from
