CGI for RunRev 4.5

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
ale870
Posts: 250
Joined: Tue Apr 22, 2008 9:17 am
Contact:

CGI for RunRev 4.5

Post by ale870 » Tue Apr 06, 2010 8:55 am

Hello,
anyone has good news about CGI with RunRev 4.5?
I found that CGI "-ui" does not work any more with versions more than 3.5

I tried with 4.5 but... no success. Anyone knows something more about it?

Thank you!
Runtime Revolution Widgets, tutorials, tips & tricks and more!
http://runrevwidgets.com/wiki

RRobert
Posts: 151
Joined: Sat Feb 28, 2009 8:20 pm

Re: CGI for RunRev 4.5

Post by RRobert » Tue Apr 06, 2010 10:17 am

It works.

demo.rev

Code: Select all

on startup
    send "quit" to me in 10 seconds 
    wait 10 milliseconds
    
    put "Content-Type: text/plain" & cr & cr
    put "Hello World! :)"
    quit
end startup
1) Compile the application (e.g. Linux)
2) Check your CGI settings (e.g. .htaccess)

Code: Select all

Options +ExecCGI
AddHandler cgi-script cgi
3) Create a CGI wrapper to call your binary with -ui

demo.cgi

Code: Select all

#!demo -ui
Dont forget to change file access permissions under Linux (chmod +x demo.cgi, chmod +x demo).

Robert

Klaus
Posts: 13806
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: CGI for RunRev 4.5

Post by Klaus » Tue Apr 06, 2010 12:31 pm

