Scope for object singleton TikiDb::get() access to Pdo function : incompatibility with php 5.3.2 (on windows)
- Status
- Closed
- Subject
- Scope for object singleton TikiDb::get() access to Pdo function : incompatibility with php 5.3.2 (on windows)
- Version
- 4.x
- Category
- Consistency
- Error
- Regression
- Feature
- All / Undefined
Database independence (Non-Mysql, ADOdb Postgres, Oracle, etc) - Resolution status
- Invalid
- Submitted by
- Ushindi Gedeon
- Lastmod by
- Ushindi Gedeon
- Rating
- Description
Hello,
A problem completely identified
This is a new formulation of 3029 and 3057 problem after near 200 hours of test and debug.
The problem is now precise and (I hope so) near solution (but depends of quality team (this part has been rewrite for 5.0):
The solution that I propose establish the compatibility of 4.2 with php 5.3.2.Not alone may be
Can't end test of changes to submit (just tiki-db-dbo.php)
I can't affirm that I wrote a complete debug version because the execution stop on another problem (track http://dev.tikiwiki.org/tiki-view_tracker_item.php?trackerId=5&itemId=3115
, so it is not ended. I can't be sure that everything is OK.
Note about time spent to be able to participate efficiently to the team
The time spend is not only on TikiWiki, a had to solved installation problems and find a bug into easyphp and addresses resolution on the server.The problem began with 4.1 and php 5.3.0 and I upgrade to 4.2 and 5.3.2 to be sure of the problem and the available solution.
Span of the problem :
- Definition of main classes TikiDb and TikiDb_Pdo and PDO->function execution
- Progs : tiki-db-pdo.php, tikisession-pdo.php and naturally pdo.php, tikiDb.php
- PDO extension and behavior of objects and classes
Description of the nature of the problem and is generation
note : Because I found the nature of the problem, I don't start from the nature of the crash but the analysis, but I produce a selected track made with xdebug var_dump)- In tiki-db-pdo.php:40 we create the Pdo object
<$dbTiki = new PDO("$db_tiki:$db_hoststring;dbname=$dbs_tiki", $user_tiki, $pass_tiki); >
- just later In tiki-db-pdo.php:49 we set the singleton of TikiDb_Pdo into TikiDb abstract class with scope operator
<TikiDb::set( new TikiDb_Pdo( $dbTiki ) ); >
- further we call In tikisession-pdo.php:28 we can find the session read
< $sth = TikiDb::get()->prepare($qry); >
This instruction generates the fatal error :
Fatal error: Call to undefined method TikiDb_Pdo::prepare() in D:\Trebly\Teawik-ld8-422a\lib\tikisession-pdo.php on line 28Explanation and solution implemented
The reason is simple and explained by the error comment :
we try to run the prepare function which is a PDO function on a TikiDb_Pdo object which has no reason to inherit of these Pdo function even <TikiDb::get()->db->prepare> could have a meaning.Then the solution is in what is made in ZEND lib (not yet used in 4.2), create an interface to PDO into Class TikiDb_Pdo.
This functions and it is written.A major question
One important question is why and how the same instructions seems to be available and functions well on Linux (I have a site which runs normally with 4.1, not yet upgraded to 4.2, a to-do)
I believe that the actual solution that I have developed for 4.2 on Windows with PDO (compiled) extension, should be extended to the normal version.
As I have said before I can't confirm completely that the solution is correctly tested and free of bug because, the program have a FATAL ERROR PDOException: SQLSTATEHY093 later on the prefs restoration I create another report for this.
Complements of information (working around finding and solving bugs):
Note 1 (complement, I will made another little track for this) :
the execute statement written execute() without parameter generates each time a warning message when xdebug is used and php error management activated with STRICT option (default in 5.3.2). This makes necessarily the code lightly slower.Note 2 :
I developed for other debug for this an enhanced error template according to the error handler which displays much more informations about the context and, into these, the parameter (title) of execute statement. This make an enhancement to find much more quickly the errors.
I will implement a test so that it should be displayed only for administrator.- Solution
- Workaround
- Priority
- 25
- Demonstrate Bug on Tiki 19+
-
This bug has been demonstrated on show2.tiki.org
Please demonstrate your bug on show2.tiki.org
Show.tiki.org is not configured properlyThe public/private keys configured to connect to show2.tiki.org were not accepted. Please make sure you are using RSA keys. Thanks.
- Demonstrate Bug (older Tiki versions)
-
This bug has been demonstrated on show.tikiwiki.org
Please demonstrate your bug on show.tikiwiki.org
Show.tiki.org is not configured properlyThe public/private keys configured to connect to show.tikiwiki.org were not accepted. Please make sure you are using RSA keys. Thanks.
- Ticket ID
- 3116
- Created
- Wednesday 14 April, 2010 00:55:28 UTC
by Bernard TREMBLAY - LastModif
- Tuesday 02 June, 2026 08:10:39 UTC