Add installer functionality for WordPress with FTP and database configuration

- Create SQL migration for prompt templates used in article and image generation.
- Add migration to change publish interval from days to hours in the sites table.
- Implement InstallerController to handle installation requests and validation.
- Develop FtpService for FTP connections and file uploads.
- Create InstallerService to manage the WordPress installation process, including downloading, extracting, and configuring WordPress.
- Add index view for the installer with form inputs for FTP, database, and WordPress admin settings.
- Implement progress tracking for the installation process with AJAX polling.
This commit is contained in:
2026-02-16 21:55:24 +01:00
parent 884ee9cc88
commit b653cea252
37 changed files with 2899 additions and 204 deletions

View File

@@ -56,7 +56,7 @@ class SiteController extends Controller
'url' => rtrim($this->input('url'), '/'),
'api_user' => $this->input('api_user'),
'api_token' => $this->input('api_token'),
'publish_interval_days' => (int) ($this->input('publish_interval_days', 3)),
'publish_interval_hours' => (int) ($this->input('publish_interval_hours', 24)),
'is_active' => $this->input('is_active') ? 1 : 0,
'is_multisite' => $this->input('is_multisite') ? 1 : 0,
]);
@@ -128,9 +128,22 @@ class SiteController extends Controller
'url' => rtrim($this->input('url'), '/'),
'api_user' => $this->input('api_user'),
'api_token' => $this->input('api_token'),
'publish_interval_days' => (int) ($this->input('publish_interval_days', 3)),
'publish_interval_hours' => (int) ($this->input('publish_interval_hours', 24)),
'is_active' => $this->input('is_active') ? 1 : 0,
'is_multisite' => $this->input('is_multisite') ? 1 : 0,
'ftp_host' => $this->input('ftp_host') ?: null,
'ftp_port' => $this->input('ftp_port') ? (int) $this->input('ftp_port') : null,
'ftp_user' => $this->input('ftp_user') ?: null,
'ftp_pass' => $this->input('ftp_pass') ?: null,
'ftp_path' => $this->input('ftp_path') ?: null,
'db_host' => $this->input('db_host') ?: null,
'db_name' => $this->input('db_name') ?: null,
'db_user' => $this->input('db_user') ?: null,
'db_pass' => $this->input('db_pass') ?: null,
'db_prefix' => $this->input('db_prefix') ?: null,
'wp_admin_user' => $this->input('wp_admin_user') ?: null,
'wp_admin_pass' => $this->input('wp_admin_pass') ?: null,
'wp_admin_email' => $this->input('wp_admin_email') ?: null,
]);
$this->flash('success', 'Strona została zaktualizowana.');