From: Andrey Kutejko Date: Thu, 20 Jun 2013 22:41:54 +0000 (+0300) Subject: dbdump command X-Git-Tag: 0.5~221 X-Git-Url: https://git.andy128k.dev/?a=commitdiff_plain;h=c37be2810d2955076de747f3aaba58ac56176b4f;p=ipf.git dbdump command --- diff --git a/ipf/cli.php b/ipf/cli.php index eff7869..39b97ba 100644 --- a/ipf/cli.php +++ b/ipf/cli.php @@ -12,9 +12,10 @@ class IPF_Cli new IPF_Command_BuildModels, new IPF_Command_BuildContribModels, new IPF_Command_Sql, - new IPF_Command_DB, new IPF_Command_SyncDB, new IPF_Command_Fixtures, + new IPF_Command_DB, + new IPF_Command_DBDump, new IPF_Command_CreateSuperUser, new IPF_Command_SyncPerms, ); diff --git a/ipf/command/dbdump.php b/ipf/command/dbdump.php new file mode 100644 index 0000000..2072389 --- /dev/null +++ b/ipf/command/dbdump.php @@ -0,0 +1,28 @@ +connectionParameters(IPF::get('database', IPF::get('dsn'))); + + if ($db['scheme'] === 'mysql') { + IPF_Shell::call('mysqldump', + '-h'.$db['host'], + '-u'.$db['username'], + '-p'.$db['password'], + '-r'.$output, + $db['database']); + } else { + print 'Do not know how to connect to "'.$db['scheme'].'" database.'; + } + } +} +