From 4b8a9a5189a625bf99fedec7fd31f6e146410a14 Mon Sep 17 00:00:00 2001 From: emkael Date: Thu, 26 Apr 2018 01:00:12 +0200 Subject: Update FB API library --- .../src/Facebook/FileUpload/FacebookFile.php | 40 ++++++++++++++++++++-- 1 file changed, 37 insertions(+), 3 deletions(-) (limited to 'lib/facebook-graph-sdk/src/Facebook/FileUpload/FacebookFile.php') diff --git a/lib/facebook-graph-sdk/src/Facebook/FileUpload/FacebookFile.php b/lib/facebook-graph-sdk/src/Facebook/FileUpload/FacebookFile.php index f8b9905..3c1536d 100644 --- a/lib/facebook-graph-sdk/src/Facebook/FileUpload/FacebookFile.php +++ b/lib/facebook-graph-sdk/src/Facebook/FileUpload/FacebookFile.php @@ -1,6 +1,6 @@ path = $filePath; + $this->maxLength = $maxLength; + $this->offset = $offset; $this->open(); } @@ -98,7 +112,7 @@ class FacebookFile */ public function getContents() { - return stream_get_contents($this->stream); + return stream_get_contents($this->stream, $this->maxLength, $this->offset); } /** @@ -111,6 +125,26 @@ class FacebookFile return basename($this->path); } + /** + * Return the path of the file. + * + * @return string + */ + public function getFilePath() + { + return $this->path; + } + + /** + * Return the size of the file. + * + * @return int + */ + public function getSize() + { + return filesize($this->path); + } + /** * Return the mimetype of the file. * -- cgit v1.2.3