private function __construct() { Loader::registerNamespace('WDB\\Framework', dirname(__FILE__) . DIRECTORY_SEPARATOR); Loader::registerAutoload(); $this->_config = Config::getInstance(); if ($this->_config->getConfigFolder() == null) { $this->setConfigFolder('../config'); } $this->_httpContext = HttpContext::getInstance(); $this->_identity = IdentityDataModel::getInstance(); }
public function run() { if ($this->_config->getConfigFolder() == null) { $this->setConfigFolder('../config'); } $this->_frontController = FrontController::getInstance(); if ($this->_router instanceof IRouter) { $this->_frontController->setRouter($this->_router); } else { $this->_frontController->setRouter(new DefaultRouter()); } $_sess = $this->_config->app['session']; if ($_sess['autostart']) { if ($_sess['type'] == 'native') { $s = new NativeSession($_sess['name'], $_sess['lifetime'], $_sess['path'], $_sess['domain'], $_sess['secure']); $this->_httpContext->setSession($s); } } $this->_identity->createUserTable(); $this->_frontController->dispatch(); }
<?php include_once '../../Framework/App.php'; error_reporting(E_ALL ^ E_NOTICE ^ E_WARNING); $app = WDB\Framework\App::getInstance(); $identity = \WDB\Framework\identity\IdentityDataModel::getInstance(); $user = new \WDB\Framework\identity\IdentityUser(); $user->setRole(1); $user->setEmail('*****@*****.**'); $user->setUsername('tupalan'); $user->setPassword('ganjamen'); echo $identity->register($user); //$user = new \WDB\Framework\identity\IdentityUser('tupalan', 'ganjamen'); //$identity = new \WDB\Framework\identity\IdentityDataModel($user); //$identity->createUserTable(); $app->run();