-
Notifications
You must be signed in to change notification settings - Fork 15
/
islandora_checksum_checker.api.php
36 lines (35 loc) · 1.22 KB
/
islandora_checksum_checker.api.php
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
* This file documents hook functions for the Islandora Checksum Checker module.
*/
/**
* Notify modules of the outcome of the checksum validation.
*
* @param string $pid
* The current object's PID.
* @param string $dsid
* The current datastream's DSID. Will be empty if the exception is thrown
* from the initial Tuque connection (i.e., there is no current datastream).
* @param array $ds_info
* Output of Tuque's API-M getDatastream() method, with 'validateChecksum'
* set to TRUE. See islandora_checksum_checker_validate_checksum() for
* details on the content of this array. Will be empty if an exception was
* caught.
* @param string $outcome
* One of 'valid', 'invalid', or 'disabled'. Will be empty if an exception
* was caught.
* @param array $exceptions
* An array of all exception objects caught during the validation. Exceptions
* will already be logged to the watchdog.
*/
function hook_islandora_checksum_checker_outcome($pid, $dsid, $ds_info, $outcome, $exceptions) {
if ($outcome == 'disabled') {
watchdog('my_module', 'You should enable checksums for !pid !dsid.',
array(
'!pid' => $pid,
'!dsid' => $dsid,
),
WATCHDOG_WARNING);
}
}