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

exportEvents() публичный Метод

Exports events
public exportEvents ( string $db ) : boolean
$db string Database
Результат boolean Whether it succeeded
    public function exportEvents($db)
    {
        global $crlf;
        $text = '';
        $delimiter = '$$';
        $event_names = $GLOBALS['dbi']->fetchResult("SELECT EVENT_NAME FROM information_schema.EVENTS WHERE" . " EVENT_SCHEMA= '" . $GLOBALS['dbi']->escapeString($db) . "';");
        if ($event_names) {
            $text .= $crlf . "DELIMITER " . $delimiter . $crlf;
            $text .= $this->_exportComment() . $this->_exportComment(__('Events')) . $this->_exportComment();
            foreach ($event_names as $event_name) {
                if (!empty($GLOBALS['sql_drop_table'])) {
                    $text .= "DROP EVENT " . Util::backquote($event_name) . $delimiter . $crlf;
                }
                $text .= $GLOBALS['dbi']->getDefinition($db, 'EVENT', $event_name) . $delimiter . $crlf . $crlf;
            }
            $text .= "DELIMITER ;" . $crlf;
        }
        if (!empty($text)) {
            return PMA_exportOutputHandler($text);
        } else {
            return false;
        }
    }