This commit is contained in:
parent
2e8a5f18a7
commit
98ca021738
1 changed files with 11 additions and 2 deletions
|
@ -313,7 +313,7 @@ function saveSql($wikiDir, $backupDir)
|
||||||
$sudo = 'sudo -u ' . $user . ' ';
|
$sudo = 'sudo -u ' . $user . ' ';
|
||||||
$wakkaConfig = [];
|
$wakkaConfig = [];
|
||||||
include $wikiDir.'/wakka.config.php';
|
include $wikiDir.'/wakka.config.php';
|
||||||
exec($sudo . 'mysqldump -u'.$wakkaConfig['mysql_user'].' -p'.$wakkaConfig['mysql_password'].' '.$wakkaConfig['mysql_database'].' '.$wakkaConfig['table_prefix'].'acls, '.$wakkaConfig['table_prefix'].'links '.$wakkaConfig['table_prefix'].'nature '.$wakkaConfig['table_prefix'].'pages '.$wakkaConfig['table_prefix'].'referrers '.$wakkaConfig['table_prefix'].'triples '.$wakkaConfig['table_prefix'].'usersname > ' . $backupDir.'/database.sql');
|
exec($sudo . 'mysqldump -u\''.$wakkaConfig['mysql_user'].'\' -p\''.$wakkaConfig['mysql_password'].'\' '.$wakkaConfig['mysql_database'].' '.$wakkaConfig['table_prefix'].'acls, '.$wakkaConfig['table_prefix'].'links '.$wakkaConfig['table_prefix'].'nature '.$wakkaConfig['table_prefix'].'pages '.$wakkaConfig['table_prefix'].'referrers '.$wakkaConfig['table_prefix'].'triples '.$wakkaConfig['table_prefix'].'usersname > ' . $backupDir.'/database.sql');
|
||||||
return '==== Mysql database saved in '.$backupDir.'/database.sql ==========='. "\n";
|
return '==== Mysql database saved in '.$backupDir.'/database.sql ==========='. "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -364,9 +364,18 @@ function upgradeWiki($srcDir, $destDir)
|
||||||
return $output;
|
return $output;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function cli($cmd)
|
||||||
|
{
|
||||||
|
system($cmd, $return_value);
|
||||||
|
($return_value == 0) or die('ERROR : '.$cmd."\n");
|
||||||
|
}
|
||||||
|
|
||||||
function runUpgrades($sudo, $destDir)
|
function runUpgrades($sudo, $destDir)
|
||||||
{
|
{
|
||||||
exec('pushd '.$destDir.' && '.$sudo.' ./yeswicli upgrade && '.$sudo.' ./yeswicli migrate && popd');
|
cli('pushd '.$destDir);
|
||||||
|
cli($sudo.' ./yeswicli upgrade');
|
||||||
|
cli($sudo.' ./yeswicli migrate');
|
||||||
|
cli('popd');
|
||||||
}
|
}
|
||||||
|
|
||||||
function copyYesWikiFiles($domain, $user, $dbUser, $herseUser = null, $hersePass = null, $nossl = null)
|
function copyYesWikiFiles($domain, $user, $dbUser, $herseUser = null, $hersePass = null, $nossl = null)
|
||||||
|
|
Loading…
Add table
Reference in a new issue