1
|
<?php
|
2
|
|
3
|
/**
|
4
|
* @file
|
5
|
* Provides drush integration for print_pdf_mpdf module PDF libraries download.
|
6
|
*/
|
7
|
|
8
|
/**
|
9
|
* The PDF project download URL.
|
10
|
*/
|
11
|
// URI to the the latest mpdf version.
|
12
|
define('MPDF_DOWNLOAD_URI', 'https://api.github.com/repos/mpdf/mpdf/releases/latest');
|
13
|
|
14
|
/**
|
15
|
* Implements hook_drush_command().
|
16
|
*/
|
17
|
function print_pdf_mpdf_drush_pdf_libs_alter(&$pdf_libs) {
|
18
|
$pdf_libs['mpdf'] = array(
|
19
|
'callback' => '_print_pdf_mpdf_drush_download_url',
|
20
|
);
|
21
|
}
|
22
|
|
23
|
/**
|
24
|
* Discover the correct URL of the package to download.
|
25
|
*
|
26
|
* @return string
|
27
|
* URL of the file to download, FALSE if not known
|
28
|
*/
|
29
|
function _print_pdf_mpdf_drush_download_url() {
|
30
|
return MPDF_DOWNLOAD_URI;
|
31
|
}
|