[Piwik-svn] r361 - in trunk: . libs/Zend modules plugins/API plugins/ExamplePlugin

svnmaster at piwik.org svnmaster at piwik.org
Tue Mar 11 23:52:41 CET 2008


Author: matt
Date: 2008-03-11 23:52:39 +0100 (Tue, 11 Mar 2008)
New Revision: 361

Removed:
   trunk/libs/Zend/Debug.php
   trunk/libs/Zend/Json.php
Modified:
   trunk/modules/FrontController.php
   trunk/modules/LogStats.php
   trunk/piwik.js
   trunk/plugins/API/Controller.php
   trunk/plugins/ExamplePlugin/API.php
Log:
- deleting useless zend lib
- fix redirect bug in download/outlink tracking refs #40

Deleted: trunk/libs/Zend/Debug.php
===================================================================
--- trunk/libs/Zend/Debug.php	2008-03-11 21:50:07 UTC (rev 360)
+++ trunk/libs/Zend/Debug.php	2008-03-11 22:52:39 UTC (rev 361)
@@ -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 at 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;
-    }
-
-}

Deleted: trunk/libs/Zend/Json.php
===================================================================
--- trunk/libs/Zend/Json.php	2008-03-11 21:50:07 UTC (rev 360)
+++ trunk/libs/Zend/Json.php	2008-03-11 22:52:39 UTC (rev 361)
@@ -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 at 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);
-    }
-}
-

Modified: trunk/modules/FrontController.php
===================================================================
--- trunk/modules/FrontController.php	2008-03-11 21:50:07 UTC (rev 360)
+++ trunk/modules/FrontController.php	2008-03-11 22:52:39 UTC (rev 361)
@@ -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";
 

Modified: trunk/modules/LogStats.php
===================================================================
--- trunk/modules/LogStats.php	2008-03-11 21:50:07 UTC (rev 360)
+++ trunk/modules/LogStats.php	2008-03-11 22:52:39 UTC (rev 361)
@@ -115,7 +115,10 @@
 		
 		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 @@
 		
 		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);
 		}
 	}

Modified: trunk/piwik.js
===================================================================
--- trunk/piwik.js	2008-03-11 21:50:07 UTC (rev 360)
+++ trunk/piwik.js	2008-03-11 22:52:39 UTC (rev 361)
@@ -158,7 +158,7 @@
 {
 	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);
 }
 

Modified: trunk/plugins/API/Controller.php
===================================================================
--- trunk/plugins/API/Controller.php	2008-03-11 21:50:07 UTC (rev 360)
+++ trunk/plugins/API/Controller.php	2008-03-11 22:52:39 UTC (rev 361)
@@ -60,7 +60,7 @@
 		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";

Modified: trunk/plugins/ExamplePlugin/API.php
===================================================================
--- trunk/plugins/ExamplePlugin/API.php	2008-03-11 21:50:07 UTC (rev 360)
+++ trunk/plugins/ExamplePlugin/API.php	2008-03-11 22:52:39 UTC (rev 361)
@@ -9,8 +9,11 @@
  * @package Piwik_ExamplePlugin
  */
 
+/**
+ * Go to the API page in the Piwik Interface
+ * And try the API of the plugin ExamplePlugin
+ */
 
-
 /**
  * 
  * @package Piwik_ExamplePlugin



More information about the Piwik-svn mailing list