The Artima Developer Community
Sponsored Link

PHP Buzz Forum
dmdscript with fastcgi

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Alan Knowles

Posts: 390
Nickname: alank
Registered: Sep, 2004

Alan Knowles is Freelance Developer, works on PHP extensions and PEAR.
dmdscript with fastcgi Posted: Jul 13, 2007 4:53 AM
Reply to this message Reply

This post originated from an RSS feed registered with PHP Buzz by Alan Knowles.
Original Post: dmdscript with fastcgi
Feed Title: Smoking toooo much PHP
Feed URL: http://www.akbkhome.com/blog.php/RSS.xml
Feed Description: More than just a blog :)
Latest PHP Buzz Posts
Latest PHP Buzz Posts by Alan Knowles
Latest Posts From Smoking toooo much PHP

Advertisement
I've been slowly ticking away adding features to the gtk javascript bindings, in doing so, I'm adding extra libraries - Mysql works quite well, and Seeing the recent post on planet.dprogramming.com about fastcgi4d, I wondered if I could run dmdscript from fastcgi.

To enable a web version of dmdscript with my bindings, I had to do quite a bit of re-organization, enabling it to be built with random libraries added in and exclude the Gtk stuff. Core to this was to move all the registration code into the directories that hold the binding code. Each binding directory now contains 3 files, binding***.d, binding***type.d and register***.d. Which manage the dynamic loading of .so (or .dll if windows actually works). and the registering of all the javascript objects and methods.

For fastcgi, I had a look at the code described on the blog post, but was very reluctant to use it, as it
  • required tango, which is not a current requirement, and I'm a little concerned about using.
  • required knowlege of templates, which are still a bit of a black art. and I've only used very sparingly when absolutly every other alternative has been ruled out.
So after considerable digging through the code and trying to make head or tail of the code on fastcgi.com, I finally found the python fastcgi code, which ported easily to D.

The core files libraries that are helpers in dealing with fastcgi are here.
http://www.akbkhome.com/svn/gtkDS/src/fastcgi/

They need the loader.d and paths.d file from here
http://www.akbkhome.com/svn/gtkDS/wrap/
to be usable.

and the current, non-threaded simple responder is here
http://www.akbkhome.com/svn/gtkDS/src/fcgi.d

So for hello world example, this simple piece of code dumps all the server variables and says hello world.
println(Request.toSource());

println("hellow world from javascript");
Next job is to look at how GET/POST data is passed around and how to escape data on output. among a list of 100 ideas for how it could all work.

Read: dmdscript with fastcgi

Topic: My Interview Regarding Joe White Previous Topic   Next Topic Topic: Solar Views and Layouts

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use