phpmyadmin/libraries/classes/Controllers/SchemaExportController.php
Maurício Meneghini Fauth 3531775b7c
Add type declarations to the controllers contructors
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-09-11 17:32:22 -03:00

49 lines
1009 B
PHP

<?php
declare(strict_types=1);
namespace PhpMyAdmin\Controllers;
use PhpMyAdmin\Export;
use PhpMyAdmin\Relation;
use PhpMyAdmin\Util;
/**
* Schema export handler
*/
class SchemaExportController
{
/** @var Export */
private $export;
/** @var Relation */
private $relation;
public function __construct(Export $export, Relation $relation)
{
$this->export = $export;
$this->relation = $relation;
}
public function __invoke(): void
{
global $cfgRelation;
/**
* get all variables needed for exporting relational schema
* in $cfgRelation
*/
$cfgRelation = $this->relation->getRelationsParam();
if (! isset($_POST['export_type'])) {
Util::checkParameters(['export_type']);
}
/**
* Include the appropriate Schema Class depending on $export_type
* default is PDF
*/
$this->export->processExportSchema($_POST['export_type']);
}
}