1--TEST-- 2User-space streams: test metadata option 3--FILE-- 4<?php 5class test_wrapper { 6 function stream_open($path, $mode, $openedpath) { 7 return true; 8 } 9 public function stream_metadata($path, $option, $var) { 10 echo "metadata: $path, $option\n"; 11 if(is_array($var)) { 12 echo join(",", $var); 13 } else { 14 echo $var; 15 } 16 echo "\n"; 17 return false; 18 } 19} 20 21var_dump(stream_wrapper_register('test', 'test_wrapper')); 22 23$fd = fopen("test://foo","r"); 24touch("test://testdir/touch"); 25touch("test://testdir/touch", 1); 26touch("test://testdir/touch", 1, 2); 27chown("test://testdir/chown", "test"); 28chown("test://testdir/chown", 42); 29chgrp("test://testdir/chgrp", "test"); 30chgrp("test://testdir/chgrp", 42); 31chmod("test://testdir/chmod", 0755); 32?> 33--EXPECT-- 34bool(true) 35metadata: test://testdir/touch, 1 36 37metadata: test://testdir/touch, 1 381,1 39metadata: test://testdir/touch, 1 401,2 41metadata: test://testdir/chown, 2 42test 43metadata: test://testdir/chown, 3 4442 45metadata: test://testdir/chgrp, 4 46test 47metadata: test://testdir/chgrp, 5 4842 49metadata: test://testdir/chmod, 6 50493 51