├── .gitignore ├── .travis.yml ├── Api ├── Data │ └── ProfileInterface.php └── ProfileRepositoryInterface.php ├── App ├── AbstractAction.php ├── Action │ ├── Context.php │ └── Frontend │ │ └── Context.php ├── Area │ └── FrontNameResolver.php ├── Config.php ├── ConfigInterface.php ├── DefaultPath.php ├── Request │ └── PathInfoProcessor.php ├── Router.php └── Router │ └── NoRouteHandler.php ├── Console └── Command │ ├── DatabaseProfilerDisableCommand.php │ └── DatabaseProfilerEnableCommand.php ├── Controller ├── Adminhtml │ └── Profiler │ │ └── Config.php └── Debug │ ├── Cache │ ├── Clean.php │ ├── Disable.php │ ├── Enable.php │ └── Flush.php │ ├── Profiler │ ├── Info.php │ ├── PHPInfo.php │ ├── Purge.php │ ├── Search.php │ └── Toolbar.php │ └── Xhprof │ └── Detail.php ├── Exception └── CollectorNotFoundException.php ├── Helper ├── Config.php ├── Database.php ├── Debug.php ├── File.php ├── Formatter.php ├── Injector.php └── Url.php ├── Interception ├── CliCallmap.php ├── CliProfiler.php ├── Code │ └── Generator │ │ ├── Interceptor.php │ │ └── SetupInterceptor.php ├── Interceptor.php └── PluginDataCollector.php ├── Logger ├── DataLogger.php ├── Handler.php ├── LoggableInterface.php └── Logger.php ├── Model ├── Collector │ ├── AjaxCollector.php │ ├── CacheCollector.php │ ├── CallmapCollector.php │ ├── CollectorInterface.php │ ├── ConfigCollector.php │ ├── CustomerCollector.php │ ├── DatabaseCollector.php │ ├── EventCollector.php │ ├── LateCollectorInterface.php │ ├── LayoutCollector.php │ ├── LoggerCollectorInterface.php │ ├── MemoryCollector.php │ ├── ModelCollector.php │ ├── PluginCollector.php │ ├── RequestCollector.php │ ├── TimeCollector.php │ └── TranslationCollector.php ├── Config │ ├── Database │ │ └── ProfilerWriter.php │ └── Source │ │ ├── ErrorHandler.php │ │ └── XhprofFlags.php ├── DataCollector.php ├── Indexer │ └── ProfileIndexer.php ├── Info │ ├── CacheInfo.php │ ├── CallmapInfo.php │ ├── CustomerInfo.php │ ├── DatabaseInfo.php │ ├── ExtensionInfo.php │ ├── LayoutInfo.php │ ├── MagentoInfo.php │ ├── MemoryInfo.php │ ├── PluginInfo.php │ └── RequestInfo.php ├── Profile.php ├── Profile │ └── Criteria.php ├── ProfileRepository.php ├── Profiler.php ├── Profiler │ └── Driver │ │ └── StopwatchDriver.php ├── Serializer │ ├── CollectorSerializer.php │ └── ProfileSerializer.php ├── Session.php ├── Storage │ ├── HttpStorage.php │ ├── ProfileFileStorage.php │ └── ProfileMemoryStorage.php ├── Url │ └── ScopeResolver.php ├── ValueObject │ ├── Block.php │ ├── CacheAction.php │ ├── EventObserver.php │ ├── LayoutNode.php │ ├── LoopModelAction.php │ ├── ModelAction.php │ ├── Plugin.php │ ├── Redirect.php │ ├── SearchResult.php │ └── Translation.php └── View │ ├── Menu.php │ ├── Profiler.php │ ├── Renderer │ ├── LayoutGraphRenderer.php │ ├── LayoutNodeRenderer.php │ ├── ParametersRenderer.php │ ├── QueryListRenderer.php │ ├── QueryParametersRenderer.php │ ├── QueryRenderer.php │ ├── RedirectRenderer.php │ ├── RendererInterface.php │ ├── TableRenderer.php │ ├── TraceCallRenderer.php │ ├── TraceRenderer.php │ ├── VarRenderer.php │ └── XhprofProfile.php │ ├── Search.php │ ├── Summary.php │ ├── Toolbar.php │ └── Xhprof.php ├── Observer ├── AllowedIP.php ├── BeforeSendResponse.php ├── Collector │ ├── LayoutCollectorAfterToHtml.php │ └── LayoutCollectorBeforeToHtml.php ├── Config │ └── DatabaseProfiler.php ├── DebugHandle.php └── ValidateRedirect.php ├── Plugin ├── Collector │ ├── CacheCollectorPlugin.php │ ├── CallmapCollectorPlugin.php │ ├── EventCollectorPlugin.php │ ├── ModelCollectorPlugin.php │ ├── TimeCollectorPlugin.php │ └── TranslationCollectorPlugin.php ├── ErrorHandler │ └── WhoopsPlugin.php ├── PageCache │ └── KernelPlugin.php └── ProfileRepository │ └── RequestTimePlugin.php ├── Readme.md ├── Serializer ├── Serializer.php └── SerializerInterface.php ├── composer.json ├── etc ├── adminhtml │ ├── di.xml │ ├── events.xml │ ├── routes.xml │ └── system.xml ├── config.xml ├── debug │ ├── di.xml │ └── routes.xml ├── di.xml ├── events.xml ├── frontend │ └── routes.xml └── module.xml ├── phpmd.xml ├── registration.php └── view └── base ├── layout ├── clawrock_debug.xml ├── debug_panel_cache.xml ├── debug_panel_callmap.xml ├── debug_panel_config.xml ├── debug_panel_database.xml ├── debug_panel_event.xml ├── debug_panel_layout.xml ├── debug_panel_model.xml ├── debug_panel_plugin.xml ├── debug_panel_request.xml ├── debug_panel_time.xml ├── debug_panel_translation.xml ├── debug_profiler_info.xml ├── debug_profiler_search.xml ├── debug_profiler_toolbar.xml └── debug_xhprof_detail.xml ├── page_layout ├── profiler.xml └── toolbar.xml ├── requirejs-config.js ├── templates ├── menu │ ├── cache.phtml │ ├── callmap.phtml │ ├── config.phtml │ ├── database.phtml │ ├── event.phtml │ ├── layout.phtml │ ├── model.phtml │ ├── plugin.phtml │ ├── request.phtml │ ├── settings.phtml │ ├── time.phtml │ └── translation.phtml ├── panel │ ├── cache.phtml │ ├── callmap.phtml │ ├── callmap_detail.phtml │ ├── config.phtml │ ├── database.phtml │ ├── event.phtml │ ├── layout.phtml │ ├── model.phtml │ ├── plugin.phtml │ ├── request.phtml │ ├── time.phtml │ └── translation.phtml ├── profiler.phtml ├── profiler │ ├── js.phtml │ ├── summary.phtml │ └── toolbar │ │ └── js.phtml ├── renderer │ ├── layout │ │ ├── graph.phtml │ │ └── node.phtml │ ├── parameters.phtml │ ├── query.phtml │ ├── query │ │ └── list.phtml │ ├── redirect.phtml │ ├── table.phtml │ ├── trace.phtml │ └── trace │ │ └── call.phtml ├── search │ ├── input.phtml │ └── results.phtml ├── toolbar.phtml └── toolbar │ ├── ajax.phtml │ ├── cache.phtml │ ├── callmap.phtml │ ├── config.phtml │ ├── customer.phtml │ ├── database.phtml │ ├── event.phtml │ ├── layout.phtml │ ├── memory.phtml │ ├── model.phtml │ ├── plugin.phtml │ ├── request.phtml │ ├── time.phtml │ └── translation.phtml └── web ├── css ├── jquery-ui.css ├── profiler.css └── toolbar.css ├── images ├── collector │ ├── ajax.svg │ ├── cache.svg │ ├── config.svg │ ├── customer.svg │ ├── database.svg │ ├── event.svg │ ├── layout.svg │ ├── logs.svg │ ├── memory.svg │ ├── model.svg │ ├── models.svg │ ├── plugin.svg │ ├── redirect.svg │ ├── time.svg │ └── translation.svg ├── icon │ ├── close.svg │ ├── menu.svg │ ├── no.svg │ ├── search.svg │ ├── settings.svg │ └── yes.svg ├── jquery-ui │ ├── ui-icons_444444_256x240.png │ ├── ui-icons_555555_256x240.png │ ├── ui-icons_777620_256x240.png │ ├── ui-icons_777777_256x240.png │ ├── ui-icons_cc0000_256x240.png │ └── ui-icons_ffffff_256x240.png ├── magento.svg └── readme │ ├── ajax.png │ ├── cache.png │ ├── callmap-main.png │ ├── callmap-popup.png │ ├── config.png │ ├── database.png │ ├── events.png │ ├── homepage.png │ ├── hyva.png │ ├── layout-block-cache.png │ ├── layout-render.png │ ├── memory.png │ ├── models.png │ ├── performance.png │ ├── plugins.png │ ├── request.png │ └── translation.png └── js ├── callmap └── extra-data.js └── tablesorter.js /.gitignore: -------------------------------------------------------------------------------- 1 | /.idea/ 2 | composer.lock 3 | /vendor 4 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: php 2 | 3 | php: 4 | - 7.0 5 | - 7.1 6 | - 7.2 7 | 8 | install: 9 | - echo "{\"http-basic\":{\"repo.magento.com\":{\"username\":\"${MAGENTO_USERNAME}\",\"password\":\"${MAGENTO_PASSWORD}\"}}}" > auth.json 10 | - composer install --prefer-dist 11 | 12 | script: 13 | - php vendor/bin/phpcs --standard=PSR2 --extensions=php --ignore=etc,view,vendor . 14 | - php vendor/bin/phpmd . text phpmd.xml --suffixes=php 15 | - php vendor/bin/phpcpd . --exclude=etc --exclude=Test --exclude=view --exclude=vendor 16 | - php vendor/bin/phpunit --coverage-clover build/logs/clover.xml 17 | 18 | after_script: 19 | - php vendor/bin/php-coveralls 20 | 21 | env: 22 | global: 23 | - secure: VSM4hmQPJNRN6TcD4k1dbUJblG3gtEOGR08MuQA8AzKejHVcMLbz5auUJkHcSR+zKUimsINUFPRPn1A2lFTSfYttmiYZfpIIf0oQcs+wqp/v0UaO56G9nEzTmzRbxr9gz65eNzFJakfsg95CS1RGN6wVQK4LNOUYyHeT/saJ+69D9WdMH3qkWksWAyCYJoMd9zJFf5ojg7DtcwMzA+FC2AZcXMcwWBTY1yXInGaO87hz3VhodrJT2MapvEoB3PHul/2zAnHSfSJyQmioRa3QGdK6oXsckuZMafSpcVhWNN9bzMS7Z+nYTPJEeM085pAK6XUHKadCYdHDXEQEiG7OmJP5wMNEmw9aXRKS4wOc9IsuXHoGiO5jzeGFuXcj66yqPYBkotQ/uEUrCzZ758G9XvxqR4dI01uUcme35eSZg44PofXOtD34sxkW8Zkat/3RKJUHyqxeyms+0aPRtbeRXo3agw75Sr89n4AqapCPMnhVrKKDXOXbAV16+OCHIEalX8WrXnzDoBg/CK4EBI7AtRWV1PAdGXEVdXRrfVG4fEilwyIMHpCEXTZN3KPjnZsNKBwG4KGVAffIgm+jmR+hQQWCHo0c5roDUNY5ekG+FL54jwFB3e7Jq2x37iXBUDW/jLaRVab53T/ugAC3IZmJWILHPQ4VCzs1Jjt+6ojoLGM= 24 | - secure: aYHyyZwkkwcIgT0Drf4rncibv7DWUH74tpe6LNEyYnu11nPKv9sQD7xj3G9c2Z+rp3QSbN+QPyYtY0BY8KzGoLLoTHrmECOBi5O/kDyzFumo/p2Vt6YrFpOSn9GByuys8eL5o8LCtpKVWlvi0B5X3k693eLaHEy12VqpK2igB1HOUZC+2FNzO8U7gGH9aomOLxr08pW0uCk14KNj3KPCi/PixX1JP6KBt0OGyM7+nFBJzet9nDDdy16PDBTdcIYGnIAcE/JKtYdQek4OpvacKaCkfZ++wZ6u1c8oyO5SEPHZW8yiN1rjosXw8gE/dOJarrNeYo8gidAJHX6Tia7F+t23c2JcvIkSS5xInalWyvvrUntJ6eiAy8RZfxWTJzXrJ0aFhtbcmKhG8fR4QH83bfoF3nBHOT8551eadh7pjTz5CZ3NMzV5mQ3/+kXWctXOTgsTTlBG/9JZDszRIkPm8i3aTLt0JGVtQRnxuwBO8F5LZhGWVii4wwQBZj9vshlQ3lDcU9FF285aBwhQBfid7PjlyCKme0DK9/d4TjFWcTE7QQ4yVmbw9Q5pNigPNalNFI3N+xo4XOkyWWUk0E02C2i5oWdIHkrqyBm3lxYQyldYcwMnJk+DzPQB7UeHiuXknjZNyJjW7E4lkriRu/6aTisIvuC5G6QY2KCYMBNVH90= 25 | -------------------------------------------------------------------------------- /Api/Data/ProfileInterface.php: -------------------------------------------------------------------------------- 1 | appConfig = $appConfig; 27 | } 28 | 29 | /** 30 | * @inheritdoc 31 | */ 32 | public function getValue($path) 33 | { 34 | if (isset($this->data[$path])) { 35 | return $this->data[$path]; 36 | } 37 | 38 | $configPath = ScopeConfigInterface::SCOPE_TYPE_DEFAULT; 39 | if ($path) { 40 | $configPath .= '/' . $path; 41 | } 42 | return $this->appConfig->get(System::CONFIG_TYPE, $configPath); 43 | } 44 | 45 | /** 46 | * @inheritdoc 47 | */ 48 | public function setValue($path, $value) 49 | { 50 | $this->data[$path] = $value; 51 | } 52 | 53 | /** 54 | * @inheritdoc 55 | */ 56 | public function isSetFlag($path) 57 | { 58 | $configPath = ScopeConfigInterface::SCOPE_TYPE_DEFAULT; 59 | if ($path) { 60 | $configPath .= '/' . $path; 61 | } 62 | return (bool) $this->appConfig->get(System::CONFIG_TYPE, $configPath); 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /App/ConfigInterface.php: -------------------------------------------------------------------------------- 1 | getValue('web/default/debug')); 18 | 19 | $this->parts = [ 20 | 'area' => isset($pathParts[0]) ? $pathParts[0] : '', 21 | 'module' => isset($pathParts[1]) ? $pathParts[1] : 'debug', 22 | 'controller' => isset($pathParts[2]) ? $pathParts[2] : 'index', 23 | 'action' => isset($pathParts[3]) ? $pathParts[3] : 'index', 24 | ]; 25 | } 26 | 27 | /** 28 | * Retrieve default path part by code 29 | * 30 | * @param string $code 31 | * @return string 32 | */ 33 | public function getPart($code) 34 | { 35 | return isset($this->parts[$code]) ? $this->parts[$code] : null; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /App/Request/PathInfoProcessor.php: -------------------------------------------------------------------------------- 1 | subject = $subject; 26 | $this->frontname = $frontNameResolver; 27 | } 28 | 29 | /** 30 | * Process path info 31 | * 32 | * @param \Magento\Framework\App\RequestInterface $request 33 | * @param string $pathInfo 34 | * @return string 35 | */ 36 | public function process(\Magento\Framework\App\RequestInterface $request, $pathInfo) 37 | { 38 | $pathParts = explode('/', ltrim($pathInfo, '/'), 2); 39 | $firstPart = $pathParts[0]; 40 | 41 | if ($firstPart != $this->frontNameResolver->getFrontName()) { 42 | return $this->subject->process($request, $pathInfo); 43 | } 44 | return $pathInfo; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /App/Router.php: -------------------------------------------------------------------------------- 1 | getPathInfo(), '/'); 56 | $path = FrontNameResolver::AREA_CODE . '/' . $path; 57 | 58 | $params = explode('/', $path ? $path : $this->pathConfig->getDefaultPath()); 59 | foreach ($this->_requiredParams as $paramName) { 60 | $output[$paramName] = array_shift($params); 61 | } 62 | //$output['moduleFrontName'] = 'debug'; 63 | for ($i = 0, $l = sizeof($params); $i < $l; $i += 2) { 64 | $output['variables'][$params[$i]] = isset($params[$i + 1]) ? urldecode($params[$i + 1]) : ''; 65 | } 66 | return $output; 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /App/Router/NoRouteHandler.php: -------------------------------------------------------------------------------- 1 | frontNameResolver = $frontNameResolver; 25 | $this->routeConfig = $routeConfig; 26 | } 27 | 28 | /** 29 | * Check and process no route request 30 | * 31 | * @param \Magento\Framework\App\RequestInterface $request 32 | * @return bool 33 | */ 34 | public function process(\Magento\Framework\App\RequestInterface $request) 35 | { 36 | $requestPathParams = explode('/', trim($request->getPathInfo(), '/')); 37 | $areaFrontName = array_shift($requestPathParams); 38 | 39 | if ($areaFrontName === $this->frontNameResolver->getFrontName(true)) { 40 | $moduleName = $this->routeConfig->getRouteFrontName('debug'); 41 | $actionNamespace = 'noroute'; 42 | $actionName = 'index'; 43 | $request->setModuleName($moduleName)->setControllerName($actionNamespace)->setActionName($actionName); 44 | return true; 45 | } 46 | return false; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Console/Command/DatabaseProfilerDisableCommand.php: -------------------------------------------------------------------------------- 1 | profilerWriter = $profilerWriter; 22 | } 23 | 24 | protected function configure() 25 | { 26 | parent::configure(); 27 | 28 | $this->setDescription('Disable database profiler required for database collector.'); 29 | } 30 | 31 | /** 32 | * @SuppressWarnings(PHPMD.UnusedFormalParameter) 33 | */ 34 | protected function execute(InputInterface $input, OutputInterface $output) 35 | { 36 | $this->profilerWriter->save(false); 37 | 38 | $output->writeLn('Database profiler disabled!'); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Console/Command/DatabaseProfilerEnableCommand.php: -------------------------------------------------------------------------------- 1 | profilerWriter = $profilerWriter; 22 | } 23 | 24 | protected function configure() 25 | { 26 | parent::configure(); 27 | 28 | $this->setDescription('Enable database profiler required for database collector.'); 29 | } 30 | 31 | /** 32 | * @SuppressWarnings(PHPMD.UnusedFormalParameter) 33 | */ 34 | protected function execute(InputInterface $input, OutputInterface $output) 35 | { 36 | $this->profilerWriter->save(true); 37 | 38 | $output->writeLn('Database profiler enabled!'); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Controller/Adminhtml/Profiler/Config.php: -------------------------------------------------------------------------------- 1 | resultRedirectFactory->create(); 20 | 21 | return $resultRedirect->setPath('admin/system_config/edit', [ 22 | 'section' => 'daseraf_debug', 23 | 'key' => $this->_url->getSecretKey('adminhtml', 'system_config', 'edit'), 24 | ]); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Controller/Debug/Cache/Clean.php: -------------------------------------------------------------------------------- 1 | cacheManager = $cacheManager; 21 | } 22 | 23 | public function execute() 24 | { 25 | $result = $this->resultFactory->create(ResultFactory::TYPE_JSON); 26 | $types = $this->getRequest()->getParam('type'); 27 | 28 | if (!$types) { 29 | $types = $this->cacheManager->getAvailableTypes(); 30 | } 31 | 32 | $this->cacheManager->clean((array) $types); 33 | 34 | return $result; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Controller/Debug/Cache/Disable.php: -------------------------------------------------------------------------------- 1 | cacheManager = $cacheManager; 21 | } 22 | 23 | public function execute() 24 | { 25 | $result = $this->resultFactory->create(ResultFactory::TYPE_JSON); 26 | $types = $this->getRequest()->getParam('type'); 27 | 28 | $this->cacheManager->setEnabled((array) $types, false); 29 | 30 | return $result; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Controller/Debug/Cache/Enable.php: -------------------------------------------------------------------------------- 1 | cacheManager = $cacheManager; 21 | } 22 | 23 | public function execute() 24 | { 25 | $result = $this->resultFactory->create(ResultFactory::TYPE_JSON); 26 | $types = $this->getRequest()->getParam('type'); 27 | 28 | $this->cacheManager->setEnabled((array) $types, true); 29 | 30 | return $result; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Controller/Debug/Cache/Flush.php: -------------------------------------------------------------------------------- 1 | cacheManager = $cacheManager; 21 | } 22 | 23 | public function execute() 24 | { 25 | $result = $this->resultFactory->create(ResultFactory::TYPE_JSON); 26 | $types = $this->getRequest()->getParam('type'); 27 | 28 | if (!$types) { 29 | $types = $this->cacheManager->getAvailableTypes(); 30 | } 31 | 32 | $this->cacheManager->flush((array) $types); 33 | 34 | return $result; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Controller/Debug/Profiler/PHPInfo.php: -------------------------------------------------------------------------------- 1 | resultFactory->create(ResultFactory::TYPE_RAW); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Controller/Debug/Profiler/Purge.php: -------------------------------------------------------------------------------- 1 | profileFileStorage = $profileFileStorage; 28 | $this->logger = $logger; 29 | } 30 | 31 | public function execute() 32 | { 33 | try { 34 | $this->profileFileStorage->purge(); 35 | } catch (FileSystemException $e) { 36 | $this->logger->critical($e); 37 | } 38 | 39 | /** @var $resultRedirect */ 40 | return $this->resultFactory->create(ResultFactory::TYPE_REDIRECT) 41 | ->setUrl($this->_redirect->getRefererUrl()); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Controller/Debug/Profiler/Search.php: -------------------------------------------------------------------------------- 1 | layout = $layout; 30 | $this->profileRepository = $profileRepository; 31 | } 32 | 33 | /** 34 | * @SuppressWarnings(PHPMD.StaticAccess) 35 | * @return \Magento\Framework\App\ResponseInterface|\Magento\Framework\Controller\ResultInterface 36 | */ 37 | public function execute() 38 | { 39 | $request = $this->getRequest(); 40 | 41 | if (!empty($token = $request->getParam('_token'))) { 42 | return $this->_redirect('debug/profiler/info', [Profiler::URL_TOKEN_PARAMETER => $token]); 43 | } 44 | 45 | /** @var \Magento\Framework\View\Result\Page $page */ 46 | $page = $this->resultFactory->create(ResultFactory::TYPE_PAGE); 47 | 48 | $page->addPageLayoutHandles([ 49 | 'profiler' => 'info', 50 | ], 'debug'); 51 | 52 | $criteria = Criteria::createFromRequest($request); 53 | 54 | $this->layout->getBlock('debug.profiler.panel.content')->addData([ 55 | 'results' => $this->profileRepository->find($criteria), 56 | 'criteria' => $criteria, 57 | ]); 58 | 59 | return $page; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /Controller/Debug/Profiler/Toolbar.php: -------------------------------------------------------------------------------- 1 | profileMemoryStorage = $profileMemoryStorage; 28 | $this->profileRepository = $profileRepository; 29 | } 30 | 31 | public function execute() 32 | { 33 | $token = $this->getRequest()->getParam(Profiler::URL_TOKEN_PARAMETER); 34 | $profile = $this->profileRepository->getById($token); 35 | $this->profileMemoryStorage->write($profile); 36 | 37 | return $this->resultFactory->create(ResultFactory::TYPE_PAGE); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Exception/CollectorNotFoundException.php: -------------------------------------------------------------------------------- 1 | isBacktraceItemValid($item, $functions)) { 22 | array_shift($backtrace); 23 | $item = reset($backtrace); 24 | } 25 | 26 | return array_map(function ($item) { 27 | unset($item['object'], $item['args'], $item['type']); 28 | 29 | return $item; 30 | }, $backtrace); 31 | } 32 | 33 | private function isBacktraceItemValid(array $data, array $functions): bool 34 | { 35 | if (!isset($data['class'], $data['function'])) { 36 | return false; 37 | } 38 | 39 | if (empty($functions)) { 40 | return true; 41 | } 42 | 43 | if (!in_array($data['function'], $functions)) { 44 | return false; 45 | } 46 | 47 | return true; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /Helper/File.php: -------------------------------------------------------------------------------- 1 | directoryList = $directoryList; 16 | } 17 | 18 | /** 19 | * @throws \Magento\Framework\Exception\FileSystemException 20 | * @return string 21 | */ 22 | public function getProfileDirectory() 23 | { 24 | return $this->directoryList->getPath('var') . DIRECTORY_SEPARATOR . 'debug'; 25 | } 26 | 27 | /** 28 | * @throws \Magento\Framework\Exception\FileSystemException 29 | * @return string 30 | */ 31 | public function getProfileIndex() 32 | { 33 | return $this->directoryList->getPath('var') . DIRECTORY_SEPARATOR . 'debug' . DIRECTORY_SEPARATOR . 'index.csv'; 34 | } 35 | 36 | public function getProfileTempIndex() 37 | { 38 | return $this->directoryList->getPath('var') . DIRECTORY_SEPARATOR . 'debug' . DIRECTORY_SEPARATOR . 'tmp' 39 | . DIRECTORY_SEPARATOR . 'index.csv'; 40 | } 41 | 42 | /** 43 | * @param $token 44 | * @throws \Magento\Framework\Exception\FileSystemException 45 | * @return string 46 | */ 47 | public function getProfileFilename($token) 48 | { 49 | return $this->getProfileDirectory() . DIRECTORY_SEPARATOR 50 | . substr($token, -2, 2) . DIRECTORY_SEPARATOR 51 | . substr($token, -4, 2) . DIRECTORY_SEPARATOR 52 | . $token; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /Helper/Formatter.php: -------------------------------------------------------------------------------- 1 | config = $config; 16 | } 17 | 18 | public function microtime(float $value, int $precision = null) 19 | { 20 | if ($precision === null) { 21 | $precision = $this->config->getTimePrecision(); 22 | } 23 | 24 | return sprintf('%0.' . $precision . 'f', $value * 1000); 25 | } 26 | 27 | public function revertMicrotime(string $value): float 28 | { 29 | return (float) $value / 1000; 30 | } 31 | 32 | public function toMegaBytes(int $value, int $precision = 0) 33 | { 34 | return sprintf('%0.' . $precision . 'f', $value / 1024 / 1024); 35 | } 36 | 37 | public function formatBytes($bytes, $to, $decimal_places = 3) 38 | { 39 | $formulas = [ 40 | 'K' => number_format($bytes / 1024, $decimal_places), 41 | 'M' => number_format($bytes / 1048576, $decimal_places), 42 | 'G' => number_format($bytes / 1073741824, $decimal_places), 43 | ]; 44 | 45 | return $formulas[$to] ?? 0; 46 | } 47 | 48 | public function percentage(float $value, int $precision = 5) 49 | { 50 | return sprintf('%.' . $precision . 'f%%', $value * 100); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /Helper/Injector.php: -------------------------------------------------------------------------------- 1 | layout = $layout; 26 | $this->viewModel = $viewModel; 27 | } 28 | 29 | public function inject(Request $request, Response $response, $token = null) 30 | { 31 | $content = $response->getBody(); 32 | $pos = strripos($content, ''); 33 | 34 | if (false !== $pos) { 35 | /** @var Toolbar $toolbarBlock */ 36 | $toolbarBlock = $this->layout->createBlock(Template::class, 'debug.toolbar'); 37 | $toolbarBlock->setTemplate('Daseraf_Debug::profiler/toolbar/js.phtml')->setData([ 38 | 'view_model' => $this->viewModel, 39 | 'token' => $token, 40 | 'request' => $request, 41 | ]); 42 | 43 | /** @var Template $jsBlock */ 44 | $jsBlock = $this->layout->createBlock(Template::class, 'debug.profiler.js'); 45 | $jsBlock->setTemplate('Daseraf_Debug::profiler/js.phtml'); 46 | 47 | $toolbarBlock->setChild('debug_profiler_js', $jsBlock); 48 | 49 | $toolbar = "\n" . str_replace("\n", '', $toolbarBlock->toHtml()) . "\n"; 50 | $content = substr($content, 0, $pos) . $toolbar . substr($content, $pos); 51 | $response->setBody($content); 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /Interception/CliProfiler.php: -------------------------------------------------------------------------------- 1 | logger = ObjectManager::getInstance()->get(LoggerInterface::class); 34 | $this->profiler = ObjectManager::getInstance()->get(Profiler::class); 35 | } 36 | 37 | /** 38 | * @inheritdoc 39 | * 40 | * @throws \Exception The exception in case of unexpected error 41 | */ 42 | public function doRun(InputInterface $input, OutputInterface $output) 43 | { 44 | $exitCode = null; 45 | try { 46 | $exitCode = parent::doRun($input, $output); 47 | } catch (\Exception $e) { 48 | $errorMessage = $e->getMessage() . PHP_EOL . $e->getTraceAsString(); 49 | $this->logger->error($errorMessage); 50 | $this->initException = $e; 51 | } 52 | 53 | if ($this->initException) { 54 | throw $this->initException; 55 | } 56 | 57 | $name = $this->getCommandName($input); 58 | $this->profiler->collectCli($exitCode, $name); 59 | 60 | return $exitCode; 61 | } 62 | } -------------------------------------------------------------------------------- /Interception/Code/Generator/Interceptor.php: -------------------------------------------------------------------------------- 1 | getSourceClassName(); 11 | $reflection = new \ReflectionClass($typeName); 12 | 13 | $interfaces = []; 14 | if ($reflection->isInterface()) { 15 | $interfaces[] = $typeName; 16 | } else { 17 | $this->_classGenerator->setExtendedClass($typeName); 18 | } 19 | $this->_classGenerator->addTrait('\\' . \Daseraf\Debug\Interception\Interceptor::class); 20 | $interfaces[] = '\\' . \Magento\Framework\Interception\InterceptorInterface::class; 21 | $this->_classGenerator->setImplementedInterfaces($interfaces); 22 | 23 | return \Magento\Framework\Code\Generator\EntityAbstract::_generateCode(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Interception/Code/Generator/SetupInterceptor.php: -------------------------------------------------------------------------------- 1 | getSourceClassName(); 11 | $reflection = new \ReflectionClass($typeName); 12 | 13 | $interfaces = []; 14 | if ($reflection->isInterface()) { 15 | $interfaces[] = $typeName; 16 | } else { 17 | $this->_classGenerator->setExtendedClass($typeName); 18 | } 19 | $this->_classGenerator->addTrait('\\' . \Daseraf\Debug\Interception\Interceptor::class); 20 | $interfaces[] = '\\' . \Magento\Framework\Interception\InterceptorInterface::class; 21 | $this->_classGenerator->setImplementedInterfaces($interfaces); 22 | 23 | return \Magento\Framework\Code\Generator\EntityAbstract::_generateCode(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Interception/PluginDataCollector.php: -------------------------------------------------------------------------------- 1 | [], 11 | DefinitionInterface::LISTENER_AROUND => [], 12 | DefinitionInterface::LISTENER_AFTER => [] 13 | ]; 14 | 15 | private $executedTypes = []; 16 | 17 | /** 18 | * @param array $data 19 | * @return void 20 | */ 21 | public function setPluginExecutionTime(array $data) 22 | { 23 | $definition = array_key_first($data); 24 | $this->execution[$definition] = array_merge_recursive($this->execution[$definition], $data[$definition]); 25 | } 26 | 27 | public function getPluginExecutionTime() 28 | { 29 | return $this->execution; 30 | } 31 | 32 | public function addInExecutedTypes($typeClass) 33 | { 34 | $this->executedTypes[] = $typeClass; 35 | } 36 | 37 | public function getExecutedTypes() 38 | { 39 | return $this->executedTypes; 40 | } 41 | } -------------------------------------------------------------------------------- /Logger/DataLogger.php: -------------------------------------------------------------------------------- 1 | data[$value->getId()] = $value; 12 | 13 | return $this; 14 | } 15 | 16 | public function getLogs() 17 | { 18 | return $this->data; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Logger/Handler.php: -------------------------------------------------------------------------------- 1 | config = $config; 18 | } 19 | 20 | public function collect(): CollectorInterface 21 | { 22 | // Nothing to collect here 23 | return $this; 24 | } 25 | 26 | /** 27 | * @return bool 28 | */ 29 | public function isEnabled(): bool 30 | { 31 | return $this->config->isAjaxCollectorEnabled(); 32 | } 33 | 34 | public function getData(): array 35 | { 36 | return []; 37 | } 38 | 39 | public function setData(array $data): CollectorInterface 40 | { 41 | return $this; 42 | } 43 | 44 | public function getName(): string 45 | { 46 | return self::NAME; 47 | } 48 | 49 | public function getStatus(): string 50 | { 51 | return self::STATUS_DEFAULT; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /Model/Collector/CollectorInterface.php: -------------------------------------------------------------------------------- 1 | configWriter = $configWriter; 20 | } 21 | 22 | /** 23 | * @param bool $flag 24 | * @throws \Magento\Framework\Exception\FileSystemException 25 | */ 26 | public function save(bool $flag) 27 | { 28 | $configGroup = [ 29 | ConfigOptionsListConstants::CONFIG_PATH_DB => [ 30 | 'connection' => [ 31 | 'default' => [ 32 | 'profiler' => [ 33 | 'class' => Profiler::class, 34 | 'enabled' => $flag, 35 | ], 36 | ], 37 | ], 38 | ], 39 | ]; 40 | 41 | $this->configWriter->saveConfig([ConfigFilePool::APP_ENV => $configGroup]); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Model/Config/Source/ErrorHandler.php: -------------------------------------------------------------------------------- 1 | self::MAGENTO, 'label' => __('Default')], 16 | ['value' => self::WHOOPS, 'label' => __('Whoops')], 17 | ]; 18 | } 19 | 20 | public function toArray() 21 | { 22 | return [ 23 | self::MAGENTO => __('Default'), 24 | self::WHOOPS => __('Whoops'), 25 | ]; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Model/Config/Source/XhprofFlags.php: -------------------------------------------------------------------------------- 1 | self::FLAG_NO_BUILTINS, 'label' => __('No xhprof builtins')], 27 | ['value' => self::FLAG_MEMORY, 'label' => __('Profile Memory')], 28 | ['value' => self::FLAG_CPU, 'label' => __('Profile Cpu')], 29 | ]; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Model/DataCollector.php: -------------------------------------------------------------------------------- 1 | $value) { 15 | $this->data[$key] = $value; 16 | } 17 | 18 | return $this; 19 | } 20 | 21 | public function getData(string $key = '') 22 | { 23 | if ($key) { 24 | return $this->data[$key] ?? null; 25 | } 26 | 27 | return $this->data; 28 | } 29 | 30 | public function addData(string $key, $value): DataCollector 31 | { 32 | $this->data[$key] = $value; 33 | 34 | return $this; 35 | } 36 | 37 | public function appendData(string $key, $value): DataCollector 38 | { 39 | if (!isset($this->data[$key])) { 40 | $this->data[$key] = []; 41 | } 42 | $this->data[$key][] = $value; 43 | 44 | return $this; 45 | } 46 | 47 | public function removeData(string $key): DataCollector 48 | { 49 | unset($this->data[$key]); 50 | 51 | return $this; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /Model/Indexer/ProfileIndexer.php: -------------------------------------------------------------------------------- 1 | fileSystem = $fileSystem; 37 | $this->fileWriteFactory = $fileWriteFactory; 38 | $this->logger = $logger; 39 | $this->fileHelper = $fileHelper; 40 | } 41 | 42 | public function index(ProfileInterface $profile): ProfileIndexer 43 | { 44 | try { 45 | $tmpIndexPath = $this->fileHelper->getProfileTempIndex(); 46 | $this->fileSystem->createDirectory($this->fileSystem->getParentDirectory($tmpIndexPath)); 47 | $tmpIndex = $this->fileWriteFactory->create($tmpIndexPath, $this->fileSystem, 'w'); 48 | 49 | $tmpIndex->writeCsv($profile->getIndex()); 50 | $index = $tmpIndex->readAll(); 51 | $tmpIndex->close(); 52 | 53 | try { 54 | $index .= $this->fileSystem->fileGetContents($this->fileHelper->getProfileIndex()); 55 | } catch (FileSystemException $e) { 56 | $this->logger->info($e); 57 | } 58 | 59 | $this->fileSystem->filePutContents($this->fileHelper->getProfileIndex(), $index); 60 | } catch (\Exception $e) { 61 | $this->logger->critical($e); 62 | } 63 | 64 | return $this; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /Model/Info/CallmapInfo.php: -------------------------------------------------------------------------------- 1 | runData = $data; 15 | } 16 | 17 | public function getRunData(): array 18 | { 19 | return $this->runData; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Model/Info/CustomerInfo.php: -------------------------------------------------------------------------------- 1 | session = $session; 31 | $this->groupRepository = $groupRepository; 32 | $this->groupInterfaceFactory = $groupInterfaceFactory; 33 | } 34 | 35 | public function isLoggedIn(): bool 36 | { 37 | return $this->session->isLoggedIn(); 38 | } 39 | 40 | public function getCustomer(): Customer 41 | { 42 | return $this->session->getCustomer(); 43 | } 44 | 45 | public function getGroup(): GroupInterface 46 | { 47 | try { 48 | $group = $this->groupRepository->getById($this->getCustomer()->getGroupId()); 49 | } catch (\Exception $e) { 50 | $group = $this->groupInterfaceFactory->create(); 51 | } 52 | 53 | return $group; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /Model/Info/ExtensionInfo.php: -------------------------------------------------------------------------------- 1 | layout = $layout; 19 | } 20 | 21 | public function getHandles(): array 22 | { 23 | return $this->layout->getUpdate()->getHandles(); 24 | } 25 | 26 | public function getCreatedBlocks(): array 27 | { 28 | $blocks = []; 29 | foreach ($this->layout->getAllBlocks() as $block) { 30 | $blocks[] = new Block($block); 31 | } 32 | 33 | return $blocks; 34 | } 35 | 36 | public function getNotRenderedBlocks(): array 37 | { 38 | $blocks = []; 39 | foreach ($this->layout->getAllBlocks() as $block) { 40 | /** @var \Magento\Framework\View\Element\AbstractBlock $block */ 41 | if (!$block->getData(LayoutCollector::BLOCK_PROFILER_ID_KEY)) { 42 | $blocks[] = new Block($block); 43 | } 44 | } 45 | 46 | return $blocks; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Model/Info/MagentoInfo.php: -------------------------------------------------------------------------------- 1 | appState = $appState; 39 | $this->cache = $cache; 40 | $this->productMetadata = $productMetadata; 41 | $this->moduleList = $moduleList; 42 | } 43 | 44 | public function isDeveloperMode(): bool 45 | { 46 | return $this->appState->getMode() === State::MODE_DEVELOPER; 47 | } 48 | 49 | public function getVersion(): string 50 | { 51 | if ($this->cache->test(self::VERSION_CACHE_ID)) { 52 | return $this->cache->load(self::VERSION_CACHE_ID); 53 | } 54 | 55 | $version = $this->productMetadata->getVersion() . ' ' . $this->productMetadata->getEdition(); 56 | $this->cache->save($version, self::VERSION_CACHE_ID); 57 | 58 | return $version; 59 | } 60 | 61 | public function getModules(): array 62 | { 63 | if ($this->cache->test(self::MODULES_CACHE_ID)) { 64 | return unserialize($this->cache->load(self::MODULES_CACHE_ID)); 65 | } 66 | 67 | $modules = $this->moduleList->getAll(); 68 | $this->cache->save(serialize($modules), self::MODULES_CACHE_ID); 69 | 70 | return $modules; 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /Model/Info/MemoryInfo.php: -------------------------------------------------------------------------------- 1 | convertToBytes(ini_get('memory_limit')); 10 | } 11 | 12 | public function getRealMemoryUsage() 13 | { 14 | return memory_get_peak_usage(true); 15 | } 16 | 17 | public function getMemoryUsage() 18 | { 19 | return memory_get_peak_usage(); 20 | } 21 | 22 | private function convertToBytes($memoryLimit) 23 | { 24 | if ('-1' === $memoryLimit) { 25 | return -1; 26 | } 27 | 28 | $memoryLimit = strtolower($memoryLimit); 29 | $max = $this->readValue($memoryLimit); 30 | 31 | switch (substr($memoryLimit, -1)) { 32 | case 't': 33 | $max *= 1024; 34 | // no break 35 | case 'g': 36 | $max *= 1024; 37 | // no break 38 | case 'm': 39 | $max *= 1024; 40 | // no break 41 | case 'k': 42 | $max *= 1024; 43 | } 44 | 45 | return $max; 46 | } 47 | 48 | private function readValue($memoryLimit): int 49 | { 50 | $value = ltrim($memoryLimit, '+'); 51 | if (0 === strpos($value, '0x')) { 52 | return intval($value, 16); 53 | } 54 | 55 | if (0 === strpos($value, '0')) { 56 | return intval($value, 8); 57 | } 58 | 59 | return (int) $value; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /Model/Serializer/CollectorSerializer.php: -------------------------------------------------------------------------------- 1 | objectManager = $objectManager; 31 | $this->logger = $logger; 32 | $this->config = $config; 33 | } 34 | 35 | /** 36 | * @param CollectorInterface[] $collectors 37 | * @return array 38 | */ 39 | public function serialize(array $collectors): array 40 | { 41 | foreach ($collectors as &$collector) { 42 | $collector = $collector->getData(); 43 | } 44 | 45 | return $collectors; 46 | } 47 | 48 | public function unserialize(array $data): array 49 | { 50 | $collectors = []; 51 | foreach ($data as $name => $collector) { 52 | try { 53 | $collectorClass = $this->config->getCollectorClass($name); 54 | $collectors[$name] = $this->objectManager->create($collectorClass)->setData($collector); 55 | } catch (CollectorNotFoundException $e) { 56 | $this->logger->critical($e); 57 | continue; 58 | } 59 | } 60 | 61 | return $collectors; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /Model/Serializer/ProfileSerializer.php: -------------------------------------------------------------------------------- 1 | serializer = $serializer; 30 | $this->collectorSerializer = $collectorSerializer; 31 | $this->profileFactory = $profileFactory; 32 | } 33 | 34 | public function serialize(ProfileInterface $profile): string 35 | { 36 | return $this->serializer->serialize(array_merge( 37 | $profile->getData(), 38 | ['collectors' => $this->collectorSerializer->serialize($profile->getCollectors())] 39 | )); 40 | } 41 | 42 | public function unserialize(string $data): ProfileInterface 43 | { 44 | $profileData = $this->serializer->unserialize($data); 45 | $collectors = $this->collectorSerializer->unserialize($profileData['collectors']); 46 | unset($profileData['collectors']); 47 | 48 | /** @var \Daseraf\Debug\Model\Profile $profile */ 49 | $profile = $this->profileFactory->create(['token' => $profileData['token']])->setData($profileData); 50 | $profile->setCollectors($collectors); 51 | 52 | return $profile; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /Model/Session.php: -------------------------------------------------------------------------------- 1 | request; 31 | } 32 | 33 | /** 34 | * @param \Magento\Framework\HTTP\PhpEnvironment\Request $request 35 | * @return HttpStorage 36 | */ 37 | public function setRequest(Request $request): HttpStorage 38 | { 39 | $this->request = $request; 40 | 41 | return $this; 42 | } 43 | 44 | /** 45 | * @return \Magento\Framework\HTTP\PhpEnvironment\Response 46 | */ 47 | public function getResponse(): ?Response 48 | { 49 | return $this->response; 50 | } 51 | 52 | /** 53 | * @param \Magento\Framework\HTTP\PhpEnvironment\Response $response 54 | * @return HttpStorage 55 | */ 56 | public function setResponse(Response $response): HttpStorage 57 | { 58 | $this->response = $response; 59 | 60 | return $this; 61 | } 62 | 63 | public function markAsFPCRequest(): HttpStorage 64 | { 65 | $this->fpc = true; 66 | 67 | return $this; 68 | } 69 | 70 | public function isFPCRequest(): bool 71 | { 72 | return $this->fpc; 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /Model/Storage/ProfileMemoryStorage.php: -------------------------------------------------------------------------------- 1 | profile; 17 | } 18 | 19 | public function write(ProfileInterface $profile) 20 | { 21 | $this->profile = $profile; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Model/Url/ScopeResolver.php: -------------------------------------------------------------------------------- 1 | id = uniqid(); 41 | $this->name = $name; 42 | $this->class = $class; 43 | $this->event = $event; 44 | $this->time = $time; 45 | } 46 | 47 | public function getId() 48 | { 49 | return $this->getName() . '_' . $this->id; 50 | } 51 | 52 | /** 53 | * @return string 54 | */ 55 | public function getName(): string 56 | { 57 | return $this->name; 58 | } 59 | 60 | /** 61 | * @return string 62 | */ 63 | public function getClass(): string 64 | { 65 | return $this->class; 66 | } 67 | 68 | /** 69 | * @return string 70 | */ 71 | public function getEvent(): string 72 | { 73 | return $this->event; 74 | } 75 | 76 | /** 77 | * @return float 78 | */ 79 | public function getTime(): float 80 | { 81 | return $this->time; 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /Model/ValueObject/LoopModelAction.php: -------------------------------------------------------------------------------- 1 | modelAction = $modelAction; 25 | $this->time = $time; 26 | $this->count = $count; 27 | } 28 | 29 | /** 30 | * @return \Daseraf\Debug\Model\ValueObject\ModelAction 31 | */ 32 | public function getModelAction(): ModelAction 33 | { 34 | return $this->modelAction; 35 | } 36 | 37 | public function getName(): string 38 | { 39 | return $this->modelAction->getName(); 40 | } 41 | 42 | public function getModel(): string 43 | { 44 | return $this->modelAction->getModel(); 45 | } 46 | 47 | public function getTrace(): array 48 | { 49 | return $this->modelAction->getTrace(); 50 | } 51 | 52 | /** 53 | * @return float 54 | */ 55 | public function getTime(): float 56 | { 57 | return $this->time; 58 | } 59 | 60 | /** 61 | * @return int 62 | */ 63 | public function getCount(): int 64 | { 65 | return $this->count; 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /Model/ValueObject/ModelAction.php: -------------------------------------------------------------------------------- 1 | id = uniqid(); 43 | $this->name = $name; 44 | $this->model = $model; 45 | $this->time = $time; 46 | $this->trace = $trace; 47 | } 48 | 49 | /** 50 | * @return string 51 | */ 52 | public function getId(): string 53 | { 54 | return $this->name . '::' . $this->id . '::' . $this->model; 55 | } 56 | 57 | /** 58 | * @return string 59 | */ 60 | public function getName(): string 61 | { 62 | return $this->name; 63 | } 64 | 65 | /** 66 | * @return string 67 | */ 68 | public function getModel(): string 69 | { 70 | return $this->model; 71 | } 72 | 73 | /** 74 | * @return float 75 | */ 76 | public function getTime(): float 77 | { 78 | return $this->time; 79 | } 80 | 81 | /** 82 | * @return array 83 | */ 84 | public function getTrace(): array 85 | { 86 | return $this->trace; 87 | } 88 | 89 | /** 90 | * @return string 91 | */ 92 | public function getTraceHash(): string 93 | { 94 | if (empty($this->getTrace())) { 95 | return ''; 96 | } 97 | 98 | return md5(serialize($this->getTrace())); 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /Model/ValueObject/Plugin.php: -------------------------------------------------------------------------------- 1 | class = $class; 52 | $this->name = $name; 53 | $this->sortOrder = $sortOrder; 54 | $this->method = $method; 55 | $this->type = $type; 56 | $this->executionTime = $executionTime; 57 | $this->executionCount = $executionCount; 58 | } 59 | 60 | /** 61 | * @return string 62 | */ 63 | public function getClass(): string 64 | { 65 | return $this->class; 66 | } 67 | 68 | /** 69 | * @return string 70 | */ 71 | public function getName(): string 72 | { 73 | return $this->name; 74 | } 75 | 76 | /** 77 | * @return int 78 | */ 79 | public function getSortOrder(): int 80 | { 81 | return $this->sortOrder; 82 | } 83 | 84 | /** 85 | * @return string 86 | */ 87 | public function getMethod(): string 88 | { 89 | return $this->method; 90 | } 91 | 92 | /** 93 | * @return string 94 | */ 95 | public function getType(): string 96 | { 97 | return $this->type; 98 | } 99 | 100 | /** 101 | * @return float 102 | */ 103 | public function getExecutionTime(): float 104 | { 105 | return $this->executionTime; 106 | } 107 | 108 | /** 109 | * @return int 110 | */ 111 | public function getExecutionCount(): int 112 | { 113 | return $this->executionCount; 114 | } 115 | } 116 | -------------------------------------------------------------------------------- /Model/ValueObject/Translation.php: -------------------------------------------------------------------------------- 1 | phrase = $phrase; 27 | $this->translation = $translation; 28 | $this->defined = $defined; 29 | } 30 | 31 | public function getId() 32 | { 33 | return $this->phrase; 34 | } 35 | 36 | /** 37 | * @return string 38 | */ 39 | public function getPhrase(): string 40 | { 41 | return $this->phrase; 42 | } 43 | 44 | /** 45 | * @return string 46 | */ 47 | public function getTranslation(): string 48 | { 49 | return $this->translation; 50 | } 51 | 52 | /** 53 | * @return bool 54 | */ 55 | public function isDefined(): bool 56 | { 57 | return $this->defined; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /Model/View/Menu.php: -------------------------------------------------------------------------------- 1 | request = $request; 32 | $this->profileMemoryStorage = $profileMemoryStorage; 33 | $this->url = $url; 34 | } 35 | 36 | public function isActive(string $collectorName): bool 37 | { 38 | return $this->getProfile()->hasCollector($collectorName); 39 | } 40 | 41 | public function isCurrentPanel(string $collectorName): bool 42 | { 43 | return $this->request->getParam('panel') === $collectorName; 44 | } 45 | 46 | public function getCollector(string $collectorName): CollectorInterface 47 | { 48 | return $this->getProfile()->getCollector($collectorName); 49 | } 50 | 51 | public function getProfilerUrl(string $collectorName): string 52 | { 53 | return $this->url->getProfilerUrl($this->getProfile()->getToken(), $collectorName); 54 | } 55 | 56 | public function getConfigurationUrl(): string 57 | { 58 | return $this->url->getConfigurationUrl(); 59 | } 60 | 61 | private function getProfile(): ProfileInterface 62 | { 63 | return $this->profileMemoryStorage->read(); 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /Model/View/Renderer/LayoutNodeRenderer.php: -------------------------------------------------------------------------------- 1 | node = $node; 38 | $this->layout = $layout; 39 | $this->layoutNodeRendererFactory = $layoutNodeRendererFactory; 40 | $this->formatter = $formatter; 41 | } 42 | 43 | public function render(): string 44 | { 45 | return $this->layout->createBlock(Template::class) 46 | ->setTemplate(self::TEMPLATE) 47 | ->setData([ 48 | 'node' => $this->node, 49 | 'formatter' => $this->formatter, 50 | 'layout_node_renderer' => $this->layoutNodeRendererFactory, 51 | ]) 52 | ->toHtml(); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /Model/View/Renderer/ParametersRenderer.php: -------------------------------------------------------------------------------- 1 | parameters = $parameters; 32 | $this->layout = $layout; 33 | $this->varRendererFactory = $varRendererFactory; 34 | } 35 | 36 | public function render(): string 37 | { 38 | return $this->layout->createBlock(Template::class) 39 | ->setTemplate(self::TEMPLATE) 40 | ->setData('parameters', $this->parameters) 41 | ->setData('var_renderer', $this->varRendererFactory) 42 | ->toHtml(); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Model/View/Renderer/QueryListRenderer.php: -------------------------------------------------------------------------------- 1 | queries = $queries; 44 | $this->layout = $layout; 45 | $this->mathRandom = $mathRandom; 46 | $this->queryRendererFactory = $queryRendererFactory; 47 | $this->formatter = $formatter; 48 | } 49 | 50 | public function render(): string 51 | { 52 | return $this->layout->createBlock(Template::class) 53 | ->setTemplate(self::TEMPLATE) 54 | ->setData([ 55 | 'queries' => $this->queries, 56 | 'query_renderer' => $this->queryRendererFactory, 57 | 'prefix' => $this->mathRandom->getUniqueHash(), 58 | 'formatter' => $this->formatter, 59 | ]) 60 | ->toHtml(); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /Model/View/Renderer/QueryParametersRenderer.php: -------------------------------------------------------------------------------- 1 | query = $query; 30 | $this->parameters = $parameters; 31 | $this->resource = $resource; 32 | } 33 | 34 | public function render(): string 35 | { 36 | $parameters = $this->parameters; 37 | $i = !array_key_exists(0, $parameters) && array_key_exists(1, $parameters) ? 1 : 0; 38 | 39 | return preg_replace_callback('/\?|((?resource->getConnection(ResourceConnection::DEFAULT_CONNECTION)->quote($value); 46 | $i++; 47 | 48 | return $result; 49 | }, $this->query); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /Model/View/Renderer/QueryRenderer.php: -------------------------------------------------------------------------------- 1 | query = $query; 44 | $this->layout = $layout; 45 | $this->mathRandom = $mathRandom; 46 | $this->varRendererFactory = $varRendererFactory; 47 | $this->databaseHelper = $databaseHelper; 48 | } 49 | 50 | public function render(): string 51 | { 52 | return $this->layout->createBlock(Template::class) 53 | ->setTemplate(self::TEMPLATE) 54 | ->setData([ 55 | 'query' => $this->query, 56 | 'highlighted_query' => $this->databaseHelper->highlightQuery($this->query->getQuery()), 57 | 'formatted_query' => $this->databaseHelper->formatQuery($this->query->getQuery()), 58 | 'runnable_query' => $this->databaseHelper->highlightQuery( 59 | $this->databaseHelper->replaceQueryParameters( 60 | $this->query->getQuery(), 61 | $this->query->getQueryParams() 62 | ) 63 | ), 64 | 'var_renderer' => $this->varRendererFactory, 65 | 'uniq_id' => $this->mathRandom->getUniqueHash(), 66 | ]) 67 | ->toHtml(); 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /Model/View/Renderer/RedirectRenderer.php: -------------------------------------------------------------------------------- 1 | redirect = $redirect; 32 | $this->layout = $layout; 33 | $this->url = $url; 34 | } 35 | 36 | public function render(): string 37 | { 38 | return $this->layout->createBlock(Template::class) 39 | ->setTemplate(self::TEMPLATE) 40 | ->setProfilerUrl($this->url->getProfilerUrl($this->redirect->getToken())) 41 | ->setRedirect($this->redirect) 42 | ->toHtml(); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Model/View/Renderer/RendererInterface.php: -------------------------------------------------------------------------------- 1 | items = $items; 38 | $this->layout = $layout; 39 | $this->varRendererFactory = $varRendererFactory; 40 | $this->labels = $labels; 41 | } 42 | 43 | public function render(): string 44 | { 45 | return $this->layout->createBlock(Template::class) 46 | ->setTemplate(self::TEMPLATE) 47 | ->setData('items', $this->items) 48 | ->setData('labels', $this->labels) 49 | ->setData('var_renderer', $this->varRendererFactory) 50 | ->setData('key_label', $this->labels[0] ?? 'Key') 51 | ->setData('value_label', $this->labels[1] ?? 'Value') 52 | ->toHtml(); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /Model/View/Renderer/TraceCallRenderer.php: -------------------------------------------------------------------------------- 1 | call = $call; 34 | $this->layout = $layout; 35 | $this->directoryList = $directoryList; 36 | } 37 | 38 | public function render(): string 39 | { 40 | /** @var \Magento\Framework\View\Element\Template $block */ 41 | $block = $this->layout->createBlock(Template::class); 42 | 43 | foreach (self::CALL_INFO as $info) { 44 | if (isset($this->call[$info])) { 45 | $block->setData($info, $this->call[$info]); 46 | } 47 | } 48 | if ($block->hasFile()) { 49 | $block->setFile($this->relativizePath($block->getFile())); 50 | } 51 | 52 | return $block->setTemplate(self::TEMPLATE)->toHtml(); 53 | } 54 | 55 | private function relativizePath(string $path): string 56 | { 57 | $rootDirectory = $this->directoryList->getRoot(); 58 | 59 | return (string) strpos($path, $rootDirectory) === 0 ? substr($path, strlen($rootDirectory)) : $path; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /Model/View/Renderer/TraceRenderer.php: -------------------------------------------------------------------------------- 1 | id = uniqid(); 37 | $this->trace = $trace; 38 | $this->layout = $layout; 39 | $this->traceCallRendererFactory = $traceCallRendererFactory; 40 | } 41 | 42 | public function render(): string 43 | { 44 | return $this->layout->createBlock(Template::class) 45 | ->setTemplate(self::TEMPLATE) 46 | ->setData('trace', $this->trace) 47 | ->setData('trace_id', $this->id) 48 | ->setData('trace_call_renderer', $this->traceCallRendererFactory) 49 | ->toHtml(); 50 | } 51 | 52 | /** 53 | * @return string 54 | */ 55 | public function getId(): string 56 | { 57 | return $this->id; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /Model/View/Renderer/VarRenderer.php: -------------------------------------------------------------------------------- 1 | variable = $variable; 14 | } 15 | 16 | /** 17 | * @SuppressWarnings(PHPMD.StaticAccess) 18 | * @return string 19 | */ 20 | public function render(): string 21 | { 22 | return (string) VarDumper::dump($this->variable); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Model/View/Search.php: -------------------------------------------------------------------------------- 1 | request = $request; 42 | $this->profileMemoryStorage = $profileMemoryStorage; 43 | $this->formatter = $formatter; 44 | $this->url = $url; 45 | } 46 | 47 | public function isParamSelected($param, $expected): bool 48 | { 49 | return $this->request->getParam($param) === $expected; 50 | } 51 | 52 | public function getParam($param) 53 | { 54 | return $this->request->getParam($param); 55 | } 56 | 57 | public function getLimits() 58 | { 59 | return ['10', '50', '100']; 60 | } 61 | 62 | public function getMethods() 63 | { 64 | return ['GET', 'POST', 'DELETE', 'PUT', 'PATCH', 'HEAD']; 65 | } 66 | 67 | public function getToken() 68 | { 69 | if ($this->token === null) { 70 | $this->token = $this->profileMemoryStorage->read()->getToken(); 71 | } 72 | 73 | return $this->token; 74 | } 75 | 76 | public function toMegaBytes(int $value) 77 | { 78 | return $this->formatter->toMegaBytes($value, 2); 79 | } 80 | 81 | public function getProfilerUrl(string $token): string 82 | { 83 | return $this->url->getProfilerUrl($token, RequestCollector::NAME); 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /Model/View/Summary.php: -------------------------------------------------------------------------------- 1 | profileMemoryStorage = $profileMemoryStorage; 32 | $this->url = $url; 33 | $this->redirectRendererFactory = $redirectRendererFactory; 34 | } 35 | 36 | public function getProfile(): ProfileInterface 37 | { 38 | return $this->profileMemoryStorage->read(); 39 | } 40 | 41 | public function getProfilerUrl($token): string 42 | { 43 | return $this->url->getProfilerUrl($token); 44 | } 45 | 46 | public function renderRedirect(Redirect $redirect): string 47 | { 48 | return $this->redirectRendererFactory->create(['redirect' => $redirect])->render(); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /Model/View/Xhprof.php: -------------------------------------------------------------------------------- 1 | xhprofProfileFactory = $xhprofProfileFactory; 44 | $this->formatter = $formatter; 45 | $this->request = $request; 46 | } 47 | 48 | public function getXhprofProfile($runData) 49 | { 50 | if ($this->calculatedProfile) { 51 | return $this->calculatedProfile; 52 | } 53 | 54 | $profileData['profile'] = $runData; 55 | /** @var XhprofProfile $profile */ 56 | $profile = $this->xhprofProfileFactory->create($profileData); 57 | $profile->calculateSelf(); 58 | 59 | $this->calculatedProfile = $profile; 60 | 61 | return $this->calculatedProfile; 62 | } 63 | 64 | public function getRelatives(XhprofProfile $profile) 65 | { 66 | $functionName = $this->request->getParam('function'); 67 | 68 | return $profile->getRelatives($functionName, null, 1); 69 | } 70 | 71 | public function formatTime($value) 72 | { 73 | return $this->formatter->revertMicrotime($value); 74 | } 75 | 76 | public function formatBytes($value) 77 | { 78 | return $this->formatter->formatBytes(abs($value), 'M'); 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /Observer/AllowedIP.php: -------------------------------------------------------------------------------- 1 | config = $config; 19 | } 20 | 21 | public function execute(Observer $observer) 22 | { 23 | if ($this->config->isAllowedIP()) { 24 | return; 25 | } 26 | 27 | /** @var \Magento\Framework\App\Request\Http $request */ 28 | $request = $observer->getRequest(); 29 | $request->initForward(); 30 | $request->setControllerName('noroute'); 31 | $request->setModuleName('cms'); 32 | $request->setActionName('index'); 33 | $request->setDispatched(false); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Observer/BeforeSendResponse.php: -------------------------------------------------------------------------------- 1 | config = $config; 25 | $this->profiler = $profiler; 26 | } 27 | 28 | public function execute(Observer $observer) 29 | { 30 | $request = $observer->getEvent()->getRequest(); 31 | $response = $observer->getEvent()->getResponse(); 32 | if ($this->isProfilerAction($request) || !$this->config->isEnabled()) { 33 | return; 34 | } 35 | 36 | $this->profiler->run($request, $response); 37 | } 38 | 39 | private function isProfilerAction(\Magento\Framework\HTTP\PhpEnvironment\Request $request) 40 | { 41 | if (preg_match('/\/debug\/profiler*/s', $request->getPathInfo())) { 42 | return true; 43 | } 44 | if (preg_match('/\/debug\/xhprof*/s', $request->getPathInfo())) { 45 | return true; 46 | } 47 | 48 | return $request->getModuleName() === 'debug'; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /Observer/Collector/LayoutCollectorAfterToHtml.php: -------------------------------------------------------------------------------- 1 | layoutCollector = $layoutCollector; 21 | } 22 | 23 | public function execute(Observer $observer) 24 | { 25 | /** @var \Magento\Framework\View\Element\AbstractBlock $block */ 26 | $block = $observer->getBlock(); 27 | 28 | $renderedTimestamp = microtime(true); 29 | $renderTime = $renderedTimestamp - $block->getData(LayoutCollector::BLOCK_START_RENDER_KEY); 30 | 31 | $block->addData([ 32 | LayoutCollector::BLOCK_STOP_RENDER_KEY => $renderedTimestamp, 33 | LayoutCollector::RENDER_TIME => $renderTime, 34 | ]); 35 | 36 | $this->layoutCollector->log(new Block($block)); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Observer/Collector/LayoutCollectorBeforeToHtml.php: -------------------------------------------------------------------------------- 1 | getBlock(); 15 | $id = uniqid(); 16 | $block->addData([ 17 | LayoutCollector::BLOCK_PROFILER_ID_KEY => $id, 18 | LayoutCollector::BLOCK_START_RENDER_KEY => microtime(true), 19 | LayoutCollector::BLOCK_HASH_KEY => spl_object_hash($block), 20 | ]); 21 | 22 | if ($block->getParentBlock()) { 23 | $block->addData([ 24 | LayoutCollector::BLOCK_PARENT_PROFILER_ID_KEY => $block->getParentBlock() 25 | ->getData(LayoutCollector::BLOCK_PROFILER_ID_KEY), 26 | ]); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Observer/Config/DatabaseProfiler.php: -------------------------------------------------------------------------------- 1 | messageManager = $messageManager; 33 | $this->dbProfilerWriter = $dbProfilerWriter; 34 | $this->config = $config; 35 | } 36 | 37 | /** 38 | * @param \Magento\Framework\Event\Observer $observer 39 | * @return void 40 | */ 41 | public function execute(Observer $observer) 42 | { 43 | if (!$this->isDBProfilerDependentConfigChanged($observer->getChangedPaths())) { 44 | return; 45 | } 46 | 47 | $flag = $this->config->isDatabaseCollectorEnabled() && $this->config->isActive(); 48 | 49 | try { 50 | $this->dbProfilerWriter->save($flag); 51 | } catch (FileSystemException $e) { 52 | $this->messageManager->addExceptionMessage($e); 53 | } 54 | } 55 | 56 | private function isDBProfilerDependentConfigChanged(array $paths): bool 57 | { 58 | return in_array(Config::CONFIG_COLLECTOR_DATABASE, $paths) || in_array(Config::CONFIG_ENABLED, $paths); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /Observer/DebugHandle.php: -------------------------------------------------------------------------------- 1 | config = $config; 20 | } 21 | 22 | public function execute(Observer $observer) 23 | { 24 | if ($this->config->isEnabled()) { 25 | $observer->getLayout()->getUpdate()->addHandle('daseraf_debug'); 26 | } 27 | 28 | if ($observer->getFullActionName() === Profiler::TOOLBAR_FULL_ACTION_NAME) { 29 | $observer->getLayout()->getUpdate()->removeHandle('default'); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Observer/ValidateRedirect.php: -------------------------------------------------------------------------------- 1 | session = $session; 20 | } 21 | 22 | public function execute(Observer $observer) 23 | { 24 | if ($this->session->getData(RequestInfo::REDIRECT_PARAM)) { 25 | $observer->getRequest()->setParam('_redirected', true); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Plugin/Collector/CacheCollectorPlugin.php: -------------------------------------------------------------------------------- 1 | cacheCollector = $cacheCollector; 22 | } 23 | 24 | public function aroundLoad(Cache $subject, callable $proceed, $identifier) 25 | { 26 | $start = microtime(true); 27 | $result = $proceed($identifier); 28 | $time = microtime(true) - $start; 29 | $this->cacheCollector->log(new CacheAction($identifier, CacheAction::LOAD, $time, [ 30 | CacheAction::CACHE_HIT => ($result !== false), 31 | ])); 32 | 33 | return $result; 34 | } 35 | 36 | public function aroundSave(Cache $subject, callable $proceed, $data, $identifier, $tags = [], $lifeTime = null) 37 | { 38 | $start = microtime(true); 39 | $result = $proceed($data, $identifier, $tags, $lifeTime); 40 | $time = microtime(true) - $start; 41 | $this->cacheCollector->log(new CacheAction($identifier, CacheAction::SAVE, $time, [ 42 | CacheAction::CACHE_TAGS => $tags, 43 | CacheAction::CACHE_TTL => $lifeTime, 44 | ])); 45 | 46 | return $result; 47 | } 48 | 49 | public function aroundRemove(Cache $subject, callable $proceed, $identifier) 50 | { 51 | $start = microtime(true); 52 | $result = $proceed($identifier); 53 | $time = microtime(true) - $start; 54 | $this->cacheCollector->log(new CacheAction($identifier, CacheAction::REMOVE, $time)); 55 | 56 | return $result; 57 | } 58 | 59 | public function aroundClean(Cache $subject, callable $proceed, $tags = []) 60 | { 61 | $start = microtime(true); 62 | $result = $proceed($tags); 63 | $time = microtime(true) - $start; 64 | $this->cacheCollector->log(new CacheAction('', CacheAction::CLEAN, $time)); 65 | 66 | return $result; 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /Plugin/Collector/EventCollectorPlugin.php: -------------------------------------------------------------------------------- 1 | eventCollector = $eventCollector; 23 | } 24 | 25 | public function aroundDispatch(InvokerDefault $subject, callable $proceed, array $configuration, Observer $observer) 26 | { 27 | $start = microtime(true); 28 | $proceed($configuration, $observer); 29 | $end = microtime(true); 30 | 31 | $this->eventCollector->log(new EventObserver( 32 | $configuration['name'], 33 | $configuration['instance'], 34 | $observer->getEvent()->getName(), 35 | $end - $start 36 | )); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Plugin/Collector/TimeCollectorPlugin.php: -------------------------------------------------------------------------------- 1 | stopwatchDriver = $stopwatchDriver; 21 | } 22 | 23 | /** 24 | * @SuppressWarnings(PHPMD.StaticAccess) 25 | * @param \Magento\Framework\App\Http $subject 26 | */ 27 | public function beforeLaunch(\Magento\Framework\App\Http $subject) 28 | { 29 | Profiler::reset(); 30 | Profiler::add($this->stopwatchDriver); 31 | Profiler::start($this->stopwatchDriver::ROOT_EVENT); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Plugin/Collector/TranslationCollectorPlugin.php: -------------------------------------------------------------------------------- 1 | translate = $translate; 33 | $this->translationCollector = $translationCollector; 34 | } 35 | 36 | public function beforeRender(Translate $subject, array $source, array $arguments) 37 | { 38 | $text = end($source); 39 | $text = str_replace('\"', '"', $text); 40 | $text = str_replace("\\'", "'", $text); 41 | 42 | $data = $this->getTranslations(); 43 | $translation = ''; 44 | 45 | if ($isDefined = array_key_exists($text, $data)) { 46 | $translation = $data[$text]; 47 | } 48 | 49 | $this->translationCollector->log(new Translation(end($source), $translation, $isDefined)); 50 | 51 | return null; 52 | } 53 | 54 | private function getTranslations(): array 55 | { 56 | if ($this->translations === null) { 57 | $this->translations = $this->translate->getData(); 58 | } 59 | 60 | return $this->translations; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /Plugin/ErrorHandler/WhoopsPlugin.php: -------------------------------------------------------------------------------- 1 | config = $config; 35 | $this->whoopsFactory = $whoopsFactory; 36 | $this->prettyPageHandlerFactory = $prettyPageHandlerFactory; 37 | } 38 | 39 | public function beforeCatchException(Http $subject, Bootstrap $bootstrap, \Exception $exception) 40 | { 41 | if ($this->config->getErrorHandler() === ErrorHandler::WHOOPS) { 42 | $whoops = $this->whoopsFactory->create(); 43 | $whoops->pushHandler($this->prettyPageHandlerFactory->create()); 44 | $whoops->handleException($exception); 45 | } 46 | 47 | return [$bootstrap, $exception]; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /Plugin/PageCache/KernelPlugin.php: -------------------------------------------------------------------------------- 1 | httpStorage = $httpStorage; 19 | } 20 | 21 | /** 22 | * @param \Magento\Framework\App\PageCache\Kernel $subject 23 | * @param false|\Magento\Framework\App\Response\Http $result 24 | * @return false|\Magento\Framework\App\Response\Http 25 | */ 26 | public function afterLoad(\Magento\Framework\App\PageCache\Kernel $subject, $result) 27 | { 28 | if ($result !== false) { 29 | $this->httpStorage->markAsFPCRequest(); 30 | } 31 | 32 | return $result; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Plugin/ProfileRepository/RequestTimePlugin.php: -------------------------------------------------------------------------------- 1 | getCollector(TimeCollector::NAME); 23 | } catch (\InvalidArgumentException $e) { 24 | return [$profile]; 25 | } 26 | 27 | $profile->setRequestTime($timeCollector->getDuration()); 28 | 29 | return [$profile]; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Serializer/Serializer.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Magento\Framework\Url 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /etc/adminhtml/events.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /etc/adminhtml/routes.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /etc/debug/routes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /etc/events.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 19 | 20 | 21 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /etc/frontend/routes.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /etc/module.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /phpmd.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | Magento 2 Debug module ruleset 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | etc 20 | Test 21 | view 22 | vendor 23 | 24 | -------------------------------------------------------------------------------- /registration.php: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /view/base/layout/debug_panel_cache.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 9 | 10 | Daseraf\Debug\Model\View\Profiler 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /view/base/layout/debug_panel_callmap.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 9 | 10 | Daseraf\Debug\Model\View\Xhprof 11 | Daseraf\Debug\Model\View\Profiler 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /view/base/layout/debug_panel_config.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 9 | 10 | Daseraf\Debug\Model\View\Profiler 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /view/base/layout/debug_panel_database.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 9 | 10 | Daseraf\Debug\Model\View\Profiler 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /view/base/layout/debug_panel_event.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 9 | 10 | Daseraf\Debug\Model\View\Profiler 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /view/base/layout/debug_panel_layout.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 9 | 10 | Daseraf\Debug\Model\View\Profiler 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /view/base/layout/debug_panel_model.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 9 | 10 | Daseraf\Debug\Model\View\Profiler 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /view/base/layout/debug_panel_plugin.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 9 | 10 | Daseraf\Debug\Model\View\Profiler 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /view/base/layout/debug_panel_request.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 9 | 10 | Daseraf\Debug\Model\View\Profiler 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /view/base/layout/debug_panel_time.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 9 | 10 | Daseraf\Debug\Model\View\Profiler 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /view/base/layout/debug_panel_translation.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 9 | 10 | Daseraf\Debug\Model\View\Profiler 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /view/base/layout/debug_profiler_info.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 32 | -------------------------------------------------------------------------------- /view/base/templates/profiler/summary.phtml: -------------------------------------------------------------------------------- 1 | 2 | 3 | getViewModel(); ?> 4 | 5 | getProfile()): ?> 6 |
7 |
8 |

