aboutsummaryrefslogtreecommitdiff
path: root/engine/classes/ElggFile.php
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2013-07-29 11:42:02 -0300
committerSilvio Rhatto <rhatto@riseup.net>2013-07-29 11:42:02 -0300
commitbb3c9a26bb75c76c5934d327548bf08606467b9f (patch)
tree26760aa866799fc70683ef6845bf54fb17bdc955 /engine/classes/ElggFile.php
parent2feedf39f6484879333a7b77fdc3c184150db8c7 (diff)
parent398572fd96c72b363fd5a252fb9cbe1cecab1e04 (diff)
downloadelgg-bb3c9a26bb75c76c5934d327548bf08606467b9f.tar.gz
elgg-bb3c9a26bb75c76c5934d327548bf08606467b9f.tar.bz2
Merge branch 'floxglove-3' into saravea
Conflicts: .gitmodules
Diffstat (limited to 'engine/classes/ElggFile.php')
-rw-r--r--engine/classes/ElggFile.php12
1 files changed, 10 insertions, 2 deletions
diff --git a/engine/classes/ElggFile.php b/engine/classes/ElggFile.php
index f21621ffd..3e9c24c17 100644
--- a/engine/classes/ElggFile.php
+++ b/engine/classes/ElggFile.php
@@ -93,6 +93,7 @@ class ElggFile extends ElggObject {
$container_guid = $this->container_guid;
}
$fs = $this->getFilestore();
+ // @todo add getSize() to ElggFilestore
return $fs->getSize($prefix, $container_guid);
}
@@ -127,9 +128,11 @@ class ElggFile extends ElggObject {
* @param mixed $default A default. Useful to pass what the browser thinks it is.
* @since 1.7.12
*
+ * @note If $file is provided, this may be called statically
+ *
* @return mixed Detected type on success, false on failure.
*/
- static function detectMimeType($file = null, $default = null) {
+ public function detectMimeType($file = null, $default = null) {
if (!$file) {
if (isset($this) && $this->filename) {
$file = $this->filename;
@@ -178,6 +181,8 @@ class ElggFile extends ElggObject {
* @param string $mode Either read/write/append
*
* @return resource File handler
+ *
+ * @throws IOException|InvalidParameterException
*/
public function open($mode) {
if (!$this->getFilename()) {
@@ -285,6 +290,7 @@ class ElggFile extends ElggObject {
public function seek($position) {
$fs = $this->getFilestore();
+ // @todo add seek() to ElggFilestore
return $fs->seek($this->handle, $position);
}
@@ -347,6 +353,8 @@ class ElggFile extends ElggObject {
* a filestore as recorded in metadata or the system default.
*
* @return ElggFilestore
+ *
+ * @throws ClassNotFoundException
*/
protected function getFilestore() {
// Short circuit if already set.
@@ -359,7 +367,6 @@ class ElggFile extends ElggObject {
// need to get all filestore::* metadata because the rest are "parameters" that
// get passed to filestore::setParameters()
if ($this->guid) {
- $db_prefix = elgg_get_config('dbprefix');
$options = array(
'guid' => $this->guid,
'where' => array("n.string LIKE 'filestore::%'"),
@@ -388,6 +395,7 @@ class ElggFile extends ElggObject {
$this->filestore = new $filestore();
$this->filestore->setParameters($parameters);
+ // @todo explain why $parameters will always be set here (PhpStorm complains)
}
// this means the entity hasn't been saved so fallback to default