/**
  * @return void
  */
 public function initPiwikFrameWork()
 {
     if ($this->initPiwikFramework) {
         $this->initPiwikFramework = TRUE;
         return;
     }
     //load files from piwik
     if (!defined('PIWIK_INCLUDE_PATH')) {
         define('PIWIK_INCLUDE_PATH', PATH_site . 'typo3conf/piwik/piwik/');
         define('PIWIK_USER_PATH', PATH_site . 'typo3conf/piwik/piwik/');
     }
     if (!defined('PIWIK_INCLUDE_SEARCH_PATH')) {
         define('PIWIK_INCLUDE_SEARCH_PATH', PIWIK_INCLUDE_PATH . '/core' . PATH_SEPARATOR . PIWIK_INCLUDE_PATH . '/libs' . PATH_SEPARATOR . PIWIK_INCLUDE_PATH . '/plugins' . PATH_SEPARATOR . get_include_path());
         @ini_set('include_path', PIWIK_INCLUDE_SEARCH_PATH);
         @set_include_path(PIWIK_INCLUDE_SEARCH_PATH);
     }
     set_include_path(PIWIK_INCLUDE_PATH . PATH_SEPARATOR . PIWIK_INCLUDE_PATH . '/libs/' . PATH_SEPARATOR . PIWIK_INCLUDE_PATH . '/plugins/' . PATH_SEPARATOR . get_include_path());
     require_once PIWIK_INCLUDE_PATH . 'libs/upgradephp/upgrade.php';
     require_once PIWIK_INCLUDE_PATH . 'vendor/autoload.php';
     // create root container
     $environment = new \Piwik\Application\Environment(null);
     $environment->init();
     //create config object
     try {
         $config = \Piwik\Config::getInstance();
         $config->getInstance()->init();
     } catch (\Exception $e) {
     }
 }
示例#2
0
    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';
// Composer autoloader
if (file_exists(PIWIK_INCLUDE_PATH . '/vendor/autoload.php')) {
    $path = PIWIK_INCLUDE_PATH . '/vendor/autoload.php';
    // Piwik is the main project
} else {
    $path = PIWIK_INCLUDE_PATH . '/../../autoload.php';
    // Piwik is installed as a dependency
}
require $path;
$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;