Loading...
 

Scope for object singleton TikiDb::get() access to Pdo function : incompatibility with php 5.3.2 (on windows)

Status
Open
Subject
Scope for object singleton TikiDb::get() access to Pdo function : incompatibility with php 5.3.2 (on windows)
Version
4.x
Category
  • Error
  • Regression
  • Consistency
Feature
All / Undefined
Database independence (Non-Mysql, ADOdb Postgres, Oracle, etc)
Resolution status
New
Rating
(0)
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 :

  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 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)

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

Importance
9 high
Priority
45
Demonstrate Bug (Tiki 19+)
Please demonstrate your bug on show2.tiki.org
 About show2.tiki.org

To help developers solve the bug, we kindly request that you demonstrate your bug on a show2.tiki.org instance. To start, simply select a version and click on "Create show2.tiki.org instance". Once the instance is ready (in a minute or two), as indicated in the status window below, you can then access that instance, login (the initial admin username/password is "admin") and configure the Tiki to demonstrate your bug. Priority will be given to bugs that have been demonstrated on show2.tiki.org.

Version: Create show2.tiki.org instance
Demonstrate Bug (older Tiki versions)
Please demonstrate your bug on show.tikiwiki.org
 About show.tikiwiki.org

To help developers solve the bug, we kindly request that you demonstrate your bug on a show.tikiwiki.org instance. To start, simply select a version and click on "Create show.tikiwiki.org instance". Once the instance is ready (in a minute or two), as indicated in the status window below, you can then access that instance, login (the initial admin username/password is "admin") and configure the Tiki to demonstrate your bug. Priority will be given to bugs that have been demonstrated on show.tikiwiki.org.

Version: Create show.tikiwiki.org instance
Created
Wednesday 14 April, 2010 00:55:28 GMT-0000
by Bernard TREMBLAY
LastModif
Wednesday 14 April, 2010 00:55:28 GMT-0000

Attachments

 filenamecreatedhitscommentversionfiletype 
No attachments for this item


Keywords

The following is a list of keywords that should serve as hubs for navigation within the Tiki development and should correspond to documentation keywords.

Each feature in Tiki has a wiki page which regroups all the bugs, requests for enhancements, etc. It is somewhat a form of wiki-based project management. You can also express your interest in a feature by adding it to your profile. You can also try out the Dynamic filter.

Accessibility (WAI & 508)
Accounting
Administration
Ajax
Articles & Submissions
Backlinks
Banner
Batch
BigBlueButton audio/video/chat/screensharing
Blog
Bookmark
Browser Compatibility
Calendar
Category
Chat
Comment
Communication Center
Consistency
Contacts Address book
Contact us
Content template
Contribution
Cookie
Copyright
Credits
Custom Home (and Group Home Page)
Database MySQL - MyISAM
Database MySQL - InnoDB
Date and Time
Debugger Console
Diagram
Directory (of hyperlinks)
Documentation link from Tiki to doc.tiki.org (Help System)
Docs
DogFood
Draw -superseded by Diagram
Dynamic Content
Preferences
Dynamic Variable
External Authentication
FAQ
Featured links
Feeds (RSS)
File Gallery
Forum
Friendship Network (Community)
Gantt
Group
Groupmail
Help
History
Hotword
HTML Page
i18n (Multilingual, l10n, Babelfish)
Image Gallery
Import-Export
Install
Integrator
Interoperability
Inter-User Messages
InterTiki
jQuery
Kaltura video management
Kanban
Karma
Live Support
Logs (system & action)
Lost edit protection
Mail-in
Map
Menu
Meta Tag
Missing features
Visual Mapping
Mobile
Mods
Modules
MultiTiki
MyTiki
Newsletter
Notepad
OS independence (Non-Linux, Windows/IIS, Mac, BSD)
Organic Groups (Self-managed Teams)
Packages
Payment
PDF
Performance Speed / Load / Compression / Cache
Permission
Poll
Profiles
Quiz
Rating
Realname
Report
Revision Approval
Scheduler
Score
Search engine optimization (SEO)
Search
Security
Semantic links
Share
Shopping Cart
Shoutbox
Site Identity
Slideshow
Smarty Template
Social Networking
Spam protection (Anti-bot CATPCHA)
Spellcheck
Spreadsheet
Staging and Approval
Stats
Survey
Syntax Highlighter (Codemirror)
Tablesorter
Tags
Task
Tell a Friend
Terms and Conditions
Theme
TikiTests
Federated Timesheets
Token Access
Toolbar (Quicktags)
Tours
Trackers
TRIM
User Administration
User Files
User Menu
Watch
Webmail and Groupmail
WebServices
Wiki History, page rename, etc
Wiki plugins extends basic syntax
Wiki syntax text area, parser, etc
Wiki structure (book and table of content)
Workspace and perspectives
WYSIWTSN
WYSIWYCA
WYSIWYG
XMLRPC
XMPP




Useful Tools