Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

REBOL + PHP, or ...?

 [1/10] from: petr:krenzelok:trz:cz at: 24-Nov-2001 20:47


Hi, I am about to help my friend to script some part of our town website. Now the problem is - I can't do any graphics, as I am really no talent in this area, while my friend can't program. Now what are possibilities of getting work done together? currently we can: - use rebol to generate whole website. But how should I integrate Martin's graphics? If I will let him layout page in some html-editor, and will use its parts in my Rebol script, it will be pain, if he decides to change design ... but what about following?: - ability to let my friend generate website in his favorite html-editor, and inserting script execution results in various places, e.g. tables. Problem: But - that would require some kind of SSI, or PHP (which I am not willing to learn - no free time left). Rebol Apache module was cancelled in favor of Rebol/Command and FastCGI solution. But fastCGI doesn't provide us with anything along the lines of SSI. What is the possible solution? What about having some php wrapper func for SSI usage, with ability to somehow contact/call my fastCGI process, or rebol server listening on some port? But - what communictaion protocol to use? I know that rebol dialects, etc. stuff are great, but it prevents me from letting my friend to have complete design freedom ... Thanks, -pekr-

 [2/10] from: chrismorency:videotron:ca at: 24-Nov-2001 15:37


Hi,
> - ability to let my friend generate website in his favorite html-editor, > and inserting script execution results in various places, e.g. tables.
Take a look at Maarten Koopmans eRebol script in the CGI folder of Rebol Library, if I understand what you need is the following : Availability to use standard HTML, but preprocessed by a server (a la ASP or PHP), this is what you need... I actually use this on some of Palmtime.com's website to generate the AvantGo channel of the mailing list ! It's not difficult to setup, I've made some minor modification myself to it... and it runs great with Apache ! Best, Chris

 [3/10] from: petr:krenzelok:trz:cz at: 25-Nov-2001 1:26


Christian Morency wrote:
>Hi, >>- ability to let my friend generate website in his favorite html-editor,
<<quoted lines omitted: 7>>
>difficult to setup, I've made some minor modification myself to it... and it >runs great with Apache !
Ah, thanks! So all my pages are supposed to come to /cgi-bin/ dir, right? Few comments, one question though :-) 1) I would strongly suggest to NOT prin(t) parts of script to output. That slow downs things way too much to be viable. Have you ever tried to store your text to buffer first, and print it at once at the end? 2) exec-rule: [ copy pre to "<%" thru "<%" copy code thru "%>" page-end: (execs: true prin pre error? try blok)] the beginning of above parse rule could be modified to copy pre thru <% or I am missing something here .... 3) what is following code doing exactly? What does 'bind do here and why not to user e.g. 'reduce? blok: [ do code ] bind blok 'do Anyway - I got the idea, thanks ... -pekr-

 [4/10] from: al:bri:xtra at: 25-Nov-2001 13:30


Petr wrote:
> 1) I would strongly suggest to NOT prin(t) parts of script to output. That
slow downs things way too much to be viable. Have you ever tried to store your text to buffer first, and print it at once at the end? There's some bad examples of this in Rebol's own code. For example, 'help and 'source. Andrew Martin ICQ: 26227169 http://valley.150m.com/

 [5/10] from: chrismorency:videotron:ca at: 24-Nov-2001 20:43


Hi,
> Ah, thanks! So all my pages are supposed to come to /cgi-bin/ dir, > right? Few comments, one question though :-)
Actually no, they can be anywhere in the hierarchy of your site, however since they have a specific extension you told Apache about, they will be processed by rebol.exe. Yeah, you put erebol.r in the cgi-bin directory, but I'm not even sure that this is obligatory...
> 1) I would strongly suggest to NOT prin(t) parts of script to output. > That slow downs things way too much to be viable. Have you ever tried to > store your text to buffer first, and print it at once at the end?\
Actually, you can even save the information to txt files and reuse them later with a print read %file within your script.
> 2) exec-rule: [ copy pre to "<%" thru "<%" copy code thru "%>" page-end: > (execs: true prin pre error? try blok)] > > the beginning of above parse rule could be modified to copy pre thru > "<%" or I am missing something here ....
Not sure about this, wild guess here but what about this snippet : <html> <head></head> <body> <... static html code ...> <% do something %> <... static html code ...> <% do other things %> ...
> 3) what is following code doing exactly? What does 'bind do here and why > not to user e.g. 'reduce? > > blok: [ do code ] > bind blok 'do > > Anyway - I got the idea, thanks ...
Thank Marteen, and I'm sure he would be the one to answer... Best, Chris

 [6/10] from: dvydra2:yaho:o at: 24-Nov-2001 18:19


Petr, This seems to be a common issue with any programming language used for the web. At my last job we used java and decided to go with XSLT to generate HTML on the server. The web design person was able to work directly in the file that contained html/xslt. Our java objects spit out XML and we used xalan xslt interpreter. I hope thats clear. David --- Petr Krenzelok <[petr--krenzelok--trz--cz]> wrote:
> Hi, > I am about to help my friend to script some part of
<<quoted lines omitted: 43>>
> [rebol-request--rebol--com] with "unsubscribe" in the > subject, without the quotes.
===== David Vydra www.vydra.net david (at) vydra (dot) net

 [7/10] from: petr:krenzelok:trz:cz at: 25-Nov-2001 6:11


