Skip to content
This repository has been archived by the owner on Jan 24, 2022. It is now read-only.

Commit

Permalink
Add support for Magento2, Presta 1.6, Drupal 8, Flow and Typo3 Framew…
Browse files Browse the repository at this point in the history
…orks.
  • Loading branch information
beberlei committed Jan 25, 2016
1 parent 68bd255 commit 1476229
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions src/main/Tideways/Profiler.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ class Profiler
const FRAMEWORK_WORDPRESS = 'wordpress';
const FRAMEWORK_LARAVEL = 'laravel';
const FRAMEWORK_MAGENTO = 'magento';
const FRAMEWORK_MAGENTO2 = 'magento2';
const FRAMEWORK_PRESTA16 = 'presta16';
const FRAMEWORK_DRUPAL8 = 'drupal8';
const FRAMEWORK_TYPO3 = 'typo3';
const FRAMEWORK_FLOW = 'flow';

/**
* Default XHProf/Tideways hierachical profiling options.
Expand Down Expand Up @@ -167,6 +172,31 @@ public static function detectFramework($framework)
self::$defaultOptions['exception_function'] = 'Mage::printException';
break;

case self::FRAMEWORK_MAGENTO2:
self::$defaultOptions['transaction_function'] = 'Magento\Framework\App\ActionFactory::create';
self::$defaultOptions['exception_function'] = 'Magento\Framework\App\Http::catchException';
break;

case self::FRAMEWORK_PRESTA16:
self::$defaultOptions['transaction_function'] = 'ControllerCore::getController';
self::$defaultOptions['exception_function'] = 'PrestaShopExceptionCore::displayMessage';
break;

case self::FRAMEWORK_DRUPAL8:
self::$defaultOptions['transaction_function'] = 'Drupal\Core\Controller\ControllerResolver::createController';
self::$defaultOptions['exception_function'] = 'Symfony\Component\HttpKernel\HttpKernel::handleException';
break;

case self::FRAMEWORK_FLOW:
self::$defaultOptions['transaction_function'] = 'TYPO3\Flow\Mvc\Controller\ActionController::callActionMethod';
self::$defaultOptions['exception_function'] = 'TYPO3\Flow\Error\AbstractExceptionHandler::handleException';
break;

case self::FRAMEWORK_TYPO3:
self::$defaultOptions['transaction_function'] = 'TYPO3\CMS\Extbase\Mvc\Controller\ActionController::callActionMethod';
self::$defaultOptions['exception_function'] = 'TYPO3\CMS\Error\AbstractExceptionHandler::handleException';
break;

default:
self::$defaultOptions['transaction_function'] = $framework;
break;
Expand Down

0 comments on commit 1476229

Please sign in to comment.