public function setup() { //Setup session stuff SilkSession::setup(); //Load up the configuration file if (is_file(join_path(ROOT_DIR, 'config', 'setup.yml'))) { $config = SilkYaml::load(join_path(ROOT_DIR, 'config', 'setup.yml')); } else { die("Config file not found!"); } //Add class path entries if (isset($config['class_autoload'])) { foreach ($config['class_autoload'] as $dir) { add_class_directory(join_path(ROOT_DIR, $dir)); } } //Setup the database connection if (!isset($config['database']['dsn'])) { die("No database information found in the configuration file"); } if (null == SilkDatabase::connect($config['database']['dsn'], $config['debug'], true, $config['database']['prefix'])) { die("Could not connect to the database"); } silk()->set('config', $config); //Load components SilkComponentManager::load(); }