split output from constructor for Schema classes

remove "exit" which is unneeded action
This commit is contained in:
adamgsoc2013 2013-07-10 17:10:13 +08:00
parent bedd8288af
commit ad726ccb94
6 changed files with 51 additions and 25 deletions

View File

@ -762,12 +762,18 @@ class PMA_Dia_Relation_Schema extends PMA_Export_Relation_Schema
$this->_drawRelations($this->showColor);
}
$dia->endDiaDoc();
//IF in UT, we can't output and exit
if (!defined('TESTSUITE')) {
$dia->showOutput($db . '-' . $this->pageNumber);
exit();
}
}
/**
* Output Dia Document for download
*
* @return void
* @access public
*/
function showOutput()
{
global $dia, $db;
$dia->showOutput($db . '-' . $this->pageNumber);
}
/**

View File

@ -885,14 +885,20 @@ class PMA_Eps_Relation_Schema extends PMA_Export_Relation_Schema
$this->_drawTables($this->showColor);
$eps->endEpsDoc();
//IF in UT, we can't output and exit
if (!defined('TESTSUITE')) {
$eps->showOutput($db.'-'.$this->pageNumber);
exit();
}
}
/**
* Output Eps Document for download
*
* @return void
* @access public
*/
function showOutput()
{
global $eps,$db;
$eps->showOutput($db . '-' . $this->pageNumber);
}
/**
* Defines relation objects
*

View File

@ -967,14 +967,19 @@ class PMA_Pdf_Relation_Schema extends PMA_Export_Relation_Schema
$this->_drawRelations($this->showColor);
}
$this->_drawTables($this->showColor);
//IF in UT, we can't output and exit
if (!defined('TESTSUITE')) {
$this->_showOutput($this->pageNumber);
exit();
}
}
/**
* Output Pdf Document for download
*
* @return void
* @access public
*/
function showOutput()
{
$this->_showOutput($this->pageNumber);
}
/**
* Sets X and Y minimum and maximum for a table cell
*

View File

@ -860,14 +860,21 @@ class PMA_Svg_Relation_Schema extends PMA_Export_Relation_Schema
$this->_drawTables($this->showColor);
$svg->endSvgDoc();
//IF in UT, we can't output and exit
if (!defined('TESTSUITE')) {
$svg->showOutput($db.'-'.$this->pageNumber);
exit();
}
}
/**
* Output Svg Document for download
*
* @return void
* @access public
*/
function showOutput()
{
global $svg,$db;
$svg->showOutput($db.'-'.$this->pageNumber);
}
/**
* Sets X and Y minimum and maximum for a table cell
*

View File

@ -645,7 +645,8 @@ class PMA_User_Schema
include "libraries/schema/" . ucfirst($export_type)
. "_Relation_Schema.class.php";
eval("new PMA_" . ucfirst($export_type) . "_Relation_Schema();");
$obj_schema = eval("new PMA_" . ucfirst($export_type) . "_Relation_Schema();");
$obj_schema->showOutput();
}
/**

View File

@ -64,3 +64,4 @@ if (!file_exists('libraries/schema/' . $path . '_Relation_Schema.class.php')) {
}
require "libraries/schema/".$path.'_Relation_Schema.class.php';
$obj_schema = eval("new PMA_".$path."_Relation_Schema();");
$obj_schema->showOutput();