View Single Post
  #2 (permalink)  
Old 02-03-06, 09:22 PM
clancey clancey is offline
Newbie Coder
 
Join Date: Dec 2005
Location: B.C., Canada
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
You have two other options. You could try running the script as a cron job. It would then run from the command line, bypasing apache. Or you could translate into perl and run from the CLI before considering C/C++

Perl is a good transition language. It has a C syntax and shares some function names. It may also lend itself better to being run from the CLI than PHP.

On my sites, I use perl for background tasks and restrict PHP to foreground, web-based tasks.

You would still need to do some rewritting and translating -- but perl shortern the code-compile-run-debug cycle to code-run-debug. Over the life of a project this is a considerable savings in time.

In both cases, CLI perl and PHP, you can code and test on Windows and run on Linux. To make this easier, you can do this make porting quicker:

Code:
################ include files
my $OS = $^O;
if($OS eq "MSWin32") { use lib ("c:/perl/mylib"); }
else { use lib ("/home/myhome/myperl/lib"); }

# Directories and paths

if($OS eq "MSWin32")	{ $homeDir = "c:/"; }
else 			{ $homeDir = "/home/me/"; }
While not answering your question, I hope these thoughts are helpful.
__________________
www.10-minute-rule.com
If software can't do something useful in 10 minutes, it never will.

Last edited by clancey; 02-03-06 at 09:25 PM.
Reply With Quote