Exemplo n.º 1
0
function backupDB($host, $user, $passwd, $dbname, $tmpDir)
{
    $oDbMaintainer = new DataBaseMaintenance($host, $user, $passwd);
    //stablishing connetion with host
    $oDbMaintainer->connect($dbname);
    //set temporal dir. for maintenance for oDbMaintainer object
    $oDbMaintainer->setTempDir($tmpDir . $dbname . PATH_SEP);
    //create the backup
    $oDbMaintainer->backupDataBaseSchema($oDbMaintainer->getTempDir() . "{$dbname}.sql");
    $oDbMaintainer->backupSqlData();
}