PHP5?...
Moderator: Thorsten
PHP5?...
Will phpMYFAQ version 2 completely redone using PHP5?...
Re: PHP5?...
Hi,
phpMyFAQ 1.3.9 and later are already running with PHP5.
bye
Thorsten
this is the plan...jch02140 wrote:Will phpMYFAQ version 2 completely redone using PHP5?...
phpMyFAQ 1.3.9 and later are already running with PHP5.
bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
amazon.de Wishlist
PHP5 in CVS, db class problems
Just downloaded CVS version to test the Postgres implementation, but I didn't get too far.
I found a couple of problems i the db class:
1. I had to insert a str_replace to replace backslashes to be able to include correct database class.
2 More fatal, the reassign of $this is not allowed in php5 ($this = new $func();) I guess we need some refactoring of this.
I'm on winxp with Apache 2 and PostgreSQL 8 beta4.
/moj
I found a couple of problems i the db class:
1. I had to insert a str_replace to replace backslashes to be able to include correct database class.
2 More fatal, the reassign of $this is not allowed in php5 ($this = new $func();) I guess we need some refactoring of this.
I'm on winxp with Apache 2 and PostgreSQL 8 beta4.
/moj
Hi,
is it possible to send me your diffs from the current CVS? Thanks!
bye
Thorsten
is it possible to send me your diffs from the current CVS? Thanks!
bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
amazon.de Wishlist
Still problems with php5... (CVS version from 2004-12-31)
I think the reassign of $this in the db class is illegal, in php5 $this is readonly.
This is my error message:
Fatal error: Cannot re-assign $this in P:\www\virtualhosts\phpmyfaq\inc\db.php on line 59
The only workaround I can think of is to disable the db class and use the pgsql or other db specific class instead.
Can someone suggest a more elegant solution to this?
I think the reassign of $this in the db class is illegal, in php5 $this is readonly.
This is my error message:
Fatal error: Cannot re-assign $this in P:\www\virtualhosts\phpmyfaq\inc\db.php on line 59
The only workaround I can think of is to disable the db class and use the pgsql or other db specific class instead.
Can someone suggest a more elegant solution to this?
Hi,
we need to rewrite the complete DB class to fix this PHP5 only problem. I'll try to do this the next days.
bye
Thorsten
we need to rewrite the complete DB class to fix this PHP5 only problem. I'll try to do this the next days.
bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
amazon.de Wishlist
Hi,
could you please test the current CVS version with PHP5. I rewrote some of the stuff.
bye
Thorsten
could you please test the current CVS version with PHP5. I rewrote some of the stuff.
bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
amazon.de Wishlist
Yes, this seems to fix the reassign $this problem 
A few other problems (not related to php5) :
- I get doble linefeeds i all files. In some cases this will lead to problems when ther ins an extra empty line at the end, after "?>", e.g. in db.php and category.php. Maybe this could have something to dio with my CVS client Tortoise?
- Add user with some debug lines:
Debug - function nextID($table, $id)
Debug - query: SELECT max(id) as current_id FROM faquser
Debug - $result: Resource id #20
Debug - num rows: 1
Warning: pg_result() [function.pg-result]: Unable to jump to row 1 on PostgreSQL result index 20 in P:\www\virtualhosts\phpmyfaq\inc\pgsql.php on line 377
I can't se anything wrong with the query. Have also tried with function pg_fetch_result. Still same problem...
/moj

A few other problems (not related to php5) :
- I get doble linefeeds i all files. In some cases this will lead to problems when ther ins an extra empty line at the end, after "?>", e.g. in db.php and category.php. Maybe this could have something to dio with my CVS client Tortoise?
- Add user with some debug lines:
Debug - function nextID($table, $id)
Debug - query: SELECT max(id) as current_id FROM faquser
Debug - $result: Resource id #20
Debug - num rows: 1
Warning: pg_result() [function.pg-result]: Unable to jump to row 1 on PostgreSQL result index 20 in P:\www\virtualhosts\phpmyfaq\inc\pgsql.php on line 377
I can't se anything wrong with the query. Have also tried with function pg_fetch_result. Still same problem...
/moj
Hi,
I don't have double line feeds and I use Tortoise, too. Your reported bug is fixed in CVS.
bye
Thorsten
I don't have double line feeds and I use Tortoise, too. Your reported bug is fixed in CVS.
bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
amazon.de Wishlist
Solutionmoj wrote:...
Warning: pg_result() [function.pg-result]: Unable to jump to row 1 on PostgreSQL result index 20 in P:\www\virtualhosts\phpmyfaq\inc\pgsql.php on line 377
...
Line 377 in inc\pgsql.php:
$currentID = pg_result($result, 1, 'current_id');
change to:
$currentID = pg_result($result, 0, 'current_id');
Row numbering starts from 0 according to docs.
Hi,
thanks, it's fixed in CVS.
bye
Thorsten
thanks, it's fixed in CVS.
bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
amazon.de Wishlist