[sword-devel] Re: PHP format

Glen Prideaux sword-devel@crosswire.org
Sun, 12 Jan 2003 14:47:30 +0800

Daniel Adams wrote:

>It makes sense to me, I am working at re-doing diatheke right now and am
>dealing with the diatheke.pl -> .php part of the formatting. I will ask,
>once again, what would the function be, or which file is it located in, that
>does the verse retrieval and also module lists?
>I am currently designing diatheke in a php format guiding from the perl one.
>By the Grace of God,
>Dan Adams - infoChi@infomagic.net
>  1 Peter 4:10 (NIV)-  Each one should use whatever gift he has received to
>serve others, faithfully administering God's grace in its various forms.
The perl script works by calling the command line diatheke. It's the 
command line program that does the work of retrieving the verses. What 
the perl script does is allow you to interactively specify the 
parameters to the command line program and then display the outputs. 
Your PHP code could do just the same. This may require diatheke to 
reside in a particular directory (the PHP safe_mode_exec_dir) if the 
server is running PHP in "safe mode".

If you want to look inside the command line program, the main file is 
apps/console/diatheke/corediatheke.cpp of the Sword distribution, 
containing the function doquery. But whether you'll be able to make any 
sense out of that depends on how good you are at reading other people's 
C++ code, and really doquery is really just an interface to the API. 
You'd probably get more from reading the comments in swmgr.h. I know I do.