Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2534488
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/lib/drivers/seafile/seafile_request_observer.php b/lib/drivers/seafile/seafile_request_observer.php
index 0ab06b5..65eae51 100644
--- a/lib/drivers/seafile/seafile_request_observer.php
+++ b/lib/drivers/seafile/seafile_request_observer.php
@@ -1,51 +1,50 @@
<?php
/**
* Observer for HTTP_Request2 implementing saving response body into a file
*/
class seafile_request_observer implements SplObserver
{
protected $file;
protected $fp;
public function set_file($file)
{
$this->file = $file;
}
public function set_fp($fp)
{
$this->fp = $fp;
}
public function update(SplSubject $subject)
{
$event = $subject->getLastEvent();
switch ($event['name']) {
case 'receivedHeaders':
if ($this->file) {
- $target = $this->dir . DIRECTORY_SEPARATOR . $this->file;
- if (!($this->fp = @fopen($target, 'wb'))) {
- throw new Exception("Cannot open target file '{$target}'");
+ if (!($this->fp = @fopen($this->file, 'wb'))) {
+ throw new Exception("Cannot open target file '{$this->file}'");
}
}
else if (!$this->fp) {
throw new Exception("File destination not specified");
}
break;
case 'receivedBodyPart':
case 'receivedEncodedBodyPart':
fwrite($this->fp, $event['data']);
break;
case 'receivedBody':
if ($this->file) {
fclose($this->fp);
}
break;
}
}
}
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Fri, Feb 6, 1:35 PM (49 m, 43 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
428284
Default Alt Text
(1 KB)
Attached To
Mode
R26 chwala
Attached
Detach File
Event Timeline
Log In to Comment