mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-08 14:26:16 +01:00
bug fix: wp staging
This commit is contained in:
@@ -110,6 +110,14 @@ class StagingSetup(multi.Thread):
|
|||||||
|
|
||||||
logging.statusWriter(tempStatusPath, 'Domain successfully created..,15')
|
logging.statusWriter(tempStatusPath, 'Domain successfully created..,15')
|
||||||
|
|
||||||
|
### Get table prefix of master site
|
||||||
|
|
||||||
|
command = '%s -d error_reporting=0 /usr/bin/wp config get table_prefix --allow-root --skip-plugins --skip-themes --path=%s' % (
|
||||||
|
FinalPHPPath, masterPath)
|
||||||
|
TablePrefix = ProcessUtilities.outputExecutioner(command).rstrip('\n')
|
||||||
|
|
||||||
|
###
|
||||||
|
|
||||||
## Creating WP Site and setting Database
|
## Creating WP Site and setting Database
|
||||||
|
|
||||||
command = '%s -d error_reporting=0 /usr/bin/wp core download --path=%s' % (FinalPHPPath, path)
|
command = '%s -d error_reporting=0 /usr/bin/wp core download --path=%s' % (FinalPHPPath, path)
|
||||||
@@ -122,6 +130,11 @@ class StagingSetup(multi.Thread):
|
|||||||
command = '%s -d error_reporting=0 /usr/bin/wp core config --dbname=%s --dbuser=%s --dbpass=%s --dbhost=%s:%s --path=%s' % (FinalPHPPath, dbNameRestore, dbUser, dbPassword, ApplicationInstaller.LOCALHOST, ApplicationInstaller.PORT, path)
|
command = '%s -d error_reporting=0 /usr/bin/wp core config --dbname=%s --dbuser=%s --dbpass=%s --dbhost=%s:%s --path=%s' % (FinalPHPPath, dbNameRestore, dbUser, dbPassword, ApplicationInstaller.LOCALHOST, ApplicationInstaller.PORT, path)
|
||||||
ProcessUtilities.executioner(command, website.externalApp)
|
ProcessUtilities.executioner(command, website.externalApp)
|
||||||
|
|
||||||
|
### Set table prefix
|
||||||
|
|
||||||
|
command = '%s -d error_reporting=0 /usr/bin/wp config set table_prefix %s --path=%s' % (FinalPHPPath, TablePrefix , path)
|
||||||
|
ProcessUtilities.executioner(command, website.externalApp)
|
||||||
|
|
||||||
## Exporting and importing database
|
## Exporting and importing database
|
||||||
|
|
||||||
command = '%s -d error_reporting=0 /usr/bin/wp --allow-root --skip-plugins --skip-themes --path=%s db export %s/dbexport-stage.sql' % (FinalPHPPath, masterPath, path)
|
command = '%s -d error_reporting=0 /usr/bin/wp --allow-root --skip-plugins --skip-themes --path=%s db export %s/dbexport-stage.sql' % (FinalPHPPath, masterPath, path)
|
||||||
@@ -132,6 +145,7 @@ class StagingSetup(multi.Thread):
|
|||||||
command = '%s -d error_reporting=0 /usr/bin/wp --allow-root --skip-plugins --skip-themes --path=%s --quiet db import %s/dbexport-stage.sql' % (FinalPHPPath, path, path)
|
command = '%s -d error_reporting=0 /usr/bin/wp --allow-root --skip-plugins --skip-themes --path=%s --quiet db import %s/dbexport-stage.sql' % (FinalPHPPath, path, path)
|
||||||
ProcessUtilities.executioner(command)
|
ProcessUtilities.executioner(command)
|
||||||
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
command = 'rm -f %s/dbexport-stage.sql' % (path)
|
command = 'rm -f %s/dbexport-stage.sql' % (path)
|
||||||
ProcessUtilities.executioner(command)
|
ProcessUtilities.executioner(command)
|
||||||
|
|||||||
Reference in New Issue
Block a user