- var_dump: documentation ( source)
- stream_wrapper_register: documentation ( source)
- flock: documentation ( source)
- fopen: documentation ( source)
<?php
class streamWrapper
{
public function stream_lock($operation )
{
var_dump($operation);
}
public function stream_open($path, $mode, $options, $opened_path)
{
var_dump($path);
return fopen('/tmp/waa', $mode);
}
}
stream_wrapper_register('test', 'streamWrapper');
$fp = fopen('test://waa', 'w+');
flock($fp, LOCK_EX);