Officially version 4.5 (maybe even 4.0, I'm not sure) cannot be run as a (faceless) CGI engine anymore!
Simply because a new server-side engine "ON-REV" is currently being developed!

But Robert obviously works with a funny trick :D

ale870
Posts: 250
Joined: Tue Apr 22, 2008 9:17 am
Contact:

Re: CGI for RunRev 4.5

Post by ale870 » Tue Apr 06, 2010 12:45 pm

Yes, I know that, but I think RunRev company should consider that, for companies, it is not feasible using online On-Rev (as in my case).
Runtime Revolution Widgets, tutorials, tips & tricks and more!
http://runrevwidgets.com/wiki

Klaus
Posts: 13806
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: CGI for RunRev 4.5

Post by Klaus » Tue Apr 06, 2010 1:01 pm

The new ON-REV server-side engine is currently still in BETA and will of course be availalbe for the public once it is finished!
But I have no idea about pricing, if there is any.

On the other hand, what features are you missing with CGI engine 3.5?

ale870
Posts: 250
Joined: Tue Apr 22, 2008 9:17 am
Contact:

Re: CGI for RunRev 4.5

Post by ale870 » Tue Apr 06, 2010 1:07 pm

One question: do you think that I will be able to buy On-Rev server to install it in the company where I work for?
Do you think the price could justify some free or open source alternatives (like Apache, PHP, Python, etc...).
If I have a consolidated server, I like to write CGI in RunRev, but I cannot ask to the company XYZ to spend a lot of money to use a server that I use only to program in RunRev. They simply say: "learn PHP!".

About RunRev 3.5: I cannot imagine to develop long-term jobs using a language that will not be updated any more. So the problem is not the gap 3.5->4.5, but 3.5->....<all future versions>!!
Runtime Revolution Widgets, tutorials, tips & tricks and more!
http://runrevwidgets.com/wiki

Klaus
Posts: 13806
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: CGI for RunRev 4.5

Post by Klaus » Tue Apr 06, 2010 1:13 pm

ale870 wrote:One question: do you think that I will be able to buy On-Rev server to install it in the company where I work for?
Yes, sure, once the engine is ready!
ale870 wrote:Do you think the price could justify some free or open source alternatives (like Apache, PHP, Python, etc...).
If I have a consolidated server, I like to write CGI in RunRev, but I cannot ask to the company XYZ to spend a lot of money to use a server that I use only to program in RunRev. They simply say: "learn PHP!".
As I wrote, I have no idea about pricing, but I think they should NOT charge anything for that to be able to compete with free enginines like PHP and to spread REV even more.
ale870 wrote:About RunRev 3.5: I cannot imagine to develop long-term jobs using a language that will not be updated any more. So the problem is not the gap 3.5->4.5, but 3.5->....<all future versions>!!
The new engine will of course be developed in the future, so I think you do not need to worry :D
We still use the old 2.x engine here on our OS X server and we never missed a feature so far.


Best from germany

Klaus

BvG
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1236
Joined: Sat Apr 08, 2006 1:10 pm
Location: Zurich
Contact:

Re: CGI for RunRev 4.5

Post by BvG » Wed Apr 07, 2010 1:50 am

ale870 wrote:About RunRev 3.5: I cannot imagine to develop long-term jobs using a language that will not be updated any more. So the problem is not the gap 3.5->4.5, but 3.5->....<all future versions>!!
Here on the forum, you can let off Steam. But only when you write RunRev directly, then they will be aware that this might be an issue for you, their customer.
Various teststacks and stuff:
http://bjoernke.com

Chat with other RunRev developers:
chat.freenode.net:6666 #livecode

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9802
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: CGI for RunRev 4.5

Post by FourthWorld » Thu Apr 08, 2010 12:32 am

ale870 wrote:About RunRev 3.5: I cannot imagine to develop long-term jobs using a language that will not be updated any more. So the problem is not the gap 3.5->4.5, but 3.5->....<all future versions>!!
As others have already noted, a more powerful free replacement for the current CGI engine is in development.

In the meantime, what specific features from v4.0 or v4.5 do you need to use from a CGI?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

ale870
Posts: 250
Joined: Tue Apr 22, 2008 9:17 am
Contact:

Re: CGI for RunRev 4.5

Post by ale870 » Thu Apr 08, 2010 7:56 am

No particular feature. I was talking for the future.
Thank you!
Runtime Revolution Widgets, tutorials, tips & tricks and more!
http://runrevwidgets.com/wiki

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9802
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: CGI for RunRev 4.5

Post by FourthWorld » Thu Apr 08, 2010 2:03 pm

Hopefully that future will be soon, but in the meantime the v3.5 engine is pretty useful. Most new features in recent versions have been the sorts of things that are useful only in GUI environments, like graphic effects, data grids, etc. But nested arrays are part of v3.5, and of course everything else from earlier versions as well, so I suspect you'll have a good time using it while we wait for an updated server engine.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

RRobert
Posts: 151
Joined: Sat Feb 28, 2009 8:20 pm

Re: CGI for RunRev 4.5

Post by RRobert » Fri Apr 09, 2010 1:24 am

As long as you could build console applications with RunRev you could build CGI applications in the way mentioned above. Even with the 4.0 engine. Where is the problem?

Robert

Ocean
Posts: 16
Joined: Wed May 03, 2006 4:29 am

Re: CGI for RunRev 4.5

Post by Ocean » Mon May 17, 2010 6:50 am

[quote="RRobert"]

Code: Select all

    send "quit" to me in 10 seconds 
    wait 10 milliseconds
What is the purpose of those 2 lines in the CGI?

Would there be any problems if those 2 lines are not present?

RRobert
Posts: 151
Joined: Sat Feb 28, 2009 8:20 pm

Re: CGI for RunRev 4.5

Post by RRobert » Mon May 17, 2010 11:10 am

Code: Select all

 send "quit" to me in 10 seconds 
Quits the script if it runs longer than 10 seconds. So in case something went wrong you could be sure that the engine is not in the memory anymore.
wait 10 milliseconds
I found the line in a Revolution CGI tutorial. You simply provide the engine 10 milliseconds to breath.

Both lines are not mandatory.

Robert
Last edited by RRobert on Mon May 17, 2010 11:15 am, edited 2 times in total.

ale870
Posts: 250
Joined: Tue Apr 22, 2008 9:17 am
Contact:

Re: CGI for RunRev 4.5

Post by ale870 » Mon May 17, 2010 11:13 am

Generally speaking, that instruction is used to allow a "better" multitasking acitivites, for the engine self and other applications (queue management, etc...). In the past that instruction was very useful since Win 95/98 used "cooperative multitasking". In "modern" OS that instruction, generally, is no more required. Sometimes, we insert that since it "helps" the OS to manage other processes/threads.

EDIT: did yoou notice in windows, if you have a long task running, if you click over the application, Windows says "the application is not responding"? Well, introducing that instruction will "help" the OS, for example, to detect application activity.
Runtime Revolution Widgets, tutorials, tips & tricks and more!
http://runrevwidgets.com/wiki

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”