Skip to content

Commit

Permalink
Allow TCPDF to be removed
Browse files Browse the repository at this point in the history
We currently require TCPDF to be present, but in most cases this is
feature which users do not need and thus can reduce size of installed
phpMyAdmin.

Also this is helpful for Linux distributions as they can provide soft
dependency on tcpdf package.

Signed-off-by: Michal Čihař <michal@cihar.com>
  • Loading branch information
nijel committed Mar 24, 2014
1 parent b3448d1 commit 186a809
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 1 deletion.
1 change: 1 addition & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ phpMyAdmin - ChangeLog
4.1.12.0 (not yet released)
- bug #4334 Add event : datepicker won't open
- bug #4338 Fix missing value error while executing SQL query
- TCPDF library is now optional dependency

4.1.11.0 (2014-03-23)
- bug #4335 reCaptcha problem (4.1.10 regression)
Expand Down
10 changes: 9 additions & 1 deletion libraries/plugins/export/ExportPdf.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@
exit;
}

/**
* Skip the plugin if TCPDF is not available.
*/
if (! file_exists(TCPDF_INC)) {
$GLOBALS['skip_import'] = true;
return;
}

/* Get the export interface */
require_once 'libraries/plugins/ExportPlugin.class.php';
/* Get the PMA_ExportPdf class */
Expand Down Expand Up @@ -265,4 +273,4 @@ private function _setPdfReportTitle($pdfReportTitle)
$this->_pdfReportTitle = $pdfReportTitle;
}
}
?>
?>
8 changes: 8 additions & 0 deletions libraries/schema/Pdf_Relation_Schema.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@
exit;
}

/**
* Skip the plugin if TCPDF is not available.
*/
if (! file_exists(TCPDF_INC)) {
$GLOBALS['skip_import'] = true;
return;
}

/**
* block attempts to directly run this script
*/
Expand Down
8 changes: 8 additions & 0 deletions libraries/schema/User_Schema.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,15 @@ private function _processExportSchema()
__('File doesn\'t exist')
);
}
$GLOBALS['skip_import'] = false;
include $filename;
if ( $GLOBALS['skip_import']) {
PMA_Export_Relation_Schema::dieSchema(
$_POST['chpage'],
$export_type,
__('Plugin is disabled')
);
}
$class_name = 'PMA_' . $path . '_Relation_Schema';
$obj_schema = new $class_name();
$obj_schema->showOutput();
Expand Down

0 comments on commit 186a809

Please sign in to comment.