public function dir_opendir($path, $options) { stream_wrapper_restore('file'); $this->hwnd = opendir($path); stream_wrapper_unregister("file"); stream_wrapper_register("file", get_class($this)); return true; }