"added stream_stat required to use file_get_contents"

This commit is contained in:
Ralf Becker 2009-08-26 14:10:25 +00:00
parent b3f5fc282b
commit af19f3663e

View File

@ -25,10 +25,11 @@ class global_stream_wrapper
{ {
private $pos; private $pos;
private $stream; private $stream;
private $name;
public function stream_open($path, $mode, $options, &$opened_path) public function stream_open($path, $mode, $options, &$opened_path)
{ {
$this->stream = &$GLOBALS[parse_url($path,PHP_URL_HOST)]; $this->stream = &$GLOBALS[$this->name=parse_url($path,PHP_URL_HOST)];
$this->pos = 0; $this->pos = 0;
if (!is_string($this->stream)) return false; if (!is_string($this->stream)) return false;
return true; return true;
@ -77,6 +78,25 @@ class global_stream_wrapper
return $ret; return $ret;
} }
public function stream_stat()
{
if (!isset($this->stream))
{
return false;
}
return array(
'ino' => md5($this->name),
'name' => $this->name,
'mode' => 0100000,
'size' => bytes($this->stream),
'uid' => 0,
'gid' => 0,
'mtime' => 0,
'ctime' => 0,
'nlink' => 1,
);
}
/** /**
* are the string functions overloaded by their mbstring variants * are the string functions overloaded by their mbstring variants
* *