Hi internal,
A missing feature in PHP is a file system watcher/monitoring available
for almost all platforms. On Linux, we have inotify (available in PHP
through pecl/inotify), on Mac OS X, we have /dev/fsevents (not available
in PHP, since we need ioctl to do that in pure PHP —and sudo—, no C
extension needed), on FreeBSD, we have FAM, and on Windows, we have
FileSystemWatcher in .NET. All major platforms have a solution ready to use.
By now, if we didn't use these solutions, we should use a finder (thanks
to RecursiveIteratorIterator and DirectoryIterator in SPL) that runs
every n seconds and compute a diff with the previous run. This solution
works fine for a small set of files but it can slow for a big one. This
is just a tricky solution, not a proper one.
Possible domains where it is needed: test, CI, log, file transfering,
security etc.
Is it possible to have such a feature landing in PHP (core if karma
allows it)? or do you want such a feature?
Best regards :-).
--
Ivan Enderlin
Developer of Hoa
http://hoa-project.net/
PhD. student at DISC/Femto-ST (Vesontio) and INRIA (Cassis)
http://disc.univ-fcomte.fr/ and http://www.inria.fr/
Member of HTML and WebApps Working Group of W3C
http://w3.org/
Just a quick note, FileSystemWatcher in .NET is actually not recommended for use by Microsoft.
It does not guarantee that an event will be raised on every new file or file mod in a given folder… and it's even less determinstic when trying to deal with network share drives.
Microsoft's own developer blogs usually recommend that people roll their own polling-based solution instead of depending on FileSystemWatcher (googling FileSystemWatcher will yield many many results regarding this).
I'm not necessarily saying that the overall idea is without merit… but it's just that if someone does want to try and implement something like this on Windows, they should try and avoid whatever Win32 API calls that FileSystemWatcher uses.
--Mike
Hi internal,
A missing feature in PHP is a file system watcher/monitoring available for almost all platforms. On Linux, we have inotify (available in PHP through pecl/inotify), on Mac OS X, we have /dev/fsevents (not available in PHP, since we need ioctl to do that in pure PHP —and sudo—, no C extension needed), on FreeBSD, we have FAM, and on Windows, we have FileSystemWatcher in .NET. All major platforms have a solution ready to use.
By now, if we didn't use these solutions, we should use a finder (thanks to RecursiveIteratorIterator and DirectoryIterator in SPL) that runs every n seconds and compute a diff with the previous run. This solution works fine for a small set of files but it can slow for a big one. This is just a tricky solution, not a proper one.
Possible domains where it is needed: test, CI, log, file transfering, security etc.
Is it possible to have such a feature landing in PHP (core if karma allows it)? or do you want such a feature?
Best regards :-).
--
Ivan Enderlin
Developer of Hoa
http://hoa-project.net/PhD. student at DISC/Femto-ST (Vesontio) and INRIA (Cassis)
http://disc.univ-fcomte.fr/ and http://www.inria.fr/Member of HTML and WebApps Working Group of W3C
http://w3.org/
Hi Mike,
Just a quick note, FileSystemWatcher in .NET is actually not recommended for use by Microsoft.
It does not guarantee that an event will be raised on every new file or file mod in a given folder… and it's even less determinstic when trying to deal with network share drives.
Microsoft's own developer blogs usually recommend that people roll their own polling-based solution instead of depending on FileSystemWatcher (googling FileSystemWatcher will yield many many results regarding this).
I'm not necessarily saying that the overall idea is without merit… but it's just that if someone does want to try and implement something like this on Windows, they should try and avoid whatever Win32 API calls that FileSystemWatcher uses.
Ok, thank you for the note. I didn't look deeply in Windows API, just
Mac OS X and Linux for the moment… Thank you again.
--Mike
Hi internal,
A missing feature in PHP is a file system watcher/monitoring available for almost all platforms. On Linux, we have inotify (available in PHP through pecl/inotify), on Mac OS X, we have /dev/fsevents (not available in PHP, since we need ioctl to do that in pure PHP —and sudo—, no C extension needed), on FreeBSD, we have FAM, and on Windows, we have FileSystemWatcher in .NET. All major platforms have a solution ready to use.
By now, if we didn't use these solutions, we should use a finder (thanks to RecursiveIteratorIterator and DirectoryIterator in SPL) that runs every n seconds and compute a diff with the previous run. This solution works fine for a small set of files but it can slow for a big one. This is just a tricky solution, not a proper one.
Possible domains where it is needed: test, CI, log, file transfering, security etc.
Is it possible to have such a feature landing in PHP (core if karma allows it)? or do you want such a feature?
Best regards :-).
--
Ivan Enderlin
Developer of Hoa
http://hoa-project.net/PhD. student at DISC/Femto-ST (Vesontio) and INRIA (Cassis)
http://disc.univ-fcomte.fr/ and http://www.inria.fr/Member of HTML and WebApps Working Group of W3C
http://w3.org/--
--
Ivan Enderlin
Developer of Hoa
http://hoa-project.net/
PhD. student at DISC/Femto-ST (Vesontio) and INRIA (Cassis)
http://disc.univ-fcomte.fr/ and http://www.inria.fr/
Member of HTML and WebApps Working Group of W3C
http://w3.org/
On Thu, Feb 14, 2013 at 3:03 PM, Ivan Enderlin @ Hoa <
ivan.enderlin@hoa-project.net> wrote:
Hi internal,
A missing feature in PHP is a file system watcher/monitoring available for
almost all platforms. On Linux, we have inotify (available in PHP through
pecl/inotify), on Mac OS X, we have /dev/fsevents (not available in PHP,
since we need ioctl to do that in pure PHP —and sudo—, no C extension
needed), on FreeBSD, we have FAM, and on Windows, we have FileSystemWatcher
in .NET. All major platforms have a solution ready to use.By now, if we didn't use these solutions, we should use a finder (thanks
to RecursiveIteratorIterator and DirectoryIterator in SPL) that runs every
n seconds and compute a diff with the previous run. This solution works
fine for a small set of files but it can slow for a big one. This is just a
tricky solution, not a proper one.Possible domains where it is needed: test, CI, log, file transfering,
security etc.Is it possible to have such a feature landing in PHP (core if karma allows
it)? or do you want such a feature?Best regards :-).
Hello :-)
I don't see why we would have such a thing into PHP Core.
We are already smooth about the file system accesses with a realpath cache,
and users may use different pecl ext if they want to take hand on a lib
such as inotify.
Julien
Hello Julien,
On Thu, Feb 14, 2013 at 3:03 PM, Ivan Enderlin @ Hoa <
ivan.enderlin@hoa-project.net> wrote:Hi internal,
A missing feature in PHP is a file system watcher/monitoring available for
almost all platforms. On Linux, we have inotify (available in PHP through
pecl/inotify), on Mac OS X, we have /dev/fsevents (not available in PHP,
since we need ioctl to do that in pure PHP —and sudo—, no C extension
needed), on FreeBSD, we have FAM, and on Windows, we have FileSystemWatcher
in .NET. All major platforms have a solution ready to use.By now, if we didn't use these solutions, we should use a finder (thanks
to RecursiveIteratorIterator and DirectoryIterator in SPL) that runs every
n seconds and compute a diff with the previous run. This solution works
fine for a small set of files but it can slow for a big one. This is just a
tricky solution, not a proper one.Possible domains where it is needed: test, CI, log, file transfering,
security etc.Is it possible to have such a feature landing in PHP (core if karma allows
it)? or do you want such a feature?Best regards :-).
Hello :-)
I don't see why we would have such a thing into PHP Core.
We are already smooth about the file system accesses with a realpath cache,
and users may use different pecl ext if they want to take hand on a lib
such as inotify.
Well ok, forget PHP core, but an extension would be great.
--
Ivan Enderlin
Developer of Hoa
http://hoa-project.net/
PhD. student at DISC/Femto-ST (Vesontio) and INRIA (Cassis)
http://disc.univ-fcomte.fr/ and http://www.inria.fr/
Member of HTML and WebApps Working Group of W3C
http://w3.org/
2013/2/14 Ivan Enderlin @ Hoa ivan.enderlin@hoa-project.net
Hello Julien,
On Thu, Feb 14, 2013 at 3:03 PM, Ivan Enderlin @ Hoa <
ivan.enderlin@hoa-project.net> wrote:Hi internal,
A missing feature in PHP is a file system watcher/monitoring available
for
almost all platforms. On Linux, we have inotify (available in PHP through
pecl/inotify), on Mac OS X, we have /dev/fsevents (not available in PHP,
since we need ioctl to do that in pure PHP —and sudo—, no C extension
needed), on FreeBSD, we have FAM, and on Windows, we have
FileSystemWatcher
in .NET. All major platforms have a solution ready to use.By now, if we didn't use these solutions, we should use a finder (thanks
to RecursiveIteratorIterator and DirectoryIterator in SPL) that runs
every
n seconds and compute a diff with the previous run. This solution works
fine for a small set of files but it can slow for a big one. This is
just a
tricky solution, not a proper one.Possible domains where it is needed: test, CI, log, file transfering,
security etc.Is it possible to have such a feature landing in PHP (core if karma
allows
it)? or do you want such a feature?Best regards :-).
Hello :-)
I don't see why we would have such a thing into PHP Core.
We are already smooth about the file system accesses with a realpath
cache,
and users may use different pecl ext if they want to take hand on a lib
such as inotify.Well ok, forget PHP core, but an extension would be great.
At least for inotify there is an extension, which works quite fine. Never
searched something similar for other OSs.
Regards,
Sebastian
--
Ivan Enderlin
Developer of Hoa
http://hoa-project.net/PhD. student at DISC/Femto-ST (Vesontio) and INRIA (Cassis)
http://disc.univ-fcomte.fr/ and http://www.inria.fr/Member of HTML and WebApps Working Group of W3C
http://w3.org/--
Hi Sebastian,
2013/2/14 Ivan Enderlin @ Hoa ivan.enderlin@hoa-project.net
Hello Julien,
On Thu, Feb 14, 2013 at 3:03 PM, Ivan Enderlin @ Hoa <
ivan.enderlin@hoa-project.net> wrote:Hi internal,
A missing feature in PHP is a file system watcher/monitoring available
for
almost all platforms. On Linux, we have inotify (available in PHP through
pecl/inotify), on Mac OS X, we have /dev/fsevents (not available in PHP,
since we need ioctl to do that in pure PHP —and sudo—, no C extension
needed), on FreeBSD, we have FAM, and on Windows, we have
FileSystemWatcher
in .NET. All major platforms have a solution ready to use.By now, if we didn't use these solutions, we should use a finder (thanks
to RecursiveIteratorIterator and DirectoryIterator in SPL) that runs
every
n seconds and compute a diff with the previous run. This solution works
fine for a small set of files but it can slow for a big one. This is
just a
tricky solution, not a proper one.Possible domains where it is needed: test, CI, log, file transfering,
security etc.Is it possible to have such a feature landing in PHP (core if karma
allows
it)? or do you want such a feature?Best regards :-).
Hello :-)
I don't see why we would have such a thing into PHP Core.
We are already smooth about the file system accesses with a realpath
cache,
and users may use different pecl ext if they want to take hand on a lib
such as inotify.Well ok, forget PHP core, but an extension would be great.
At least for inotify there is an extension, which works quite fine. Never
searched something similar for other OSs.
I have written: “On Linux, we have inotify (available in PHP through
pecl/inotify)”, so yup, I know for inotify :-). I propose to gather all
these API and give a proper one to the end-user.
--
Ivan Enderlin
Developer of Hoa
http://hoa-project.net/
PhD. student at DISC/Femto-ST (Vesontio) and INRIA (Cassis)
http://disc.univ-fcomte.fr/ and http://www.inria.fr/
Member of HTML and WebApps Working Group of W3C
http://w3.org/
2013/2/14 Ivan Enderlin @ Hoa ivan.enderlin@hoa-project.net:
I have written: “On Linux, we have inotify (available in PHP through
pecl/inotify)”, so yup, I know for inotify :-). I propose to gather all
these API and give a proper one to the end-user.
If you are doing so, I would suggest you to create this as a C
library, that way you could bring that feature to any
applications/languages and you would only have to create a bridge as a
PECL extension.
On Thu, Feb 14, 2013 at 5:00 PM, Patrick ALLAERT patrickallaert@php.netwrote:
2013/2/14 Ivan Enderlin @ Hoa ivan.enderlin@hoa-project.net:
I have written: “On Linux, we have inotify (available in PHP through
pecl/inotify)”, so yup, I know for inotify :-). I propose to gather all
these API and give a proper one to the end-user.If you are doing so, I would suggest you to create this as a C
library, that way you could bring that feature to any
applications/languages and you would only have to create a bridge as a
PECL extension.
and to carry on from Patrick's point, it would probably be cleaner to do it
this way so your library wouldn't need to work around PHP stuff.
On Thu, Feb 14, 2013 at 5:00 PM, Patrick ALLAERT patrickallaert@php.netwrote:
2013/2/14 Ivan Enderlin @ Hoa ivan.enderlin@hoa-project.net:
I have written: “On Linux, we have inotify (available in PHP through
pecl/inotify)”, so yup, I know for inotify :-). I propose to gather all
these API and give a proper one to the end-user.
If you are doing so, I would suggest you to create this as a C
library, that way you could bring that feature to any
applications/languages and you would only have to create a bridge as a
PECL extension.and to carry on from Patrick's point, it would probably be cleaner to do it
this way so your library wouldn't need to work around PHP stuff.
Actually, I have already considered this approach, but to make a clean
and portable C version, it might be better to use external existing
libraries (e.g. for events). This might create hard dependencies and
could be embarassing for a PECL extension, no?
Thoughts?
--
Ivan Enderlin
Developer of Hoa
http://hoa-project.net/
PhD. student at DISC/Femto-ST (Vesontio) and INRIA (Cassis)
http://disc.univ-fcomte.fr/ and http://www.inria.fr/
Member of HTML and WebApps Working Group of W3C
http://w3.org/
Hi!
A missing feature in PHP is a file system watcher/monitoring available
for almost all platforms. On Linux, we have inotify (available in PHP
through pecl/inotify), on Mac OS X, we have /dev/fsevents (not available
in PHP, since we need ioctl to do that in pure PHP —and sudo—, no C
extension needed), on FreeBSD, we have FAM, and on Windows, we have
FileSystemWatcher in .NET. All major platforms have a solution ready to use.
I think it'd be great to have a library with unified interface and an
extension that uses it. However, I'm not sure if these libraries are
useful in common php use case - short-lived requests. Could I get the
changes since the last request? Or is it useful only for long-running
persistent processes?
Is it possible to have such a feature landing in PHP (core if karma
allows it)? or do you want such a feature?
I'm not sure why it has to be in core though. I don't see so far
anything that requires modifying language core.
--
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227
I think it'd be great to have a library with unified interface and an
extension that uses it. However, I'm not sure if these libraries are
useful in common php use case - short-lived requests. Could I get the
changes since the last request? Or is it useful only for long-running
persistent processes?
You're right of course that you are implicitly lengthening a request.
But if you are already embracing a long-polling model that waits for
filesystem changes, the back-end service can actually use fs events
instead of looping -- much more efficient. In fact I do this already
on Windows by running an external FileSystemWatcher EXE and waiting
for it to return (+ a timeout in the wrapper).
-- S.
hi,
On Thu, Feb 14, 2013 at 10:47 PM, Sanford Whiteman
swhitemanlistens-software@cypressintegrated.com wrote:
I think it'd be great to have a library with unified interface and an
extension that uses it. However, I'm not sure if these libraries are
useful in common php use case - short-lived requests. Could I get the
changes since the last request? Or is it useful only for long-running
persistent processes?You're right of course that you are implicitly lengthening a request.
But if you are already embracing a long-polling model that waits for
filesystem changes, the back-end service can actually use fs events
instead of looping -- much more efficient. In fact I do this already
on Windows by running an external FileSystemWatcher EXE and waiting
for it to return (+ a timeout in the wrapper).
There are native APIs for that (read: non .net, aka C) on Windows,
using an external process for this purpose would be horrible, in all
possible ways.
Cheers,
Pierre
@pierrejoye
There are native APIs for that (read: non .net, aka C) on Windows
Well aware of that. The EXE does use the Win32 API, not a .NET
wrapper. I've used that API ever since it's been documented.
using an external process for this purpose would be horrible, in all
possible ways.
Well, yeah, that's my very point... having the engine/extension do
this is the proper direction (I only use this hack to check completion
of some scheduled tasks, it's all private).
Stas says typical PHP apps don't have a need for file system hooks.
Sure, long-polling may not be good with thread-per-process webservers,
but those aren't the only PHP environments in the wild. Once you
accept that people already roll out long-polling back ends with PHP,
the next step is to minimize the check-sleep-loop hackery and offer
true event-driven alternatives when possible.
Nothing I'm saying is controversial.
-- Sandy
P.S. This was the very extension I was referring to when I posted to
Internals sometime last year about developing extensions, latest
books, etc..
It'd been a longtime fantasy of mine because I use PHP for a lot of
sysadmin-type tasks on Windows servers -- DB import/export, nightly
HTTP and FTP transfers from data feed providers, things like that --
and having this API supported right in PHP would be great (instead of
relying on Windows apps that do use the API but have their own arcane
embedded scripting languages, if they have any at all).
But my C and Win32 are not what they were when I was writing DLLs as
part of my day job, so there's almost zero chance I could do the job.
-- S.
hi Sanford,
On Fri, Feb 15, 2013 at 8:35 AM, Sanford Whiteman
swhitemanlistens-software@cypressintegrated.com wrote:
There are native APIs for that (read: non .net, aka C) on Windows
Well aware of that. The EXE does use the Win32 API, not a .NET
wrapper. I've used that API ever since it's been documented.
Right, but these APIs can and should be used within the extension. I
have a couple private extensions using them.
using an external process for this purpose would be horrible, in all
possible ways.Well, yeah, that's my very point... having the engine/extension do
this is the proper direction (I only use this hack to check completion
of some scheduled tasks, it's all private).Stas says typical PHP apps don't have a need for file system hooks.
Well, I tend to slightly disagree with him here, that's something,
along with a better locking API and another for shared memory (shared,
process or thread) should be available.
Sure, long-polling may not be good with thread-per-process webservers,
but those aren't the only PHP environments in the wild. Once you
accept that people already roll out long-polling back ends with PHP,
the next step is to minimize the check-sleep-loop hackery and offer
true event-driven alternatives when possible.
Events based APIs are already part of the PHP ecosystems. I see no
problem here, even within a request. However there are some technical
issues to solve, APIs and how they should work outside or between
requests.
Nothing I'm saying is controversial.
That's a tech discussion, I do not see controversy here but exchange
of views or arguments, that's how we move forward :)
Cheers,
Pierre
@pierrejoye | http://blog.thepimp.net | http://www.libgd.org
Hi Stas,
Hi!
A missing feature in PHP is a file system watcher/monitoring available
for almost all platforms. On Linux, we have inotify (available in PHP
through pecl/inotify), on Mac OS X, we have /dev/fsevents (not available
in PHP, since we need ioctl to do that in pure PHP —and sudo—, no C
extension needed), on FreeBSD, we have FAM, and on Windows, we have
FileSystemWatcher in .NET. All major platforms have a solution ready to use.
I think it'd be great to have a library with unified interface and an
extension that uses it. However, I'm not sure if these libraries are
useful in common php use case - short-lived requests. Could I get the
changes since the last request? Or is it useful only for long-running
persistent processes?
It is only useful for long-running processes.
For example when you are writting tests: at each modifications, you
would like to re-run or re-generate tests. In this case, you have a
daemon that watches files changes and executes a command when needed.
Another more concrete example is with EventSource [1]. The browser
maintains opened a connection and the server writes on this connection
step-by-step (or… chunk-by-chunk since it uses the chunk feature of
HTTP1.1). It is very useful to develop some “realtime-tools”. I made a
video [2] to illustrate (code is here [3]). This is very naive and not
optimized at all, but this is a short POC to show you an interesting
usecase.
Is it possible to have such a feature landing in PHP (core if karma
allows it)? or do you want such a feature?
I'm not sure why it has to be in core though. I don't see so far
anything that requires modifying language core.
The core integration was a joke, forget it ;-).
Regards.
[1] http://www.w3.org/TR/eventsource/
[2] https://dl.dropbox.com/u/26317193/Realtime_edition.webm
[3] http://paste.hoa-project.net/9f15189c05ef0961d374fe7e6c70b3b2b27c8b64
--
Ivan Enderlin
Developer of Hoa
http://hoa-project.net/
PhD. student at DISC/Femto-ST (Vesontio) and INRIA (Cassis)
http://disc.univ-fcomte.fr/ and http://www.inria.fr/
Member of HTML and WebApps Working Group of W3C
http://w3.org/
2013/2/15 Ivan Enderlin @ Hoa ivan.enderlin@hoa-project.net
Hi Stas,
Hi!
A missing feature in PHP is a file system watcher/monitoring available
for almost all platforms. On Linux, we have inotify (available in PHP
through pecl/inotify), on Mac OS X, we have /dev/fsevents (not available
in PHP, since we need ioctl to do that in pure PHP —and sudo—, no C
extension needed), on FreeBSD, we have FAM, and on Windows, we have
FileSystemWatcher in .NET. All major platforms have a solution ready to
use.I think it'd be great to have a library with unified interface and an
extension that uses it. However, I'm not sure if these libraries are
useful in common php use case - short-lived requests. Could I get the
changes since the last request? Or is it useful only for long-running
persistent processes?It is only useful for long-running processes.
For example when you are writting tests: at each modifications, you would
like to re-run or re-generate tests. In this case, you have a daemon that
watches files changes and executes a command when needed.
Why do you need PHP for this?
http://stackoverflow.com/questions/3283228/bash-execute-script-on-file-save#answer-3283390
Another more concrete example is with EventSource [1]. The browser
maintains opened a connection and the server writes on this connection
step-by-step (or… chunk-by-chunk since it uses the chunk feature of
HTTP1.1). It is very useful to develop some “realtime-tools”. I made a
video [2] to illustrate (code is here [3]). This is very naive and not
optimized at all, but this is a short POC to show you an interesting
usecase.
Is it possible to have such a feature landing in PHP (core if karma
allows it)? or do you want such a feature?
I'm not sure why it has to be in core though. I don't see so far
anything that requires modifying language core.The core integration was a joke, forget it ;-).
Regards.
[1] http://www.w3.org/TR/**eventsource/http://www.w3.org/TR/eventsource/
[2] https://dl.dropbox.com/u/**26317193/Realtime_edition.webmhttps://dl.dropbox.com/u/26317193/Realtime_edition.webm
[3] http://paste.hoa-project.net/9f15189c05ef0961d374fe7e6c70b3
b2b27c8b64http://paste.hoa-project.net/9f15189c05ef0961d374fe7e6c70b3b2b27c8b64--
Ivan Enderlin
Developer of Hoa
http://hoa-project.net/PhD. student at DISC/Femto-ST (Vesontio) and INRIA (Cassis)
http://disc.univ-fcomte.fr/ and http://www.inria.fr/Member of HTML and WebApps Working Group of W3C
http://w3.org/--
2013/2/15 Ivan Enderlin @ Hoa ivan.enderlin@hoa-project.net
Hi Stas,
Hi!
A missing feature in PHP is a file system watcher/monitoring available
for almost all platforms. On Linux, we have inotify (available in PHP
through pecl/inotify), on Mac OS X, we have /dev/fsevents (not available
in PHP, since we need ioctl to do that in pure PHP —and sudo—, no C
extension needed), on FreeBSD, we have FAM, and on Windows, we have
FileSystemWatcher in .NET. All major platforms have a solution ready to
use.I think it'd be great to have a library with unified interface and an
extension that uses it. However, I'm not sure if these libraries are
useful in common php use case - short-lived requests. Could I get the
changes since the last request? Or is it useful only for long-running
persistent processes?It is only useful for long-running processes.
For example when you are writting tests: at each modifications, you would
like to re-run or re-generate tests. In this case, you have a daemon that
watches files changes and executes a command when needed.Why do you need PHP for this?
http://stackoverflow.com/questions/3283228/bash-execute-script-on-file-save#answer-3283390
I don't understand your point.
--
Ivan Enderlin
Developer of Hoa
http://hoa-project.net/
PhD. student at DISC/Femto-ST (Vesontio) and INRIA (Cassis)
http://disc.univ-fcomte.fr/ and http://www.inria.fr/
Member of HTML and WebApps Working Group of W3C
http://w3.org/
2013/2/15 Ivan Enderlin @ Hoa ivan.enderlin@hoa-project.net
2013/2/15 Ivan Enderlin @ Hoa <ivan.enderlin@hoa-project.net**>
Hi Stas,
Hi!
A missing feature in PHP is a file system watcher/monitoring available
for almost all platforms. On Linux, we have inotify (available in PHP
through pecl/inotify), on Mac OS X, we have /dev/fsevents (not
available
in PHP, since we need ioctl to do that in pure PHP —and sudo—, no C
extension needed), on FreeBSD, we have FAM, and on Windows, we have
FileSystemWatcher in .NET. All major platforms have a solution ready to
use.I think it'd be great to have a library with unified interface and an
extension that uses it. However, I'm not sure if these libraries are
useful in common php use case - short-lived requests. Could I get the
changes since the last request? Or is it useful only for long-running
persistent processes?It is only useful for long-running processes.
For example when you are writting tests: at each modifications, you would
like to re-run or re-generate tests. In this case, you have a daemon that
watches files changes and executes a command when needed.Why do you need PHP for this?
http://stackoverflow.com/questions/3283228/bash-
execute-script-on-file-save#**answer-3283390http://stackoverflow.com/questions/3283228/bash-execute-script-on-file-save#answer-3283390I don't understand your point.
For the use-case you described here a PHP-implementation is not required,
because you can use the system-tools to invoke PHPUnit. In fact you don't
need a daemon at all ;)
--
Ivan Enderlin
Developer of Hoa
http://hoa-project.net/PhD. student at DISC/Femto-ST (Vesontio) and INRIA (Cassis)
http://disc.univ-fcomte.fr/ and http://www.inria.fr/Member of HTML and WebApps Working Group of W3C
http://w3.org/--
2013/2/15 Ivan Enderlin @ Hoa ivan.enderlin@hoa-project.net
2013/2/15 Ivan Enderlin @ Hoa <ivan.enderlin@hoa-project.net**>
Hi Stas,
Hi!
A missing feature in PHP is a file system watcher/monitoring available
for almost all platforms. On Linux, we have inotify (available in PHP
through pecl/inotify), on Mac OS X, we have /dev/fsevents (not
available
in PHP, since we need ioctl to do that in pure PHP —and sudo—, no C
extension needed), on FreeBSD, we have FAM, and on Windows, we have
FileSystemWatcher in .NET. All major platforms have a solution ready to
use.I think it'd be great to have a library with unified interface and an
extension that uses it. However, I'm not sure if these libraries are
useful in common php use case - short-lived requests. Could I get the
changes since the last request? Or is it useful only for long-running
persistent processes?It is only useful for long-running processes.
For example when you are writting tests: at each modifications, you would
like to re-run or re-generate tests. In this case, you have a daemon that
watches files changes and executes a command when needed.Why do you need PHP for this?
http://stackoverflow.com/questions/3283228/bash-
execute-script-on-file-save#**answer-3283390http://stackoverflow.com/questions/3283228/bash-execute-script-on-file-save#answer-3283390I don't understand your point.
For the use-case you described here a PHP-implementation is not required,
because you can use the system-tools to invoke PHPUnit. In fact you don't
need a daemon at all ;)
It is an example :-). I could reply: why do you need need PHPUnit, there
is so much other tools ;-).
Well, you get the point. These is a lot of applications.
--
Ivan Enderlin
Developer of Hoa
http://hoa-project.net/
PhD. student at DISC/Femto-ST (Vesontio) and INRIA (Cassis)
http://disc.univ-fcomte.fr/ and http://www.inria.fr/
Member of HTML and WebApps Working Group of W3C
http://w3.org/