Page MenuHomePhorge

No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None
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

Mime Type
text/x-diff
Expires
Fri, Feb 6, 1:35 PM (2 h, 32 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
428284
Default Alt Text
(1 KB)

Event Timeline