This is a snapshot of Indico's old Trac site. Any information contained herein is most probably outdated. Access our new GitHub site here.

Ticket #1265: main.inc.php

File main.inc.php, 1.6 KB (added by Slavon, 22 months ago)

http://stoppnd.tumblr.com/

Line 
1<?php
2/**
3 * Piwik - Open source web analytics
4 *
5 * @link http://piwik.org
6 * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
7 * @version $Id: index.php 6068 2012-03-20 06:23:29Z matt $
8 *
9 * @package Piwik
10 */
11
12define('PIWIK_DOCUMENT_ROOT', dirname(__FILE__)=='/'?'':dirname(__FILE__));
13if(file_exists(PIWIK_DOCUMENT_ROOT . '/bootstrap.php'))
14{
15        require_once PIWIK_DOCUMENT_ROOT . '/bootstrap.php';
16}
17
18error_reporting(E_ALL|E_NOTICE);
19@ini_set('display_errors', defined('PIWIK_DISPLAY_ERRORS') ? PIWIK_DISPLAY_ERRORS : @ini_get('display_errors')); 
20@ini_set('xdebug.show_exception_trace', 0);
21@ini_set('magic_quotes_runtime', 0);
22
23if(!defined('PIWIK_USER_PATH'))
24{
25        define('PIWIK_USER_PATH', PIWIK_DOCUMENT_ROOT);
26}
27if(!defined('PIWIK_INCLUDE_PATH'))
28{
29        define('PIWIK_INCLUDE_PATH', PIWIK_DOCUMENT_ROOT);
30}
31
32require_once PIWIK_INCLUDE_PATH . '/libs/upgradephp/upgrade.php';
33require_once PIWIK_INCLUDE_PATH . '/core/testMinimumPhpVersion.php';
34
35// NOTE: the code above this comment must be PHP4 compatible
36
37session_cache_limiter('nocache');
38@date_default_timezone_set('UTC');
39require_once PIWIK_INCLUDE_PATH .'/core/Loader.php';
40
41if(!defined('PIWIK_ENABLE_ERROR_HANDLER') || PIWIK_ENABLE_ERROR_HANDLER)
42{
43        require_once PIWIK_INCLUDE_PATH .'/core/ErrorHandler.php';
44        require_once PIWIK_INCLUDE_PATH .'/core/ExceptionHandler.php';
45        set_error_handler('Piwik_ErrorHandler');
46        set_exception_handler('Piwik_ExceptionHandler');
47}
48
49if(!defined('PIWIK_ENABLE_DISPATCH') || PIWIK_ENABLE_DISPATCH)
50{
51        $controller = Piwik_FrontController::getInstance();
52        $controller->init();
53        $controller->dispatch();
54}