/** * Start App * @param array $config * @param string $directory * @throws DfSetupException */ public static function start($config = [], $directory = '') { static::prepareRuntimePath($directory); try { if (empty(DfApp::$runtimePath)) { throw new DfSetupException("No defined RuntimePath"); } DfApp::app()->router = new DfMVC(); static::configRead($config); DfErrorHandler::registerHandlers(); DfApp::$app->router->process(); try { DfApp::app()->router->call(); } catch (DfException $ex) { DfErrorHandler::exception($ex); } } catch (DfException $ex) { DfErrorHandler::exception($ex); } }