print_pdf_mpdf.drush.inc 685 B

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