public static function shell_exec_sql4file($sql_file, $dbname = null) { $command = sprintf('%s < %s', Util_Db::make_mysql_conect_command(true, $dbname), $sql_file); if ($error = Util_Toolkit::shell_exec($command)) { throw new Database_Exception($error); } return true; }
public static function exec_db_command4file($sql_file, $dbname = null) { try { $command = sprintf('%s < %s', Util_Db::make_mysql_conect_command(true, $dbname), $sql_file); } catch (FuelException $e) { throw new FuelException($e->getMessage()); } if ($error = Util_Toolkit::shell_exec($command)) { throw new Database_Exception($error); } return true; }