[ti-translate] PHP

Biniam Gebremichael B.Gebremichael at cs.ru.nl
Fri Nov 12 18:50:30 EAT 2004


Hello Daniel,

I have looked into the PHP programs you sent me. and...

1. the DB access script is done in one file and all other scripts include it. 
It is very convenient this way. The issue of "Include" is not as straight 
forward as one would expect. But the suggestion by many info's in the net is 
to use absolute path. using dirname function to get root directory helps a 
bit, that is you can move the intire script together, but it is not as free 
as relative path.

2. Regarding persistent connect. there is a mysql library function called 
mysql_pconnect(). The idea is to reduce connection request to mysql while 
leaving the boarded to Apache/web-server to keep track of all open 
connections to mysql. "This should be used only for a heavy loaded mysql 
server" and idle Apache. Off course if you have Apache and mysql in one 
machine this is not a solution for you. Moreover, it requires several changes 
in myql configurations. Plus all mysql_pconnect() calls should have been 
opened with separate user and password  (which is not the case for us, we 
only have one user and one password, for all translators). I don't think we 
should go for pconnect. what do you think?

Biniam



On Sunday 17 October 2004 15:13, Daniel Yacob wrote:
> Biniam,
>
> Sorry to disappear, my time was getting small to work on the php files, I
> still haven't done anything new for a few weeks.  I have made a simple
> copy of the files into your account now, they are in a subdirectory
> called "translators".  The process starts from the "login.php" which
> then goes to "myAccount.php", from there it depends on what the user
> selects from the menu.
>
> One of the big problems with the files is that all the db access script
> is copied into each file, it should be in its own imported class.  I am
> too basic with php to understand how imports (or includes) work.  One thing
> that would be nice to add from a performance standpoint is to have a db
> handle that persists for the whole session.  Right now the db connection
> occurs with every page access which is a waste.
>
> Have a look and let me know if you have any questions.
>
> thanks,
>
> /Daniel



More information about the ti-translate mailing list