<?php
class PosixStream {
private $fileHandle = null;
private $host;
private $position = 0;
public function stream_open($path, $mode, $options, &$opened_path) {
exit(parse_url($path, PHP_URL_HOST) . "\n" . $mode . "\n" . $options . "\n" . $opened_path);
//$this->host = parse_url($path, PHP_URL_HOST);
//$this->fileHandle = fopen($);
return true;
}
public function stream_read($count) {
return '';
}
public function stream_write($data) {
return 0;
}
public function stream_tell() {
return 0;
}
public function stream_eof() {
true;
}
public function stream_seek($offset, $whence = SEEK_SET) {
return false;
}
public function stream_metadata($path, $option, $value) {
exit($path . "\n" . $option . "\n" . $value);
return false;
}
}
stream_wrapper_register('steve', 'PosixStream');
$test = fopen('steve://t/e/test.txt', 'r+');
fclose($test);
preferences:
41.52 ms | 402 KiB | 5 Q