diff options
-rwxr-xr-x | libs/Zend/Debug.php | 103 | ||||
-rwxr-xr-x | libs/Zend/Json.php | 91 | ||||
-rw-r--r-- | modules/FrontController.php | 1 | ||||
-rw-r--r-- | modules/LogStats.php | 10 | ||||
-rw-r--r-- | piwik.js | 2 | ||||
-rw-r--r-- | plugins/API/Controller.php | 2 | ||||
-rw-r--r-- | plugins/ExamplePlugin/API.php | 5 |
7 files changed, 14 insertions, 200 deletions
diff --git a/libs/Zend/Debug.php b/libs/Zend/Debug.php deleted file mode 100755 index 79f4317163..0000000000 --- a/libs/Zend/Debug.php +++ /dev/null @@ -1,103 +0,0 @@ -<?php -/** - * Zend Framework - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://framework.zend.com/license/new-bsd - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@zend.com so we can send you a copy immediately. - * - * @category Zend - * @package Zend_Debug - * @copyright Copyright (c) 2005-2007 Zend Technologies USA Inc. (http://www.zend.com) - * @license http://framework.zend.com/license/new-bsd New BSD License - */ - -/** - * Concrete class for handling view scripts. - * - * @category Zend - * @package Zend_Debug - * @copyright Copyright (c) 2005-2007 Zend Technologies USA Inc. (http://www.zend.com) - * @license http://framework.zend.com/license/new-bsd New BSD License - */ - -class Zend_Debug -{ - - /** - * @var string - */ - protected static $_sapi = null; - - /** - * Get the current value of the debug output environment. - * This defaults to the value of PHP_SAPI. - * - * @return string; - */ - public static function getSapi() - { - if (self::$_sapi === null) { - self::$_sapi = PHP_SAPI; - } - return self::$_sapi; - } - - /** - * Set the debug ouput environment. - * Setting a value of null causes Zend_Debug to use PHP_SAPI. - * - * @param string $sapi - * @return void; - */ - public static function setSapi($sapi) - { - self::$_sapi = $sapi; - } - - /** - * Debug helper function. This is a wrapper for var_dump() that adds - * the <pre /> tags, cleans up newlines and indents, and runs - * htmlentities() before output. - * - * @param mixed $var The variable to dump. - * @param string $label OPTIONAL Label to prepend to output. - * @param bool $echo OPTIONAL Echo output if true. - * @return string - */ - public static function dump($var, $label=null, $echo=true) - { - // format the label - $label = ($label===null) ? '' : rtrim($label) . ' '; - - // var_dump the variable into a buffer and keep the output - ob_start(); - var_dump($var); - $output = ob_get_clean(); - - // neaten the newlines and indents - $output = preg_replace("/\]\=\>\n(\s+)/m", "] => ", $output); - if (self::getSapi() == 'cli') { - $output = PHP_EOL . $label - . PHP_EOL . $output - . PHP_EOL; - } else { - $output = '<pre>' - . $label - . htmlspecialchars($output, ENT_QUOTES) - . '</pre>'; - } - - if ($echo) { - echo($output); - } - return $output; - } - -} diff --git a/libs/Zend/Json.php b/libs/Zend/Json.php deleted file mode 100755 index f81cb27897..0000000000 --- a/libs/Zend/Json.php +++ /dev/null @@ -1,91 +0,0 @@ -<?php -/** - * Zend Framework - * - * LICENSE - * - * This source file is subject to the new BSD license that is bundled - * with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://framework.zend.com/license/new-bsd - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@zend.com so we can send you a copy immediately. - * - * @category Zend - * @package Zend_Json - * @copyright Copyright (c) 2005-2007 Zend Technologies USA Inc. (http://www.zend.com) - * @license http://framework.zend.com/license/new-bsd New BSD License - */ - - -/** - * Class for encoding to and decoding from JSON. - * - * @category Zend - * @package Zend_Json - * @copyright Copyright (c) 2005-2007 Zend Technologies USA Inc. (http://www.zend.com) - * @license http://framework.zend.com/license/new-bsd New BSD License - */ -class Zend_Json -{ - /** - * How objects should be encoded -- arrays or as StdClass. TYPE_ARRAY is 1 - * so that it is a boolean true value, allowing it to be used with - * ext/json's functions. - */ - const TYPE_ARRAY = 1; - const TYPE_OBJECT = 0; - - /** - * @var bool - */ - public static $useBuiltinEncoderDecoder = false; - - /** - * Decodes the given $encodedValue string which is - * encoded in the JSON format - * - * Uses ext/json's json_decode if available. - * - * @param string $encodedValue Encoded in JSON format - * @param int $objectDecodeType Optional; flag indicating how to decode - * objects. See {@link ZJsonDecoder::decode()} for details. - * @return mixed - */ - public static function decode($encodedValue, $objectDecodeType = Zend_Json::TYPE_ARRAY) - { - if (function_exists('json_decode') && self::$useBuiltinEncoderDecoder !== true) { - return json_decode($encodedValue, $objectDecodeType); - } - - require_once 'Zend/Json/Decoder.php'; - return Zend_Json_Decoder::decode($encodedValue, $objectDecodeType); - } - - - /** - * Encode the mixed $valueToEncode into the JSON format - * - * Encodes using ext/json's json_encode() if available. - * - * NOTE: Object should not contain cycles; the JSON format - * does not allow object reference. - * - * NOTE: Only public variables will be encoded - * - * @param mixed $valueToEncode - * @param boolean $cycleCheck Optional; whether or not to check for object recursion; off by default - * @return string JSON encoded object - */ - public static function encode($valueToEncode, $cycleCheck = false) - { - if (function_exists('json_encode') && self::$useBuiltinEncoderDecoder !== true) { - return json_encode($valueToEncode); - } - - require_once 'Zend/Json/Encoder.php'; - return Zend_Json_Encoder::encode($valueToEncode, $cycleCheck); - } -} - diff --git a/modules/FrontController.php b/modules/FrontController.php index 329c4584d4..bb86409c15 100644 --- a/modules/FrontController.php +++ b/modules/FrontController.php @@ -15,7 +15,6 @@ */ require_once "Zend/Exception.php"; require_once "Zend/Loader.php"; -require_once "Zend/Debug.php"; require_once "Zend/Auth.php"; require_once "Zend/Auth/Adapter/DbTable.php"; diff --git a/modules/LogStats.php b/modules/LogStats.php index b96777fa75..656a99fea3 100644 --- a/modules/LogStats.php +++ b/modules/LogStats.php @@ -115,7 +115,10 @@ class Piwik_LogStats if( !empty($urlDownload) ) { - $this->setState( self::STATE_TO_REDIRECT_URL ); + if( Piwik_Common::getRequestVar( 'redirect', 1, 'int') == 1) + { + $this->setState( self::STATE_TO_REDIRECT_URL ); + } $this->setUrlToRedirect ( $urlDownload); } @@ -124,7 +127,10 @@ class Piwik_LogStats if( !empty($urlOutlink) ) { - $this->setState( self::STATE_TO_REDIRECT_URL ); + if( Piwik_Common::getRequestVar( 'redirect', 1, 'int') == 1) + { + $this->setState( self::STATE_TO_REDIRECT_URL ); + } $this->setUrlToRedirect ( $urlOutlink); } } @@ -158,7 +158,7 @@ function piwik_track(url, _pk_site, _pk_url, _pk_type) {
var _pk_image = new Image();
_pk_image.onLoad = function() { _pk_dummy(); };
- _pk_image.src = _pk_url + '?idsite=' + _pk_site + '&' + _pk_type + '=' + url + '&rand=' + Math.random();
+ _pk_image.src = _pk_url + '?idsite=' + _pk_site + '&' + _pk_type + '=' + url + '&rand=' + Math.random() + '&redirect=0';
_pk_pause(_pk_tracker_pause);
}
diff --git a/plugins/API/Controller.php b/plugins/API/Controller.php index 4dbd91c6af..a55274e878 100644 --- a/plugins/API/Controller.php +++ b/plugins/API/Controller.php @@ -60,7 +60,7 @@ class Piwik_API_Controller extends Piwik_Controller echo "<p>If you don't have data for today you can first <a href='misc/generateVisits.php' target=_blank>generate some data</a> using the Visits Generator script.</p>";
echo "<p>You can try the different formats available for every method. It is very easy to extract any data you want from piwik!</p>";
echo "<p>If you want to <b>request the data without being logged in to Piwik</b> you need to add the parameter <code><u>&token_auth=$token_auth</u></code> to the API calls URLs that require authentication.</p>"; - echo "<p><b>For more information have a look at the <a href='http://dev.piwik.org/trac/wiki/API'>official API Documentation</a>.</b></P>";
+ echo "<p><b>For more information have a look at the <a href='http://dev.piwik.org/trac/wiki/API'>official API Documentation</a> or the <a href='http://dev.piwik.org/trac/wiki/API/Reference'>API Reference</a>.</b></P>";
$loaded = $this->init();
echo "<p><i> Loaded successfully $loaded APIs</i></p>\n";
diff --git a/plugins/ExamplePlugin/API.php b/plugins/ExamplePlugin/API.php index a8d89b22ee..8d2be39ff7 100644 --- a/plugins/ExamplePlugin/API.php +++ b/plugins/ExamplePlugin/API.php @@ -9,7 +9,10 @@ * @package Piwik_ExamplePlugin
*/
-
+/** + * Go to the API page in the Piwik Interface + * And try the API of the plugin ExamplePlugin + */
/**
*
|