Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:65871 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 19838 invoked from network); 15 Feb 2013 13:21:18 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Feb 2013 13:21:18 -0000 Authentication-Results: pb1.pair.com smtp.mail=krebs.seb@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=krebs.seb@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.181 as permitted sender) X-PHP-List-Original-Sender: krebs.seb@gmail.com X-Host-Fingerprint: 209.85.212.181 mail-wi0-f181.google.com Received: from [209.85.212.181] ([209.85.212.181:36255] helo=mail-wi0-f181.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 35/42-06160-C463E115 for ; Fri, 15 Feb 2013 08:21:16 -0500 Received: by mail-wi0-f181.google.com with SMTP id hm6so1142459wib.14 for ; Fri, 15 Feb 2013 05:21:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=RpPixHOyBSLZ5952XeEb6jyUQKDmJsBdxqATjGSqrws=; b=bxgZ/CY522Ml8/rtWYoi+lDFZUg1H3zoSauAhXm2/BoYvYSJQfIcO481rcSQt/jO0J R4HiPdwnbg8+HCpIhGa8jCixPcFL1qx2I2ikhoJy4l6PoM3ZQab1kCs4UGhwL9VzlLNZ Z07BHJmsAPEDy3oEOj3VsPI2RV7GUyyYzvRxuVhMdchHZwdF0x+YUsD8Wma5n4c0/m75 7vbGHrFMfV/5/Gncw3Apl8Nmgl1iMDLnE7Q3tP2Msj0+OCY0NZ8PjofPvbD4BXXTpiXe Samv76/10HrOg/dAy7WQ9EpUqehkKMMN8Mb6YLkHUvI1gFqI/S/BGH4cIPs8Gmn29AKU vWTg== X-Received: by 10.194.238.226 with SMTP id vn2mr4184157wjc.23.1360934473483; Fri, 15 Feb 2013 05:21:13 -0800 (PST) MIME-Version: 1.0 Received: by 10.217.50.137 with HTTP; Fri, 15 Feb 2013 05:20:53 -0800 (PST) In-Reply-To: <511E3305.2020506@hoa-project.net> References: <511CEEB1.7040303@hoa-project.net> <511D5924.4070602@sugarcrm.com> <511E3305.2020506@hoa-project.net> Date: Fri, 15 Feb 2013 14:20:53 +0100 Message-ID: To: "ivan.enderlin@hoa-project.net" Cc: PHP internals list Content-Type: multipart/alternative; boundary=089e01493c98dac74204d5c33f1c Subject: Re: [PHP-DEV] File system watcher/monitoring From: krebs.seb@gmail.com (Sebastian Krebs) --089e01493c98dac74204d5c33f1c Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable 2013/2/15 Ivan Enderlin @ Hoa > Hi Stas, > > > On 14/02/13 22:37, Stas Malyshev wrote: > >> 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 availabl= e >>> in PHP, since we need ioctl to do that in pure PHP =97and sudo=97, 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=85 chunk-by-chunk since it uses the chunk feature of > HTTP1.1). It is very useful to develop some =93realtime-tools=94. 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/**9f15189c05ef0961d374fe7e6c70b3** > b2b27c8b64 > > > -- > 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/ > > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --=20 github.com/KingCrunch --089e01493c98dac74204d5c33f1c--