- flock: documentation ( source)
- fclose: documentation ( source)
- printf: documentation ( source)
- stream_register_wrapper: documentation ( source)
- fopen: documentation ( source)
<?php
class StreamTest
{
function stream_open($path, $mode, $options, &$opened_path) {
return true;
}
function stream_close() {
return ;
}
function stream_lock($mode) {
printf( "0x%x\n", $mode ) ;
return ;
}
}
stream_register_wrapper("streamtest", "StreamTest");
$handle = fopen( 'streamtest://test', "r" ) ;
flock( $handle, LOCK_EX ) ;
flock( $handle, LOCK_UN ) ;
fclose($handle) ;