Beispiel #1
0
 public function tearDown()
 {
     parent::tearDown();
     Log::unsetInstance();
     @unlink(self::getLogFileLocation());
     Error::$debugBacktraceForTests = ExceptionHandler::$debugBacktraceForTests = null;
 }
Beispiel #2
0
 private function init()
 {
     $this->handleFatalErrors();
     if ($this->isDebugModeEnabled()) {
         ErrorHandler::registerErrorHandler();
         ExceptionHandler::setUp();
         Common::printDebug("Debug enabled - Input parameters: ");
         Common::printDebug(var_export($_GET, true));
     }
 }
Beispiel #3
0
 *
 * @link http://piwik.org
 * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
 *
 * @package Piwik
 */
use Piwik\Error;
use Piwik\ExceptionHandler;
use Piwik\FrontController;
use Piwik\Plugin\ControllerAdmin as PluginControllerAdmin;
PluginControllerAdmin::disableEacceleratorIfEnabled();
if (!defined('PIWIK_ENABLE_ERROR_HANDLER') || PIWIK_ENABLE_ERROR_HANDLER) {
    require_once PIWIK_INCLUDE_PATH . '/core/Error.php';
    Error::setErrorHandler();
    require_once PIWIK_INCLUDE_PATH . '/core/ExceptionHandler.php';
    ExceptionHandler::setUp();
}
FrontController::setUpSafeMode();
if (!defined('PIWIK_ENABLE_DISPATCH')) {
    define('PIWIK_ENABLE_DISPATCH', true);
}
if (PIWIK_ENABLE_DISPATCH) {
    $controller = FrontController::getInstance();
    $controller->init();
    $response = $controller->dispatch();
    if (is_array($response)) {
        var_export($response);
    } elseif (!is_null($response)) {
        echo $response;
    }
}
Beispiel #4
0
require_once PIWIK_INCLUDE_PATH . '/core/Tracker/VisitExcluded.php';
require_once PIWIK_INCLUDE_PATH . '/core/Tracker/VisitorNotFoundInDb.php';
require_once PIWIK_INCLUDE_PATH . '/core/CacheFile.php';
require_once PIWIK_INCLUDE_PATH . '/core/Filesystem.php';
require_once PIWIK_INCLUDE_PATH . '/core/Cookie.php';
session_cache_limiter('nocache');
@date_default_timezone_set('UTC');
if (!defined('PIWIK_ENABLE_TRACKING') || PIWIK_ENABLE_TRACKING) {
    ob_start();
}
if ($GLOBALS['PIWIK_TRACKER_DEBUG'] === true) {
    require_once PIWIK_INCLUDE_PATH . '/core/Loader.php';
    require_once PIWIK_INCLUDE_PATH . '/core/Error.php';
    \Piwik\Error::setErrorHandler();
    require_once PIWIK_INCLUDE_PATH . '/core/ExceptionHandler.php';
    \Piwik\ExceptionHandler::setUp();
    $timer = new Timer();
    Common::printDebug("Debug enabled - Input parameters: <br/>" . var_export($_GET, true));
    \Piwik\Tracker\Db::enableProfiling();
    \Piwik\FrontController::createConfigObject();
}
if (!defined('PIWIK_ENABLE_TRACKING') || PIWIK_ENABLE_TRACKING) {
    $process = new Tracker();
    try {
        $process->main();
    } catch (Exception $e) {
        echo "Error:" . $e->getMessage();
    }
    ob_end_flush();
    if ($GLOBALS['PIWIK_TRACKER_DEBUG'] === true) {
        Common::printDebug($_COOKIE);
Beispiel #5
0
 *
 * @link http://piwik.org
 * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
 *
 * @package Piwik
 */
use Piwik\ErrorHandler;
use Piwik\ExceptionHandler;
use Piwik\FrontController;
if (!defined('PIWIK_ENABLE_ERROR_HANDLER') || PIWIK_ENABLE_ERROR_HANDLER) {
    ErrorHandler::registerErrorHandler();
    ExceptionHandler::setUp();
}
FrontController::setUpSafeMode();
if (!defined('PIWIK_ENABLE_DISPATCH')) {
    define('PIWIK_ENABLE_DISPATCH', true);
}
if (PIWIK_ENABLE_DISPATCH) {
    $environment = new \Piwik\Application\Environment(null);
    $environment->init();
    $controller = FrontController::getInstance();
    try {
        $controller->init();
        $response = $controller->dispatch();
        if (!is_null($response)) {
            echo $response;
        }
    } catch (Exception $ex) {
        ExceptionHandler::dieWithHtmlErrorPage($ex);
    }
}