Example #1
0
 function __construct()
 {
     parent::__construct();
     Config::load('App.DB');
     $entityType = 'Create' . ucfirst(Config::read('App.DB.entity.type')) . 'Configuration';
     if (!method_exists($setup = new Setup(), $entityType)) {
         Exceptions::showError('Server Error', 'Invalid Entity Type use Annotation, XML or YAML');
     }
     $this->config = $setup->{$entityType}(Config::read('App.DB.entity.path'), true);
     $this->em = EntityManager::create(Config::read('App.DB.connect'), $this->config);
 }
Example #2
0
 function __construct($conf = [])
 {
     parent::__construct($conf);
     $this->uri = Loader::getClass('Sky.core.URI');
     $this->method = $this->getConfig('default_method');
     $this->setClass($this->getConfig('default_controller'));
     if (!$this->class) {
         Exceptions::showError("Server Error", "Unable to determine what should be displayed. A default route has not been specified in the routing file.");
         exit;
     }
     $this->_initialize();
 }
Example #3
0
 function __construct(array $params = [], Configuration $config = null, EventManager $eventManager = null)
 {
     if (!$params) {
         Config::load('App.DB');
         $params = Config::read('App.DB.connect');
     }
     parent::__construct();
     $this->db = DriverManager::getConnection($params, new Configuration());
     if ($this->db->connect()) {
         Loader::getClass('Sky.core.Log')->write(100, 'database connected');
     }
 }