This commit is contained in:
Peter Ivanov 2024-08-27 14:43:58 +03:00
parent 6c3e9cf4cc
commit 9119906f2a

View file

@ -56,6 +56,18 @@ class DomainIsCreatedListener
$createdDatabaseHost = null; $createdDatabaseHost = null;
$createdDatabasePort = null; $createdDatabasePort = null;
$databseType = 'sqlite';
$databasesAreCreated = false;
$shouldCreateMysqlDatabase = false;
$microweberSettingsFromPanel = setting('microweber');
if (isset($microweberSettingsFromPanel['database_driver']) && $microweberSettingsFromPanel['database_driver'] == 'mysql') {
$shouldCreateMysqlDatabase = true;
}
if($shouldCreateMysqlDatabase) {
try { try {
$databaseUserPassword = Str::password(24); $databaseUserPassword = Str::password(24);
@ -79,9 +91,22 @@ class DomainIsCreatedListener
} catch (\Exception $e) { } catch (\Exception $e) {
$databasesAreCreated = false; $databasesAreCreated = false;
} }
}
$installationType = 'symlink'; $installationType = 'symlink';
$installationLanguage = 'bg'; $installationLanguage = 'en';
$website_manager_url = 'https://microweber.com';
//$installationTemplate = 'default';
if (isset($microweberSettingsFromPanel['default_installation_type']) && $microweberSettingsFromPanel['default_installation_type'] == 'standalone') {
$installationType = 'standalone';
}
if (isset($microweberSettingsFromPanel['website_manager_url']) && $microweberSettingsFromPanel['website_manager_url']) {
$website_manager_url = $microweberSettingsFromPanel['website_manager_url'];
}
// dd(setting('microweber'));
$install = new \MicroweberPackages\SharedServerScripts\MicroweberInstaller(); $install = new \MicroweberPackages\SharedServerScripts\MicroweberInstaller();
$install->setChownUser($findDomain->domain_username); $install->setChownUser($findDomain->domain_username);
@ -93,7 +118,12 @@ class DomainIsCreatedListener
$install->setLanguage($installationLanguage); $install->setLanguage($installationLanguage);
//$install->setStandaloneInstallation(); //$install->setStandaloneInstallation();
if($installationType == 'symlink') {
$install->setSymlinkInstallation(); $install->setSymlinkInstallation();
} else {
$install->setStandaloneInstallation();
}
if ($databasesAreCreated) { if ($databasesAreCreated) {
$install->setDatabaseDriver('mysql'); $install->setDatabaseDriver('mysql');
@ -114,7 +144,7 @@ class DomainIsCreatedListener
if (isset($status['success']) && $status['success']) { if (isset($status['success']) && $status['success']) {
$whiteLabelSettings = []; $whiteLabelSettings = [];
$whiteLabelSettings['website_manager_url'] = 'https://microweber.com'; $whiteLabelSettings['website_manager_url'] = $website_manager_url;
$whitelabel = new MicroweberWhitelabelSettingsUpdater(); $whitelabel = new MicroweberWhitelabelSettingsUpdater();
$whitelabel->setPath($findDomain->domain_public); $whitelabel->setPath($findDomain->domain_public);