Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation: add mysqli detection and db selector #980

Closed
robocoder opened this issue Sep 12, 2009 · 4 comments
Closed

Installation: add mysqli detection and db selector #980

robocoder opened this issue Sep 12, 2009 · 4 comments
Assignees
Labels
Bug For errors / faults / flaws / inconsistencies etc. Major Indicates the severity or impact or benefit of an issue is much higher than normal but not critical.
Milestone

Comments

@robocoder
Copy link
Contributor

How are people going to use it if they don't know about it (or read the FAQ)?

@mattab
Copy link
Member

mattab commented Sep 12, 2009

how do you see this in the installer? do we need a checkbox (PDO / Mysqli) that defaults to PDO? would this checkbox only show up if we detect that mysqli is installed (otherwise there is no point)?

by the way, it also means that we don't require PDO but we require either PDO or mysqli, which means a little logic has to be updated in the requirements checks.

thoughts?

@robocoder
Copy link
Contributor Author

Right. I've already updated the system check to test for "either" as ok. Ditto for the template.

In FormDatabaseSetup, I add a 'select' element with the available adapters.

Changes to make:

  • If there's only one choice, make it a hidden element.
  • CSS styling the select element a bit (eg font size).
  • MySQL error codes #904 mysqli adapter doesn't include the errno in the Exception message

@robocoder
Copy link
Contributor Author

Nice-to-have: move the database-specific system check logic into the adapters. Installation Controller would deep-glob() the adapters, and iterate through them calling a method asking the adapter if its system requirements have been met.

@robocoder
Copy link
Contributor Author

In [1473]:

fixes #904 - MySQL error codes; unsupported adapters can map these to driver-specific SQLSTATE
fixes #980 - Piwik Installation support for "MySQL Improved" (mysqli) extension
fixes #984 - Set client connection charset to utf8.

Fixed tracker profiling data not recorded until after report generated.

More refactoring and database abstraction:

  • Installation gets a list of adapters instead of hardcoding in the plugin
  • checking for database-specific system requirements deferred to the adapter
  • error detection moved to adapter but we still use MySQL error codes rather than defining new constants

Note: unit tests don't run with MYSQLI -- Zend Framework's Mysqli adapater doesn't support prepare() yet

@robocoder robocoder added this to the Piwik 0.4.4 milestone Jul 8, 2014
@robocoder robocoder self-assigned this Jul 8, 2014
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc. Major Indicates the severity or impact or benefit of an issue is much higher than normal but not critical.
Projects
None yet
Development

No branches or pull requests

2 participants