Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:65828 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 49797 invoked from network); 14 Feb 2013 14:50:23 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Feb 2013 14:50:23 -0000 Authentication-Results: pb1.pair.com smtp.mail=ivan.enderlin@hoa-project.net; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=ivan.enderlin@hoa-project.net; sender-id=unknown Received-SPF: error (pb1.pair.com: domain hoa-project.net from 95.130.12.24 cause and error) X-PHP-List-Original-Sender: ivan.enderlin@hoa-project.net X-Host-Fingerprint: 95.130.12.24 host1.trois-doubles.net Linux 2.6 Received: from [95.130.12.24] ([95.130.12.24:48684] helo=host1.trois-doubles.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 1E/8A-13268-CA9FC115 for ; Thu, 14 Feb 2013 09:50:22 -0500 Received: from Hwhost2.local (unknown [194.57.88.213]) by host1.trois-doubles.net (Postfix) with ESMTPSA id 9003420ADC3 for ; Thu, 14 Feb 2013 15:50:17 +0100 (CET) Message-ID: <511CF9A9.4030205@hoa-project.net> Date: Thu, 14 Feb 2013 15:50:17 +0100 Reply-To: ivan.enderlin@hoa-project.net User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:20.0) Gecko/20100101 Thunderbird/20.0a2 MIME-Version: 1.0 To: internals@lists.php.net References: <511CEEB1.7040303@hoa-project.net> <511CF6D2.5050108@hoa-project.net> In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] File system watcher/monitoring From: ivan.enderlin@hoa-project.net ("Ivan Enderlin @ Hoa") Hi Sebastian, On 14/02/13 15:40, Sebastian Krebs wrote: > 2013/2/14 Ivan Enderlin @ Hoa > >> Hello Julien, >> >> >> On 14/02/13 15:29, Julien Pauli wrote: >> >>> 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 availab= le >>>> for >>>> almost all platforms. On Linux, we have inotify (available in PHP th= rough >>>> pecl/inotify), on Mac OS X, we have /dev/fsevents (not available in = PHP, >>>> since we need ioctl to do that in pure PHP =97and sudo=97, no C exte= nsion >>>> 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 (th= anks >>>> to RecursiveIteratorIterator and DirectoryIterator in SPL) that runs= >>>> every >>>> n seconds and compute a diff with the previous run. This solution wo= rks >>>> 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 l= ib >>> 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. Nev= er > searched something similar for other OSs. I have written: =93On Linux, we have inotify (available in PHP through=20 pecl/inotify)=94, so yup, I know for inotify :-). I propose to gather all= =20 these API and give a proper one to the end-user. --=20 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/