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
|
||||
|
|
@ -10,6 +10,7 @@ namespace Piwik\AssetManager\UIAsset;
|
|||
|
||||
use Exception;
|
||||
use Piwik\AssetManager\UIAsset;
|
||||
use Piwik\Filesystem;
|
||||
|
||||
class OnDiskUIAsset extends UIAsset
|
||||
{
|
||||
|
|
@ -27,7 +28,7 @@ class OnDiskUIAsset extends UIAsset
|
|||
* @param string $baseDirectory
|
||||
* @param string $fileLocation
|
||||
*/
|
||||
function __construct($baseDirectory, $fileLocation)
|
||||
public function __construct($baseDirectory, $fileLocation)
|
||||
{
|
||||
$this->baseDirectory = $baseDirectory;
|
||||
$this->relativeLocation = $fileLocation;
|
||||
|
|
@ -50,20 +51,23 @@ class OnDiskUIAsset extends UIAsset
|
|||
|
||||
public function validateFile()
|
||||
{
|
||||
if (!$this->assetIsReadable())
|
||||
if (!$this->assetIsReadable()) {
|
||||
throw new Exception("The ui asset with 'href' = " . $this->getAbsoluteLocation() . " is not readable");
|
||||
}
|
||||
}
|
||||
|
||||
public function delete()
|
||||
{
|
||||
if ($this->exists()) {
|
||||
|
||||
if (!unlink($this->getAbsoluteLocation()))
|
||||
try {
|
||||
Filesystem::remove($this->getAbsoluteLocation());
|
||||
} catch (Exception $e) {
|
||||
throw new Exception("Unable to delete merged file : " . $this->getAbsoluteLocation() . ". Please delete the file and refresh");
|
||||
}
|
||||
|
||||
// try to remove compressed version of the merged file.
|
||||
@unlink($this->getAbsoluteLocation() . ".deflate");
|
||||
@unlink($this->getAbsoluteLocation() . ".gz");
|
||||
Filesystem::remove($this->getAbsoluteLocation() . ".deflate", true);
|
||||
Filesystem::remove($this->getAbsoluteLocation() . ".gz", true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -77,8 +81,9 @@ class OnDiskUIAsset extends UIAsset
|
|||
|
||||
$newFile = @fopen($this->getAbsoluteLocation(), "w");
|
||||
|
||||
if (!$newFile)
|
||||
throw new Exception ("The file : " . $newFile . " can not be opened in write mode.");
|
||||
if (!$newFile) {
|
||||
throw new Exception("The file : " . $newFile . " can not be opened in write mode.");
|
||||
}
|
||||
|
||||
fwrite($newFile, $content);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue