diff options
author | Pranav <blueelvisrocks@gmail.com> | 2016-07-30 08:13:15 +0300 |
---|---|---|
committer | Thomas Steur <tsteur@users.noreply.github.com> | 2016-07-30 08:13:15 +0300 |
commit | 5f91bfbde51a9567b468d53b9263a093cf318c64 (patch) | |
tree | 311dfcda155f1e9d56236e710157f22902c77730 | |
parent | f00abe7080dc8c5ee382d2d09842dc02234afc97 (diff) |
Added Recommended Drivers During Installation (#10346)
* Fixed
* Made Recommended Changes
-rw-r--r-- | core/Db/Adapter.php | 10 | ||||
-rw-r--r-- | plugins/Installation/FormDatabaseSetup.php | 3 |
2 files changed, 13 insertions, 0 deletions
diff --git a/core/Db/Adapter.php b/core/Db/Adapter.php index df84b4ae50..5363d15383 100644 --- a/core/Db/Adapter.php +++ b/core/Db/Adapter.php @@ -119,4 +119,14 @@ class Adapter return $adapters; } + + /** + * Checks if the available adapters are recommended by Piwik or not. + * @param string $adapterName + * @return bool + */ + public function isRecommendedAdapter($adapterName) + { + return strtolower($adapterName) === 'pdo/mysql'; + } } diff --git a/plugins/Installation/FormDatabaseSetup.php b/plugins/Installation/FormDatabaseSetup.php index bd5e668cf4..65ddb3c077 100644 --- a/plugins/Installation/FormDatabaseSetup.php +++ b/plugins/Installation/FormDatabaseSetup.php @@ -41,6 +41,9 @@ class FormDatabaseSetup extends QuickForm2 $adapters = array(); foreach ($availableAdapters as $adapter => $port) { $adapters[$adapter] = $adapter; + if (Adapter::isRecommendedAdapter($adapter)) { + $adapters[$adapter] .= ' (' . Piwik::translate('General_Recommended') . ')'; + } } $this->addElement('text', 'host') |