Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #8244

Re: anyone else writing Linux (or cross-system) applications in PHP?

From "Jonathan N. Little" <lws4art@gmail.com>
Newsgroups alt.os.linux, alt.os.linux.ubuntu, comp.lang.php
Subject Re: anyone else writing Linux (or cross-system) applications in PHP?
Date 2013-02-04 11:06 -0500
Organization LITTLE WORKS STUDIO
Message-ID <keom9q$oen$1@dont-email.me> (permalink)
References (2 earlier) <kelfbp01crq@news4.newsguy.com> <kelv1m$226$1@dont-email.me> <kemauj01u23@news1.newsguy.com> <kemc4i$6i6$1@dont-email.me> <kenv7p02tc5@news1.newsguy.com>

Cross-posted to 3 groups.

Show all headers | View raw


crankypuss wrote:
> On 02/03/2013 12:00 PM, Jonathan N. Little wrote:
>> crankypuss wrote:
>>> On 02/03/2013 08:17 AM, Jonathan N. Little wrote:
>>
>> <snip>
>>
>>>> I don't think so. Since its original name was "Personal Home Page
>>>> Tools"
>>>> for scripts to facilitate created personal webpages on a server speaks
>>>> to its origins. How an application interacts in with the user from a
>>>> webserver is very different from that of a desktop application.
>>>
>>> It's okay if we disagree on this, you're allowed to be incorrect. <G>
>>
>> Not sure even if a smile can change history though.
>>
>>>
>>> As for how users interact with applications, if you think it's different
>>> on the web vs on the desktop, I would claim that you haven't finished
>>> generalizing your view of it.  In either case the application presents
>>> something, the user responds, rinse-and-repeat.  The main difference
>>> between a web-app and a desktop-app is the level of precision provided
>>> by the interface and the amount of latency.  I've built web-apps that
>>> run equally well on the desktop.  If you aren't aware of it, there is
>>> (or, was) a guy in the Windows world who sells a shareware product to
>>> facilitate writing desktop applications in PHP.
>>
>> But how it "runs" is different. A desktop app starts and has a message
>> loop that checks for user interaction. Responds and continues until
>> either program, user, or system terminates the processes. With the web
>> the php script receives its input via the web server, script runs and
>> does its stuff, creates the web page and terminates.
>>
>
> I guess you never worked much with state-driven applications, not
> everyone has.  What we think of as a "desktop app" just sits there with
> its state-data in memory, and a "web app" reloads its state-data when
> another request comes in from the same user.  Once the state data is
> re-established the internal processing is basically the same except for
> what subroutines are used to draw the "screen".  In fact a "desktop app"
> doesn't keep its state-data in memory except conceptually unless the
> system is so lightly loaded that there's no thread-switching or swapping
> going on.  Conceptually it generalizes to pretty much the same thing in
> either case.
>
> The "message loop" you speak of really isn't any different between a
> web-app and a desktop-app.  For a desktop-app it looks like this,

Well sort of, where the web app has a web server in between and the 
desktop has the OS,

>
> 1. application is entered on initiation
> 2. application presents initial display
> 4. application waits for input and is swapped out
> 5. user does something to cause an interrupt
> 6. application gets rescheduled as ready-to-run, swapped in
> 7. application scratches head, presents output
> 8. application goes back to (4) and gets "swapped out" again
>
> For a web-app it looks like this,
>
> 1. server starts up and eventually reaches idle state
> 2. a message comes in (analogous to 5 above)
> 3. application's state data gets reloaded as it's "swapped in"
> 4. application scratches head, presents output
> 5. application gets swapped out (state saved)
>

However with the desktop app it keeps running with a pid to the 
instance, the web app does not. To keep continuity with a web app you 
need to employ session mechanism. It need some sort of a login and 
logout or it gets quite complicated with DBs and files. A simple example:

Application updated a simple file from user:

Desktop
1. App launches get pid
2. Locks file.
3. Reads file.
4. Displays file.
5. Waits for user input.
6. Writes updated file.
7. Removes lock
8. Program exits and pid is destroyed

