Skip to content

Commit

Permalink
MDL-34290 repository_filesystem add original info function and reduce…
Browse files Browse the repository at this point in the history
… ref lifetime
  • Loading branch information
marinaglancy committed Aug 29, 2012
1 parent 72a5655 commit 96221c6
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions repository/filesystem/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,33 @@ public function supported_returntypes() {
return FILE_INTERNAL | FILE_REFERENCE;
}

/**
* Return reference file life time
*
* @param string $ref
* @return int
*/
public function get_reference_file_lifetime($ref) {
// Does not cost us much to synchronise within our own filesystem, set to 1 minute
return 60;
}

/**
* Return human readable reference information
*
* @param string $reference value of DB field files_reference.reference
* @param int $filestatus status of the file, 0 - ok, 666 - source missing
* @return string
*/
public function get_reference_details($reference, $filestatus = 0) {
$details = $this->get_name().': '.$reference;
if ($filestatus) {
return get_string('lostsource', 'repository', $details);
} else {
return $details;
}
}

/**
* Returns information about file in this repository by reference
* {@link repository::get_file_reference()}
Expand Down

0 comments on commit 96221c6

Please sign in to comment.