eduardok / libsmbclient-php

smbclient's extension for PHP
Other
96 stars 21 forks source link

Add support for smbclient_notify #29

Open icewind1991 opened 9 years ago

icewind1991 commented 9 years ago

The smbclient notify command allows clients to get notified whenever a file or folder is changed on the server.

From what I can tell this functionality is exposed as smbc_setFunctionNotify in libsmbclient in newer versions of smbclient

eduardok commented 9 years ago

hmm, ok, I will try to take a look at this soon, a bit busy this week as I will move next week.

aklomp commented 9 years ago

smbc_notify was added to libsmbclient.h on June 26, 2015. I wonder how it should be implemented for PHP, since the notifications come asynchronously through callbacks. You'd have to register a PHP callback function with the library.

remicollet commented 9 years ago

I think such callback make sense in long running process (CLI), not really in web env.

eduardok commented 8 years ago

Well, it would be nice if it kept the notifications on a queue for later consumption (with a configurable timeout, etc), but that means more code in samba :P What options do we have ?

aklomp commented 8 years ago

Well, PHP can also be (ab)used as a tool to write CLI programs/daemons, so adding notify support is not totally crazy. I just wonder how hard it is to hook into the PHP event loop and issue a callback. It's certainly something that I have no experience with.

remicollet commented 8 years ago

Notice: the pecl/inotify ext use the "queue" way