Web:
1. Session created with user login
2) Web server calls script
    locks file*
    reads it
    displays it
    script ends
3) Web server waits for next request.
    check session if same user goto 4 else 2
4) Get user edits
    write file
    remove lock*
    script ends
5) User logout to remove session

*With a web app you would not lock the file from step 2-4 because if the 
user left (close the browser, whatever) the session does not 
automatically get destroyed the the desktop pid to run a cleanup to 
unlock the file and such. You can have a session expire to auto logout 
and such but it is not the same at all. With a desktop app it is real 
easy to to insure only one instance, not so nor often desirable for web.


> It's pretty much the same thing, except that some websites don't do
> squat about saving state-data for an individual user.  Some use PHP
> "session" stuff to do that, where a session identifier is a token coming
> in on each http request that allows that user's state-data to be
> reloaded for the request.

To emulate what happens in the desktop environment on the web is not so 
easy.

> The loop is basically the same except that its "top" gets rolled around
> to the middle and given a different name.  For a desktop-app the "top"
> is the guy hitting the enter key or clicking the mouse or whatever,
> that's the top of the "message loop".  For a web-app the browser
> recognizes a link-click and sends an http request.  It's the same thing
> unless you get fixated on the details to the point where you can't see
> the forest.  Look an X Windows application in enough detail and you'll
> see the same basic process with a different protocol used between the
> client and the server.  Steak or hamburger, it's all beef.
>


-- 
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com

Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

