Exemplo n.º 1
0
 /**
  * Output the merged JavaScript file.
  * This method is called when the asset manager is enabled.
  * 
  * @see core/AssetManager.php
  */
 public function getJs()
 {
     $jsMergedFile = Piwik_AssetManager::getMergedJsFileLocation();
     Piwik::serveStaticFile($jsMergedFile, "application/javascript; charset=UTF-8");
 }
Exemplo n.º 2
0
<?php

/**
 * Piwik - Open source web analytics
 *
 * @link http://piwik.org
 * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
 * @version $Id: index.php 4151 2011-03-20 11:51:09Z vipsoft $
 */
/**
 * 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/Piwik.php';
$file = '../piwik.js';
Piwik::serveStaticFile($file, "application/javascript; charset=UTF-8");
exit;
Exemplo n.º 3
0
 public function getPieHtc()
 {
     Piwik::serveStaticFile(PIWIK_INCLUDE_PATH . "/libs/CSS3PIE/PIE.htc", "text/x-component");
 }
Exemplo n.º 4
0
    define("PIWIK_USER_PATH", PIWIK_PATH_TEST_TO_ROOT);
    require_once PIWIK_PATH_TEST_TO_ROOT . '/core/Piwik.php';
    switch ($staticFileServerMode) {
        // The static file server calls Piwik::serveStaticFile with a null file
        case NULL_FILE_SRV_MODE:
            Piwik::serveStaticFile(null, TEST_FILE_CONTENT_TYPE);
            break;
            // The static file server calls Piwik::serveStaticFile with a non-existing file
        // The static file server calls Piwik::serveStaticFile with a non-existing file
        case GHOST_FILE_SRV_MODE:
            Piwik::serveStaticFile(TEST_FILE_LOCATION . ".ghost", TEST_FILE_CONTENT_TYPE);
            break;
            // The static file server calls Piwik::serveStaticFile with the test file
        // The static file server calls Piwik::serveStaticFile with the test file
        case TEST_FILE_SRV_MODE:
            Piwik::serveStaticFile(TEST_FILE_LOCATION, TEST_FILE_CONTENT_TYPE);
            break;
    }
    // Stops the execution of the whole file
    exit;
}
if (!defined('PIWIK_CONFIG_TEST_INCLUDED')) {
    require_once PIWIK_PATH_TEST_TO_ROOT . "/tests/config_test.php";
}
// If the static file server has not been requested, the standard unit test case class is defined
class Test_Piwik_serveStaticFile extends UnitTestCase
{
    public function tearDown()
    {
        parent::tearDown();
        chmod(TEST_FILE_LOCATION, 0644);
Exemplo n.º 5
0
 * @version $Id: index.php 4642 2011-05-05 21:23:12Z matt $
 */

/**
 * 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/Piwik.php';

$file = '../piwik.js';

// There is no cache buster parameter so we don't set Expires: header 
$expireFarFuture = false;
Piwik::serveStaticFile($file, "application/javascript; charset=UTF-8", $expireFarFuture);

exit;