Loading...
 
Skip to main content

Start of tikiWiki with Windows and PDO extension (Apache-php-mysql win) - DB Main Classes problem and functions calls - Makes unable to start Tikiwiki

Status
Closed
Subject
Start of tikiWiki with Windows and PDO extension (Apache-php-mysql win) - DB Main Classes problem and functions calls - Makes unable to start Tikiwiki
Version
4.x
Category
  • Conflict of two features (each works well independently)
  • Consistency
Feature
All / Undefined
Database independence (Non-Mysql, ADOdb Postgres, Oracle, etc)
Resolution status
Fixed or Solved
Submitted by
Ushindi Gedeon
Lastmod by
Ushindi Gedeon
Rating
(0)
Description

Hello,

This is a new formulation of 3029 problem after near 200 hours of test and debug.

The problem is now precise and near solution :

I can't affirm that I wrote debug because the execution stop on another problem.
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 :

  1. Definition of main classes TikiDb and TikiDb_Pdo and PDO->function execution
  2. Progs : tiki-db-pdo.php, tikisession-pdo.php and naturally pdo.php, tikiDb.php
  3. PDO extension and behavior of objects and classes

Description

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)

  1. 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); >

  1. 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 ) ); >

  1. 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 28

Explanation 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), 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.

Note :
the execute statement written execute() without parameter generates each time a warning message when xdebug is activated with STRICT option (default in 5.3.2) for errors handling in php, and necessarily makes the code lightly slower. I developed 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.

Solution
Partial integrated in problem formulation.
Workaround
Importance
8
Priority
40
Demonstrate Bug on Tiki 19+
Demonstrate Bug (older Tiki versions)
Ticket ID
3101
Created
Wednesday 07 April, 2010 01:27:05 UTC
by Bernard TREMBLAY
LastModif
Monday 01 June, 2026 20:36:40 UTC


Show PHP error messages