anyone else writing Linux (or cross-system) applications in PHP? crankypuss <noemail@noemail.invalid> - 2013-02-02 13:27 -0700
  Re: anyone else writing Linux (or cross-system) applications in PHP? DanS <t.h.i.s.n.t.h.a.t@r.o.a.d.r.u.n.n.e.r.c.o.m> - 2013-02-02 14:57 -0600
    Re: anyone else writing Linux (or cross-system) applications in PHP? crankypuss <noemail@noemail.invalid> - 2013-02-03 03:45 -0700
      Re: anyone else writing Linux (or cross-system) applications in PHP? DanS <t.h.i.s.n.t.h.a.t@r.o.a.d.r.u.n.n.e.r.c.o.m> - 2013-02-03 06:00 -0600
  Re: anyone else writing Linux (or cross-system) applications in PHP? "Jonathan N. Little" <lws4art@gmail.com> - 2013-02-02 16:27 -0500
    Re: anyone else writing Linux (or cross-system) applications in PHP? crankypuss <noemail@noemail.invalid> - 2013-02-03 03:49 -0700
      Re: anyone else writing Linux (or cross-system) applications in PHP? The Natural Philosopher <tnp@invalid.invalid> - 2013-02-03 11:00 +0000
      Re: anyone else writing Linux (or cross-system) applications in PHP? "Jonathan N. Little" <lws4art@gmail.com> - 2013-02-03 10:17 -0500
        Re: anyone else writing Linux (or cross-system) applications in PHP? crankypuss <noemail@noemail.invalid> - 2013-02-03 11:40 -0700
          Re: anyone else writing Linux (or cross-system) applications in PHP? "Jonathan N. Little" <lws4art@gmail.com> - 2013-02-03 14:00 -0500
            Re: anyone else writing Linux (or cross-system) applications in PHP? Richard Yates <richard@yatesguitar.com> - 2013-02-03 13:56 -0800
            Re: anyone else writing Linux (or cross-system) applications in PHP? Martin <no@spam.invalid> - 2013-02-04 01:53 +0100
              Re: anyone else writing Linux (or cross-system) applications in PHP? The Natural Philosopher <tnp@invalid.invalid> - 2013-02-04 02:40 +0000
              Re: anyone else writing Linux (or cross-system) applications in PHP? Tim Streater <timstreater@greenbee.net> - 2013-02-04 09:14 +0000
            Re: anyone else writing Linux (or cross-system) applications in PHP? crankypuss <noemail@noemail.invalid> - 2013-02-04 02:32 -0700
              Re: anyone else writing Linux (or cross-system) applications in PHP? "Jonathan N. Little" <lws4art@gmail.com> - 2013-02-04 11:06 -0500
                Re: anyone else writing Linux (or cross-system) applications in PHP? crankypuss <noemail@noemail.invalid> - 2013-02-04 09:15 -0700
                Re: anyone else writing Linux (or cross-system) applications in PHP? The Natural Philosopher <tnp@invalid.invalid> - 2013-02-04 16:24 +0000
                Re: anyone else writing Linux (or cross-system) applications in PHP? "Jonathan N. Little" <lws4art@gmail.com> - 2013-02-04 11:35 -0500
                Re: anyone else writing Linux (or cross-system) applications in PHP? crankypuss <noemail@noemail.invalid> - 2013-02-05 02:22 -0700
                Re: anyone else writing Linux (or cross-system) applications in PHP? The Natural Philosopher <tnp@invalid.invalid> - 2013-02-05 12:16 +0000
                Re: anyone else writing Linux (or cross-system) applications in PHP? crankypuss <noemail@noemail.invalid> - 2013-02-05 11:49 -0700
                Re: anyone else writing Linux (or cross-system) applications in PHP? The Natural Philosopher <tnp@invalid.invalid> - 2013-02-05 21:22 +0000
                Re: anyone else writing Linux (or cross-system) applications in PHP? J G Miller <miller@yoyo.ORG> - 2013-02-04 16:38 +0000
                Re: anyone else writing Linux (or cross-system) applications in   PHP? "M. Strobel" <sorry_no_mail_here@nowhere.dee> - 2013-02-04 17:41 +0100
                Re: anyone else writing Linux (or cross-system) applications in   PHP? The Natural Philosopher <tnp@invalid.invalid> - 2013-02-04 16:58 +0000
                Re: anyone else writing Linux (or cross-system) applications in PHP? crankypuss <noemail@noemail.invalid> - 2013-02-05 02:21 -0700
                Re: anyone else writing Linux (or cross-system) applications in PHP? The Natural Philosopher <tnp@invalid.invalid> - 2013-02-05 12:15 +0000
                Re: anyone else writing Linux (or cross-system) applications in PHP? crankypuss <noemail@noemail.invalid> - 2013-02-05 11:52 -0700
                Re: anyone else writing Linux (or cross-system) applications in PHP? The Natural Philosopher <tnp@invalid.invalid> - 2013-02-05 21:23 +0000
                Re: anyone else writing Linux (or cross-system) applications in PHP? Jasen Betts <jasen@xnet.co.nz> - 2013-02-05 06:00 +0000
              Re: anyone else writing Linux (or cross-system) applications in PHP? Arno Welzel <usenet@arnowelzel.de> - 2013-02-05 13:49 +0100
                Re: anyone else writing Linux (or cross-system) applications in PHP? Jerry Stuckle <jstucklex@attglobal.net> - 2013-02-05 08:22 -0500
                Re: anyone else writing Linux (or cross-system) applications in PHP? "Cybe R. Wizard" <cybe_r_wizard@wizardstower> - 2013-02-05 08:50 -0600
      Re: anyone else writing Linux (or cross-system) applications in PHP? Arno Welzel <usenet@arnowelzel.de> - 2013-02-04 08:40 +0100
        Re: anyone else writing Linux (or cross-system) applications in PHP? crankypuss <noemail@noemail.invalid> - 2013-02-04 02:49 -0700
  Re: anyone else writing Linux (or cross-system) applications in PHP? Robert Heller <heller@deepsoft.com> - 2013-02-02 15:43 -0600
    Re: anyone else writing Linux (or cross-system) applications in PHP? crankypuss <noemail@noemail.invalid> - 2013-02-03 03:57 -0700
  Re: anyone else writing Linux (or cross-system) applications in PHP? "Keith D. Lee" <keithdlee2012@gmail.com> - 2013-02-02 22:20 +0000
    Re: anyone else writing Linux (or cross-system) applications in PHP? crankypuss <noemail@noemail.invalid> - 2013-02-03 04:13 -0700
      Re: anyone else writing Linux (or cross-system) applications in PHP? Jasen Betts <jasen@xnet.co.nz> - 2013-02-04 12:23 +0000
        Re: anyone else writing Linux (or cross-system) applications in PHP? crankypuss <noemail@noemail.invalid> - 2013-02-04 08:57 -0700
          Re: anyone else writing Linux (or cross-system) applications in PHP? Arno Welzel <usenet@arnowelzel.de> - 2013-02-05 14:04 +0100
      Re: anyone else writing Linux (or cross-system) applications in PHP? Arno Welzel <usenet@arnowelzel.de> - 2013-02-05 13:59 +0100
  Re: anyone else writing Linux (or cross-system) applications in PHP? "M. Strobel" <sorry_no_mail_here@nowhere.dee> - 2013-02-03 10:58 +0100
    Re: anyone else writing Linux (or cross-system) applications in PHP? crankypuss <noemail@noemail.invalid> - 2013-02-03 04:20 -0700
      Re: anyone else writing Linux (or cross-system) applications in PHP? "J.O. Aho" <user@example.net> - 2013-02-03 12:44 +0100
        Re: anyone else writing Linux (or cross-system) applications in PHP? The Natural Philosopher <tnp@invalid.invalid> - 2013-02-03 11:50 +0000
          Re: anyone else writing Linux (or cross-system) applications in PHP? "J.O. Aho" <user@example.net> - 2013-02-03 13:47 +0100
            Re: anyone else writing Linux (or cross-system) applications in PHP? The Natural Philosopher <tnp@invalid.invalid> - 2013-02-03 13:23 +0000
            Re: anyone else writing Linux (or cross-system) applications in PHP? Jasen Betts <jasen@xnet.co.nz> - 2013-02-04 11:32 +0000
          Re: anyone else writing Linux (or cross-system) applications in PHP? crankypuss <noemail@noemail.invalid> - 2013-02-03 11:43 -0700
    Re: anyone else writing Linux (or cross-system) applications in PHP? J G Miller <miller@yoyo.ORG> - 2013-02-03 13:08 +0000
      Re: anyone else writing Linux (or cross-system) applications in   PHP? "M. Strobel" <sorry_no_mail_here@nowhere.dee> - 2013-02-03 14:49 +0100
        Re: anyone else writing Linux (or cross-system) applications in  PHP? John Hasler <jhasler@newsguy.com> - 2013-02-03 08:16 -0600
          Re: anyone else writing Linux (or cross-system) applications in  PHP? Richard Kettlewell <rjk@greenend.org.uk> - 2013-02-03 15:28 +0000
            Re: anyone else writing Linux (or cross-system) applications in  PHP? John Hasler <jhasler@newsguy.com> - 2013-02-03 09:39 -0600
          Re: anyone else writing Linux (or cross-system) applications in  PHP? "M. Strobel" <sorry_no_mail_here@nowhere.dee> - 2013-02-03 17:50 +0100
            Re: anyone else writing Linux (or cross-system) applications in  PHP? John Hasler <jhasler@newsguy.com> - 2013-02-03 11:24 -0600
              Re: anyone else writing Linux (or cross-system) applications in  PHP? J G Miller <miller@yoyo.ORG> - 2013-02-03 19:25 +0000
                Re: anyone else writing Linux (or cross-system) applications in  PHP? Richard Kettlewell <rjk@greenend.org.uk> - 2013-02-03 20:25 +0000
                Re: anyone else writing Linux (or cross-system) applications in  PHP? J G Miller <miller@yoyo.ORG> - 2013-02-03 21:47 +0000
                Re: anyone else writing Linux (or cross-system) applications in  PHP? John Hasler <jhasler@newsguy.com> - 2013-02-03 16:32 -0600
                Re: anyone else writing Linux (or cross-system) applications in  PHP? The Natural Philosopher <tnp@invalid.invalid> - 2013-02-03 22:59 +0000
                Re: anyone else writing Linux (or cross-system) applications in  PHP? J G Miller <miller@yoyo.ORG> - 2013-02-04 00:21 +0000
                Re: anyone else writing Linux (or cross-system) applications in  PHP? Jasen Betts <jasen@xnet.co.nz> - 2013-02-04 11:46 +0000
                Re: anyone else writing Linux (or cross-system) applications in  PHP? Richard Kettlewell <rjk@greenend.org.uk> - 2013-02-03 23:13 +0000
                Re: anyone else writing Linux (or cross-system) applications in    PHP? "M. Strobel" <sorry_no_mail_here@nowhere.dee> - 2013-02-04 17:21 +0100
                Re: anyone else writing Linux (or cross-system) applications in    PHP? The Natural Philosopher <tnp@invalid.invalid> - 2013-02-04 16:28 +0000
                Re: anyone else writing Linux (or cross-system) applications in  PHP? John Hasler <jhasler@newsguy.com> - 2013-02-03 14:26 -0600
        Re: anyone else writing Linux (or cross-system) applications in   PHP? Jasen Betts <jasen@xnet.co.nz> - 2013-02-04 11:37 +0000
  Re: anyone else writing Linux (or cross-system) applications in PHP? Tim Streater <timstreater@greenbee.net> - 2013-02-03 13:17 +0000
  Re: anyone else writing Linux (or cross-system) applications in PHP? Arno Welzel <usenet@arnowelzel.de> - 2013-02-04 08:38 +0100
    Re: anyone else writing Linux (or cross-system) applications in PHP? Tim Streater <timstreater@greenbee.net> - 2013-02-04 09:04 +0000
      Re: anyone else writing Linux (or cross-system) applications in PHP? Arno Welzel <usenet@arnowelzel.de> - 2013-02-04 10:29 +0100
        Re: anyone else writing Linux (or cross-system) applications in PHP? Tim Streater <timstreater@greenbee.net> - 2013-02-04 09:34 +0000
          Re: anyone else writing Linux (or cross-system) applications in PHP? crankypuss <noemail@noemail.invalid> - 2013-02-04 03:06 -0700
        Re: anyone else writing Linux (or cross-system) applications in PHP? crankypuss <noemail@noemail.invalid> - 2013-02-04 03:01 -0700
        Re: anyone else writing Linux (or cross-system) applications in PHP? crankypuss <noemail@noemail.invalid> - 2013-02-04 09:08 -0700
          Re: anyone else writing Linux (or cross-system) applications in PHP? "M. Strobel" <sorry_no_mail_here@nowhere.dee> - 2013-02-04 17:34 +0100
          Re: anyone else writing Linux (or cross-system) applications in PHP? J G Miller <miller@yoyo.ORG> - 2013-02-04 16:44 +0000
            Re: anyone else writing Linux (or cross-system) applications in PHP? crankypuss <noemail@noemail.invalid> - 2013-02-05 02:36 -0700
              Re: anyone else writing Linux (or cross-system) applications in PHP? Michael Vilain <vilain@NOspamcop.net> - 2013-02-05 01:49 -0800
              Re: anyone else writing Linux (or cross-system) applications in PHP? J G Miller <miller@yoyo.ORG> - 2013-02-05 15:03 +0000
                Re: anyone else writing Linux (or cross-system) applications in PHP? crankypuss <noemail@noemail.invalid> - 2013-02-05 12:07 -0700
                Re: anyone else writing Linux (or cross-system) applications in PHP? J G Miller <miller@yoyo.ORG> - 2013-02-05 20:22 +0000
                Re: anyone else writing Linux (or cross-system) applications in PHP? Jasen Betts <jasen@xnet.co.nz> - 2013-02-05 22:27 +0000
                Re: anyone else writing Linux (or cross-system) applications in PHP? J G Miller <miller@yoyo.ORG> - 2013-02-06 00:06 +0000
                Re: anyone else writing Linux (or cross-system) applications in PHP? crankypuss <noemail@noemail.invalid> - 2013-02-06 04:32 -0700
                Re: anyone else writing Linux (or cross-system) applications in PHP? Richard Kettlewell <rjk@greenend.org.uk> - 2013-02-06 11:50 +0000
                Re: anyone else writing Linux (or cross-system) applications in PHP? crankypuss <noemail@noemail.invalid> - 2013-02-06 04:22 -0700
                Re: anyone else writing Linux (or cross-system) applications in PHP? J G Miller <miller@yoyo.ORG> - 2013-02-06 15:37 +0000
                Re: anyone else writing Linux (or cross-system) applications in PHP? Jasen Betts <jasen@xnet.co.nz> - 2013-02-05 22:13 +0000
                Re: anyone else writing Linux (or cross-system) applications in PHP? Richard Kettlewell <rjk@greenend.org.uk> - 2013-02-05 23:38 +0000
          Re: anyone else writing Linux (or cross-system) applications in PHP? crankypuss <noemail@noemail.invalid> - 2013-02-05 02:26 -0700
            Re: anyone else writing Linux (or cross-system) applications in PHP? Tim Streater <timstreater@greenbee.net> - 2013-02-05 10:31 +0000
              Re: anyone else writing Linux (or cross-system) applications in PHP? Arno Welzel <usenet@arnowelzel.de> - 2013-02-05 13:41 +0100
                Re: anyone else writing Linux (or cross-system) applications in PHP? Tim Streater <timstreater@greenbee.net> - 2013-02-05 12:56 +0000
                Re: anyone else writing Linux (or cross-system) applications in PHP? Arno Welzel <usenet@arnowelzel.de> - 2013-02-05 14:08 +0100
                Re: anyone else writing Linux (or cross-system) applications in PHP? crankypuss <noemail@noemail.invalid> - 2013-02-05 12:24 -0700
                Re: anyone else writing Linux (or cross-system) applications in PHP? J G Miller <miller@yoyo.ORG> - 2013-02-05 20:14 +0000
                Re: anyone else writing Linux (or cross-system) applications in PHP? Aragorn <stryder@telenet.be.invalid> - 2013-02-06 06:27 +0100
                Re: anyone else writing Linux (or cross-system) applications in PHP? DanS <t.h.i.s.n.t.h.a.t@r.o.a.d.r.u.n.n.e.r.c.o.m> - 2013-02-06 19:48 -0600
                Re: anyone else writing Linux (or cross-system) applications in PHP? "Cybe R. Wizard" <cybe_r_wizard@wizardstower> - 2013-02-06 22:44 -0600
                Re: anyone else writing Linux (or cross-system) applications in PHP? GooseMan <TheGoose@gonnagiveittothegander.org> - 2013-02-06 21:38 -0800
                Re: anyone else writing Linux (or cross-system) applications in PHP? Arno Welzel <usenet@arnowelzel.de> - 2013-02-07 15:13 +0100
                Re: anyone else writing Linux (or cross-system) applications in PHP? DanS <t.h.i.s.n.t.h.a.t@r.o.a.d.r.u.n.n.e.r.c.o.m> - 2013-02-10 08:09 -0600
                Re: anyone else writing Linux (or cross-system) applications in PHP? crankypuss <noemail@noemail.invalid> - 2013-02-05 12:10 -0700
            Re: anyone else writing Linux (or cross-system) applications in PHP? Jasen Betts <jasen@xnet.co.nz> - 2013-02-05 21:51 +0000
              Re: anyone else writing Linux (or cross-system) applications in PHP? The Natural Philosopher <tnp@invalid.invalid> - 2013-02-05 22:32 +0000
            Re: anyone else writing Linux (or cross-system) applications in PHP? Meeh <meeh@i2pmail.org> - 2013-02-05 17:51 +0100
    Re: anyone else writing Linux (or cross-system) applications in PHP? crankypuss <noemail@noemail.invalid> - 2013-02-04 02:55 -0700
      Re: anyone else writing Linux (or cross-system) applications in PHP? Arno Welzel <usenet@arnowelzel.de> - 2013-02-05 13:42 +0100
        Re: anyone else writing Linux (or cross-system) applications in PHP? crankypuss <noemail@noemail.invalid> - 2013-02-05 12:28 -0700
          Re: anyone else writing Linux (or cross-system) applications in PHP? Arno Welzel <usenet@arnowelzel.de> - 2013-02-09 20:58 +0100

csiph-web