aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/filestore.php
diff options
context:
space:
mode:
Diffstat (limited to 'engine/lib/filestore.php')
-rw-r--r--engine/lib/filestore.php23
1 files changed, 21 insertions, 2 deletions
diff --git a/engine/lib/filestore.php b/engine/lib/filestore.php
index daed925f5..94ab26594 100644
--- a/engine/lib/filestore.php
+++ b/engine/lib/filestore.php
@@ -117,10 +117,17 @@
/**
* Get the contents of the whole file.
*
- * @param mixed $f The file handle.
+ * @param mixed $file The file handle.
* @return mixed The file contents.
*/
- abstract public function grabFile(ElggFile $file);
+ abstract public function grabFile(ElggFile $file);
+
+ /**
+ * Return whether a file physically exists or not.
+ *
+ * @param ElggFile $file
+ */
+ abstract public function exists(ElggFile $file);
}
@@ -243,6 +250,11 @@
return file_get_contents($file->getFilenameOnFilestore());
+ }
+
+ public function exists(ElggFile $file)
+ {
+ return file_exists($this->getFilenameOnFilestore($file));
}
/**
@@ -556,6 +568,13 @@
return $fs->eof($this->handle);
}
+ public function exists()
+ {
+ $fs = $this->getFilestore();
+
+ return $fs->exists($this);
+ }
+
/**
* Set a filestore.
*