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
|
||||
|
|
@ -8,7 +8,6 @@
|
|||
*/
|
||||
namespace Piwik\DataTable\Renderer;
|
||||
|
||||
use Piwik\DataTable\Manager;
|
||||
use Piwik\DataTable;
|
||||
use Piwik\DataTable\Renderer;
|
||||
|
||||
|
|
@ -31,22 +30,9 @@ class Console extends Renderer
|
|||
*/
|
||||
public function render()
|
||||
{
|
||||
$this->renderHeader();
|
||||
return $this->renderTable($this->table);
|
||||
}
|
||||
|
||||
/**
|
||||
* Computes the exception output and returns the string/binary
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function renderException()
|
||||
{
|
||||
$this->renderHeader();
|
||||
$exceptionMessage = $this->getExceptionMessage();
|
||||
return 'Error: ' . $exceptionMessage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the prefix to be used
|
||||
*
|
||||
|
|
@ -85,8 +71,9 @@ class Console extends Renderer
|
|||
*/
|
||||
protected function renderTable($table, $prefix = "")
|
||||
{
|
||||
if (is_array($table)) // convert array to DataTable
|
||||
{
|
||||
if (is_array($table)) {
|
||||
// convert array to DataTable
|
||||
|
||||
$table = DataTable::makeFromSimpleArray($table);
|
||||
}
|
||||
|
||||
|
|
@ -110,8 +97,11 @@ class Console extends Renderer
|
|||
$dataTableMapBreak = true;
|
||||
break;
|
||||
}
|
||||
if (is_string($value)) $value = "'$value'";
|
||||
elseif (is_array($value)) $value = var_export($value, true);
|
||||
if (is_string($value)) {
|
||||
$value = "'$value'";
|
||||
} elseif (is_array($value)) {
|
||||
$value = var_export($value, true);
|
||||
}
|
||||
|
||||
$columns[] = "'$column' => $value";
|
||||
}
|
||||
|
|
@ -122,8 +112,11 @@ class Console extends Renderer
|
|||
|
||||
$metadata = array();
|
||||
foreach ($row->getMetadata() as $name => $value) {
|
||||
if (is_string($value)) $value = "'$value'";
|
||||
elseif (is_array($value)) $value = var_export($value, true);
|
||||
if (is_string($value)) {
|
||||
$value = "'$value'";
|
||||
} elseif (is_array($value)) {
|
||||
$value = var_export($value, true);
|
||||
}
|
||||
$metadata[] = "'$name' => $value";
|
||||
}
|
||||
$metadata = implode(", ", $metadata);
|
||||
|
|
@ -133,14 +126,10 @@ class Console extends Renderer
|
|||
. $row->getIdSubDataTable() . "]<br />\n";
|
||||
|
||||
if (!is_null($row->getIdSubDataTable())) {
|
||||
if ($row->isSubtableLoaded()) {
|
||||
$subTable = $row->getSubtable();
|
||||
if ($subTable) {
|
||||
$depth++;
|
||||
$output .= $this->renderTable(
|
||||
Manager::getInstance()->getTable(
|
||||
$row->getIdSubDataTable()
|
||||
),
|
||||
$prefix . ' '
|
||||
);
|
||||
$output .= $this->renderTable($subTable, $prefix . ' ');
|
||||
$depth--;
|
||||
} else {
|
||||
$output .= "-- Sub DataTable not loaded<br />\n";
|
||||
|
|
@ -155,7 +144,7 @@ class Console extends Renderer
|
|||
foreach ($metadata as $id => $metadataIn) {
|
||||
$output .= "<br />";
|
||||
$output .= $prefix . " <b>$id</b><br />";
|
||||
if(is_array($metadataIn)) {
|
||||
if (is_array($metadataIn)) {
|
||||
foreach ($metadataIn as $name => $value) {
|
||||
$output .= $prefix . $prefix . "$name => $value";
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue