Fix: Wrong path of mysqldump command. Another try to fix this.

This commit is contained in:
Laurent Destailleur
2009-11-29 19:32:16 +00:00
parent afebd7c1cf
commit 6596e42118
6 changed files with 137 additions and 29 deletions

View File

@@ -1038,5 +1038,42 @@ class DoliDb
return $liste;
}
/**
* \brief Return full path of dump program
* \return string Full path of dump program
*/
function getPathOfDump()
{
$fullpathofdump='/pathtopgdump/pg_dump';
$resql=$db->query('SHOW data_directory');
if ($resql)
{
$liste=$db->fetch_array($resql);
$basedir=$liste['data_directory'];
$fullpathofdump=preg_replace('/data$/','bin',$basedir).'/pg_dump';
}
return $fullpathofdump;
}
/**
* \brief Return full path of restore program
* \return string Full path of restore program
*/
function getPathOfRestore()
{
$fullpathofmysqldump='/pathtomysql/mysql';
$resql=$this->query('SHOW VARIABLES LIKE \'basedir\'');
if ($resql)
{
$liste=$this->fetch_array($resql);
$basedir=$liste['Value'];
$fullpathofmysqldump=$basedir.'bin/mysql';
}
return $fullpathofmysqldump;
}
}
?>