Christian Morency wrote:
>Hi, >>Ah, thanks! So all my pages are supposed to come to /cgi-bin/ dir,
<<quoted lines omitted: 4>>
>processed by rebol.exe. Yeah, you put erebol.r in the cgi-bin directory, but >I'm not even sure that this is obligatory...
I am not sure I understand you correctly, but typically assigning some extension for your files to be "executed", we speak "cgi". I have currently set-up ability to execute scripts only for /cgi-bin/ dir, and /fast-cgi/ for fast-cgi scripts. I am not sure it is a good thing to allow cgi scripts being executed from anywhere on your server .... btw: here is a code snipped from old Apache rebol handler: output: make string! 1000 p2: head file until [ not all [ p1: find p2 "<!--[" append output copy/part p2 p1 p2: find p1 "]-->" either not error? set/any 'result try [ do load copy/part skip p1 4 next p2 ][ append output any compose [(get/any 'result) system/ports/output # ] clear system/ports/output ][apache/log reform ["SSI error:" newline mold disarm result] apache-codes/LOG-INFO true ] p2: skip p2 4 ;-thx petr ] ] print append output copy p2 As you can see, parser was not used for e.g. And also - <!--[code here]--!> looks more rebol way than <%code here%> :-)
>>1) I would strongly suggest to NOT prin(t) parts of script to output. >>That slow downs things way too much to be viable. Have you ever tried to >>store your text to buffer first, and print it at once at the end?\ >> > >Actually, you can even save the information to txt files and reuse them >later with a print read %file within your script. >
Hmm, of course you can, but why to slow it down by hd access? Cheers, -pekr-

 [8/10] from: al:bri:xtra at: 25-Nov-2001 18:08


pekr wrote:
> - use rebol to generate whole website. But how should I integrate Martin's
graphics? If I will let him layout page in some html-editor, and will use its parts in my Rebol script, it will be pain, if he decides to change design ...
> I know that rebol dialects, etc. stuff are great, but it prevents me from
letting my friend to have complete design freedom ... My eText dialect allows integration of graphics. If your designer friend is still refining his graphical design, then let him do that with the tools, he's familiar with, seeing as you're running out of time. To integrate a Rebol-generated content on a high-style HTML page, let the designer specify one or more pictures or table locations where the Rebol-generated content goes. For example in HTML, write (in a table): <td><image src="RebolPlaceHolder.gif" height=123 width=234></td> and then to generate the final result, process the HTML file through a Rebol script and insert the relevant Rebol-generated content in place of the <image> tag. Change the name: RebolPlaceHolder.gif to more suitable names and vary the name depending upon the different types of Rebol-generated content. The script can determine the exact width and height required by reading the <image> tag. To integrate high-style pages with eText, just generate the pages as normal, then use my site creation scripts, which automatically integrates prewritten HTML pages with eText pages. I hope that helps! Andrew Martin ICQ: 26227169 http://valley.150m.com/

 [9/10] from: brett:codeconscious at: 25-Nov-2001 17:50


Hi Andrew,
> To integrate a Rebol-generated content on a high-style HTML page, let the > designer specify one or more pictures or table locations where the > Rebol-generated content goes.
...
> to more suitable names and vary the name depending upon the different > types of Rebol-generated content.
Great ideas! BTW your scripts don't appear to be available on your web/reb sites. Brett.

 [10/10] from: chrismorency:videotron:ca at: 25-Nov-2001 13:51


Hi,
> I am not sure I understand you correctly, but typically assigning some > extension for your files to be "executed", we speak "cgi". I have > currently set-up ability to execute scripts only for /cgi-bin/ dir, and > /fast-cgi/ for fast-cgi scripts. > I am not sure it is a good thing to allow cgi scripts being executed > from anywhere on your server ....
The eRebol script should be in the cgi-bin directory, however your html/rebol .r pages can be anywhere in the hierarchy of the site and would still be processed by eRebol.
> As you can see, parser was not used for e.g. And also - <!--[code > here]--!> looks more rebol way than <%code here%> :-)
I'm not familiar with the history of the <% %> syntax, I know it's used in ASP pages, so basically Marteen wanted to use something developers are already familiar with... as for the <!-- --!>, these are actually comments in a html doc... let's say your developer would still like the ability to use these ? you can't use them for scripting engine heh ?
> >Actually, you can even save the information to txt files and reuse them > >later with a print read %file within your script. > > > Hmm, of course you can, but why to slow it down by hd access?
For example, on my site I have two generated channels, both are independent in their own directory on the site, and no one should link the other. however, there is one page the about page that will be partially similar, the first paragraph is not, but the second paragraph on both page is... now let's say I only want to edit one file to modify both pages ? I could include a print read %file.txt ! and it'll work ! Best. Chris

Notes
  • Quoted lines have been omitted from some messages.
    View the message alone to see the lines that have been omitted