-
Notifications
You must be signed in to change notification settings - Fork 0
/
uc_pdf_invoice_mail.install
36 lines (30 loc) · 1.13 KB
/
uc_pdf_invoice_mail.install
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
/**
* @file
* Install file for Ubercart PDF Invoice Mail. Checks requirements.
*/
/**
* Implements hook_requirements().
*/
function uc_pdf_invoice_mail_requirements($phase) {
$requirements = array();
$t = get_t();
if ($phase == 'install') {
if (version_compare(phpversion(), '5.3.0', '<')) {
$requirements['php_version']['title'] = $t('PHP version');
$requirements['php_version']['value'] = check_plain(phpversion());
$requirements['php_version']['severity'] = REQUIREMENT_ERROR;
$requirements['php_version']['description'] = $t('Ubercart PDF Invoice Mail could not be installed. DOMPDF requires PHP 5.3 or higher.');
}
// Make sure that Libraries module is loaded.
if (!function_exists('libraries_get_path')) {
module_load_include('module', 'libraries');
}
$path = libraries_get_path('dompdf');
if (!is_file($path . '/README.md')) {
$requirements['dompdf']['severity'] = REQUIREMENT_ERROR;
$requirements['dompdf']['description'] = $t('Dompdf could not be installed. Dompdf version 0.8.x or higher not found. See README.txt.');
}
}
return $requirements;
}