Skip to content
Browse files

MDL-34290 repository_filesystem add original info function and reduce…

… ref lifetime
  • Loading branch information...
1 parent e53394b commit 22fa5d9a7cc7e78ba1d320163cf0aebf4a1b5131 @marinaglancy marinaglancy committed Jul 31, 2012
Showing with 27 additions and 0 deletions.
  1. +27 −0 repository/filesystem/lib.php
View
27 repository/filesystem/lib.php
@@ -245,6 +245,33 @@ public function supported_returntypes() {
}
/**
+ * 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()}
* {@link repository::get_file()}

0 comments on commit 22fa5d9

Please sign in to comment.
Something went wrong with that request. Please try again.