9 | getUrl() ?> 10 |

11 | hasRedirect()): ?> 12 | renderRedirect($profile->getRedirect()); ?> 13 | 14 | 30 |
31 |
32 | 33 | -------------------------------------------------------------------------------- /view/base/templates/renderer/layout/graph.phtml: -------------------------------------------------------------------------------- 1 | 2 |
3 |     
4 |     getNodes() as $node) : ?>
5 |         getLayoutNodeRenderer()->create(['node' => $node])->render(); ?>
6 |     
7 | 
8 | -------------------------------------------------------------------------------- /view/base/templates/renderer/layout/node.phtml: -------------------------------------------------------------------------------- 1 | getNode(); 5 | $nodeTemplate = $node->getTemplate(); 6 | $cacheStatus = $node->getCacheStatus(); 7 | $isCached = $cacheStatus === 'load'; 8 | $cacheStatusColor = ''; 9 | switch ($cacheStatus) { 10 | case 'load': 11 | $cacheStatusColor = '#dfd;'; 12 | break; 13 | case 'save': 14 | $cacheStatusColor = '#ffd;'; 15 | break; 16 | case 'not cached': 17 | $cacheStatusColor = '#fdd;'; 18 | break; 19 | default: 20 | $cacheStatusColor = '#ddf'; 21 | } 22 | ?> 23 |
24 | getParentId()): ?> 25 | 26 | getName() ?> | 27 | getClass() ?> 28 | | 29 | 30 | 31 | 32 | 33 | 34 | getPrefix() ?>└ 35 | 36 | getName() ?> | 37 | getClass() ?> 38 | | 39 | 40 | 41 | 42 | 43 | 44 | | 45 | getFormatter()->microtime($node->getRenderTime()) ?> ms 46 | getParentId()): ?> 47 | | (getFormatter()->percentage($node->getRenderPercent()) ?>) 48 | 49 | 50 | getChildren()): ?> 51 |
52 | getChildren() as $child): ?> 53 | getLayoutNodeRenderer()->create(['node' => $child])->render(); ?> 54 | 55 |
56 | 57 |
-------------------------------------------------------------------------------- /view/base/templates/renderer/parameters.phtml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | getParameters()): ?> 12 | $value): ?> 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 |
escapeHtml(__('Key')); ?>escapeHtml(__('Value')); ?>
getVarRenderer()->create(['variable' => $value])->render(); ?>
escapeHtml(__('No data')); ?>
25 | -------------------------------------------------------------------------------- /view/base/templates/renderer/query.phtml: -------------------------------------------------------------------------------- 1 | getQuery(); 5 | ?> 6 | getHighlightedQuery(); ?> 7 | getQueryParams())) : ?> 8 |
9 | escapeHtml(__('Parameters')) ?>: 10 | getVarRenderer()->create(['variable' => $query->getQueryParams()])->render(); ?> 11 |
12 | 13 | 14 | 15 | getUniqId() ?> 16 | escapeHtml(__('Hide formatted query')) ?> 17 | escapeHtml(__('View formatted query')) ?> 18 | 19 | 20 | getUniqId() ?> 21 | escapeHtml(__('Hide runnable query')) ?> 22 | escapeHtml(__('View runnable query')) ?> 23 | 24 | 25 | getUniqId() ?> 26 | getFormattedQuery(); ?> 27 | 28 | getUniqId() ?> 29 | getRunnableQuery(); ?> 30 | 31 | -------------------------------------------------------------------------------- /view/base/templates/renderer/query/list.phtml: -------------------------------------------------------------------------------- 1 | getPrefix(); 4 | ?> 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | getQueries() as $index => $data): ?> 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 30 | 31 | 32 | 33 | 34 |
#escapeHtml(__('Query Count')) ?>escapeHtml(__('Time')) ?>escapeHtml(__('Info')) ?>
28 | getFormatter()->microtime($query->getElapsedSecs()); ?> ms 29 | getQueryRenderer()->create(['query' => $query])->render(); ?>
35 | -------------------------------------------------------------------------------- /view/base/templates/renderer/redirect.phtml: -------------------------------------------------------------------------------- 1 | 2 | 3 | getRedirect(); ?> 4 | 18 | -------------------------------------------------------------------------------- /view/base/templates/renderer/table.phtml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | getItems() as $key => $value): ?> 11 | 12 | 13 | 14 | 15 | 16 | 17 |
escapeHtml(__($block->getKeyLabel())); ?>escapeHtml(__($block->getValueLabel())); ?>
getVarRenderer()->create(['variable' => $value])->render(); ?>
-------------------------------------------------------------------------------- /view/base/templates/renderer/trace.phtml: -------------------------------------------------------------------------------- 1 | 2 | getTrace(); ?> 3 | 4 | 5 | 7 | escapeHtml(__('Show trace')) ?> 8 | 9 | 19 | -------------------------------------------------------------------------------- /view/base/templates/renderer/trace/call.phtml: -------------------------------------------------------------------------------- 1 | 2 |
3 | hasClass()): ?> 4 | getClass() ?> 5 | 6 | hasClass() && $block->hasFunction()): ?> 7 | :: 8 | 9 | hasFunction()): ?> 10 | getFunction() ?> 11 | 12 |
13 |
14 | hasLine()): ?> 15 | #getLine() ?> 16 | 17 | hasFile()): ?> 18 | getFile() ?> 19 | 20 |
21 | -------------------------------------------------------------------------------- /view/base/templates/toolbar.phtml: -------------------------------------------------------------------------------- 1 | 2 | 3 | getViewModel(); ?> 4 | getToken(); ?> 5 | 6 |
7 |
8 | 9 | getCollectorBlocks() as $collectorBlock): ?> 10 | toHtml(); ?> 11 | 12 | 13 | <?= $block->escapeHtml(__('Close')) ?> 14 | 15 |
16 | -------------------------------------------------------------------------------- /view/base/templates/toolbar/ajax.phtml: -------------------------------------------------------------------------------- 1 | getCollector(); 5 | ?> 6 |
7 |
8 | <?= $block->escapeHtmlAttr(__('Ajax')) ?> 10 | 0 11 |
12 |
13 |
14 | 15 |
16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 |
escapeHtml(__('Method')); ?>escapeHtml(__('Status')); ?>escapeHtml(__('URL')); ?>escapeHtml(__('Time')); ?>escapeHtml(__('Profile')); ?>
29 |
30 |
31 |
32 | -------------------------------------------------------------------------------- /view/base/templates/toolbar/callmap.phtml: -------------------------------------------------------------------------------- 1 | getCollector(); 5 | $xhporfViewModel = $block->getXhporfViewModel(); 6 | $xhporfProfile = $xhporfViewModel->getXhprofProfile($collector->getData()); 7 | $fallbackData = $xhporfProfile->sort('ewt'); 8 | $totalFunctions = number_format($xhporfProfile->getFunctionCount()); 9 | ?> 10 |
11 | 12 |
13 | <?= $block->escapeHtmlAttr(__('Call Map')) ?> 15 | escapeHtmlAttr(__('Call Map')) ?> 16 |
17 |
18 |
19 |
20 | escapeHtml(__('Number of function calls')); ?> 21 | 22 |
23 |
24 |
25 | -------------------------------------------------------------------------------- /view/base/templates/toolbar/database.phtml: -------------------------------------------------------------------------------- 1 | getCollector(); 5 | ?> 6 |
7 | 8 |
9 | <?= $block->escapeHtmlAttr(__('Database')) ?> 11 | getQueriesCount() ?> 12 | 13 | escapeHtml(__('in')); ?> 14 | getTotalTime() ?> 15 | ms 16 | 17 |
18 |
19 |
20 |
21 | escapeHtml(__('Database Queries')); ?> 22 | getQueriesCount() ?> 23 |
24 |
25 | escapeHtml(__('Duplicated Queries')); ?> 26 | 27 | getDuplicatedQueries()) ?> 28 | 29 |
30 |
31 | escapeHtml(__('Query time')); ?> 32 | getTotalTime() ?> ms 33 |
34 |
35 |
36 | -------------------------------------------------------------------------------- /view/base/templates/toolbar/event.phtml: -------------------------------------------------------------------------------- 1 | getCollector(); 5 | ?> 6 |
7 | 8 |
9 | <?= $block->escapeHtmlAttr(__('Event')) ?> 11 | getObserversCount() ?> 12 | 13 | escapeHtml(__('in')); ?> 14 | getTime() ?> 15 | ms 16 | 17 |
18 |
19 |
20 |
21 |
22 | escapeHtml(__('Events dispatched')); ?> 23 | getEvents()) ?> 24 |
25 |
26 | escapeHtml(__('Observers executed')); ?> 27 | getObserversCount() ?> 28 |
29 |
30 | escapeHtml(__('Time')); ?> 31 | getTime(); ?> ms 32 |
33 |
34 |
35 |
36 | -------------------------------------------------------------------------------- /view/base/templates/toolbar/layout.phtml: -------------------------------------------------------------------------------- 1 | getCollector(); 5 | ?> 6 |
7 | 8 |
9 | <?= $block->escapeHtmlAttr(__('Layout')) ?> 11 | 12 | getRenderTime() ?> ms 13 | 14 |
15 |
16 |
17 |
18 |
19 | escapeHtml(__('Layout handles')); ?> 20 | getHandles() as $handle): ?> 21 |
22 | 23 |
24 |
25 |
26 |
27 | escapeHtml(__('Render Time')); ?> 28 | getRenderTime(); ?> ms 29 |
30 |
31 | escapeHtml(__('Block created')); ?> 32 | getCreatedBlocks()) ?> 33 |
34 |
35 | escapeHtml(__('Block rendered')); ?> 36 | getRenderedBlocks()) ?> 37 |
38 |
39 |
40 |
41 | -------------------------------------------------------------------------------- /view/base/templates/toolbar/memory.phtml: -------------------------------------------------------------------------------- 1 | getCollector(); 5 | ?> 6 |
7 |
8 | <?= $block->escapeHtmlAttr(__('Memory')) ?> 10 | 11 |
12 |
13 |
14 | escapeHtml(__('Peak memory usage')); ?> 15 | getTotalMemoryUsage(); ?> MB 16 |
17 |
18 | escapeHtml(__('Real memory usage')); ?> 19 | getRealMemoryUsage(); ?> MB 20 |
21 |
22 | escapeHtml(__('PHP memory limit')); ?> 23 | hasMemoryLimit() ? $block->escapeHtml(__('Unlimited')) : $collector->getMemoryLimit(); ?> 24 |
25 |
26 |
27 | -------------------------------------------------------------------------------- /view/base/templates/toolbar/model.phtml: -------------------------------------------------------------------------------- 1 | getCollector(); 5 | ?> 6 |
7 | 8 |
9 | <?= $block->escapeHtmlAttr(__('Model')) ?> 11 | getTotalActionsMetric() ?> 12 |
13 |
14 |
15 |
16 | escapeHtml(__('Model loads')); ?> 17 | 18 | getLoadMetric(); ?> 19 | 20 |
21 |
22 | escapeHtml(__('Loads in loops')); ?> 23 | 24 | getLoopLoadMetric() ?> 25 | 26 |
27 |
28 | escapeHtml(__('Model save')); ?> 29 | 30 | getSaveMetric(); ?> 31 | 32 |
33 |
34 | escapeHtml(__('Model delete')); ?> 35 | 36 | getDeleteMetric(); ?> 37 | 38 |
39 |
40 |
41 | -------------------------------------------------------------------------------- /view/base/templates/toolbar/plugin.phtml: -------------------------------------------------------------------------------- 1 | getCollector(); 5 | ?> 6 |
7 | 8 |
9 | <?= $block->escapeHtmlAttr(__('Plugin')) ?> 11 | getPluginsCount() ?> 12 |
13 |
14 |
15 |
16 | escapeHtml(__('Before plugins')); ?> 17 | 18 | getBeforePluginsCount() ?> 19 | 20 |
21 |
22 | escapeHtml(__('Around plugins')); ?> 23 | 24 | getAroundPluginsCount() ?> 25 | 26 |
27 |
28 | escapeHtml(__('After plugins')); ?> 29 | 30 | getAfterPluginsCount() ?> 31 | 32 |
33 |
34 |
35 | -------------------------------------------------------------------------------- /view/base/templates/toolbar/time.phtml: -------------------------------------------------------------------------------- 1 | getCollector(); 5 | $token = $block->getToken(); 6 | ?> 7 | 23 | -------------------------------------------------------------------------------- /view/base/templates/toolbar/translation.phtml: -------------------------------------------------------------------------------- 1 | getCollector(); 5 | ?> 6 |
7 | 9 |
10 | <?= $block->escapeHtmlAttr(__('Translation')) ?> 12 | getTotal() ?> 13 |
14 |
15 |
16 |
17 | escapeHtml(__('Missing messages')); ?> 18 | 19 | getMissingTranslations()); ?> 20 | 21 |
22 |
23 | escapeHtml(__('Defined messages')) ?> 24 | getDefinedTranslations()) ?> 25 |
26 |
27 |
28 | -------------------------------------------------------------------------------- /view/base/web/images/collector/ajax.svg: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | -------------------------------------------------------------------------------- /view/base/web/images/collector/cache.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /view/base/web/images/collector/config.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /view/base/web/images/collector/customer.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /view/base/web/images/collector/database.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | -------------------------------------------------------------------------------- /view/base/web/images/collector/event.svg: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | -------------------------------------------------------------------------------- /view/base/web/images/collector/layout.svg: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | -------------------------------------------------------------------------------- /view/base/web/images/collector/logs.svg: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | -------------------------------------------------------------------------------- /view/base/web/images/collector/memory.svg: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /view/base/web/images/collector/model.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /view/base/web/images/collector/models.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /view/base/web/images/collector/plugin.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /view/base/web/images/collector/redirect.svg: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | -------------------------------------------------------------------------------- /view/base/web/images/collector/time.svg: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /view/base/web/images/collector/translation.svg: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | -------------------------------------------------------------------------------- /view/base/web/images/icon/close.svg: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /view/base/web/images/icon/menu.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /view/base/web/images/icon/no.svg: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /view/base/web/images/icon/search.svg: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | -------------------------------------------------------------------------------- /view/base/web/images/icon/settings.svg: -------------------------------------------------------------------------------- 1 | 2 | 9 | 16 | 17 | -------------------------------------------------------------------------------- /view/base/web/images/icon/yes.svg: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /view/base/web/images/jquery-ui/ui-icons_444444_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Daseraf/magento2-debug/234232023a3c7f97024738a657893d8e67264e38/view/base/web/images/jquery-ui/ui-icons_444444_256x240.png -------------------------------------------------------------------------------- /view/base/web/images/jquery-ui/ui-icons_555555_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Daseraf/magento2-debug/234232023a3c7f97024738a657893d8e67264e38/view/base/web/images/jquery-ui/ui-icons_555555_256x240.png -------------------------------------------------------------------------------- /view/base/web/images/jquery-ui/ui-icons_777620_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Daseraf/magento2-debug/234232023a3c7f97024738a657893d8e67264e38/view/base/web/images/jquery-ui/ui-icons_777620_256x240.png -------------------------------------------------------------------------------- /view/base/web/images/jquery-ui/ui-icons_777777_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Daseraf/magento2-debug/234232023a3c7f97024738a657893d8e67264e38/view/base/web/images/jquery-ui/ui-icons_777777_256x240.png -------------------------------------------------------------------------------- /view/base/web/images/jquery-ui/ui-icons_cc0000_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Daseraf/magento2-debug/234232023a3c7f97024738a657893d8e67264e38/view/base/web/images/jquery-ui/ui-icons_cc0000_256x240.png -------------------------------------------------------------------------------- /view/base/web/images/jquery-ui/ui-icons_ffffff_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Daseraf/magento2-debug/234232023a3c7f97024738a657893d8e67264e38/view/base/web/images/jquery-ui/ui-icons_ffffff_256x240.png -------------------------------------------------------------------------------- /view/base/web/images/magento.svg: -------------------------------------------------------------------------------- 1 | 8 | -------------------------------------------------------------------------------- /view/base/web/images/readme/ajax.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Daseraf/magento2-debug/234232023a3c7f97024738a657893d8e67264e38/view/base/web/images/readme/ajax.png -------------------------------------------------------------------------------- /view/base/web/images/readme/cache.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Daseraf/magento2-debug/234232023a3c7f97024738a657893d8e67264e38/view/base/web/images/readme/cache.png -------------------------------------------------------------------------------- /view/base/web/images/readme/callmap-main.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Daseraf/magento2-debug/234232023a3c7f97024738a657893d8e67264e38/view/base/web/images/readme/callmap-main.png -------------------------------------------------------------------------------- /view/base/web/images/readme/callmap-popup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Daseraf/magento2-debug/234232023a3c7f97024738a657893d8e67264e38/view/base/web/images/readme/callmap-popup.png -------------------------------------------------------------------------------- /view/base/web/images/readme/config.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Daseraf/magento2-debug/234232023a3c7f97024738a657893d8e67264e38/view/base/web/images/readme/config.png -------------------------------------------------------------------------------- /view/base/web/images/readme/database.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Daseraf/magento2-debug/234232023a3c7f97024738a657893d8e67264e38/view/base/web/images/readme/database.png -------------------------------------------------------------------------------- /view/base/web/images/readme/events.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Daseraf/magento2-debug/234232023a3c7f97024738a657893d8e67264e38/view/base/web/images/readme/events.png -------------------------------------------------------------------------------- /view/base/web/images/readme/homepage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Daseraf/magento2-debug/234232023a3c7f97024738a657893d8e67264e38/view/base/web/images/readme/homepage.png -------------------------------------------------------------------------------- /view/base/web/images/readme/hyva.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Daseraf/magento2-debug/234232023a3c7f97024738a657893d8e67264e38/view/base/web/images/readme/hyva.png -------------------------------------------------------------------------------- /view/base/web/images/readme/layout-block-cache.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Daseraf/magento2-debug/234232023a3c7f97024738a657893d8e67264e38/view/base/web/images/readme/layout-block-cache.png -------------------------------------------------------------------------------- /view/base/web/images/readme/layout-render.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Daseraf/magento2-debug/234232023a3c7f97024738a657893d8e67264e38/view/base/web/images/readme/layout-render.png -------------------------------------------------------------------------------- /view/base/web/images/readme/memory.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Daseraf/magento2-debug/234232023a3c7f97024738a657893d8e67264e38/view/base/web/images/readme/memory.png -------------------------------------------------------------------------------- /view/base/web/images/readme/models.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Daseraf/magento2-debug/234232023a3c7f97024738a657893d8e67264e38/view/base/web/images/readme/models.png -------------------------------------------------------------------------------- /view/base/web/images/readme/performance.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Daseraf/magento2-debug/234232023a3c7f97024738a657893d8e67264e38/view/base/web/images/readme/performance.png -------------------------------------------------------------------------------- /view/base/web/images/readme/plugins.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Daseraf/magento2-debug/234232023a3c7f97024738a657893d8e67264e38/view/base/web/images/readme/plugins.png -------------------------------------------------------------------------------- /view/base/web/images/readme/request.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Daseraf/magento2-debug/234232023a3c7f97024738a657893d8e67264e38/view/base/web/images/readme/request.png -------------------------------------------------------------------------------- /view/base/web/images/readme/translation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Daseraf/magento2-debug/234232023a3c7f97024738a657893d8e67264e38/view/base/web/images/readme/translation.png -------------------------------------------------------------------------------- /view/base/web/js/callmap/extra-data.js: -------------------------------------------------------------------------------- 1 | define([ 2 | 'jquery', 3 | 'jquery/jquery-ui', 4 | ], function ($) { 5 | 'use strict'; 6 | 7 | return { 8 | create: function () { 9 | this.openExtraDataModal(); 10 | }, 11 | 12 | openExtraDataModal: function () { 13 | var url = document.location.origin + '/debug/xhprof/detail'; 14 | var modalWrapper = $('.function-extra-modal'); 15 | $('.function-extra-data').click(function () { 16 | $.ajax({ 17 | url: url, 18 | data: { 19 | 'token': $('.profile_token').html(), 20 | 'function': $(this).html() 21 | } 22 | }).done(function(response) { 23 | modalWrapper.html(response); 24 | modalWrapper.dialog({ 25 | minWidth: $('#collector-content').width(), 26 | modal: true, 27 | draggable: false 28 | }); 29 | }); 30 | }); 31 | } 32 | }; 33 | }); 34 | --------------------------------------------------------------------------------