diff options
Diffstat (limited to 'core/Db/Adapter.php')
-rw-r--r-- | core/Db/Adapter.php | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/core/Db/Adapter.php b/core/Db/Adapter.php index bea69e1d04..5363d15383 100644 --- a/core/Db/Adapter.php +++ b/core/Db/Adapter.php @@ -69,7 +69,7 @@ class Adapter { $className = 'Piwik\Db\Adapter\\' . str_replace(' ', '\\', ucwords(str_replace(array('_', '\\'), ' ', strtolower($adapterName)))); if (!class_exists($className)) { - throw new \Exception("Adapter $adapterName is not valid."); + throw new \Exception(sprintf("Adapter '%s' is not valid. Maybe check that your Piwik configuration files in config/*.ini.php are readable by the webserver.", $adapterName)); } return $className; } @@ -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'; + } } |