473,385 Members | 2,210 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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.
Jul 17 '05 #1
1 2314
sk
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:

http://www.php.net/manual/en/function.virtual.php

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
http://www.hatless.com/
David McTavish wrote:
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.


Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Muthu | last post by:
I've read calling conventions to be the order(reverse or forward) in which the parameters are being read & understood by compilers. For ex. the following function. int Add(int p1, int p2, int...
6
by: jchao123 | last post by:
Dear All, I have an MDB file (Access 2000/XP) which contains generic routines I use in various apps (eg, API calls, File access classes etc). I have compiled into an MDE file which I reference...
14
by: ericellsworth | last post by:
Hi, I'm trying to use a class to pass variables back and forth from a form opened in dialog mode. I have created a class which invokes a form in its show method, like so: Public Sub Show() '...
1
by: Jesse McGrew | last post by:
Hi all, I'm trying to make a plugin DLL for a third-party application, using VC++ .NET 2003. This DLL acts as a bridge between the C++ plugin API of the application, and my actual plugin code...
5
by: Nick Flandry | last post by:
I'm running into an Invalid Cast Exception on an ASP.NET application that runs fine in my development environment (Win2K server running IIS 5) and a test environment (also Win2K server running IIS...
2
by: Geler | last post by:
A theoretical question: Sorry if its a beginner question. Here is a quote from the MSDN explaning the C/C++ calling convention.. It demonstrates that the calling function is responsible to clean...
18
by: John Friedland | last post by:
My problem: I need to call (from C code) an arbitrary C library function, but I don't know until runtime what the function name is, how many parameters are required, and what the parameters are. I...
15
by: dspfun | last post by:
Hi, Is it possible to print the function name of the calling function? For example, f1() and f2() both calls f3(), in f3() I would like to print the name of the function calling f3() which...
11
by: briankirkpatrick | last post by:
Forgive me if my post seems a little amateurish... I'm requesting assistance from some of you smart folks out there to get the managed calls write that meet the specification in the esa.h for...
16
by: teju | last post by:
hi, i am trying 2 merge 2 projects into one project.One project is using c language and the other one is using c++ code. both are working very fine independently.But now i need to merge both...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.