1
0
mirror of https://github.com/flarum/core.git synced 2025-10-19 18:56:44 +02:00

Implement web installer

This commit is contained in:
Toby Zerner
2015-08-17 14:12:02 +09:30
parent 17dbeefabe
commit 1052aa55ea
10 changed files with 596 additions and 45 deletions

View File

@@ -2,50 +2,76 @@
class DefaultData implements ProvidesData
{
protected $databaseConfiguration = [
'driver' => 'mysql',
'host' => 'localhost',
'database' => 'flarum_console',
'username' => 'root',
'password' => 'root',
'prefix' => '',
];
protected $adminUser = [
'username' => 'admin',
'password' => 'admin',
'email' => 'admin@example.com',
];
protected $settings = [
'admin_url' => 'http://flarum.dev/admin',
'allow_post_editing' => 'reply',
'allow_renaming' => '10',
'allow_sign_up' => '1',
'api_url' => 'http://flarum.dev/api',
'base_url' => 'http://flarum.dev',
'custom_less' => '',
'default_locale' => 'en',
'default_route' => '/all',
'extensions_enabled' => '[]',
'forum_title' => 'Development Forum',
'forum_description' => '',
'mail_driver' => 'mail',
'mail_from' => 'noreply@flarum.dev',
'theme_colored_header' => '0',
'theme_dark_mode' => '0',
'theme_primary_color' => '#29415E',
'theme_secondary_color' => '#29415E',
'welcome_message' => 'This is beta software and you should not use it in production.',
'welcome_title' => 'Welcome to Development Forum',
];
public function getDatabaseConfiguration()
{
return [
'driver' => 'mysql',
'host' => 'localhost',
'database' => 'flarum_console',
'username' => 'root',
'password' => 'root',
'prefix' => '',
];
return $this->databaseConfiguration;
}
public function setDatabaseConfiguration(array $databaseConfiguration)
{
$this->databaseConfiguration = $databaseConfiguration;
}
public function getAdminUser()
{
return [
'username' => 'admin',
'password' => 'admin',
'email' => 'admin@example.com',
];
return $this->adminUser;
}
public function setAdminUser(array $adminUser)
{
$this->adminUser = $adminUser;
}
public function getSettings()
{
return [
'admin_url' => 'http://flarum.dev/admin',
'allow_post_editing' => 'reply',
'allow_renaming' => '10',
'allow_sign_up' => '1',
'api_url' => 'http://flarum.dev/api',
'base_url' => 'http://flarum.dev',
'custom_less' => '',
'default_locale' => 'en',
'default_route' => '/all',
'extensions_enabled' => '[]',
'forum_title' => 'Development Forum',
'forum_description' => '',
'mail_driver' => 'mail',
'mail_from' => 'noreply@flarum.dev',
'theme_colored_header' => '0',
'theme_dark_mode' => '0',
'theme_primary_color' => '#29415E',
'theme_secondary_color' => '#29415E',
'welcome_message' => 'This is beta software and you should not use it in production.',
'welcome_title' => 'Welcome to Development Forum',
];
return $this->settings;
}
public function setSettings(array $settings)
{
$this->settings = $settings;
}
public function setSetting($key, $value)
{
$this->settings[$key] = $value;
}
}