Calling TCL function from PHP 4.3

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • David McTavish

    Calling TCL function from PHP 4.3

    Hi all,
    I'm just picking up PHP, and am really appreciating the transition, however,
    I'm running into somewhat of a loggerhead. I'm trying to find a way to
    utilize our existing code infrastructure (primarily written in TCL), while
    providing an outlet for new technology (aka PHP). It seems that Tcl isn't
    really well suited for integration with HTML pages (Rivet is fine, but not
    as fleshed out as PHP seems to be). I was wondering if there is any
    mechanism in which I can make embedded calls from PHP to TCL libraries? My
    first priority would be for these processes to be somewhat embedded (ie:
    avoid using a cgi-approach to invoke a new instance of Tcl each time the
    particular page is requested via Apache).
    Any advice is greatly appreciated! Cheers!
    d.


  • sk

    #2
    Re: Calling TCL function from PHP 4.3

    Maybe there's a PHP module that trumps this, but I see two good ways to
    do it:

    One approach would be to run a Tcl XML-RPC server behind the firewall
    and let your PHP code make XML-RPC client calls to it. It's not as
    efficient as an embedded Tcl interpreter for PHP would be, but it would
    beat the living daylights out of execing out to Tcl repeatedly.

    Another approach would be to install Apache's mod_tcl, make your
    libraries callable from it on localhost, and use PHP's virtual() call:



    This has the potential for fastest performance, but it ties your Tcl to
    the same machine as your PHP and would add the memory overhead of a Tcl
    instance to each Apache process. Since it works like a server-side
    include, it's up to you to parse what gets returned into something PHP
    can evaluate. XML-RPC will return variables ready to go.

    --
    Steve Koppelman
    Wij geloven in onafhankelijk denken en het aangaan van oprechte connecties. Wij laten jouw business betekenisvol groeien. Hoe? Dat lees je op onze site.



    David McTavish wrote:[color=blue]
    > Hi all,
    > I'm just picking up PHP, and am really appreciating the transition, however,
    > I'm running into somewhat of a loggerhead. I'm trying to find a way to
    > utilize our existing code infrastructure (primarily written in TCL), while
    > providing an outlet for new technology (aka PHP). It seems that Tcl isn't
    > really well suited for integration with HTML pages (Rivet is fine, but not
    > as fleshed out as PHP seems to be). I was wondering if there is any
    > mechanism in which I can make embedded calls from PHP to TCL libraries? My
    > first priority would be for these processes to be somewhat embedded (ie:
    > avoid using a cgi-approach to invoke a new instance of Tcl each time the
    > particular page is requested via Apache).
    > Any advice is greatly appreciated! Cheers!
    > d.
    >
    >[/color]

    Comment

    Working...