PMA\libraries\plugins\export\ExportSql::_exportComment PHP Метод

_exportComment() приватный Метод

Possibly outputs comment
private _exportComment ( string $text = '' ) : string
$text string Text of comment
Результат string The formatted comment
    private function _exportComment($text = '')
    {
        if (isset($GLOBALS['sql_include_comments']) && $GLOBALS['sql_include_comments']) {
            // see https://dev.mysql.com/doc/refman/5.0/en/ansi-diff-comments.html
            if (empty($text)) {
                return '--' . $GLOBALS['crlf'];
            } else {
                $lines = preg_split("/\\r\\n|\\r|\\n/", $text);
                $result = array();
                foreach ($lines as $line) {
                    $result[] = '-- ' . $line . $GLOBALS['crlf'];
                }
                return implode('', $result);
            }
        } else {
            return '';
        }
    }