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

@ -127,7 +127,11 @@ if (in_array('mysqli', @get_loaded_extensions()) && !function_exists('mysqli_set
if(function_exists('parse_ini_file')) {
// provide a wrapper
function _parse_ini_file($filename, $process_sections = false) {
return file_exists($filename) ? parse_ini_file($filename, $process_sections) : false;
if(!file_exists($filename)) {
return false;
}
return parse_ini_file($filename, $process_sections);
}
} else {
// we can't redefine parse_ini_file() if it has been disabled
@ -345,7 +349,7 @@ function _safe_serialize( $value )
}
if(is_float($value))
{
return 'd:'.$value.';';
return 'd:'.str_replace(',', '.', $value).';';
}
if(is_string($value))
{
@ -608,26 +612,33 @@ function safe_unserialize( $str )
* @param resource $context
* @return int the number of bytes read from the file, or false if an error occurs
*/
function _readfile($filename, $useIncludePath = false, $context = null)
function _readfile($filename, $byteStart, $byteEnd, $useIncludePath = false, $context = null)
{
$count = @filesize($filename);
// built-in function has a 2 MB limit when using mmap
if (function_exists('readfile') && $count <= (2 * 1024 * 1024)) {
if (function_exists('readfile')
&& $count <= (2 * 1024 * 1024)
&& $byteStart == 0
&& $byteEnd == $count
) {
return @readfile($filename, $useIncludePath, $context);
}
// when in doubt (or when readfile() function is disabled)
$handle = @fopen($filename, SettingsServer::isWindows() ? "rb" : "r");
if ($handle) {
while(!feof($handle)) {
echo fread($handle, 8192);
ob_flush();
flush();
fseek($handle, $byteStart);
for ($pos = $byteStart; $pos < $byteEnd && !feof($handle); $pos = ftell($handle)) {
echo fread($handle, min(8192, $byteEnd - $pos));
@ob_flush();
@flush();
}
fclose($handle);
return $count;
return $byteEnd - $byteStart;
}
return false;
}
@ -674,3 +685,20 @@ if(!function_exists('mb_strtolower')) {
return strtolower($input);
}
}
/**
* On ubuntu in some cases, there is a bug that gzopen does not exist and one must use gzopen64 instead
*/
if (!function_exists('gzopen')
&& function_exists('gzopen64')) {
function gzopen($filename , $mode = 'r', $use_include_path = 0 )
{
return gzopen64($filename , $mode, $use_include_path);
}
}
if (!function_exists('dump')) {
function dump () {
}
}