This commit is contained in:
usmannasir
2024-02-03 19:44:14 +05:00
parent 3db2eea955
commit 3a8c3cf69b
3 changed files with 31 additions and 7 deletions

View File

@@ -1076,6 +1076,29 @@ class WebsiteManager:
else:
return ACLManager.loadError()
php = PHPManager.getPHPString(wpsite.owner.phpSelection)
FinalPHPPath = '/usr/local/lsws/lsphp%s/bin/php' % (php)
if AutomaticUpdates == 'Disabled':
command = f"{FinalPHPPath} -d error_reporting=0 /usr/bin/wp config set WP_AUTO_UPDATE_CORE false --raw --allow-root --path=" + wpsite.path
result = ProcessUtilities.outputExecutioner(command, wpsite.owner.externalApp)
if result.find('Success:') == -1:
raise BaseException(result)
elif AutomaticUpdates == 'Minor and Security Updates':
command = f"{FinalPHPPath} -d error_reporting=0 /usr/bin/wp config set WP_AUTO_UPDATE_CORE minor --allow-root --path=" + wpsite.path
result = ProcessUtilities.outputExecutioner(command, wpsite.owner.externalApp)
if result.find('Success:') == -1:
raise BaseException(result)
else:
command = f"{FinalPHPPath} -d error_reporting=0 /usr/bin/wp config set WP_AUTO_UPDATE_CORE true --raw --allow-root --path=" + wpsite.path
result = ProcessUtilities.outputExecutioner(command, wpsite.owner.externalApp)
if result.find('Success:') == -1:
raise BaseException(result)
wpsite.AutoUpdates = AutomaticUpdates
wpsite.PluginUpdates = Plugins
wpsite.ThemeUpdates = Themes