update Piwik to version 2.16 (fixes #91)

This commit is contained in:
oliver 2016-04-10 18:55:57 +02:00
commit d885a4baa9
5833 changed files with 418860 additions and 226988 deletions

View file

@ -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,9 +8,6 @@
*/
namespace Piwik\AssetManager;
use Piwik\AssetManager\PiwikLessCompiler;
use Piwik\AssetManager\UIAsset\StylesheetUIAsset;
use Piwik\AssetManager;
abstract class UIAssetMerger
{
@ -39,7 +36,7 @@ abstract class UIAssetMerger
* @param UIAssetFetcher $assetFetcher
* @param UIAssetCacheBuster $cacheBuster
*/
function __construct($mergedAsset, $assetFetcher, $cacheBuster)
public function __construct($mergedAsset, $assetFetcher, $cacheBuster)
{
$this->mergedAsset = $mergedAsset;
$this->assetFetcher = $assetFetcher;
@ -48,8 +45,9 @@ abstract class UIAssetMerger
public function generateFile()
{
if(!$this->shouldGenerate())
if (!$this->shouldGenerate()) {
return;
}
$this->mergedContent = $this->getMergedAssets();
@ -95,8 +93,9 @@ abstract class UIAssetMerger
protected function getConcatenatedAssets()
{
if(empty($this->mergedContent))
if (empty($this->mergedContent)) {
$this->concatenateAssets();
}
return $this->mergedContent;
}
@ -106,7 +105,6 @@ abstract class UIAssetMerger
$mergedContent = '';
foreach ($this->getAssetCatalog()->getAssets() as $uiAsset) {
$uiAsset->validateFile();
$content = $this->processFileContent($uiAsset);
@ -137,8 +135,9 @@ abstract class UIAssetMerger
*/
private function shouldGenerate()
{
if(!$this->mergedAsset->exists())
if (!$this->mergedAsset->exists()) {
return true;
}
return !$this->isFileUpToDate();
}
@ -161,19 +160,11 @@ abstract class UIAssetMerger
return false;
}
/**
* @return boolean
*/
private function isMergedAssetsDisabled()
{
return AssetManager::getInstance()->isMergedAssetsDisabled();
}
private function adjustPaths()
{
$theme = $this->assetFetcher->getTheme();
// During installation theme is not yet ready
if($theme) {
if ($theme) {
$this->mergedContent = $this->assetFetcher->getTheme()->rewriteAssetsPathToTheme($this->mergedContent);
}
}
@ -188,8 +179,9 @@ abstract class UIAssetMerger
*/
protected function getCacheBusterValue()
{
if(empty($this->cacheBusterValue))
if (empty($this->cacheBusterValue)) {
$this->cacheBusterValue = $this->generateCacheBuster();
}
return $this->cacheBusterValue;
}
@ -198,12 +190,4 @@ abstract class UIAssetMerger
{
$this->mergedContent = $this->getPreamble() . $this->mergedContent;
}
/**
* @return boolean
*/
private function shouldCompareExistingVersion()
{
return $this->isMergedAssetsDisabled();
}
}