Ticket #133 (closed enhancement: fixed)

Opened 10 months ago

Last modified 8 months ago

Only list supported PDO drivers in installer

Reported by: gsnedders Owned by:
Priority: major Milestone: 0.4
Component: Habari Core Software Version: SVN
Keywords: Cc:

Description

Currently we always list both SQLite and MySQL in the installer, regardless of not of whether the PDO drivers are loaded. We ought to check whether the drivers are installed before giving them as an option (note that it is possible that neither are installed).

Attachments

133.diff (4.3 kB) - added by skippy 10 months ago.

Change History

Changed 10 months ago by skippy

The extension_loaded() method is what we want, here.

Changed 10 months ago by skippy

Attached is a patch which detects the currently installed PDO drivers. It forcibly excludes SQLite2. If no (usable) drivers are available, tell the user. If one or more drivers are available, only display those in the db_type drop-down.

Changed 10 months ago by skippy

Changed 10 months ago by ringmaster

  • status changed from new to closed
  • resolution set to fixed

Fixed in r1331.

Changed 8 months ago by elazar

  • status changed from closed to reopened
  • resolution fixed deleted

There is an issue with this patch. array_combine requires that each parameter contain at least one element. If no PDO drivers are installed, this causes the following error when loading the installer once the .htaccess file has been created:

Error: array_combine() [function.array-combine]: Both parameters should have at least 1 element /var/www/habari/system/classes/installhandler.php : Line 200

A check should be added to ensure that the return value of PDO::getAvailableDrivers() contains at least one element and display an appropriate error accordingly if that is not the case.

Changed 8 months ago by skippy

  • status changed from reopened to closed
  • resolution set to fixed

fixed in r1558. Thanks for catching the oversight, elazar!

Note: See TracTickets for help on using tickets.