Teknik is a suite of services with attractive and functional interfaces. https://www.teknik.io/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

dispatch.php 1.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. /**
  3. * Piwik - free/libre analytics platform
  4. *
  5. * @link http://piwik.org
  6. * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
  7. *
  8. * @package Piwik
  9. */
  10. use Piwik\Error;
  11. use Piwik\ExceptionHandler;
  12. use Piwik\FrontController;
  13. use Piwik\Plugin\ControllerAdmin as PluginControllerAdmin;
  14. PluginControllerAdmin::disableEacceleratorIfEnabled();
  15. if (!defined('PIWIK_ENABLE_ERROR_HANDLER') || PIWIK_ENABLE_ERROR_HANDLER) {
  16. require_once PIWIK_INCLUDE_PATH . '/core/Error.php';
  17. Error::setErrorHandler();
  18. require_once PIWIK_INCLUDE_PATH . '/core/ExceptionHandler.php';
  19. ExceptionHandler::setUp();
  20. }
  21. FrontController::setUpSafeMode();
  22. if(!defined('PIWIK_ENABLE_DISPATCH')) {
  23. define('PIWIK_ENABLE_DISPATCH', true);
  24. }
  25. if (PIWIK_ENABLE_DISPATCH) {
  26. $controller = FrontController::getInstance();
  27. $controller->init();
  28. $response = $controller->dispatch();
  29. if(is_array($response)) {
  30. var_export($response);
  31. } elseif (!is_null($response)) {
  32. echo $response;
  33. }
  34. }