Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create SchemaExportController controller
Moves schema export entry point logic to the SchemaExportController and removes the entry point file. Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
- Loading branch information
1 parent
07a2715
commit eea4e8e
Showing
5 changed files
with
71 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<?php | ||
/** | ||
* @package PhpMyAdmin\Controllers | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace PhpMyAdmin\Controllers; | ||
|
||
use PhpMyAdmin\Export; | ||
use PhpMyAdmin\Relation; | ||
use PhpMyAdmin\Util; | ||
|
||
/** | ||
* Schema export handler | ||
* | ||
* @package PhpMyAdmin\Controllers | ||
*/ | ||
class SchemaExportController | ||
{ | ||
/** @var Export */ | ||
private $export; | ||
|
||
/** @var Relation */ | ||
private $relation; | ||
|
||
/** | ||
* @param Export $export A Export instance. | ||
* @param Relation $relation A Relation instance. | ||
*/ | ||
public function __construct(Export $export, Relation $relation) | ||
{ | ||
$this->export = $export; | ||
$this->relation = $relation; | ||
} | ||
|
||
/** | ||
* @return void | ||
*/ | ||
public function index(): 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']); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters