update Piwik to version 2.16 (fixes #91)
This commit is contained in:
parent
296343bf3b
commit
d885a4baa9
5833 changed files with 418860 additions and 226988 deletions
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
/**
|
||||
* Piwik - Open source web analytics
|
||||
* Piwik - free/libre analytics platform
|
||||
*
|
||||
* @link http://piwik.org
|
||||
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
|
||||
|
|
@ -9,8 +9,8 @@
|
|||
namespace Piwik;
|
||||
|
||||
use Exception;
|
||||
use Piwik\Db\Adapter;
|
||||
use Piwik\Db\Schema;
|
||||
use Piwik\DataAccess\ArchiveTableCreator;
|
||||
|
||||
/**
|
||||
* Contains database related helper functions.
|
||||
|
|
@ -28,6 +28,18 @@ class DbHelper
|
|||
return Schema::getInstance()->getTablesInstalled($forceReload);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get list of installed columns in a table
|
||||
*
|
||||
* @param string $tableName The name of a table.
|
||||
*
|
||||
* @return array Installed columns indexed by the column name.
|
||||
*/
|
||||
public static function getTableColumns($tableName)
|
||||
{
|
||||
return Schema::getInstance()->getTableColumns($tableName);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new table in the database.
|
||||
*
|
||||
|
|
@ -153,7 +165,7 @@ class DbHelper
|
|||
/**
|
||||
* Get the SQL to create a specific Piwik table
|
||||
*
|
||||
* @param string $tableName
|
||||
* @param string $tableName Unprefixed table name.
|
||||
* @return string SQL
|
||||
*/
|
||||
public static function getTableCreateSql($tableName)
|
||||
|
|
@ -161,4 +173,17 @@ class DbHelper
|
|||
return Schema::getInstance()->getTableCreateSql($tableName);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes archive tables. For use in tests.
|
||||
*/
|
||||
public static function deleteArchiveTables()
|
||||
{
|
||||
foreach (ArchiveTableCreator::getTablesArchivesInstalled() as $table) {
|
||||
Log::debug("Dropping table $table");
|
||||
|
||||
Db::query("DROP TABLE IF EXISTS `$table`");
|
||||
}
|
||||
|
||||
ArchiveTableCreator::refreshTableList($forceReload = true);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue