* when install, try to detech the mysqldump auto.

This commit is contained in:
wangchunsheng
2013-01-27 07:51:45 +00:00
parent 6b9a4418d9
commit 0d290291e5
5 changed files with 24 additions and 10 deletions
+1 -2
View File
@@ -30,9 +30,8 @@ mv etc/httpd.conf.80 etc/httpd.conf
sed -e 's/3308/3306/g' etc/my.cnf > etc/my.cnf.3306
mv etc/my.cnf.3306 etc/my.cnf
sed -e 's/3308/3306/g' zentao/config/my.php |grep -v mysqldump > zentao/config/my.php.3306
sed -e 's/3308/3306/g' zentao/config/my.php > zentao/config/my.php.3306
mv zentao/config/my.php.3306 zentao/config/my.php
echo '$config->mysqldump = "/opt/lampp/bin/mysqldump";' >> zentao/config/my.php
# change directory permissions.
chmod a+rx lampp
+1 -2
View File
@@ -30,9 +30,8 @@ mv etc/httpd.conf.88 etc/httpd.conf
sed -e 's/3306/3308/g' etc/my.cnf > etc/my.cnf.3308
mv etc/my.cnf.3308 etc/my.cnf
sed -e 's/3306/3308/g' zentao/config/my.php |grep -v mysqldump > zentao/config/my.php.3308
sed -e 's/3306/3308/g' zentao/config/my.php > zentao/config/my.php.3308
mv zentao/config/my.php.3308 zentao/config/my.php
echo '$config->mysqldump = "/opt/lampp/bin/mysqldump";' >> zentao/config/my.php
# change directory permissions.
chmod a+rx lampp
+6 -5
View File
@@ -93,11 +93,12 @@ class install extends control
if($return->result == 'ok')
{
$this->view = (object)$_POST;
$this->view->app = $this->app;
$this->view->lang = $this->lang;
$this->view->config = $this->config;
$this->view->domain = $this->server->HTTP_HOST;
$this->view->title = $this->lang->install->saveConfig;
$this->view->app = $this->app;
$this->view->lang = $this->lang;
$this->view->config = $this->config;
$this->view->domain = $this->server->HTTP_HOST;
$this->view->title = $this->lang->install->saveConfig;
$this->view->mysqldump = $this->install->getMySQLDump();
$this->display();
}
else
+15
View File
@@ -448,4 +448,19 @@ class installModel extends model
return true;
}
/**
* get the mysqldump binary.
*
* @access public
* @return string
*/
public function getMySQLDump()
{
$mysqlDump = '';
if(strpos(__FILE__, '/opt/lampp') !== false)
{
$mysqlDump = '/opt/lampp/bin/mysqldump';
}
if(file_exists($mysqlDump)) return $mysqlDump;
}
}
+1 -1
View File
@@ -27,7 +27,7 @@ if(!isset($error))
\$config->webRoot = getWebRoot();
\$config->default->domain = '$domain';
\$config->default->lang = '$defaultLang';
\$config->mysqldump = '';
\$config->mysqldump = '$mysqldump';
EOT;
}
?>