protected function _exportRoutineSQL($db, $aliases, $type, $name, $routines, $delimiter)
{
global $crlf;
$text = $this->_exportComment() . $this->_exportComment($name) . $this->_exportComment();
$used_alias = false;
$proc_query = '';
foreach ($routines as $routine) {
if (!empty($GLOBALS['sql_drop_table'])) {
$proc_query .= 'DROP ' . $type . ' IF EXISTS ' . Util::backquote($routine) . $delimiter . $crlf;
}
$create_query = $this->replaceWithAliases($GLOBALS['dbi']->getDefinition($db, $type, $routine), $aliases, $db, '', $flag);
// One warning per database
if ($flag) {
$used_alias = true;
}
$proc_query .= $create_query . $delimiter . $crlf . $crlf;
}
if ($used_alias) {
$text .= $this->_exportComment(__('It appears your database uses routines;')) . $this->_exportComment(__('alias export may not work reliably in all cases.')) . $this->_exportComment();
}
$text .= $proc_query;
return $text;
}