Re: LC Script in PHP File

2014-11-25 Thread Andre Garzia
Peter,

Most PHP installations will not allow file_get_contents() to be run on
localhost to prevent infinite loops. I've been hurt by that before.

cheers


On Sun, Nov 23, 2014 at 5:09 AM, Peter W A Wood peterwaw...@gmail.com
wrote:

 You should be able to use file_get_contents in PHP to do what you want.
 Though it will take longer to get the results from LiveCode than it would
 from PHP.

 Here is an example:

 PHP file:
 !DOCTYPE html
 html
 head
 meta http-equiv=content-type
 content=text/html;charset=utf-8 /
 titleTesting Getting Results From Website/title
 /head
 body
 p
   ?php
 $livecode_returned = file_get_contents('
 http://localhost/webtest.lc');
 echo($livecode_returned);
   ?
 /p
 /body
 /html

 LiveCode file:
 ?lc
 if $_GET[name]   then
   put Peter into tName
else
   put World into tName
end if
 put header Content-Type: text/html
 put html
 put head
 put titleMy LiveCode Server Test Page/title
 put /head
 put body
 put h1My LiveCode Server Test Page/h1
 put pHello  tName  from LiveCode Server/p
 put pThe date is  the internet date  /p
 put p  the second char of 12345  /p
 put /body
 put /html
 ?

 Results:
 My LiveCode Server Test Page

 Hello World from LiveCode Server

 The date is Sun, 23 Nov 2014 14:27:24 +0800

 2

 Hope this helps.

 Peter

  On 23 Nov 2014, at 13:29, Nakia Brewer nakia.bre...@westrac.com.au
 wrote:
 
  Hi,
 
  I am in the process of putting a web app together using the UserFrosting
 system as a starting point.
  I am slowly getting the hang of the framework and am now wishing to
 start using LC Server to do some backend crunching to render the pages. (Im
 not picking up PHP as fast as I hoped!)
 
  The UserFrosting system bases all of its page contents in PHP Files by
 design.
 
  For example the index file is index.php
 
  My question is, am I able to call LC functions from within a PHP file?
 
  For example, in the below page (which is a PHP file)
  Red content...
 
  ?php
  /*

 ___
 use-livecode mailing list
 use-livecode@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-livecode




-- 
http://www.andregarzia.com -- All We Do Is Code.
http://fon.nu -- minimalist url shortening service.
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: LC Script in PHP File

2014-11-25 Thread Andre Garzia
I've just replied on another thread why FastCGI is not a good candidate for
LiveCode in my humble opinion.

As for Apache Modules, those things are on the way out. If we want LC
Server to be taken seriously then it need to work with Apache and Nginx. it
needs to work like Node, Ruby, Python and others are working which is by
having a LC Server process (or pool) listening on a port talking back to
the Apache/Nginx usually thru some reverse proxy directive.

On Tue, Nov 25, 2014 at 12:32 AM, Peter W A Wood peterwaw...@gmail.com
wrote:

 Simon

 FastCGI support would be excellent from my point of view as it would allow
 LiveCode to be run behind a web server acting as a load balancer.

 Regards

 Peter

  On 24 Nov 2014, at 21:34, Simon Smith he...@simonsmith.co wrote:
 
  Would supporting Fast CGI not be a better way forward?
 
  On Mon, Nov 24, 2014 at 7:56 AM, Monte Goulding 
 mo...@sweattechnologies.com
  wrote:
 
 
  On 24 Nov 2014, at 3:29 pm, Richard Gaskin ambassa...@fourthworld.com
  wrote:
 
  What would it take to make an Apache module for LiveCode?
 
 
  Apache modules themselves don't look all that complicated. As far as LC
  goes as long as you don't support threaded mpms it should be largely a
  matter of handling the request and setting the globals up then passing
  headers and output via the module api rather than stdout.
 
  Cheers
 
  Monte
 
  --
  M E R Goulding
  Software development services
  Bespoke application development for vertical markets
 
  mergExt - There's an external for that!
 
  ___
  use-livecode mailing list
  use-livecode@lists.runrev.com
  Please visit this url to subscribe, unsubscribe and manage your
  subscription preferences:
  http://lists.runrev.com/mailman/listinfo/use-livecode
 
 
 
 
  --
 
  *Simon Smith*
  *seo, online marketing, web development*
 
  w. http://www.simonsmith.co
  m. +27 83 306 7862
  ___
  use-livecode mailing list
  use-livecode@lists.runrev.com
  Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
  http://lists.runrev.com/mailman/listinfo/use-livecode


 ___
 use-livecode mailing list
 use-livecode@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-livecode




-- 
http://www.andregarzia.com -- All We Do Is Code.
http://fon.nu -- minimalist url shortening service.
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: LC Script in PHP File

2014-11-25 Thread Peter W A Wood
Thanks for the clarification Andre.

 On 25 Nov 2014, at 19:18, Andre Garzia an...@andregarzia.com wrote:
 
 Peter,
 
 Most PHP installations will not allow file_get_contents() to be run on
 localhost to prevent infinite loops. I've been hurt by that before.
 
 cheers
 
 
 On Sun, Nov 23, 2014 at 5:09 AM, Peter W A Wood peterwaw...@gmail.com
 wrote:
 
 You should be able to use file_get_contents in PHP to do what you want.
 Though it will take longer to get the results from LiveCode than it would
 from PHP.
 
 Here is an example:
 
 PHP file:
 !DOCTYPE html
 html
head
meta http-equiv=content-type
 content=text/html;charset=utf-8 /
titleTesting Getting Results From Website/title
/head
body
p
  ?php
$livecode_returned = file_get_contents('
 http://localhost/webtest.lc');
echo($livecode_returned);
  ?
/p
/body
 /html
 
 LiveCode file:
 ?lc
if $_GET[name]   then
  put Peter into tName
   else
  put World into tName
   end if
put header Content-Type: text/html
put html
put head
put titleMy LiveCode Server Test Page/title
put /head
put body
put h1My LiveCode Server Test Page/h1
put pHello  tName  from LiveCode Server/p
put pThe date is  the internet date  /p
put p  the second char of 12345  /p
put /body
put /html
 ?
 
 Results:
 My LiveCode Server Test Page
 
 Hello World from LiveCode Server
 
 The date is Sun, 23 Nov 2014 14:27:24 +0800
 
 2
 
 Hope this helps.
 
 Peter
 
 On 23 Nov 2014, at 13:29, Nakia Brewer nakia.bre...@westrac.com.au
 wrote:
 
 Hi,
 
 I am in the process of putting a web app together using the UserFrosting
 system as a starting point.
 I am slowly getting the hang of the framework and am now wishing to
 start using LC Server to do some backend crunching to render the pages. (Im
 not picking up PHP as fast as I hoped!)
 
 The UserFrosting system bases all of its page contents in PHP Files by
 design.
 
 For example the index file is index.php
 
 My question is, am I able to call LC functions from within a PHP file?
 
 For example, in the below page (which is a PHP file)
 Red content...
 
 ?php
 /*
 
 ___
 use-livecode mailing list
 use-livecode@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-livecode
 
 
 
 
 -- 
 http://www.andregarzia.com -- All We Do Is Code.
 http://fon.nu -- minimalist url shortening service.
 ___
 use-livecode mailing list
 use-livecode@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your subscription 
 preferences:
 http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: LC Script in PHP File

2014-11-25 Thread Richard Gaskin

Andre Garzia wrote:

I've just replied on another thread why FastCGI is not a good candidate for
LiveCode in my humble opinion.

As for Apache Modules, those things are on the way out. If we want LC
Server to be taken seriously then it need to work with Apache and Nginx.


I like to imagine this in stages:  if an Apache mod is easier to build, 
perhaps it could be done first, maybe even as a community effort, with a 
FastCGI implementation done later once the engine team has had more 
experience delivering threading to us.


Kevin and I had a good talk yesterday about community initiatives 
surrounding education*, and part of the discussion briefly touched on LC 
Server.


Of course right now the core team at RunRev has their hands quite full 
with the current lineup of items on the Road Map, but the value of a 
multi-threaded LC Server engine is well recognized there.


From various discussions of debugging we're already aware of plans to 
integrate a form of threading for that, at last separating the debugging 
engine from the instance it's debugging.


By the time that's in place the engine team will have had many good 
opportunities to explore useful ways threading can be applied to other 
tasks later on, such as for Server use.


So yes, it's not possible to use FastCGI well with the engine as it is, 
but the engine is an ever-evolving thing.


In the meantime, there's plenty we can do to move that along, mostly by 
just creating demand for it.


Build lots of cool stuff with LC Server, build your audience, and 
hopefully by the time you have an audience large enough to truly need a 
FastCGI implementation we'll have one.


For now, both Kevin and I have been very impressed with the work of one 
of their most recent hires, a fella you'll find in the forums by the 
name of peter_b.  He's been taking tests from Malte's Performance 
Benchmarking Project there (see 
http://forums.livecode.com/viewtopic.php?f=67t=22072), and using 
those to help guide the engine team for areas in which v7 performance 
can be brought up to the level we had with v6.7.


Donald Knuth reminds us that Premature optimization is the root of all 
evil, and v7 just delivered a mind-blowingly complete implementation of 
Unicode across the whole of the LC code base.  Clearly it couldn't be 
tightly optimized at the same time as it was first written, but efforts 
are well underway to bring its performance closer to v6.7 right now.


Interestingly, there are already some new changes in v7 that are pretty 
smart for optimization, like copy-on-write-only.  As they continue to 
find other ways to enhance performance without us needing to modify our 
scripts, Kevin's pretty confident we'll see v7 performance where we want 
it, possibly even faster over the long term than v6.7 is today.


And right now, unless you're running Twitter (and congrats if you have a 
project that popular), CGI is pretty nice.  It provides very clear 
separation of processing and memory space, and the overhead difference 
between multiprocessing and multithreading isn't as significant as one 
might think.


In fact, on one server I had not long ago we had a FastCGI 
implementation of PHP driving Drupal on the same server as a CGI-based 
custom search engine made in LC - we were able to perform all the steps 
needed to deliver search results in 1/3 the RAM and 1/5 the CPU time as 
Drupal could deliver a page of static content.


So even with CGI today things are pretty good, and with both performance 
in v7 being worked on now which will benefit CGI, and likely a FastCGI 
version further down the road, it only gets better.


In the meantime, it would be super-cool to see more libraries and 
frameworks in the community for this sort of thing.  Right now we have a 
great one from Ralf Bitter, RevIgniter, but just as the PHP community 
has Drupal, Wordpress, Joomla, and others, I believe there's plenty of 
room for lots of other toolkits to round out our options for delivering 
dynamic content and services with LiveCode Server.




* Anyone interesting in teaching LiveCode or teaching with LiveCode is 
strongly encourage to participate in the Teaching with LiveCode 
section of the forums - as the community moves forward with more 
resources for educators that'll be our main working group to bring it 
all together:

http://forums.livecode.com/viewforum.php?f=25

--
 Richard Gaskin
 LiveCode Community Manager
 rich...@livecode.org

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: LC Script in PHP File

2014-11-24 Thread Simon Smith
Would supporting Fast CGI not be a better way forward?

On Mon, Nov 24, 2014 at 7:56 AM, Monte Goulding mo...@sweattechnologies.com
 wrote:


 On 24 Nov 2014, at 3:29 pm, Richard Gaskin ambassa...@fourthworld.com
 wrote:

  What would it take to make an Apache module for LiveCode?


 Apache modules themselves don't look all that complicated. As far as LC
 goes as long as you don't support threaded mpms it should be largely a
 matter of handling the request and setting the globals up then passing
 headers and output via the module api rather than stdout.

 Cheers

 Monte

 --
 M E R Goulding
 Software development services
 Bespoke application development for vertical markets

 mergExt - There's an external for that!

 ___
 use-livecode mailing list
 use-livecode@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-livecode




-- 

*Simon Smith*
*seo, online marketing, web development*

w. http://www.simonsmith.co
m. +27 83 306 7862
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: LC Script in PHP File

2014-11-24 Thread Peter W A Wood
Simon

FastCGI support would be excellent from my point of view as it would allow 
LiveCode to be run behind a web server acting as a load balancer.

Regards

Peter

 On 24 Nov 2014, at 21:34, Simon Smith he...@simonsmith.co wrote:
 
 Would supporting Fast CGI not be a better way forward?
 
 On Mon, Nov 24, 2014 at 7:56 AM, Monte Goulding mo...@sweattechnologies.com
 wrote:
 
 
 On 24 Nov 2014, at 3:29 pm, Richard Gaskin ambassa...@fourthworld.com
 wrote:
 
 What would it take to make an Apache module for LiveCode?
 
 
 Apache modules themselves don't look all that complicated. As far as LC
 goes as long as you don't support threaded mpms it should be largely a
 matter of handling the request and setting the globals up then passing
 headers and output via the module api rather than stdout.
 
 Cheers
 
 Monte
 
 --
 M E R Goulding
 Software development services
 Bespoke application development for vertical markets
 
 mergExt - There's an external for that!
 
 ___
 use-livecode mailing list
 use-livecode@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-livecode
 
 
 
 
 -- 
 
 *Simon Smith*
 *seo, online marketing, web development*
 
 w. http://www.simonsmith.co
 m. +27 83 306 7862
 ___
 use-livecode mailing list
 use-livecode@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your subscription 
 preferences:
 http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: LC Script in PHP File

2014-11-23 Thread jbv
Hi
You can also use the curl function if your LC script is located on a server :

  $data = 'http://myDomain/lc/myLCscript.lc?a=' . $myVar;

  $ch = curl_init();
  curl_setopt($ch, CURLOPT_URL, $data);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  $output = curl_exec($ch);
  curl_close($ch);

I use this method very often in my php scripts and find it very easy to
maintain.

Best
jbv


 Hi,

 I am in the process of putting a web app together using the UserFrosting
 system as a starting point.
 I am slowly getting the hang of the framework and am now wishing to start
 using LC Server to do some backend crunching to render the pages. (Im not
 picking up PHP as fast as I hoped!)

 The UserFrosting system bases all of its page contents in PHP Files by
 design.

 For example the index file is index.php

 My question is, am I able to call LC functions from within a PHP file?

 For example, in the below page (which is a PHP file)
 Red content...

 ?php
 /*

 UserFrosting Version: 0.2.1 (beta)
 By Alex Weissman
 Copyright (c) 2014

 Based on the UserCake user management system, v2.0.2.
 Copyright (c) 2009-2012

 UserFrosting, like UserCake, is 100% free and open-source.

 Permission is hereby granted, free of charge, to any person obtaining a
 copy
 of this software and associated documentation files (the 'Software'), to
 deal
 in the Software without restriction, including without limitation the
 rights
 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 copies of the Software, and to permit persons to whom the Software is
 furnished to do so, subject to the following conditions:
 The above copyright notice and this permission notice shall be included in
 all copies or substantial portions of the Software.

 THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
 THE
 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 FROM,
 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 THE SOFTWARE.

 */

 require_once(../models/config.php);

 if (!securePage(__FILE__)){
   // Forward to index page
   addAlert(danger, Whoops, looks like you don't have permission to view
 that page.);
   header(Location: 404.php);
   exit();
 }

 setReferralPage(getAbsoluteDocumentPath(__FILE__));

 ?

 !DOCTYPE html
 html lang=en
   ?php
   echo renderAccountPageHeader(array(#SITE_ROOT# = SITE_ROOT,
 #SITE_TITLE# = SITE_TITLE, #PAGE_TITLE# = Whiteboard));
   ?

   body

 div id=wrapper

   !-- Sidebar --
?php
   echo renderMenu(whiteboard);
 ?
   div id=page-wrapper
 div class=row
   div class=col-lg-12
 h1Whiteboard smallIdea's register/small/h1
 ol class=breadcrumb
   li class=activei class=fa fa-home/i
 Whiteboard/li
 /ol
 div class=alert alert-success alert-dismissable
   button type=button class=close  data-dismiss=alert
 aria-hidden=truetimes;/button
   A place for use to explore idea's between the group. Kind of
 like a contained forum for our idea's.
 /div
   /div
 /div!-- /.row --
 div class=row
   div id='display-alerts' class=col-lg-12
   /div
 /div

 !-- Button trigger modal --
 button type=button class=btn btn-primary btn-lg data-toggle=modal
 data-target=#myModal
   List Idea
 /button

 !-- Modal --
 div class=modal fade id=myModal tabindex=-1 role=dialog
 aria-labelledby=myModalLabel aria-hidden=true
   div class=modal-dialog
 div class=modal-content
   div class=modal-header
 button type=button class=close data-dismiss=modalspan
 aria-hidden=truetimes;/spanspan
 class=sr-onlyClose/span/button
 h4 class=modal-title id=myModalLabelModal title/h4
   /div
   div class=modal-body
 ?lc
 put H1hello world/H1
 ?
   /div
   div class=modal-footer
 button type=button class=btn btn-default
 data-dismiss=modalClose/button
 button type=button class=btn btn-primarySave idea/button
   /div
 /div
   /div
 /div

   /div!-- /#page-wrapper --

 /div!-- /#wrapper --


 /html
 COPYRIGHT / DISCLAIMER: This message and/or including attached files may
 contain confidential proprietary or privileged information. If you are not
 the intended recipient, you are strictly prohibited from using,
 reproducing, disclosing or distributing the information contained in this
 email without authorisation from WesTrac. If you have received this
 message in error please contact WesTrac on +61 8 9377 9444. We do not
 accept liability in connection with computer virus, data corruption,
 delay, interruption, unauthorised access or unauthorised amendment. We
 reserve the right to monitor all e-mail 

Re: LC Script in PHP File

2014-11-23 Thread Nakia Brewer
Okay, this seems to make sense.

Thanks for your help, I'll give it a go tomorrow..

I'm slowly getting there with PHP, it's just taking a little longer than it 
took me to pick up LC...



Nakia Brewer | Technology  Solutions Manager | Equipment Management Solutions
t: (02) 49645051tel:(02)%2049645051
m: 0458 713 547tel:0458%20713%20547
i: www.westrac.com.auhttp://www.westrac.com.au/
ACN 009 342 572tel:009%20342%20572

On 23 Nov 2014, at 6:10 pm, Peter W A Wood 
peterwaw...@gmail.commailto:peterwaw...@gmail.com wrote:

You should be able to use file_get_contents in PHP to do what you want. Though 
it will take longer to get the results from LiveCode than it would from PHP.

Here is an example:

PHP file:
!DOCTYPE html
html
   head
   meta http-equiv=content-type content=text/html;charset=utf-8 /
   titleTesting Getting Results From Website/title
   /head
   body
   p
 ?php
   $livecode_returned = 
file_get_contents('http://localhost/webtest.lc');
   echo($livecode_returned);
 ?
   /p
   /body
/html

LiveCode file:
?lc
   if $_GET[name]   then
 put Peter into tName
  else
 put World into tName
  end if
   put header Content-Type: text/html
   put html
   put head
   put titleMy LiveCode Server Test Page/title
   put /head
   put body
   put h1My LiveCode Server Test Page/h1
   put pHello  tName  from LiveCode Server/p
   put pThe date is  the internet date  /p
   put p  the second char of 12345  /p
   put /body
   put /html
?

Results:
My LiveCode Server Test Page

Hello World from LiveCode Server

The date is Sun, 23 Nov 2014 14:27:24 +0800

2

Hope this helps.

Peter

On 23 Nov 2014, at 13:29, Nakia Brewer 
nakia.bre...@westrac.com.aumailto:nakia.bre...@westrac.com.au wrote:

Hi,

I am in the process of putting a web app together using the UserFrosting system 
as a starting point.
I am slowly getting the hang of the framework and am now wishing to start using 
LC Server to do some backend crunching to render the pages. (Im not picking up 
PHP as fast as I hoped!)

The UserFrosting system bases all of its page contents in PHP Files by design.

For example the index file is index.php

My question is, am I able to call LC functions from within a PHP file?

For example, in the below page (which is a PHP file)
Red content...

?php
/*

___
use-livecode mailing list
use-livecode@lists.runrev.commailto:use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
COPYRIGHT / DISCLAIMER: This message and/or including attached files may 
contain confidential proprietary or privileged information. If you are not the 
intended recipient, you are strictly prohibited from using, reproducing, 
disclosing or distributing the information contained in this email without 
authorisation from WesTrac. If you have received this message in error please 
contact WesTrac on +61 8 9377 9444. We do not accept liability in connection 
with computer virus, data corruption, delay, interruption, unauthorised access 
or unauthorised amendment. We reserve the right to monitor all e-mail 
communications.

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: LC Script in PHP File

2014-11-23 Thread Richard Gaskin

Peter W A Wood wrote:
 You should be able to use file_get_contents in PHP to do what you
 want. Though it will take longer to get the results from LiveCode
 than it would from PHP.

Why would that be?

In general (and pre-7.0) LC used to perform roughly on par with PHP. 
Where has it fallen down on the job?


Given the role of memory and performance for scaling, if we want to see 
LC Server taken seriously as a professional server tool we need to 
identify and eliminate any significant performance difference between it 
and PHP.


--
 Richard Gaskin
 Fourth World Systems
 Software Design and Development for Desktop, Mobile, and Web
 
 ambassa...@fourthworld.comhttp://www.FourthWorld.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: LC Script in PHP File

2014-11-23 Thread Simon Smith
I just think Peter means that there would be an additional step in the
process - instead of executing a single script, you are executing 2.

On Sun, Nov 23, 2014 at 7:45 PM, Richard Gaskin ambassa...@fourthworld.com
wrote:

 Peter W A Wood wrote:
  You should be able to use file_get_contents in PHP to do what you
  want. Though it will take longer to get the results from LiveCode
  than it would from PHP.

 Why would that be?

 In general (and pre-7.0) LC used to perform roughly on par with PHP. Where
 has it fallen down on the job?

 Given the role of memory and performance for scaling, if we want to see LC
 Server taken seriously as a professional server tool we need to identify
 and eliminate any significant performance difference between it and PHP.

 --
  Richard Gaskin
  Fourth World Systems
  Software Design and Development for Desktop, Mobile, and Web
  
  ambassa...@fourthworld.comhttp://www.FourthWorld.com


 ___
 use-livecode mailing list
 use-livecode@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-livecode




-- 

*Simon Smith*
*seo, online marketing, web development*

w. http://www.simonsmith.co
m. +27 83 306 7862
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: LC Script in PHP File

2014-11-23 Thread Peter W A Wood
Richard 

As Simon mentioned, “calling” a LiveCode function by running a cgi script will 
be slower than a simple function call. Running a very simple LiveCode cgi 
script takes a few hundred milliseconds. A function call will take a few 
milliseconds.

On my machine, which has a solid-state drive, I ran two simple test scripts:

The PHP script took 76 milliseconds
The PHP script which “calls LiveCode took 261 milliseconds

I have PHP installed as an Apache module so running a PHP script will always be 
faster than running a LiveCode script. The performance of LiveCode and PHP 
would be the same if either PHP was being run in the same fashion as LiveCode 
(i.e. using CGI) or there was a LiveCode Apache Module.

I suspect this makes little difference to shared hosting user as I understand 
that many shared hosts do not run PHP as an Apache module. It will make a 
difference to people running on dedicated servers (virtual or physical).

Also LiveCode server users are also disadvantaged compared with PHP users as 
there is no FastCGI version of LiveCode that can be run in connection with 
nginx.

Regards

Peeter
 
 On 24 Nov 2014, at 01:45, Richard Gaskin ambassa...@fourthworld.com wrote:
 
 Peter W A Wood wrote:
  You should be able to use file_get_contents in PHP to do what you
  want. Though it will take longer to get the results from LiveCode
  than it would from PHP.
 
 Why would that be?
 
 In general (and pre-7.0) LC used to perform roughly on par with PHP. Where 
 has it fallen down on the job?
 
 Given the role of memory and performance for scaling, if we want to see LC 
 Server taken seriously as a professional server tool we need to identify and 
 eliminate any significant performance difference between it and PHP.
 
 -- 
 Richard Gaskin
 Fourth World Systems
 Software Design and Development for Desktop, Mobile, and Web
 
 ambassa...@fourthworld.comhttp://www.FourthWorld.com
 
 ___
 use-livecode mailing list
 use-livecode@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your subscription 
 preferences:
 http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: LC Script in PHP File

2014-11-23 Thread Richard Gaskin
Peter Wood wrote:
 The performance of LiveCode and 
 PHP would be the same if either PHP
 was being run in the same fashion as
 LiveCode (i.e. using CGI) or there was 
 a LiveCode Apache Module.

What would it take to make an Apache module for LiveCode? 

Richard Gaskin
Fourth World Systems
http://www.FourthWorld.com
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: LC Script in PHP File

2014-11-23 Thread Monte Goulding

On 24 Nov 2014, at 3:29 pm, Richard Gaskin ambassa...@fourthworld.com wrote:

 What would it take to make an Apache module for LiveCode? 


Apache modules themselves don't look all that complicated. As far as LC goes as 
long as you don't support threaded mpms it should be largely a matter of 
handling the request and setting the globals up then passing headers and output 
via the module api rather than stdout.

Cheers

Monte

--
M E R Goulding 
Software development services
Bespoke application development for vertical markets

mergExt - There's an external for that!

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: LC Script in PHP File

2014-11-22 Thread Peter W A Wood
You should be able to use file_get_contents in PHP to do what you want. Though 
it will take longer to get the results from LiveCode than it would from PHP.

Here is an example:

PHP file:
!DOCTYPE html
html
head
meta http-equiv=content-type 
content=text/html;charset=utf-8 /
titleTesting Getting Results From Website/title
/head
body
p
  ?php 
$livecode_returned = 
file_get_contents('http://localhost/webtest.lc');
echo($livecode_returned);
  ?
/p
/body
/html

LiveCode file:
?lc
if $_GET[name]   then
  put Peter into tName
   else
  put World into tName
   end if
put header Content-Type: text/html
put html
put head
put titleMy LiveCode Server Test Page/title
put /head
put body
put h1My LiveCode Server Test Page/h1
put pHello  tName  from LiveCode Server/p
put pThe date is  the internet date  /p
put p  the second char of 12345  /p
put /body
put /html
?

Results:
My LiveCode Server Test Page

Hello World from LiveCode Server

The date is Sun, 23 Nov 2014 14:27:24 +0800

2

Hope this helps.

Peter

 On 23 Nov 2014, at 13:29, Nakia Brewer nakia.bre...@westrac.com.au wrote:
 
 Hi,
 
 I am in the process of putting a web app together using the UserFrosting 
 system as a starting point.
 I am slowly getting the hang of the framework and am now wishing to start 
 using LC Server to do some backend crunching to render the pages. (Im not 
 picking up PHP as fast as I hoped!)
 
 The UserFrosting system bases all of its page contents in PHP Files by design.
 
 For example the index file is index.php
 
 My question is, am I able to call LC functions from within a PHP file?
 
 For example, in the below page (which is a PHP file)
 Red content...
 
 ?php
 /*

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode