2 bug 40459 - Test whether the constructor of the user-space stream wrapper is called when stream functions are called
5 // Test whether the constructor of the user-space stream wrapper is called when stream functions are called
7 private $constructorCalled = false;
8 function __construct() {
9 $this->constructorCalled = true;
12 function stream_open($path, $mode, $options, &$opened_path)
14 echo $this->constructorCalled ? 'yes' : 'no';
18 function url_stat($url, $flags)
20 echo $this->constructorCalled ? 'yes' : 'no';
26 echo $this->constructorCalled ? 'yes' : 'no';
29 function rename($from, $to)
31 echo $this->constructorCalled ? 'yes' : 'no';
34 function mkdir($dir, $mode, $options)
36 echo $this->constructorCalled ? 'yes' : 'no';
39 function rmdir($dir, $options)
41 echo $this->constructorCalled ? 'yes' : 'no';
44 function dir_opendir($url, $options)
46 echo $this->constructorCalled ? 'yes' : 'no';
49 function stream_metadata()
51 echo $this->constructorCalled ? 'yes' : 'no';
56 stream_wrapper_register('test', 'testwrapper', STREAM_IS_URL);
59 fopen('test://test', 'r');
67 opendir('test://test');
79 rename('test://test', 'test://test2');
83 unlink('test://test');
87 touch('test://test', time());