diff --git a/core/Db/Schema.php b/core/Db/Schema.php index 796e71dca5b384175572ac445afb75e421779a32..b973af0b3b51182c00afbaee339b985c2e96bf8f 100644 --- a/core/Db/Schema.php +++ b/core/Db/Schema.php @@ -47,69 +47,6 @@ class Schema extends Singleton return '\Piwik\Db\Schema\\' . $class; } - /** - * Get list of schemas - * - * @param string $adapterName - * @return array - */ - public static function getSchemas($adapterName) - { - static $allSchemaNames = array( - 'MYSQL' => array( - self::DEFAULT_SCHEMA, - // InfiniDB - ), - - // Microsoft SQL Server -// 'MSSQL' => array( 'Mssql' ), - - // PostgreSQL -// 'PDO_PGSQL' => array( 'Pgsql' ), - - // IBM DB2 -// 'IBM' => array( 'Ibm' ), - - // Oracle -// 'OCI' => array( 'Oci' ), - ); - - $adapterName = strtoupper($adapterName); - switch ($adapterName) { - case 'PDO\MYSQL': - case 'PDO_MYSQL': - case 'MYSQLI': - $adapterName = 'MYSQL'; - break; - - case 'PDO_MSSQL': - case 'SQLSRV': - $adapterName = 'MSSQL'; - break; - - case 'PDO_IBM': - case 'DB2': - $adapterName = 'IBM'; - break; - - case 'PDO_OCI': - case 'ORACLE': - $adapterName = 'OCI'; - break; - } - $schemaNames = $allSchemaNames[$adapterName]; - - $schemas = array(); - - foreach ($schemaNames as $schemaName) { - $className = __NAMESPACE__ . '\\Schema\\' . $schemaName; - if (call_user_func(array($className, 'isAvailable'))) { - $schemas[] = $schemaName; - } - } - - return $schemas; - } /** * Load schema diff --git a/core/Db/Schema/Mysql.php b/core/Db/Schema/Mysql.php index 8b554e1ae40e217272c7c7a8f478d4732924dbbe..07cb1490d08862fe450afec00b8c7e325ed6a86a 100644 --- a/core/Db/Schema/Mysql.php +++ b/core/Db/Schema/Mysql.php @@ -22,33 +22,6 @@ class Mysql implements SchemaInterface { private $tablesInstalled = null; - /** - * Is this MySQL storage engine available? - * - * @param string $engineName - * @return bool True if available and enabled; false otherwise - */ - private static function hasStorageEngine($engineName) - { - $db = Db::get(); - $allEngines = $db->fetchAssoc('SHOW ENGINES'); - if (array_key_exists($engineName, $allEngines)) { - $support = $allEngines[$engineName]['Support']; - return $support == 'DEFAULT' || $support == 'YES'; - } - return false; - } - - /** - * Is this schema available? - * - * @return bool True if schema is available; false otherwise - */ - public static function isAvailable() - { - return self::hasStorageEngine('InnoDB'); - } - /** * Get the SQL to create Piwik tables * diff --git a/core/Db/SchemaInterface.php b/core/Db/SchemaInterface.php index 9caf45798c4e20c42afeab0f88c3b28e379ff93a..8c22bb6818d095c155675276d8323f1c7806094c 100644 --- a/core/Db/SchemaInterface.php +++ b/core/Db/SchemaInterface.php @@ -14,13 +14,6 @@ namespace Piwik\Db; */ interface SchemaInterface { - /** - * Is this schema available? - * - * @return bool True if schema is available; false otherwise - */ - public static function isAvailable(); - /** * Get the SQL to create a specific Piwik table *