* Add a new function named execDMSQL.
This commit is contained in:
@@ -239,6 +239,8 @@ class install extends control
|
||||
{
|
||||
if(!empty($_POST))
|
||||
{
|
||||
if($this->config->db->driver == 'dm') $this->install->execDMSQL();
|
||||
|
||||
$this->install->grantPriv();
|
||||
if(dao::isError()) return print(js::error(dao::getError()));
|
||||
|
||||
|
||||
@@ -393,8 +393,6 @@ class installModel extends model
|
||||
$dbFile = $this->app->getAppRoot() . 'db' . DS . 'zentao.sql';
|
||||
$tables = explode(';', file_get_contents($dbFile));
|
||||
|
||||
if($this->config->db->driver == 'dm') $tables = array_merge($tables, explode(';', file_get_contents($this->app->getAppRoot() . 'db' . DS . 'dm.sql')));
|
||||
|
||||
foreach($tables as $table)
|
||||
{
|
||||
$table = trim($table);
|
||||
@@ -436,6 +434,20 @@ class installModel extends model
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Exec dm.sql.
|
||||
*
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function execDMSQL()
|
||||
{
|
||||
$dbFile = $this->app->getAppRoot() . 'db' . DS . 'dm.sql';
|
||||
$tables = explode(';', file_get_contents($dbFile));
|
||||
|
||||
foreach($tables as $table) $this->dbh->exec($table);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a comapny, set admin.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user