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

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

Exports metadata from Configuration Storage
public exportMetadata ( string $db, string | array $tables, array $metadataTypes ) : boolean
$db string database being exported
$tables string | array table(s) being exported
$metadataTypes array types of metadata to export
Результат boolean Whether it succeeded
    public function exportMetadata($db, $tables, $metadataTypes)
    {
        $cfgRelation = PMA_getRelationsParam();
        if (!isset($cfgRelation['db'])) {
            return true;
        }
        $comment = $this->_possibleCRLF() . $this->_possibleCRLF() . $this->_exportComment() . $this->_exportComment(__('Metadata')) . $this->_exportComment();
        if (!PMA_exportOutputHandler($comment)) {
            return false;
        }
        if (!$this->_exportUseStatement($cfgRelation['db'], $GLOBALS['sql_compatibility'])) {
            return false;
        }
        $r = true;
        if (is_array($tables)) {
            // export metadata for each table
            foreach ($tables as $table) {
                $r &= $this->_exportMetadata($db, $table, $metadataTypes);
            }
            // export metadata for the database
            $r &= $this->_exportMetadata($db, null, $metadataTypes);
        } else {
            // export metadata for single table
            $r &= $this->_exportMetadata($db, $tables, $metadataTypes);
        }
        return $r;
    }