diff options
author | diosmosis <benaka@piwik.pro> | 2015-03-16 19:57:39 +0300 |
---|---|---|
committer | diosmosis <benaka@piwik.pro> | 2015-03-16 19:57:39 +0300 |
commit | 8976cfd575ce5673b0c52889ae43315006d01f9f (patch) | |
tree | 91e1110b99ed0c063ed99b658d9f4ecf7eca1b8b /core | |
parent | 8d1065144b6c309adb8067e8202a5ad41371abd7 (diff) | |
parent | 47a61c1ad87c9208db5a673346bb762cec7bf32f (diff) |
Merge branch 'master' into 7276_update_command_progress
Conflicts:
plugins/CoreUpdater/Controller.php
Diffstat (limited to 'core')
-rw-r--r-- | core/ArchiveProcessor.php | 9 | ||||
-rw-r--r-- | core/Container/ContainerFactory.php | 12 | ||||
-rw-r--r-- | core/Container/StaticContainer.php | 14 | ||||
-rw-r--r-- | core/Plugin.php | 3 | ||||
-rw-r--r-- | core/Plugin/Menu.php | 17 | ||||
-rw-r--r-- | core/Plugin/Widgets.php | 14 | ||||
-rw-r--r-- | core/Version.php | 2 | ||||
-rw-r--r-- | core/View/OneClickDone.php | 13 |
8 files changed, 52 insertions, 32 deletions
diff --git a/core/ArchiveProcessor.php b/core/ArchiveProcessor.php index 58282e72d1..cb24d83367 100644 --- a/core/ArchiveProcessor.php +++ b/core/ArchiveProcessor.php @@ -344,7 +344,10 @@ class ArchiveProcessor // By default we shall aggregate all sub-tables. $dataTable = $this->getArchive()->getDataTableExpanded($name, $idSubTable = null, $depth = null, $addMetadataSubtableId = false); + $columnsRenamed = false; + if ($dataTable instanceof Map) { + $columnsRenamed = true; // see https://github.com/piwik/piwik/issues/4377 $self = $this; $dataTable->filter(function ($table) use ($self, $columnsToRenameAfterAggregation) { @@ -353,7 +356,11 @@ class ArchiveProcessor } $dataTable = $this->getAggregatedDataTableMap($dataTable, $columnsAggregationOperation); - $this->renameColumnsAfterAggregation($dataTable, $columnsToRenameAfterAggregation); + + if (!$columnsRenamed) { + $this->renameColumnsAfterAggregation($dataTable, $columnsToRenameAfterAggregation); + } + return $dataTable; } diff --git a/core/Container/ContainerFactory.php b/core/Container/ContainerFactory.php index cbbc36a00a..af2a09b695 100644 --- a/core/Container/ContainerFactory.php +++ b/core/Container/ContainerFactory.php @@ -28,11 +28,17 @@ class ContainerFactory private $environment; /** + * @var array + */ + private $definitions; + + /** * @param string|null $environment Optional environment config to load. */ - public function __construct($environment = null) + public function __construct($environment = null, array $definitions = array()) { $this->environment = $environment; + $this->definitions = $definitions; } /** @@ -69,6 +75,10 @@ class ContainerFactory // Environment config $this->addEnvironmentConfig($builder); + if (!empty($this->definitions)) { + $builder->addDefinitions($this->definitions); + } + return $builder->build(); } diff --git a/core/Container/StaticContainer.php b/core/Container/StaticContainer.php index 874851acde..8468dce2ae 100644 --- a/core/Container/StaticContainer.php +++ b/core/Container/StaticContainer.php @@ -32,6 +32,13 @@ class StaticContainer private static $environment; /** + * Definitions to register in the container. + * + * @var array + */ + private static $definitions = array(); + + /** * @return Container */ public static function getContainer() @@ -63,7 +70,7 @@ class StaticContainer */ private static function createContainer() { - $containerFactory = new ContainerFactory(self::$environment); + $containerFactory = new ContainerFactory(self::$environment, self::$definitions); return $containerFactory->create(); } @@ -77,6 +84,11 @@ class StaticContainer self::$environment = $environment; } + public static function addDefinitions(array $definitions) + { + self::$definitions = $definitions; + } + /** * Proxy to Container::get() * diff --git a/core/Plugin.php b/core/Plugin.php index af564a002b..bb361b5bb5 100644 --- a/core/Plugin.php +++ b/core/Plugin.php @@ -8,6 +8,7 @@ */ namespace Piwik; +use Piwik\Container\StaticContainer; use Piwik\Plugin\Dependency; use Piwik\Plugin\MetadataLoader; @@ -359,7 +360,7 @@ class Plugin $this->cache->save($cacheId, $classname); } - return new $classname; + return StaticContainer::get($classname); } public function findMultipleComponents($directoryWithinPlugin, $expectedSubclass) diff --git a/core/Plugin/Menu.php b/core/Plugin/Menu.php index d2c54645f1..e354728821 100644 --- a/core/Plugin/Menu.php +++ b/core/Plugin/Menu.php @@ -30,16 +30,6 @@ use Piwik\Plugins\UsersManager\UserPreferences; */ class Menu { - protected $module = ''; - - /** - * @ignore - */ - public function __construct() - { - $this->module = $this->getModule(); - } - private function getModule() { $className = get_class($this); @@ -69,7 +59,7 @@ class Menu { $params = (array) $additionalParams; $params['action'] = ''; - $params['module'] = $this->module; + $params['module'] = $this->getModule(); return $params; } @@ -88,11 +78,12 @@ class Menu */ protected function urlForAction($controllerAction, $additionalParams = array()) { - $this->checkisValidCallable($this->module, $controllerAction); + $module = $this->getModule(); + $this->checkisValidCallable($module, $controllerAction); $params = (array) $additionalParams; $params['action'] = $controllerAction; - $params['module'] = $this->module; + $params['module'] = $module; return $params; } diff --git a/core/Plugin/Widgets.php b/core/Plugin/Widgets.php index 36081fe2d2..5a0cad6fde 100644 --- a/core/Plugin/Widgets.php +++ b/core/Plugin/Widgets.php @@ -25,16 +25,6 @@ class Widgets protected $category = ''; protected $widgets = array(); - private $module = ''; - - /** - * @ignore - */ - public function __construct() - { - $this->module = $this->getModule(); - } - /** * @ignore */ @@ -77,7 +67,7 @@ class Widgets 'name' => $name, 'params' => $parameters, 'method' => $method, - 'module' => $this->module); + 'module' => $this->getModule()); } /** @@ -182,7 +172,7 @@ class Widgets return; } - $controllerClass = '\\Piwik\\Plugins\\' . $this->module . '\\Controller'; + $controllerClass = 'Piwik\\Plugins\\' . $this->getModule() . '\\Controller'; if (!Development::methodExists($this, $method) && !Development::methodExists($controllerClass, $method)) { diff --git a/core/Version.php b/core/Version.php index 3474cbf56b..f9c367e4e4 100644 --- a/core/Version.php +++ b/core/Version.php @@ -20,7 +20,7 @@ final class Version * The current Piwik version. * @var string */ - const VERSION = '2.12.0-b3'; + const VERSION = '2.12.0-b5'; public function isStableVersion($version) { diff --git a/core/View/OneClickDone.php b/core/View/OneClickDone.php index e07c2c3bdd..1d8c8b809f 100644 --- a/core/View/OneClickDone.php +++ b/core/View/OneClickDone.php @@ -30,13 +30,20 @@ class OneClickDone /** * @var string */ - public $coreError; + public $error; /** * @var array */ public $feedbackMessages; + /** + * Did the download over HTTPS fail? + * + * @var bool + */ + public $httpsFail = false; + public function __construct($tokenAuth) { $this->tokenAuth = $tokenAuth; @@ -56,9 +63,10 @@ class OneClickDone @header('Cache-Control: must-revalidate'); @header('X-Frame-Options: deny'); - $error = htmlspecialchars($this->coreError, ENT_QUOTES, 'UTF-8'); + $error = htmlspecialchars($this->error, ENT_QUOTES, 'UTF-8'); $messages = htmlspecialchars(serialize($this->feedbackMessages), ENT_QUOTES, 'UTF-8'); $tokenAuth = $this->tokenAuth; + $httpsFail = (int) $this->httpsFail; // use a heredoc instead of an external file echo <<<END_OF_TEMPLATE @@ -73,6 +81,7 @@ class OneClickDone <input type="hidden" name="token_auth" value="$tokenAuth" /> <input type="hidden" name="error" value="$error" /> <input type="hidden" name="messages" value="$messages" /> + <input type="hidden" name="httpsFail" value="$httpsFail" /> <noscript> <button type="submit">Continue</button> </noscript> |