Пример #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);
 }
Пример #2
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');
     }
 }
Пример #3
0
date_default_timezone_set(Config::read('App.Base.default_timezone'));
$LOG = Loader::getClass('Sky.core.Log');
$LOG->write(100, '---------------Starting Processing -----------------------');
/*
|--------------------------------------------------------------------------
| Starting System Benchmark
|--------------------------------------------------------------------------
*/
$BM = Loader::getClass('Sky.core.Benchmark');
$BM->mark('start_sky');
/*
|--------------------------------------------------------------------------
| initialize prase URI and Router
|--------------------------------------------------------------------------
*/
Config::load('App.Routes');
$RTR = Loader::getClass('Sky.core.Router', Config::read('App.Routes'));
$class = ucfirst($RTR->class);
$method = $RTR->method;
$OUT = Loader::getClass('Sky.core.Output');
if (Config::read('App.Base.enable_cache')) {
    $CH = Loader::getClass('Sky.core.Cache');
    if ($CH_OUT = $CH->read(implode($RTR->segments, '.'))) {
        $OUT->append(View::getTemp());
        $LOG->write(100, 'Cache Rendered');
        goto OUTPUT;
    }
}
/*
|--------------------------------------------------------------------------
| Starting Controller Benchmark