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,17 +1,8 @@
|
|||
<Files "*">
|
||||
<IfModule mod_access.c>
|
||||
Allow from all
|
||||
Require all granted
|
||||
</IfModule>
|
||||
<IfModule !mod_access_compat>
|
||||
<IfModule mod_authz_host.c>
|
||||
Allow from all
|
||||
Require all granted
|
||||
</IfModule>
|
||||
</IfModule>
|
||||
<IfModule mod_access_compat>
|
||||
Allow from all
|
||||
Require all granted
|
||||
</IfModule>
|
||||
Satisfy any
|
||||
<IfVersion < 2.4>
|
||||
Allow from all
|
||||
</IfVersion>
|
||||
<IfVersion >= 2.4>
|
||||
Require all granted
|
||||
</IfVersion>
|
||||
</Files>
|
||||
|
|
|
|||
|
|
@ -1,32 +1,32 @@
|
|||
Copyright 2013 Anthon Pang
|
||||
|
||||
All rights reserved.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
* Neither the name of Anthon Pang nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this
|
||||
software without specific prior written permission.
|
||||
* Neither the name of Anthon Pang nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this
|
||||
software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
View online: http://piwik.org/free-software/bsd/
|
||||
|
|
|
|||
|
|
@ -22,37 +22,40 @@ The js/ folder contains:
|
|||
attempt to block tracking, you can change your tracking code to use "js/"
|
||||
instead of "piwik.js" and "piwik.php", respectively.
|
||||
|
||||
Note that in order for [Page Overlay](https://piwik.org/docs/page-overlay/) to work, the Piwik tracker method `setAPIUrl()` needs to be called with its parameter pointing to the root directory of Piwik. E.g.:
|
||||
|
||||
```js
|
||||
_paq.push(['setAPIUrl', u]);
|
||||
|
||||
```
|
||||
|
||||
## Deployment
|
||||
|
||||
* piwik.js is minified using YUICompressor 2.4.2.
|
||||
To install YUICompressor run:
|
||||
|
||||
```
|
||||
```bash
|
||||
$ cd /path/to/piwik/js/
|
||||
$ wget http://www.julienlecomte.net/yuicompressor/yuicompressor-2.4.2.zip
|
||||
$ unzip yuicompressor-2.4.2.zip
|
||||
```
|
||||
|
||||
|
||||
To compress the code containing the evil "eval", either apply the patch from
|
||||
http://yuilibrary.com/projects/yuicompressor/ticket/2343811,
|
||||
or run:
|
||||
|
||||
```
|
||||
```bash
|
||||
$ cd /path/to/piwik/js/
|
||||
$ sed '/<DEBUG>/,/<\/DEBUG>/d' < piwik.js | sed 's/eval/replacedEvilString/' | java -jar yuicompressor-2.4.2/build/yuicompressor-2.4.2.jar --type js --line-break 1000 | sed 's/replacedEvilString/eval/' | sed 's/^[/][*]/\/*!/' > piwik-min.js && cp piwik-min.js ../piwik.js
|
||||
```
|
||||
|
||||
|
||||
This will generate the minify /path/to/piwik/js/piwik-min.js and copy it to
|
||||
/path/to/piwik/piwik.js
|
||||
|
||||
* In a production environment, the tests/javascript folder is not used and can
|
||||
be removed (if present).
|
||||
|
||||
Note: if the file "js/tests/enable_sqlite" exists, additional unit tests
|
||||
(requires the sqlite extension) are enabled.
|
||||
|
||||
* We use /*! to include Piwik's license header in the minified source. Read
|
||||
Stallman's "The JavaScript Trap" for more information.
|
||||
|
||||
* We do not include the version number as a security best practice
|
||||
(information disclosure).
|
||||
* Information about the current version number you have installed can be found under [What version of Piwik do I have?](http://piwik.org/faq/how-to-update/faq_8/).
|
||||
|
|
|
|||
|
|
@ -1,37 +1,10 @@
|
|||
<?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
|
||||
*/
|
||||
use Piwik\ProxyHttp;
|
||||
define("PIWIK_KEEP_JS_TRACKER_COMMENT", 1);
|
||||
|
||||
/**
|
||||
* Tracker proxy
|
||||
*/
|
||||
if($_SERVER['REQUEST_METHOD'] == 'POST' || !empty($_SERVER['QUERY_STRING'])) {
|
||||
include '../piwik.php';
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* piwik.js proxy
|
||||
*
|
||||
* @see core/Piwik.php
|
||||
*/
|
||||
define('PIWIK_INCLUDE_PATH', '..');
|
||||
define('PIWIK_DOCUMENT_ROOT', '..');
|
||||
define('PIWIK_USER_PATH', '..');
|
||||
|
||||
require_once PIWIK_INCLUDE_PATH . '/libs/upgradephp/upgrade.php';
|
||||
require_once PIWIK_INCLUDE_PATH . '/core/Loader.php';
|
||||
|
||||
$file = '../piwik.js';
|
||||
|
||||
|
||||
$daysExpireFarFuture = 10;
|
||||
|
||||
ProxyHttp::serverStaticFile($file, "application/javascript; charset=UTF-8", $daysExpireFarFuture);
|
||||
|
||||
exit;
|
||||
require_once __DIR__ . '/tracker.php';
|
||||
File diff suppressed because it is too large
Load diff
56
www/analytics/js/tracker.php
Normal file
56
www/analytics/js/tracker.php
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
<?php
|
||||
/**
|
||||
* Piwik - free/libre analytics platform
|
||||
*
|
||||
* @link http://piwik.org
|
||||
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
|
||||
*/
|
||||
use Piwik\ProxyHttp;
|
||||
|
||||
/**
|
||||
* Tracker proxy
|
||||
*/
|
||||
if ($_SERVER['REQUEST_METHOD'] == 'POST'
|
||||
|| !empty($_SERVER['QUERY_STRING'])
|
||||
) {
|
||||
include '../piwik.php';
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* piwik.js proxy
|
||||
*
|
||||
* @see core/Piwik.php
|
||||
*/
|
||||
define('PIWIK_INCLUDE_PATH', '..');
|
||||
define('PIWIK_DOCUMENT_ROOT', '..');
|
||||
define('PIWIK_USER_PATH', '..');
|
||||
|
||||
require_once PIWIK_INCLUDE_PATH . '/libs/upgradephp/upgrade.php';
|
||||
|
||||
if (is_dir(PIWIK_INCLUDE_PATH . '/vendor')) {
|
||||
define('PIWIK_VENDOR_PATH', PIWIK_INCLUDE_PATH . '/vendor'); // Piwik is the main project
|
||||
} else {
|
||||
define('PIWIK_VENDOR_PATH', PIWIK_INCLUDE_PATH . '/../..'); // Piwik is installed as a Composer dependency
|
||||
}
|
||||
|
||||
// Composer autoloader
|
||||
require PIWIK_VENDOR_PATH . '/autoload.php';
|
||||
|
||||
$file = '../piwik.js';
|
||||
|
||||
$daysExpireFarFuture = 10;
|
||||
|
||||
$byteStart = $byteEnd = false;
|
||||
if (!defined("PIWIK_KEEP_JS_TRACKER_COMMENT")
|
||||
|| !PIWIK_KEEP_JS_TRACKER_COMMENT
|
||||
) {
|
||||
$byteStart = 369; // length of comment header in bytes
|
||||
}
|
||||
|
||||
$environment = new \Piwik\Application\Environment(null);
|
||||
$environment->init();
|
||||
|
||||
ProxyHttp::serverStaticFile($file, "application/javascript; charset=UTF-8", $daysExpireFarFuture, $byteStart, $byteEnd);
|
||||
|
||||
exit;
|
||||
Loading…
Add table
Add a link
Reference in a new issue