public function install()
{
// validate variables
if ($this->getVariable('default_language') === null) {
throw new \SpoonException('Default frontend language is not provided.');
}
if ($this->getVariable('default_interface_language') === null) {
throw new \SpoonException('Default backend language is not provided.');
}
if ($this->getVariable('site_domain') === null) {
throw new \SpoonException('Site domain is not provided.');
}
if ($this->getVariable('spoon_debug_email') === null) {
throw new \SpoonException('Spoon debug email is not provided.');
}
if ($this->getVariable('api_email') === null) {
throw new \SpoonException('API email is not provided.');
}
if ($this->getVariable('site_title') === null) {
throw new \SpoonException('Site title is not provided.');
}
// import SQL
$this->importSQL(__DIR__ . '/Data/install.sql');
// add core modules
$this->addModule('Core');
$this->addModule('Authentication');
$this->addModule('Dashboard');
$this->addModule('Error');
$this->setRights();
$this->setSettings();
// add core navigation
$this->setNavigation(null, 'Dashboard', 'dashboard/index', null, 1);
$this->setNavigation(null, 'Modules', null, null, 3);
}